{"version":3,"sources":["components/ExtraAttributes/AttributeLabel.js","data/logging.js","components/ShareModal/EditorControl/ShareAction.module.css","components/ShareModal/ViewerControl/ShareAction.module.css","components/ProgressModal/ProgressModal.module.css","components/DocModal/DocModal.module.css","components/GeoPlaceInput/GeoPlaceInput.module.css","components/ExtraAttributes/EditorControl/LookupEditorControl.module.css","components/SplitPanes/Pane.js","components/UploadImage/ImageEditorModal.module.css","components/FormBar/Item/Edit.module.css","components/FormBar/Item/Search.module.css","containers/Form.module.css","containers/SearchResult.module.css","components/UploadVersionModal/UploadVersionModal.module.css","components/ItemFlowsModal/ItemFlowsModal.module.css","components/RasterMapManagerModal/LayersEditor.module.css","components/RasterMapManagerModal/RasterMapModal.module.css","components/ReminderManagerModal/ReminderManagerModal.module.css","components/ExtraAttributes/ViewerControl/EnumViewerControl.module.css","containers/QueryMatch.js","components/ArchiveTargets/ArchiveTargetList/index.js","components/ArchiveTargets/ArchiveTargetList/uppyFileMatchUtils.js","components/ArchiveTargets/ArchiveTargetList/ArchiveTargetCards.js","components/ArchiveTargets/ArchiveTargetList/ArchiveTargetHomeCards.js","components/ArchiveTargets/ArchiveTargetList/ArchiveTargetSearchFormCards.js","components/ArchiveTargets/ArchiveTargetSearchForm/index.js","components/ArchiveTargets/ArchiveTargetSearchItem/index.js","containers/ArchiveTargetList.js","views/upload/index.js","data/reducers/userReducer.js","data/reducers/searchReducer.js","components/ExtraAttributes/ViewerControl/ViewerControlBase.js","views/minipicker/index.js","components/PickerModal/index.js","components/FilterBar/SearchBucket/SearchBucket.module.css","hooks/PostMessage/Utils.js","data/extensions.js","data/utils.js","components/Divider/index.js","components/Activities/Activity.module.css","data/reducers/docsReducer.js","containers/SettingValue/index.js","components/ExtraAttributes/EditorControl/DateEditorControl.js","components/ExtraAttributes/EditorControl/NumberEditorControl.js","data/apiError.js","components/DocListSimple/RowResult.module.css","data/actions/index.js","components/User/Avatar.js","components/FolderTree/FolderTree.module.css","data/reducers/networkSelectors.js","data/reducers/selectors.js","data/reducers/formReducer.js","__i18n/moment lazy /^/.*$/ groupOptions: {} namespace object","components/Attributes/SummaryAttribute/SummaryAttribute.module.css","components/Attributes/SummaryAttribute/ValueFacePile.js","components/Attributes/SummaryAttribute/ValueUser.js","components/Attributes/SummaryAttribute/ValueProgress.js","components/Attributes/SummaryAttribute/ValueVisualRules.js","components/Attributes/SummaryAttribute/ValueEnum.js","components/Attributes/SummaryAttribute/ValueTextLink.js","components/Attributes/SummaryAttribute/ValueFilesize.js","components/Attributes/SummaryAttribute/ValueDatetime.js","components/Attributes/SummaryAttribute/ValueFactory.js","components/Reminder/ReminderItem.module.css","__i18n/uppy lazy /^/.*$/ groupOptions: {} namespace object","containers/ActionPanel/ShouldBeVisible.js","../node_modules/leaflet-geosearch/lib/providers lazy /^/.*/.js$/ groupOptions: {} namespace object","components/PageStatus/inPoint_192.png","data/offline/serviceWorkerRegistration.js","index.js","data/reducers/breadcrumbReducer.js","data/reducers/loginReducer.js","data/toast.js","components/Loader/Loading.js","components/Status/Loading.js","components/Loader/index.js","data/history.js","containers/StickyToggle/index.js","containers/StickyToggle/style.js","containers/OfflineHandler.js","components/Attributes/SummaryAttribute/index.js","components/Attributes/index.js","components/MapModal/PlaceInput.js","components/MapModal/index.js","containers/TogglesHandler/index.js","data/reducers/treeReducer.js","containers/SplitPanes/index.js","data/types.js","data/ApiManagerOffline.js","data/ApiManager.js","data/api.js","data/offline/offlineQueue.js","components/ExtraAttributes/EditorControl/TextEditorControl.js","containers/ActionPanel/Utils.js","data/itemActions.js","components/DocList/CellContent.module.css","components/UploadImage/UploadImage.module.css","components/SearchResultGrid/CellContent.module.css","hooks/AbortController.js","hooks/Broadcast.js","hooks/NetworkStatus.js","hooks/PostMessage/Handler.js","hooks/PostMessage/Modal.js","hooks/PostMessage/index.js","components/GeoPointActionPanel/index.js","hooks/PersistSetting.js","hooks/LocalStore.js","hooks/Moment.js","hooks/Uppy.js","hooks/PdfHighlight.js","hooks/OfflineHandler.js","hooks/ArrowNavigation.js","hooks/RecycleBin.js","hooks/ViewNameTypeRouting.js","data/formActions.js","hooks/FormActions.js","components/Rename/index.js","components/Searchcrumb/index.js","containers/Searchcrumb.js","components/MainLayout/CrumbSelector.js","components/ToggleBar/Button.js","components/ToggleBar/index.js","containers/ToggleBar/index.js","components/MainLayout/index.js","components/MainLayout/usePendingOfflineChanges.js","components/ActionPanel/ActionCategory.js","components/ActionPanel/index.js","containers/ActionPanel/index.js","components/ItemActionPanel/index.js","components/ExtraAttributes/ViewerControl/LinkViewerControl.js","components/DocListSimple/Thumbnail.js","components/NativeSelect/index.js","data/integrationTestUtils.js","components/ExtraAttributes/ViewerControl/UserIdViewerControl.js","components/Form/utils.js","components/Form/index.js","components/ExtraAttributes/EditorControl/HiddenEditorControl.js","components/FormEdit/FieldEdit.js","components/NavigationBlock/index.js","components/FormEdit/index.js","containers/Form.js","components/Breadcrumb/BreadcrumbPart.js","components/Breadcrumb/BreadcrumbFavorite.js","components/Breadcrumb/Breadcrumb.js","components/Breadcrumb/index.js","components/ContextMenu/Handler.js","containers/Breadcrumb.js","components/ProgressModal/index.js","components/ExtraAttributes/ViewerControl/StaticViewerControl.js","components/FormBar/Item/ArchiveTarget.js","components/FormBar/Item/Edit.js","components/FormBar/Item/LockInfo.js","components/FormBar/Item/Search.js","components/FormBar/Item/SearchScope.js","components/FormBar/Item/View.js","components/FormBar/Item/index.js","components/FormBar/Factory.js","data/ApiCatalog.js","data/ApiManagerBase.js","views/minipicker/minipicker.module.css","views/document/document.module.css","components/Modal/index.js","components/Status/Overlay.js","components/Status/index.js","data/reducers/workflowReducer.js","data/reducers/serviceWorkerReducer.js","components/ActionPanel/ActionsButton.js","containers/ItemContext/index.js","components/UploadSelection/index.js","data/storeHelper.js","data/panes.js","components/SiteSelect/SiteSelect.module.css","components/RecentFolderSelect/RecentFolderSelect.module.css","components/GeoPointInput/GeoPointInput.module.css","components/SearchForm/AttributeSearch.module.css","components/ArchiveTargets/ArchiveTargetSearchForm/ArchiveTargetSearchForm.module.css","components/ExtraAttributes/ViewerControl/ImageViewerControl.js","data/reducers/docsLayoutReducer.js","data/reducers/settingsReducer.js","data/reducers/currentItemReducer.js","data/reducers/searchFormsReducer.js","data/reducers/offlineReducer.js","containers/Moment.js","components/ExtraAttributes/EditorControl/MemoEditorControl.js","components/FilterBar/SearchBucket/Name.js","components/FilterBar/SearchBucket/Header.js","components/FilterBar/SearchBucket/AllItem.js","components/FilterBar/SearchBucket/MenuItem.js","components/FilterBar/SearchBucket/Button.js","components/FilterBar/SearchBucket/Icon.js","components/FilterBar/SearchBucket/index.js","data/bowser.js","components/ExtraAttributes/EAForm.js","components/LocalContactInfo/index.js","components/CommandActions/utils/FormTokens.js","components/User/UserGroup.js","components/User/PrincipalAvatar.js","components/NativeSelect/NativeSelect.module.css","components/DocListSimple/RowResultByLayout.module.css","components/Divider/Divider.module.css","components/CommandActions/itemViews/itemView_docListGallery.module.css","components/CommandActions/itemViews/itemView_workflow.module.css","components/ShareModal/EditorControl/SharePrincipal.module.css","components/GeoRasterInput/GeoRasterInput.module.css","components/FormBar/Item/LockInfo.module.css","components/FormBar/Item/SearchScope.module.css","components/RasterMapManagerModal/RasterLayer.module.css","components/ExtraAttributes/GridEditorControl/GridUtils.js","components/ItemUriLink/index.js","data/reducers/togglesReducer.js","data/reducers/cardsReducer.js","data/reducers/thumbnailsReducer.js","data/reducers/favoritesReducer.js","data/reducers/commandActionReducer.js","data/context.js","components/CommandActions/searchResult_form.geoLocation.js","data/barcode.js","components/CommandActions/searchResult_form.barcode.js","components/CommandActions/searchResult_form.js","components/TreeFilter/TreeFilter.module.css","components/ShareModal/ViewerControl/ExternalUser.module.css","components/LocalContactInfo/LocalContactInfo.module.css","components/GeoAreaInput/GeoAreaInput.module.css","components/SearchResultCalendar/Toolbar.module.css","components/FormModal/FormModal.module.css","containers/FileDropHandler/index.js","hooks/PostMessage/Actions/Default.js","hooks/PostMessage/Actions/CustomUpload.js","hooks/PostMessage/Actions/ArrowNavigation.js","hooks/PostMessage/Actions/PdfHighlight.js","hooks/PostMessage/Actions/PdfSignature.js","hooks/PostMessage/Actions/PdfPrint.js","hooks/PostMessage/Actions/Modal.js","hooks/PostMessage/Actions/Notification.js","hooks/PostMessage/Actions/index.js","containers/ItemContext/Provider.js","components/SearchResult/FolderResult.js","components/SearchResult/DocumentResult.js","components/SearchResult/RowResult.js","components/SearchResult/index.js","components/SearchResultMap/index.js","components/SearchResultCalendar/Toolbar.js","components/SearchResultCalendar/index.js","components/SearchResultGrid/CellContent.js","components/SearchResultGrid/index.js","data/FilterBar.js","containers/SearchResult.js","data/loginFlow.js","components/CardList/index.js","data/reducers/panesReducer.js","data/reducers/globalSearchReducer.js","data/reducers/globalEventsReducer.js","data/reducers/notificationReducer.js","components/CommandActions/CommandActionButton.js","data/queryString.js","components/ExtraAttributes/EditorControl/LookupEditorControl.js","components/ExternalLinkModal/index.js","components/NoteInput/index.js","components/Activities/Activity.js","components/Activities/ActivityList.js","components/Activities/CleanupKeepInfo.js","components/Activities/RetentionInfo.js","components/Activities/index.js","containers/Activities.js","components/GeoAreaInput/index.js","components/ExtraAttributes/EditorControl/GeoAreaEditorControl.js","data/reducers/index.js","data/constants.js","components/ConflictModal/index.js","data/toggles.js","components/SearchResultActionPanel/index.js","components/ItemStatusIcons/index.js","components/Attributes/SimpleAttribute.js","components/ExtraAttributes/AttributeLabel.module.css","components/LockInfo/index.js","components/SiteSelect/index.js","containers/FilterBar.js","components/DocListFilterModal/RelativeDatePicker.js","components/uppy-restrictions/index.js","components/MapButton/index.js","components/MapViewer/index.js","components/GeoPlaceInput/index.js","components/CommandActions/doc_print.js","components/LoadingIframe/index.js","components/CardList/CardItem.js","components/LocatorButton/geoLocatorOptions.js","data/ApiCacheManager.js","data/ApiManagerMakeAvailableOffline.js","data/sagas/offlineSaga.js","data/sagas/userSaga.js","data/sagas/favoritesSaga.js","data/sagas/cardsSaga.js","data/sagas/workflowSaga.js","data/sagas/treeSaga.js","data/sagas/docsSaga.js","data/sagas/docsLayoutSaga.js","data/sagas/currentItemSaga.js","data/sagas/searchSaga.js","data/sagas/thumbnailsSaga.js","data/sagas/notificationsSaga.js","data/sagas/toastSaga.js","data/sagas/commandActionSaga.js","data/sagas/rootSaga.js","components/ActionPanel/ItemAction.js","components/DocListSimple/RowResultByLayout.js","components/CommandActions/itemViews/itemView_docListGallery.js","components/CommandActions/itemViews/itemView_docList.js","components/CommandActions/itemViews/itemView_activityList.js","components/CommandActions/itemViews/itemView_workflow.js","components/Reminder/EnumIcon.js","components/Reminder/ReminderItem.js","components/CommandActions/itemViews/itemView_reminder.js","components/CommandActions/itemViews/itemView_filter.js","components/CommandActions/itemViews/Factory.js","components/ActionPanel/ItemActions.js","components/FilterBar/ViewModesMenu.js","components/FilterBar/ViewModesButtons.js","components/FilterBar/ViewModes.js","data/actionMenus.js","components/ActionsMenu/Render.js","components/ActionsMenu/index.js","components/DocListSimple/RowResult.js","components/DocListSimple/index.js","components/NoDocs/OpenFiltersButton.js","components/NoDocs/index.js","components/Status/Status.module.css","data/toast.module.css","components/Modal/Modal.module.css","components/ActionPanel/ItemAction.module.css","components/CommandActions/itemViews/itemView_docList.module.css","components/Attributes/SummaryAttribute/ValueUser.module.css","containers/StickyToggle/StickyToggle.module.css","components/NoteInput/NoteInput.module.css","components/Activities/Activities.module.css","components/ItemActionPanel/ItemActionPanel.module.css","components/PickerModal/PickerModal.module.css","components/ToggleBar/Button.module.css","components/MapModal/PlaceInput.module.css","components/GeoRadiusInput/GeoRadiusInput.module.css","components/PageStatus/index.js","components/Sidebar/utils.js","data/store.js","data/persistTransforms.js","components/NoData/index.js","components/CommandActions/ip_commandAction.js","components/CommandActions/ip_archive.js","components/CommandActions/ip_browse.js","components/CommandActions/ip_edit.js","components/CommandActions/ip_properties.js","components/CommandActions/folder_delete.js","components/CommandActions/folder_editClassification.js","components/ExtraAttributes/EditorControl/EnumEditorControl.js","components/ShareModal/Utils.js","components/ShareModal/ShareActionForm.js","components/ShareModal/EditorControl/ShareAction.js","components/ExtraAttributes/EditorControl/PrincipalEditorControl.js","components/ShareModal/SharePrincipalForm.js","components/ShareModal/EditorControl/SharePrincipal.js","components/ShareModal/ViewerControl/ExternalUser.js","components/ShareModal/ViewerControl/ShareAction.js","components/ShareModal/ViewerControl/Attachments.js","components/ShareModal/ShareForm.js","components/ShareModal/index.js","components/CommandActions/share.js","components/CommandActions/folder_emailLink.js","components/CommandActions/folder_preview.js","components/CommandActions/form_cancel.js","components/CommandActions/form_clear.js","components/CommandActions/search_favorite.js","components/CommandActions/search_preview.js","components/CommandActions/search_scope.js","components/CommandActions/searchForm_operator.js","components/CommandActions/searchForm_scope.js","components/CommandActions/doclist_resetFilters.js","components/CommandActions/doclist_exportCsv.js","components/CommandActions/doc_download.js","components/CommandActions/doc_downloadZip.js","components/CommandActions/doc_downloadFilesAPI.js","components/CommandActions/doc_delete.js","components/ModalFullscreenButton/index.js","components/DocModal/index.js","components/CommandActions/doc_preview.js","components/CommandActions/doc_related.js","components/UploadModal/index.js","components/CommandActions/doc_upload.js","components/UploadVersionModal/index.js","components/CommandActions/doc_uploadVersion.js","components/CommandActions/doc_emailLink.js","components/CommandActions/doc_emailAttachment.js","components/CommandActions/doc_editClassification.js","components/CommandActions/doc_editWebDav.js","components/CommandActions/doc_editCloud.js","components/CommandActions/favorite.js","components/CommandActions/link.js","components/CommandActions/lock.js","components/CommandActions/unlock.js","components/CommandActions/subscribe.js","components/CommandActions/unsubscribe.js","components/CommandActions/share_web.js","components/NameModal/index.js","components/CommandActions/createFolder_template.js","components/ListWorkflowsModal/index.js","components/CommandActions/wf_start.js","components/ItemFlowsList/FlowCardImage.js","components/ItemFlowsList/index.js","views/itemFlows/CategoryFilter.js","components/CommandActions/itemFlows/itemFlow_custom.js","components/CommandActions/itemFlows/Form.js","components/CommandActions/itemFlows/itemFlow_folder.js","components/CommandActions/itemFlows/CustomUploadSelection.js","components/CommandActions/itemFlows/DocumentSelection.js","components/CommandActions/itemFlows/itemFlow_document.js","components/CommandActions/itemFlows/itemFlow_docTemplate.js","components/CommandActions/itemFlows/itemFlow_folderTemplate.js","components/CommandActions/itemFlows/Factory.js","views/itemFlows/index.js","containers/ItemFlows.js","components/ItemFlowsModal/index.js","components/CommandActions/itemFlows.js","components/CommandActions/transfer.js","components/CommandActions/recyclebin_docClear.js","components/CommandActions/recyclebin_docRestore.js","components/CommandActions/recyclebin_folderClear.js","components/CommandActions/recyclebin_folderRestore.js","components/FormModal/index.js","components/CommandActions/editClassification.js","components/CommandActions/clipboard_copyItemUri.js","components/CommandActions/clipboard_copyItemLink.js","components/RasterMapManagerModal/RasterLayer.js","components/RasterMapManagerModal/LayersEditor.js","components/RasterMapManagerModal/index.js","components/CommandActions/raster_manage.js","components/ExtraAttributes/ViewerControl/EnumViewerControl.js","components/Reminder/ReminderForm.js","components/ReminderManagerModal/index.js","components/CommandActions/reminder_manage.js","components/CommandActions/offline_add.js","components/CommandActions/offline_delete.js","components/CommandActions/offline_syncItem.js","components/CommandActions/index.js","components/MapViewer/utils.js","containers/ItemUri/index.js","hooks/NetworkStatus.module.css","components/ActionPanel/ItemActions.module.css","components/FilterBar/ViewModes.module.css","components/CommandActions/CommandActionButton.module.css","components/Attributes/SummaryAttribute/ValueFacePile.module.css","data/storage.js","components/User/UserGroup.module.css","components/LockInfo/LockInfo.module.css","components/ActionPanel/ActionCategory.module.css","components/ExtraAttributes/Error.module.css","components/ExtraAttributes/EditorControl/PrincipalEditorControl.module.css","components/ShareModal/ViewerControl/Attachments.module.css","components/ShareModal/ShareModal.module.css","components/MapModal/MapModal.module.css","components/FormBar/Item/ArchiveTarget.module.css","components/PageStatus/PageStatus.module.css","components/SearchOperators/SearchOperators.module.css","components/SearchResult/SearchResult.module.css","components/ArchiveTargets/ArchiveTargetSearchItem/ArchiveTargetSearchItem.module.css","components/CommandActions/itemFlows/itemFlow_document.module.css","components/MultiSelectionActionPanel/index.js","containers/LayoutLoader/index.js","components/DocListFilterBar/index.js","components/DocList/CellContent.js","components/DocList/index.js","components/DocListFilterModal/Operators.js","components/DocListFilterModal/DatePicker.js","components/DocListFilterModal/FilterDateValue.js","components/DocListFilterModal/BoolPicker.js","components/DocListFilterModal/FilterValue.js","components/DocListFilterModal/index.js","containers/UploadHandler/index.js","containers/DocList.js","containers/MultiSelection/Bucket.js","containers/MultiSelection/Checkbox.js","containers/MultiSelection/index.js","containers/ViewerKeysHandler/index.js","containers/SuggestionHandler/index.js","components/ExtraAttributes/Error.js","components/ExtraAttributes/EditorControl/FormsyEditorBase.js","components/TreeFilter/index.js","components/ExtraAttributes/ViewerControl/EmailViewerControl.js","components/ExtraAttributes/ViewerControl/TelViewerControl.js","components/DocViewer/HandleSignedPdf.js","components/DocViewer/HandlePdfPrint.js","components/DocViewer/ViewerUrl.js","components/DocViewer/PdfArrowNavigation.js","components/DocViewer/index.js","components/InlineViewer/index.js","containers/ContinuousPreview/index.js","containers/DocViewer.js","components/NarrowToggle/index.js","components/FilterBar/CombinedFiltersMenu.js","components/FilterBar/index.js","components/FolderTree/index.js","containers/FolderTree.js","components/MapViewer/providerSupport.js","components/uppy-exif/index.js","data/uppy.js","components/ConfirmModal/index.js","components/DocListFilterModal/Utils.js","data/actions/actionTypes.js","components/CountBadge/index.js","components/Tree/index.js","containers/LocalStore.js","components/SearchResult/RowResult.module.css","components/DocModal/TopRowExtras.js","components/ExtraAttributes/ViewerControl/LocationViewerControl.js","components/ExtraAttributes/ViewerControl/GeoRasterViewerControl.js","components/ExtraAttributes/EditorControl/LoadableGeoPointEditorControl.js","components/GeoRadiusInput/index.js","components/SearchOperators/index.js","components/SearchForm/toSearchEditor.js","components/SearchForm/toBetweenEditor.js","components/SearchForm/GeoRadiusEditorControl.js","components/SearchForm/RelativeDateEditorControl.js","components/SearchForm/AttributeSearch.js","components/SearchForm/index.js","containers/SearchForm.js","components/UploadImage/cropImage.js","components/UploadImage/rotation.js","components/UploadImage/clampInRange.js","components/UploadImage/zoom.js","components/UploadImage/ImageEditorModal.js","components/UploadImage/index.js","components/ExtraAttributes/EditorControl/ImageEditorControl.js","components/LocatorButton/target.svg","components/LocatorButton/index.js","components/GeoPointInput/index.js","containers/ViewName/index.js","views/document/index.js","components/RecentFolderSelect/index.js","components/MainSearchScope/SearchScopeSelect.js","containers/GlobalEventsHandler/index.js","components/GeoRasterInput/index.js","components/ExtraAttributes/EditorControl/GeoRasterEditorControl.js","components/Status/Overlay.module.css","components/ConfirmModal/ConfirmModal.module.css","components/NoData/NoData.module.css","components/NoDocs/NoDocs.module.css","components/DocListSimple/DocListSimple.module.css","components/User/Avatar.module.css","components/Attributes/SummaryAttribute/ValueProgress.module.css","components/Attributes/SummaryAttribute/ValueEnum.module.css","components/ExtraAttributes/ViewerControl/LinkViewer.module.css","components/DocListSimple/Thumbnail.module.css","components/ActionsMenu/ActionsMenu.module.css","components/Breadcrumb/Breadcrumb.module.css","components/ToggleBar/ToggleBar.module.css","components/Tree/Tree.module.css","components/DocListFilterModal/DocListFilterModal.module.css"],"names":["AttributeLabel","label","style","labelWidth","useContext","LabelSizeContext","width","String","trim","length","className","styles","title","displayName","setupLogging","JL","createAjaxAppender","setOptions","batchSize","bufferSize","storeInBufferLevel","level","window","CONFIG","browserLoggingLevel","sendWithBufferLevel","url","host","basename","general","api","beforeSend","xhr","setRequestHeader","CustomHttpHeader","Authorization","accessToken","CorrelationId","correlationId","consoleAppender","createConsoleAppender","hasConsole","sendLogItems","logItems","successCallback","logItem","item","m","startsWith","JSON","parse","l","getDebugLevel","console","debug","n","msg","getInfoLevel","info","getWarnLevel","warn","error","e","appenders","module","exports","Pane","id","children","dataTest","useState","height","dimensions","setDimensions","whitelist","onMeasure","measure","measureRef","ref","data-test","Provider","value","QueryMatchRoute","location","query","render","qs","queryString","search","isMatch","Object","keys","every","key","QueryMatch","React","Children","map","child","index","type","cloneElement","Route","createLink","archiveTarget","uri","searchItem","searchType","SearchItemType","Form","filterArchiveTargets","archiveTargets","pendingUploads","globalSites","filter","at","name","extras","fileTypes","file","ext","getFileExtension","toLowerCase","some","indexOf","match","replace","isFileTypeMatch","fileTags","tag","prototype","hasOwnProperty","call","ArchiveTargetList","history","usePendingUploads","globalSitesAreaSelector","onCardClick","stringify","mode","push","onMoreClick","card","a","openPickerModal","pickerType","PickerType","Folder","scopeBreadcrumb","itemUri","helpText","loc","t","CardList","status","Constants","OK","cards","filterText","toggles","CardType","Rec","Fav","Action","showOnMoreClick","itemtype","CardItemType","onClick","withRouter","views","FormBarView","ArchiveTarget","ArchiveTargetCards","PureComponent","state","_onFilterTextChange","this","setState","_getFilteredCards","props","c","onCancel","cardType","onFilterTextChange","itemtypes","Search","ArchiveTargetHomeCards","dispatch","NONE","getCardsAction","connect","ownProps","s","ArchiveTargetSearchFormCards","getSearchFormListAction","sf","image","count","ArchiveTargetSearchForm","_onSearch","_onSearchFormSetTarget","activeRowIndex","row","onTargetItemUri","breadcrumb","parts","getClassNames","wrapper","fSplit","searchPanel","SearchForm","searchLabel","searchEnabled","onSearch","searchResult","SearchResult","isBreadcrumbReadonly","showFilterBar","onSetActiveRowIndex","onAutoBrowseToItem","isMoreHidden","componentDidMount","splitView","Split","sizes","direction","minSize","gutterSize","elementStyle","dimension","size","gutterStyle","componentDidUpdate","prevProps","prevState","setSizes","updateFilesPlaceholders","filters","forEach","newValue","tokenize","fixSearchFilterName","ArchiveTargetSearchItem","useSelector","uppyPendingFilesMetaSelector","newSearchItem","useAsync","createSearchItemAsync","onSearchFormSetTarget","useCallback","searchForm","loading","Status","LOADING","ERROR","ArchiveTargetListContainer","targetItemUri","_fetch","getArchiveTargets","isOnline","catch","err","then","result","produces","draft","getLocalizedText","_setTargetItemUri","_onCardClick","cardItem","_onSearchFormClick","_onCancel","show","NoData","locContext","params","sfid","assign","viewName","Upload","constructor","super","_updateUppyOptions","formatId","defaults","getDefaultsConfig","setUppyRestrictions","uppy","upload","_updateFormToggle","uppyHasPendingUploads","produce","toggle","isDisabled","isSelected","isEqual","setToggles","_maybeResetArchiveTarget","noItemUri","_getWebDavNameHint","firstFile","getFiles","find","f","meta","_getDefaultValues","WebDavName","isEmpty","_onSaveNew","model","keepOriginalFilename","files","isFormButtonEnabled","newModel","ip","replaceFileExtension","extension","setFileMeta","UploadMode","CreateDocument","failed","reset","_onClose","onClose","backupCurrentItemAction","setCurrentItemAction","componentWillUnmount","restoreCurrentItemAction","MainLayout","breadcrumbReadonly","topRowEnd","UploadSelection","isEditMode","onSaveNew","saveLabel","savingLabel","defaultValues","newFormType","NewFormType","Document","onSaveReturnAllFields","compose","uppyHasPendingUploadsSelector","TogglesHandler","SplitPanes","paneIds","toggleIds","initialState","sites","mainNavigation","isWfEnabled","isAdmin","avatar","undefined","hasOfflineItems","itemActions","categories","actions","userReducer","action","actionTypes","USER_FETCH_REQUESTED","payload","USER_FETCH_RESULT","rest","favorites","USER_SITES_RESULT","LOGIN_SIGNOUT","PERSIST_PURGE","userIdSelector","user","userStatusSelector","userCorrelationIdSelector","userSitesSelector","userMainNavigationSelector","userIsAdminSelector","userIsWfEnabledSelector","userLanguageSelector","language","userDecimalSeparator","decimalSeparator","userThousandSeparator","thousandSeparator","userItemActionsSelector","userFormActionsSelector","formActions","userTopbarItemsSelector","topbar","items","userHasOfflineItemsSelector","totalCount","totalTime","aggregations","form","changes","searchRequest","searchReducer","SEARCH_RESET","SEARCH_FAVRENAME_REQUEST","SEARCH_FAVRENAME_RESULT","SEARCH_FETCH_REQUEST","SEARCH_FETCH_RESULT","SEARCH_ITEM_SAVE","SEARCH_FORM_CHANGES","SEARCH_FORM_FETCH_REQUEST","SEARCH_FORM_FETCH_RESULT","SEARCH_FORM_RESET","SEARCH_COUNT_REQUEST","SEARCH_COUNT_RESULT","searchStatusSelector","searchErrorSelector","searchResultSelector","searchResultTotalCountSelector","searchRequestSelector","searchTermsSelector","terms","searchItemSelector","searchFormStatusSelector","searchFormResultSelector","searchFormIdSelector","searchFormChangesSelector","searchCountStatusSelector","searchCountResultSelector","searchCountAggregationsSelector","ViewerControlBase","ctx","PaneSizeContext","computedStyle","useMemo","maxWidth","LocalStoreHandler","GlobalEventsHandler","ServerEventItemType","folder","ServerEventActionType","delete","refreshMode","RefreshMode","Originator","refreshMessage","refreshRoute","filterAction","onDocSingleClick","onDocDoubleClick","onFolderSingleClick","onBreadcrumbPartClick","breadcrumbScopeFromLevel","canChangeSite","useDispatch","treeStatus","treeIsBrowsable","treeTotalCount","treeAvailable","sitesSelector","treeFilter","setTreeFilter","includeSubfolders","setIncludeSubfolders","isTreeFocused","setIsTreeFocused","activeItemUri","setActiveItemUri","currentFolderRow","setCurrentFolderRow","currentDocumentRow","setCurrentDocumentRow","prevItemUri","usePrevious","handleTreeClick","treeNodeId","handleTreeExpand","handleTreeFilterChange","useEffect","handleSingleClick","rowIndex","handleIconClick","preventDefault","CommandActionHandler","newWindow","ctrlKey","altKey","useEffectOnce","actionsDisabled","breadcrumbCanChangeSite","split","tree","TreeFilter","onChange","allowSubfolders","noTree","FolderTree","focused","activeTreeNodeId","onExpand","doclist","DocList","showAddDocument","onIconClick","onSingleClick","onDoubleClick","File","Any","PickerModal","open","close","onSelect","additionalActions","canSelectSite","selectButton","currentRootItemUri","setCurrentRootItemUri","currentItemUri","setCurrentItemUri","currentRootItemUriLevels","setCurrentItemUriLevels","handleFolderSelect","handleDocumentSelect","setRootItemUri","handleClose","useModalPostMessageHandler","handleSelect","abortController","useAbortController","fetchBreadcrumb","signal","bc","fetchData","disabled","Modal","ModalSize","Small","fullscreen","enforceFocus","onHide","dialogClassName","picker","headerSize","footerSize","Body","Footer","aria-label","onToggle","isOpen","stopPropagation","bsStyle","button","pullRight","dropup","i","eventKey","defaultProps","createModal","postMessageTo","data","target","parent","postMessage","source","Date","toLocalJSON","pad","number","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","toFixed","slice","crypto","require","randomUUID","getRandomValues","Uint8Array","toString","isListed","list","fileName","lastIndexOf","filename","newExt","substr","hasSomeParentTheClass","element","parentNode","getAttribute","text","context","isValidItemUri","getFolderUri","substring","input","replaceAll","original","prop","prefix","joinWith","Array","isArray","join","mapValues","o","entries","reduce","v","K","V","moveArrayItem","arr","from","to","clone","splice","hasCacheSupport","performanceTester","fn","log","Error","t0","performance","now","asyncFilter","predicate","memo","sleep","ms","Promise","resolve","setTimeout","classNames","closeMenuOnScroll","getValue","param","parseSaveDocListFilterOperators","DocListFilterOperators","None","k","toUpperCase","op","maybeLocalizeBreadcrumb","bcText","siteType","delimiter","idx","maybeHandleSiteName","values","SystemWebDavName","Divider","header","hideHR","defaultExpanded","expanded","expandedFromProps","unmountOnExit","mountOnEnter","usePersistSetting","defaultValue","setExpanded","main","aria-expanded","textNoHR","Library","fa","fixedWidth","hr","in","sorts","rowCount","pageNum","pageSize","rows","cols","docsReducer","CURRENTITEM_SET","DOCS_FILTERTEXT_SET","DOCS_FETCH_REQUEST","DOCS_FETCH_RESULT","receivedAt","immutable","docsItemUriSelector","docs","docsStatusSelector","docsPageNumSelector","docsErrorSelector","docsColsSelector","docsRowsSelector","docsTotalCountSelector","docsFiltersSelector","docsSortsSelector","SettingValue","namespace","WrappedComponent","HOC","extraProps","asObject","getDisplayName","DatePickerReference","forwardRef","inputProps","inputRef","multi","onChangeWithRawEvent","DatePickerPopper","onFocus","onBlur","tabIndex","createPortal","modifiers","enabled","options","rootBoundary","positionFixed","placement","zIndex","overlay","data-placement","document","getElementById","DateEditorControl","_getFormat","DateTimeFormat","Time","moment","localeData","longDateFormat","LongTime","DateTime","DateLongTime","JsonDate","JsonDateEnd","JsonDateTime","_getDate","day","time","format","_onDayChange","dayPickerInput","changeValue","getInput","_ref","dateValue","getValueAsDate","currentTarget","shouldRenderTime","timeValue","invalidate","nextState","_onTimeChange","event","toDate","isNaN","shouldRenderSeconds","shouldRenderDate","includes","valueFormat","getValidValue","required","isRequired","isValid","isReadonly","container","overlayWrapper","formatDate","parseDate","dayPickerProps","showWeekNumbers","numberOfMonths","firstDayOfWeek","locale","userLanguage","localeUtils","LocaleUtils","fixedWeeks","todayButton","onDayChange","placeholder","component","overlayComponent","inputType","step","flexGrow","dt","HTML5_FMT","Moment","IMaskNumberDefault","decimalScale","mask","Number","scale","signed","normalizeZeros","thousandsSeparator","padFractionalZeros","radix","mapToRadix","currency","maskProps","numberProps","blocks","num","IMaskCurrencyDefault","borderRadius","validations","notEmptyMask","rawValue","IMask","pipe","definitions","A","9","C","PIPE_TYPE","MASKED","UNMASKED","validationErrors","HTTP_ERROR_CONFLICT","_log","ApiErrorContainer","response","message","captureStackTrace","ApiError","args","isError","ApiNetworkError","statusCode","statusText","ApiConflictError","ApiNetworkOfflineError","detail","eventId","notifyOnError","extra","notify","get","email","handleClick","copy","onCopy","clipboardData","toastActionResult","toastStyled","toastTypes","failure","autoClose","details","bsSize","href","rel","togglesChangeAction","TOGGLES_CHANGE","persistTogglesAction","TOGGLES_PERSIST","togglesUpdateCounterAction","counts","TOGGLES_UPDATECOUNTER","getUserAction","getUserResultAction","setSitesAction","setLoginResultAction","idToken","expiresOn","expiresIn","LOGIN_RESULT","loginSignoutAction","getGlobalSearchDefaultAction","GLOBALDEFAULTSEARCH_FETCH_REQUEST","globalSearchDefaultResultAction","GLOBALDEFAULTSEARCH_FETCH_RESULT","getFavoritesAction","FAVORITES_FETCH_REQUEST","getFavoritesResultAction","FAVORITES_FETCH_RESULT","getWorkflowProviders","WF_PROVIDERS_FETCH_REQUESTED","getWorkflowProvidersResult","providers","WF_PROVIDERS_FETCH_RESULT","getWorkflowCards","WF_FETCH_REQUESTED","getWorkflowCardsResult","WF_FETCH_RESULT","CARDS_FETCH_REQUESTED","getCardsByEntityAction","cardTypes","cardItemTypes","CARDS_FETCH_ENTITY_REQUESTED","getCardsResultAction","CARDS_FETCH_RESULT","getCardsByEntityResultAction","CARDS_FETCH_ENTITY_RESULT","setTreeStatus","TREE_SET_STATUS","getTreeAction","deep","all","TREE_FETCH_REQUEST","getTreeResultAction","TREE_FETCH_RESULT","nodes","isRoot","isBrowsable","searchResetAction","SEARCH_FORM_LIST_FETCH_REQUEST","getSearchFormListResultAction","SEARCH_FORM_LIST_FETCH_RESULT","setSearchFormChangesAction","getSearchFormAction","getSearchFormResultAction","searchFormResetAction","setSearchItemAction","getSearchAction","getSearchResultAction","getSearchCountAction","getSearchCountResultAction","renameSearchFavoriteAction","renameSearchFavoriteResultAction","docThumbnailRequestAction","DOCS_THUMBNAIL_REQUEST","docThumbnailResultAction","DOCS_THUMBNAIL_RESULT","setDocListViewModeAction","viewMode","SETTINGS_DOCLIST_VIEWMODE","exportDocsToCsvAction","DOCS_EXPORT_CSV","getDocsAction","getDocsResultAction","setSettingAction","SETTINGS_SET","setSplitPanesAction","view","SPLITPANES_SET","persistSplitPanesAction","SPLITPANES_PERSIST","setSidebarMini","mini","SETTINGS_SIDEBAR_MINI","setCurrentBreadcrumb","isFav","CURRENT_BREADCRUMB","CURRENTITEM_BAK","CURRENTITEM_RESTORE","setDocsLayoutAction","layout","DOCS_LAYOUT_SET","requestDocsLayoutAction","allowPreFetch","DOCS_LAYOUT_REQUEST","setDocFilterTextAction","valueType","operator","resetDocFilters","DOCS_FILTERS_RESET","setDocFilterByRef","docContextClick","resetValues","DOCS_FILTERS_SETBYREF","setDocFilterByName","DOCS_FILTERS_SETBYNAME","saveCurrentItemAction","persist","CURRENTITEM_SAVE","currentItemLoadedAction","CURRENTITEM_LOADED","formSetDefaultsAction","FORM_DEFAULTS_SET","formSetEditModeAction","FORM_EDITMODE_SET","extraAttributesSetTabIndexAction","EA_TABINDEX_SET","extraAttributesClearAction","EA_CLEAR","extraAttributesSetDetailViewAction","EA_DETAILVIEW_SET","extraAttributesSetField","ns","EA_FIELD_SET","extraAttributesAuditLogUpdateRow","seqId","EA_AUDITLOG_UPDATE","extraAttributesAuditLogDeleteRow","EA_AUDITLOG_DEL","extraAttributesAuditLogClearRow","EA_AUDITLOG_CLEAR","extraAttributesAuditLogInsertRow","EA_AUDITLOG_INSERT","extraAttributesGridSetCurrentRow","EA_GRID_CURRENTROW","serverEventAction","evt","GLOBALEVENTS_SERVER","startOfflineSyncAction","OFFLINE_SYNC_REQUEST","offlineSyncStartedAction","OfflineSyncStatus","Syncing","OFFLINE_SYNC_STARTED","offlineSyncDoneAction","Synced","OFFLINE_SYNC_DONE","offlineSyncUpdateAction","OFFLINE_SYNC_UPDATE","setOfflineItemSyncStatusAction","took","OFFLINEITEM_SYNC_STATUS","removeOfflineItemAction","OFFLINEITEM_REMOVE","setOfflineItemDepsMapAction","depsMap","OFFLINEITEM_DEPSMAP_RESULT","serviceWorkerInitializedAction","registration","SW_INIT","serviceWorkerUpdatedAction","SW_UPDATE","notificationUpsertAction","NOTIFICATION_UPSERT","notificationDelAction","notificationId","NOTIFICATION_DEL","notificationStatusAction","NOTIFICATION_STATUS","notificationClearAction","NOTIFICATION_CLEAR","notificationToastAction","NOTIFICATION_TOAST","commandActionRequestAction","COMMANDACTION_REQUEST","guid","commandActionQueueAddAction","COMMANDACTION_QUEUE_ADD","commandActionQueueRemoveAction","COMMANDACTION_QUEUE_REMOVE","commandActionRemoveAction","COMMANDACTION_REMOVE","commandActionLogAction","COMMANDACTION_LOG","commandActionStatusAction","COMMANDACTION_STATUS","commandActionItemStatusAction","COMMANDACTION_ITEM_STATUS","Avatar","imgUrl","encodeURIComponent","avatarStyle","backgroundImage","alt","isApiOnlineSelector","network","isNavigatorOnlineSelector","isNavigatorOnline","isOnlineSelector","hasDetectedNetworkStatus","hasDetectedNetworkStatusSelector","itemUriSelector","detailView","formReducer","isNew","merge","parseSeqId","del","isGridRowDeleted","auditLog","set","_state","deletedIds","lastChange","docmodal","alert","formDetailViewSelector","formLastChangeSelector","formAuditLogSelector","formGridRowIndexSelector","formGridRowSeqIdSelector","formDefaultsSelector","formIsEditModeSelector","formTabIndexSelector","webpackAsyncContext","req","__webpack_require__","code","ids","ValueFacePile","pile","p","PrincipalAvatar","$type","sharedStyles","description","total","facePileMore","onMoreCommand","UserName","Component","icon","ValueUser","ValueProgress","progress","ValueVisualRules","caption","color","iconSize","loader","pulse","src","iconUrl","ValueEnum","renderEnumValue","enumValue","isMulti","enum","ValueTextLink","link","ValueFilesize","ValueDatetime","SummaryAttributeValueFactory","SummaryAttributeValueType","FacePile","VisualRules","Enum","TextLink","Filesize","User","Progress","Datetime","ReactElement","SimpleAttribute","applyAnySelectionContext","cb","contextProps","check_isMultiSelection","check_isDoc","isDoc","check_isSpecialFolder","SpecialFoldersItemURIs","check_isWindows","bowser","is","check_hasContext","check_licenseAllowEdit","licenseAllowEdit","check_isSyncForced","uploadProvider","UploadProvider","Sync","check_isSyncUpload","check_hasItemStatus","itemStatus","ItemStatuses","Nothing","multiple","checkMapping","store","getState","isFolder","isSpecialFolder","isSyncEnabled","isSyncForced","isSyncUpload","isWindows","isMiniView","hasSiteType","SiteType","NotSet","hasContext","hasFeature","isFeatureOn","check_hasFeature","hasBrowser_webShareApi","navigator","share","canShare","isCreateAllowed","hasItemStatus","isRecycleBin","hasSearchType","parseInt","isCustom","isWorkflowEnabled","isAnyOnlineStatus","isAnySelection","isMultiSelection","hasExtension","hasRowAndColId","columnIndex","shouldBeVisible","expr","negate","conditionName","func","isLocalhost","Boolean","hostname","registerValidSW","swUrl","config","serviceWorker","register","trace","activeWorker","active","onSuccess","onstatechange","onupdatefound","installingWorker","installing","controller","onUpdate","fatalException","onFailure","sagaMiddleware","run","rootSaga","Root","Loader","browserCheck","satisfies","chrome","edge","firefox","safari","opera","android","iOS","samsung_internet","blackberry","electron","Feature","offline","URL","origin","install","fetch","headers","contentType","ready","unregister","reload","checkValidServiceWorker","addEventListener","serviceWorkerRegistration","process","JEST_WORKER_ID","ReactDOM","breadcrumbReducer","breadcrumbItemUriSelector","breadcrumbNameSelector","breadcrumbLevelsCountSelector","breadcrumbVersionSelector","version","breadcrumbFormatIdSelector","breadcrumbSiteTypeSelector","loginReducer","loginStatusSelector","login","loginIdTokenSelector","loginAccessTokenSelector","loginExpiresOnSelector","loginExpiresInSelector","toastPosition","toast","POSITION","toastId","PdfJs","NetworkStatus","NoNetwork","OfflineChanges","ServiceWorker","ServiceWorkerOfflineQueue","UppyInfo","UppyRecovered","UppySuccess","refresh","NotificationStyle","Info","btnToast","success","Success","partial","Warning","uppyComplete","uppyError","uppyRecovered","isRouted","uppyInfo","uppyResuming","pdfSignature","position","TOP_CENTER","swReady","globalloc","cache","done","swFailed","swReload","swOfflineQueueAdd","swOfflineQueueAddFile","offlinePendingChanges","Toast","RoutedToast","NotificationStatusFlag","New","timestamp","dismissToast","notification","getNotification","settingValue","NotificationType","API","dismiss","locPrefix","locParams","Loading","isLoading","pastDelay","modules","opts","loadingType","LoadingType","Default","Loadable","delay","timeout","StatusLoading","getDefaltsByLoadingType","createBrowserHistory","DEFAULT_CONFIG","renderDiv","usePortal","portalTargetSelector","portalTargetSelectionMethod","getStyle","node","transform","top","getBoundingClientRect","y","left","innerWidth","rowIndexProp","isActiveProp","isHoveredProp","actionsHandlerProp","actionsDisabledProp","shouldRender","withStickyToggle","onMouseEnter","onMouseLeave","MultiSelectionContext","divRef","useRef","actionsHandler","isActive","isHovered","isHandheld","setShow","handleMouseEnter","handleMouseLeave","wrapperProps","calculatedStyle","current","opacity","getPortalTarget","querySelectorAll","portalTarget","setPortalTarget","StickyToggleStyle","List","minHeight","GridList","outer","closest","inner","rect","rgb","borderColor","scrollbarWidth","scrollbarHeight","scrollTop","scrollLeft","minWidth","justifyContent","background","borderLeft","borderBottom","withOfflineHandler","offlineHandler","useOfflineHandler","SummaryAttribute","attribute","useDefaultStyle","ValueFactory","AttributeFactory","Attributes","attributes","whiteSpace","PlaceInput","_onChangePlace","latlng","ParseLocation","inputGroup","Addon","iconWrapper","GeoPlaceInput","MapModal","_onSet","mapRef","editLocation","GetEditLocationResult","onSet","_onChangeFromPlaceInput","SetCenterMarker","_showGeoInput","usePlaceInput","SupportGeoPlaceInput","useMarker","locations","allowEdit","_onViewerLoad","viewerLoaded","Header","closeButton","Title","MapViewer","mapProvider","radius","onLoad","footer","setButtonLabel","btnSet","createRef","openMapModal","onInit","selectedTogglesFromProps","viewNameFromProps","usedViewName","prevSelectedTogglesFromProps","togglesFromViewName","getToggles","allowMultiple","browser","greaterThanOrEqual","medium","prevAllowMultiple","selectedTogglesFromStore","prevSelectedTogglesFromStore","selectedTogglesFromQueryString","prevSelectedTogglesFromQueryString","selectedToggles","setSelectedToggles","prevSelectedToggles","handleSetToggles","availableToggles","isHidden","validToggles","handleToggleChange","togglesBySelected","isMultiple","hasSelection","treeReducer","treeNodesSelector","treeStatusSelector","treeErrorSelector","treeIsRootSelector","treeIsBrowsableSelector","treeTotalCountSelector","split1","split2","panes","panesViewSelector","selectedTogglesSelector","handleDispatch","setSplitSizes","paneIdx","onDragEnd","getSizes","master","panesDefaultState","slave","HttpMethod","GET","PUT","DELETE","POST","HEAD","ContentType","AUTO","BLOB","TEXT","CacheStrategy","StaleWhileRevalidate","CacheFirst","NetworkFirst","NetworkOnly","CacheOnly","DEFAULT_CACHE_NAME","CacheKey","CustomAuthorization","SecureParams","MiniView","OfflineItemUri","OfflineApiName","OfflineSync","OfflineQueueItemType","ApiCall","UppyFile","GlobalSites","MySites","SharedSites","RecycleBin","MailBox","AUSites","ViewNameType","flat","mailbox","GlobalSite","MySite","SharedSite","SidebarItemSource","System","Custom","Offline","NavigationItemType","Home","News","Report","Wf","CommandAction","Group","PrincipalType","SharePrincipalType","Share","Unknown","SyncedWithErrors","Conflict","SharedDocumentsUri","RecycledDocumentsUri","RecycleBinUri","Reminder","Relation","PDF","WFReport","Note","Link","MailHasAttachment","MailReplied","MailForwarded","Locked","Template","Subscribed","CloudSync","Deleted","ParentDeleted","ListViewMode","Thumbnails","Grid","Map","Calendar","Equals","NotEquals","LessThan","LessThanOrEqualsTo","GreaterThan","GreaterThanOrEqualsTo","Contains","DoesNotContain","StartsWith","DoesNotStartWith","EndsWith","DoesNotEndWith","Between","NotBetween","DateRelative","DocListColumnType","StringValue","FileSize","IntValue","BooleanValue","LongValue","ShortValue","DoubleValue","DecimalValue","SingleValue","DateTimeValue","DateTimeOffsetValue","ByteValue","ObjectValue","SortDirectionOptions","Ascending","Descending","ActivityType","create","modifyContent","modifyField","comment","locked","ItemNoteType","PdfHighlight","ItemNoteTypeIcon","default","pdfHighlight","CleanupKeepVersionType","All","Last","PerDay","PerUser","RetentionType","Forever","FormLookupType","ea_lookup","ea_ftlookup","sf_ftlookup","ExtraAttributeEmbeddedGridRowStatus","Updated","Added","ItemLinkType","Manual","WorkflowReport","Shortcut","WorkflowProvider","inPointWorkflow","AxonIvy","WorkflowType","Routing","Process","ToDo","WorkflowStartLinkMode","Window","Docked","SearchOperator","Contextor","From","To","FromTo","FromToWithTime","FromWithTime","ToWithTime","EqualsWithTime","RelativeDate","FromRelative","ToRelative","GeoRadius","GeoArea","GeoRadiusIntersect","GeoRadiusWithin","GeoAreaIntersect","GeoAreaWithin","GeoAreaPoint","ContextorContains","SearchNodeType","AllNodes","LeafNode","CustomNode","Auto","SearchScope","AllSites","AllFolders","CurrentFolder","SearchValueType","ItemType","Decimal","GeoPoint","StringFieldOnly","DecimalFieldOnly","IUID","SearchRequestType","Favorite","Recent","Freetext","Url","Task","Doc","ModifyDocument","activity","task","favorite","subscription","notSet","add","modify","edit","Self","ItemFlowDirection","out","ItemFlowTemplateType","DocTemplate","FolderTemplate","Uppy","RasterMapLayerEditAction","none","rename","LocalDateStringOption","DateTimeLong","year","month","hour","minute","second","ReminderPriority","High","Normal","Low","ReminderTypeFlags","Mail","CustomAction","CustomActionState","NotStarted","Retry","Done","Abort","ReminderTypeFlagsEnumValues","ReminderPriorityEnumValues","AllowedShareActionFlags","Web","Attachment","Pdf","Anonym","WebShare","ShareType","ShareAccessControlListType","View","Edit","Delete","SORT_BUCKET_NAME","GridListConstant","ExtensionIcon","IconItemStatus","ItemUri","ItemContextsFlags","ItemStatus","ResultFlags","Extension","ViewerUrl","ViewName","Workflow","ItemContextKey","IsDoc","IsFlatAU","IsReadOnly","HasWorkflow","InPointSyncIntegration","IsFolderClassificationEditAllowed","IsEditAllowed","IsDocClassificationEditAllowed","IsDocEditAllowed","IsDocDownloadAllowed","IsDocAssignmentAllowed","IsDocSendByEmailAllowed","IsOffline","HasPdf","CanPdf","IsPdf","IsContinuousPreview","CanBeShared","TransferType","Copy","Move","Read","Pending","PriorityType","Intermediate","CommandActionStatusFlag","Partial","DocModal","LockInfo","ItemFlows","QueuedOfflineStatusText","ApiManagerOffline","ApiManagerBase","OnFetch","bind","AfterFetch","CheckLicense","request","apiContext","_handleOfflineRequest","showToast","cacheKey","_getFullCacheKey","caches","method","_handleOfflineSave","_handleOfflineTransformer","resultBody","transformer","Headers","append","Response","addToOfflineQueue","ApiManager","nameof","fetchSites","fetchUser","fetchUserSettings","saveUserSettings","fetchCards","fetchCardsByEntity","fetchNews","fetchFavorites","addFavorite","delFavorite","addSearchFavorite","delFavoriteLink","linkId","sendMail","sendMailAttachments","fetchTree","createFolder","elementType","createFolderFromTemplate","template","targetFolderName","createFolderTemplateGetItemUri","jobId","fetchItemFlows","dir","fetchItemFlowForm","formType","templateId","templateType","delItemUri","fetchSearchFormList","fetchNewForm","fetchForm","fetchSearchForm","fetchFormLookup","keyword","lookupType","fetchFormLookupDependencies","currentLookupValues","fetchExtraAttributesEmbeddedGrid","sortColumn","sortDirection","saveForm","etag","saveNewDocFromTemplate","validateForm","validateWebdavName","fetchActivities","fetchItemNote","noteId","addItemNote","updateItemNote","deleteItemNote","delDocVersion","restoreDocVersion","fetchDocCount","fetchDocsCsv","fetchDocs","fetchDownloadToken","downloadDocToken","token","inline","pdf","stream","bridge","downloadDocUri","fetchThumbnail","fetchRelatedDocs","itemLinkType","getSource","getWebDavHttpLink","webDavName","getCloudInfo","lock","unlock","subscribe","isSubscribed","unsubscribeByItemUri","unsubscribeById","linkID","fetchWorkflowProviders","fetchWorkflowCards","fetchNewWorkflows","fetchWorkflowInfo","provider","wfId","delDefiniteItemUri","restoreItemUri","fetchRasterMapLayers","rasterMapIdSelector","saveRasterMapLayers","fetchSAYT","fetchSearchCount","fetchSearchResult","fetchSearchPrincipal","includeUsers","includeGroups","fetchSearchSuggestion","fetchReminders","upsertReminder","deleteReminder","reminderId","fetchShare","createShare","shareRequest","updateShare","deleteShare","checkShareName","itemUris","webDavNames","fetchShareContext","formatIds","fetchOfflineItems","addOfflineItem","delOfflineItem","transfer","transferRequest","itemContexts","fetchItemContexts","fetchShareAttachment","fetchDocResultFlags","fetchItemContext","fetchViewNameType","dbKey","offlineQueueStorage","setItem","anyPendingChanges","keyPrefix","keysStartingWith","replayOfflineQueue","getAllItems","allItems","offlineQueueItem","_replayApiCall","_replayUppyUpload","queueItem","qi","removeItem","retries","_handleConflict","openConflictModal","currentEtag","addFile","retryUpload","TextEditorControl","shouldRenderItem","targetView","visible","check_isView","itemUriRegex","check_itemUriRegex","check_formatId","backwardsCompatibleShouldBeVisible","rule","endsWith","targetViewOrCurrent","negatedViews","defaultViews","RegExp","exec","mergePartialConfig","userActions","sysActions","cloneDeep","userAction","sysIndex","findIndex","sa","sysAction","mergeItemActionsConfig","category","commandAction","showAddNote","showHistory","showNotes","showRetentionInfo","triggerPrint","isEdit","onlineEditor","triggerEditMode","flowId","asModal","docked","unionBy","abortControllerInstance","AbortController","abort","useBroadcast","channelName","channel","BroadcastChannel","onmessage","useNetworkStatus","useUpdateEffect","usePostMessageHandler","handlers","parentWindow","handleMessage","handler","onMessage","isTrusted","d","useEvent","ModalAction","Close","CloseLegacy","handleGeoInfo","openSearchResultActionPanel","openItemActionPanel","thumbnail","longitude","latitude","openGeoPointActionPanel","useDefaultPostMessageHandler","DefaultAction","Browse","externalLink","mark","print","docRoute","flatRoute","folderRoute","mailRoute","getRoute","searchRouteWithItem","GeoInfo","GeoInfoLegacy","Exec","actionId","Picker","Open","selectedItemUri","Select","Cancel","settingValueSelector","setValue","useLocalStore","storeName","createSagaMiddleware","middlewares","composeEnhancers","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","createStore","appReducers","responsiveStoreEnhancer","applyMiddleware","localRootSaga","getStore","useMomentLocale","getMomentLocale","setStatus","locales","useUppy","uppyId","uppyProps","events","setReady","createUppy","addUppyPlugins","addUppyEvents","getUppyLocale","i18n","finally","removeUppyEvents","setPendingUploads","uppyPendingUploads","useDeepCompareEffect","usePdfHighlight","createGlobalState","usePdfHighlightActions","createPostMessage","handleLoad","PdfHighlightAction","Load","handleUpsert","Upsert","handleHighlight","Highlight","handleDelete","usePdfHighlightActivityList","userId","setEdit","onAction","isReadOnly","highlight","setHighlight","messageHandler","activityId","what","pdfHighlights","targetHighlight","usePdfHighlightInput","handleNoteExtras","noteRef","clearableInput","scrollIntoView","block","focus","useDismissNetworkToast","setError","setDismiss","handleDismissClick","handleEnableOffline","factory","fetchRequest","useArrowNavigationTransmitter","targetData","setCurrentIndex","ArrowNavigationAction","Ready","Paginate","qsParam","currentIndex","createElement","pathname","useArrowNavigationReceiver","postMessageProps","setPostMessageProps","setMaxCount","Reload","SetIndex","useRecycleBin","itemUriFromProps","itemStatusFromProps","checkIfRecycledDocuments","checkIfDeleted","checkIfAnyParentDeleted","checkIfInRecycleBin","hash","useViewNameTypeRouting","targetViewNameType","isMini","viewNameType","useFormActions","itemContext","ItemContext","userFormActions","useFormActionsConfig","allContextProps","useAsyncMemo","Rename","_startEditing","editing","_txt","txt","setSelectionRange","_onChange","_onBlur","_onKeyDown","which","display","onKeyDown","Searchcrumb","favStatus","favOnClick","onRename","ok","Item","SearchcrumbContainer","_parse","favOnRename","CustomBreadcrumb","fontSize","CrumbSelector","scopeFromLevel","isFavorable","Breadcrumb","ToggleBarButton","CountBadge","badge","ToggleBar","group","ToggleBarContainer","togglesFromProps","togglesFromStore","newToggles","topRowClassName","topRowBefore","onActionShouldBeVisible","breadcrumbIsRecycleBin","usePendingOfflineChanges","ActionsButton","ActionsMenu","onShouldBeVisible","ActionCategory","catActions","content","ItemActions","renderHeader","ActionPanel","body","scroll","margin","getContextProps","hasWorkflow","ActionPanelContainer","folderItemUri","categoriesFromConfig","actionsFromConfig","MemoActionPanelContainer","nextProps","openActionPanel","RowTitle","FileExt","marginRight","RowBody","marginTop","marginBottom","parsedName","parsedTitle","parsedTitleOrName","parseTitle","renderValue","linkType","isIconLast","LinkViewer","comparableValue","useAnchorProps","nolink","LinkViewerControl","isGridCell","textAlign","Thumbnail","_onLoad","maxHeight","DownChevron","components","NativeSelect","selected","so","valueKey","_getValue","wrapperClassName","selectRef","option","labelKey","removeSpaces","UserIdViewerControl","userid","padding","marginLeft","findCustomField","fields","getFieldType","field","ImageViewerControl","creatorIdField","modifiedIdField","StaticViewerControl","LocationViewerControl","marker","GeoRasterViewerControl","T","TelViewerControl","EmailViewerControl","hidden","MyForm","isNoDataError","getFields","fieldsLength","hasEA","onSubmit","EAForm","formTitle","layoutXml","LocalContactInfo","HiddenEditorControl","FormsyEditorBase","isAdditionalRender","getValidationErrors","customErrors","isDefaultRequiredValue","FieldEdit","formPrefix","ImageEditorControl","ro","isNotInvalid","LookupEditorControl","NumberEditorControl","maxLength","max","isFilename","isPathname","MemoEditorControl","isEmail","matchRegexp","GeoPointValidationRegex","showLabel","GeoAreaEditorControl","GeoAreaValidationRegex","GeoRasterEditorControl","NavigationBlock","isDirty","onbeforeunload","Prompt","when","MyFormEdit","_prepForm","changed","defaultValueKey","defaultAttributeKey","ea","defaultFieldKey","_setupValidations","addValidationRule","range","min","test","_onInvalid","canSubmit","_onValid","_onSubmit","resetForm","invalidateForm","isValidating","onValidate","isSubmitting","onSave","_onFieldChange","splittedName","_isDirty","_getSaveButtonLabel","_formsySubmit","_formsyRef","submit","confirmLabel","toolbar","onValidSubmit","onValid","onInvalid","buttonToolbarPortal","FormContainer","_isMounted","paramUri","_updateToggleLoading","onFormLoad","_handleKeepFilename","e2","keepFilename","_isWebDavNameHidden","_ignoreWebDavName","hiddenWebDavName","_maybeAddDefaultWebDavName","_onValidate","locErrors","_onSave","renderKeepFilename","controlId","flexDirection","alignItems","checked","getFormBarViewNames","viewNames","isLocked","refreshId","isOfflineAllowed","adjustedItemUri","showHeader","defaultFormTitle","defaultFormIcon","lockInfo","FormEdit","center","partTitle","isLast","bctext","BreadcrumbPart","symbolName","onMeasured","localizedText","bi","findDOMNode","clientWidth","measureWidth","onPartClick","BreadcrumbFavorite","MyBreadcrumb","leafActive","showParts","hiddenCount","showChangeSiteType","setShowChangeSiteType","toggleChangeSiteType","handleSiteChange","Site","canClick","verticalAlign","SiteSelect","defaultItemUri","part","ResponsiveBreadcrumb","_onMeasured","__calcVisible","knownState","reduceRight","previousValue","currentValue","calculated","_calcVisible","throttle","leading","trailing","knownWidth","mybc","noop","bounds","EventHandler","componentClass","onContextMenu","onTouchEnd","onTouchStart","onTouchMove","onMouseDown","onMouseUp","handleAdd","autoToggleRow","setAutoToggleRow","handleTouchStart","handleTouchMove","handleTouchEnd","handleMouseDown","handleMouseUp","toggleFavorite","logger","BreadcrumbContainer","initialLoading","_maybeGetNewAbortController","isRefreshing","ProgressModal","doWork","initialProgress","cancelButton","modal","openProgressModal","htmlValue","dangerouslySetInnerHTML","__html","ArchiveTargetImageWithTitle","Icon","noIcon","borderless","Container","useToggle","toggleShow","aside","hide","lockedById","lockedByName","date","lockedDate","onClear","setOperator","scope","setScope","showSearchOperators","showSearchScope","searchScope","onSearchScopeChange","scopeItemUri","SearchScopeSelect","radioClassName","radio","Scope","renderAction","FormBarItem","Factory","ApiCatalog","strategy","keyParams","depsAnalyzer","isPdf","canPdf","hasPdf","isEditAllowed","depsApis","imageViewerExtensions","mediaViewerExtensions","getGeoRasterProvider","hasMore","rowKey","fetchDocument","treeNode","flows","flow","depsApi","_callReturnContext","urlEnd","_pipeline","_encodeData","_getHeaders","auth","useCustomAuthHeader","secure_params","_networkError","BeforeFetch","DecodeBody","CheckCustomError","EOL","apiTook","urlParams","credentials","signinRedirect","_getErrorData","contentHeader","json","lic","isLegacyResponseClone","blob","ModalHeader","ModalBody","Large","Medium","historyUnlisten","listen","_search","closeRequested","_onResizeDebounced","capture","passive","removeEventListener","_onResize","fs","_shouldFullscreen","vh","_getHeight","debounce","_getWidth","isIOS","documentElement","clientHeight","innerHeight","_renderChildren","_renderChild","overflowY","onKeyPress","animation","Overlay","okStyle","REFRESH","workflowReducer","workflowStatusSelector","workflow","workflowCardsSelector","workflowProvidersSelector","workflowPendingCountSelector","initialized","updated","serviceWorkerReducer","isSwInitializedSelector","sw","isSwFailedSelector","isSwUpdatedSelector","swRegistrationSelector","withItemContext","asProps","parentContext","setRefreshId","prevRefreshId","baseRefreshContext","newRefreshId","refreshContext","itemContextWithExtras","itemContextAsProps","openBrowseDialog","openCamera","onAddFile","plugin","getPlugin","hideAllPanels","getElementsByClassName","click","showPanel","toggleAddFilesPanel","plugins","uppyLexmark","hideUploadButton","hideRetryButton","hidePauseResumeButton","hideCancelButton","showLinkToFileUploadResult","showProgressDetails","disableInformer","disableThumbnailGenerator","metaFields","proudlyDisplayPoweredByUppy","minipicker","miniflat","itemflows","defaultFallbackImage","heightStyle","widthStyle","parsedValue","border","objectFit","docsLayoutFiltersSelector","docsLayout","docsLayoutSortsSelector","docListViewMode","settingsReducer","sidebarMiniSelector","settings","docListViewModeSelector","currentItemReducer","saved","currentItemUriSelector","currentNameSelector","searchFormsReducer","searchFormListStatusSelector","searchForms","searchFormListResultSelector","searchFormListCountSelector","offlineReducer","offlineItemsSelector","MomentLocale","resize","overflow","paddingTop","paddingLeft","paddingBottom","boxShadow","maxRows","Name","selectedValue","getSelected","parseSelectedValue","bucket","buckets","b","findBucketValue","hideName","AllItem","MenuItem","Button","fontWeight","fontStyle","SearchBucket","hideMenu","Toggle","Menu","hideAllReset","Bowser","getParser","userAgent","BROWSER_MAP","localContactInfo","btn","uriForFormTokens","withFormTokens","encodedContext","rawValues","UserGroup","getGridRowDefaultValues","gridName","grid","getGrid","columns","col","seqIdColumn","convertSeqIdToIndex","convertIndexToSeqId","mapGridRowToColumns","isGridRowUpdated","updatedRows","inPointAction","browse","preview","properties","archive","inPointActionLink","additionalProps","uris","sp","ClientLink","shortItemUri","sort","sortKey","searchRouteWithKeyword","searchText","searchRouteWithKeywordAndMore","nodeType","viewNameTypeRouteMapping","cfg","sitesOrdered","orderedIndex","orderedSite","orderedIndex2","BrowserLink","BrowserDragLink","isSecureParams","togglesReducer","persisted","_selected","togglesPersistedSelector","cardsReducer","cardsToAdd","oldCard","cardsToUpdate","cardsStatusSelector","cardsCardsSelector","thumbnailsReducer","thumbnailStatusSelector","thumbnails","thumbnailResultSelector","favoritesReducer","favoritesStatusSelector","favoritesFavoritesSelector","commandActionReducer","unshift","j","commandActionRequestSelector","createContext","CurrentItemContext","getGeoLocation","onLocation","geolocator","locate","geoLocatorOptions","LocationToString","coords","getBarcodeMatch","re","lastIndex","getBarcode","onBarcode","openBarcodeModal","runSearchItem","showFilterbar","fb","vm","createSearchItem","onSearchItemCreated","geoFilter","strLoc","geolocation","barcodeFilter","barcode","reject","searchResult_form","execute","isDragDropSupported","getDroppedFiles","FileDropHandler","_registerHandler","_unregisterHandler","allowDrop","_dropzone","onDrop","onDragOver","onDragLeave","clearTimeout","_timeout","dataTransfer","dropEffect","isFileDrag","addedCount","filesDTO","fileDTO","relativePath","addFilesToUppy","isRestriction","types","isDragover","_timedDragLeave","DropHandler","dragOverText","componentProps","CustomUploadAction","Language","PdfSignatureAction","PdfPrintAction","NotificationAction","Show","Hide","Clear","effects","prevProp","FolderResult","renderCheckbox","checkbox","ElementType","FolderResultWithStickyToggle","DocumentResult","article","summary","DocumentResultWithStickyToggle","RowResult","combinedClassNames","hovered","word","foundTerms","term","exclude","_cache","clearAll","_isRowLoaded","_loadMoreRows","startIndex","stopIndex","pagesStatus","Math","floor","loadMoreRows","nextRows","handleMoreRowsLoaded","_rowRenderer","isScrolling","hoveredRowIndex","CellMeasurerCache","maxTotal","scrollToRow","_list","scrollToPosition","flex","isRowLoaded","onRowsRendered","registerChild","deferredMeasurementCache","overscanRowCount","rowHeight","rowRenderer","noRowsRenderer","scrollToIndex","scrollToAlignment","handleWidth","handleHeight","onResize","SearchResultMap","totalLoaded","isLoadingNextPage","hasMorePages","_firstPage","_getLocationsFromResult","onlyRaster","isRaster","_getLocations","attr","point","area","ParseArea","ParseRaster","_loadNextPage","nextLocations","concat","onCountOfGeoResults","bottom","WithContext","Views","week","agenda","Toolbar","calendarRef","currentView","projections","currentProjection","onProjectionChange","nextPageButton","projColor","proName","getApi","prev","today","next","changeView","lessThan","colorArray","WrapperStyle","SearchResultCalendar","_getEventsFromResult","_getEvents","start","allDay","backgroundColor","extendedProps","projection","nextEvents","_onEventDidMount","el","rightClickHandlers","_rightClickListener","_onEventWillUnmount","_onEventClick","jsEvent","_onViewChange","calendarView","_onProjectionChange","_getProjectedEvents","_onDatesRender","_calendar","initialView","noEventsContent","nowIndicator","businessHours","headerToolbar","bootstrapPlugin","dayGridPlugin","timeGridPlugin","listPlugin","themeSystem","eventDidMount","eventWillUnmount","eventClick","viewDidMount","datesSet","CellContentWithStickyToggle","cell","desktop","containerClassName","SearchResultGrid","onContextClick","onFilterBarSelect","isRowActive","rowsFromResult","setRows","setPagesStatus","parseCellColumnTitle","isColumnFiltered","isColumnSorted","getColumnSortDirection","handleLoadMoreRows","handleCellClick","handleCellMoreClick","handleCellContextClick","handleHeaderFilterClick","handleHeaderClick","canSort","getColumnWidth","getCell","columnCount","CellContent","ContextMenuHandler","parseCellHeaderCaption","canColumnFilter","rowStartIndexUpdated","onCellClick","onCellDoubleClick","onCellMoreClick","onHeaderClick","onHeaderFilterClick","headerFilterTitle","GetDefaultSearchBuckets","SearchResultContainer","_maybeChangeViewMode","_prepSearchRequest","extraFilters","fakeUris","bucketFilters","hasMapViewMode","viewModeSetting","_updateToggleCounter","_handleMoreRowsLoaded","_onFilterBarSelect","newSelected","newSearchRequest","selectIndex","filterIndex","newFilter","newSort","sortSetting","_onFilterBarClear","_isDocument","_getNextDocumentIndex","_getDocument","_getPrevDocumentIndex","documents","multiSelection","activeRows","_updateArrowNavigationRows","reducedDocuments","_getDocModalProps","isNext","documentIndex","getActiveRowItemUri","setTarget","setDocuments","_onClick","prevRowIndex","showViewer","shiftKey","handleToggle","endIndex","disable","searchTerm","_onMoreClick","openMultiSelectionActionPanel","mapper","newViewMode","fallbackViewMode","SupportGeoMapViewer","searchCalendar","_onViewModeChange","_getAvailableViewModes","viewModes","_onCountOfGeoResults","updateTotalCount","additionalState","availableRows","setAvailableRows","_isRowActive","activeState","autoBrowseToItem","aggregationsFromResult","nameA","nameB","listViewMode","hideLoading","FilterBar","onViewModeChange","onMapClick","mapStateToProps","SearchResultContainerWithoutMultiSelection","withMultiSelection","functions","randomGuid","guidHolder","hex","r","guidResponse","random","getAuthCallback","urlLocation","qr","error_description","expires_in","expires_on","parsed","base64","jsonPayload","decodeURIComponent","atob","charCodeAt","parseJwt","access_token","id_token","exp","signout","persistor","pause","flush","purge","endSessionEndpoint","id_token_hint","post_logout_redirect_uri","logoutRedirectUrl","signinFromLocation","client_id","clientId","redirect_uri","redirectUrl","response_type","responseType","nonce","resource","forceLogin","prompt","forceLoginPrompt","authorizeEndpoint","getAuthUrl","panesReducer","globalSearchReducer","globalSearchOptionsSelector","globalSearch","globalEventsReducer","notificationReducer","priority","notificationSelector","CommandActionButton","actionPrefix","locId","categoryId","getItemActionLocalizationIdentifier","_queryString","object","skipNull","skipEmptyString","Option","shouldComponentUpdate","loadIndex","inputValue","getParentAsFilters","parentName","parentLookupCommonName","getCurrentDependentLookupValues","lookupValues","getValueByOperator","fetchLookup","loadedOptions","additional","val","boostLeafNode","formId","_fixValue","_handleDependenciesUpdate","_handleLookupValue","_prepareOtherValueFor","useKeys","others","O","shift","dependentLookups","lookup","_lookup","_onInputChange","_valueRenderer","toLocaleString","valueWithIcon","_optionRenderer","innerProps","onMouseMove","onMouseOver","newProps","ValueComponent","selectProps","menuPortalTarget","menuPlacement","classNamePrefix","provided","control","valueContainer","dropdownIndicator","indicatorSeparator","clearIndicator","menu","menuPortal","textShadow","cursor","isFocused","loadOptions","debounceTimeout","cacheUniqs","onMenuClose","getOptionLabel","getOptionValue","filterOption","createFilter","ignoreAccents","isClearable","openMenuOnFocus","onInputChange","useContains","openExternalLinkModal","frameBorder","allowFullScreen","getNoteType","NoteInput","onEnter","onAbort","noteExtras","setNoteExtras","handleEnter","handleAbort","noteContainer","noteWrapper","noteInput","getCommentIconString","Activity","showDetails","showActions","isHighlighted","isLastVersion","actionMenu","renderWhatIcon","renderWhat","on","renderChange","change","newVal","oldVal","renderChanges","condensed","table","tbody","activityRef","renderText","userName","toggleComponent","ActivityList","currentVersion","commentType","setCommentType","handleAction","itemCommentType","filterType","lastVersionId","totalVersions","accumulator","CleanupKeepInfo","RetentionInfo","months","Activities","cleanupKeepInfo","retentionInfo","noteService","ActivitiesContainer","_setActivityListDefaults","activityList","_onAddNote","_canUserUpdateOrDelete","_onUpdateNote","_onDeleteNote","abs","openConfirmModal","confirmButton","confirmed","deleted","_toggleDetails","_onAction","itemUriWithVersion","onShowVersion","restoreVersion","deleteVersion","keep","retention","GeoAreaInput","_setAreaManually","getGeoAreaProvider","editLocationResult","onManualArea","AreaToString","showIcon","buttonsWrapper","SupportGeoAreaEdit","combineReducers","docsLayoutReducer","globalEvents","networkReducer","createResponsiveStateReducer","extraFields","greaterThan","mediaType","uppyRedux","reducer","found","exactItemUri","globalDefaults","searchStatistics","searchAsYouType","searchFacets","homeActions","mailService","rasterMapService","reminderService","shareService","templateService","workflowService","xs","x","requireSelection","Toggles","home","wf","news","searchresult","isCallback","itemStatusMapping","Icons","Notes","Email","Replied","Forwarded","Cloud","getPropsForItemStatus","ItemStatusIcons","iconStyle","bit","ItemStatusComponent","SimpleAttributeValue","LockInfoOn","SiteRow","site","siteDisplayName","filteredSites","selectedSite","siteSelect","siteSelectNative","menuitem","FilterBarContainer","_prep","_onSelect","aggregation","filterTextPlaceholder","showClear","renderFilter","disableFilter","RelativeDatePicker","autoFocus","relDate","uppyRef","restrictions","updatedRestrictions","maxNumberOfFiles","maxFileSize","deniedFileTypes","allowedFileTypes","UppyRestrictions","Plugin","onRestrictionFailed","onBeforeUpload","_updateRestrictions","restrictedFileIDs","fileID","_checkRestrictions","restrictedFiles","old_onBeforeUpload","onBeforeFileAdded","old_onBeforeFileAdded","beforeUpload","uninstall","off","MapButton","getGeoMapViewerProvider","_iframe","contentWindow","setCenterMarker","_fetchRasterLayers","mapLayers","layers","fetchError","_callOnLoad","_frameLoaded","showLocations","searchRadius","_addLocationsToMap","showMoreLocations","_getMapUrl","providerName","geo","providerKey","lang","Consumer","_initProvider","osm","google","bing","esri","getGeoPlacesProvider","_geoCodingProvider","places","getSAYT","gpi","textOverflow","IndicatorSeparator","DropdownIndicator","cacheOptions","loadingMessage","noOptionsMessage","refreshIndex","doc_print","LoadingIframe","setLoading","marginHeight","marginWidth","CardSubTypeIcon","cardtype","onlyName","itemType","cardColor","CardItem","desc","liRef","isValidElement","custom","enableHighAccuracy","maximumWait","maximumAge","desiredAccuracy","fallbackToIP","addressLookup","timezone","staticMap","ApiCacheManager","OpenCache","DeleteCache","CacheExists","LogEstimates","cachedRequests","getStorageEstimate","estimate","usageInGb","quotaInGb","percentUsed","ApiManagerMakeAvailableOffline","offlineItem","_callWithDeps","_offlineItem","_apiCache","_runTransformer","cacheBody","apiMethod","_addToCache","put","defaultCache","updateUser","startSync","preFetchGlobals","preFetchFolder","fetchDeps","removeOfflineItem","checkOfflineItems","watchOfflineSync","getDepsMap","watchNetworkStatus","offlineSaga","checkServerConnectivity","APIs","getAPI","isSyncing","promptedForPersistentStorage","anyOfflineItemSyncErrors","select","storeItems","storeItem","_collapsed","timeLog","timeEnd","apiGlobal","childMapRef","rootDep","dep","deps","round","isSuccess","currentOffline","storage","persistent","itemsToSync","spawn","currentOfflineItem","lastUpdate","race","take","networkActionTypes","persistNetworkStatus","takeLatest","OFFLINEITEM_DEPSMAP_REQUEST","fork","pingUrl","networkActions","startWatchNetworkStatus","Request","getUser","logoutUser","userSaga","web_version","provider_fileVersion","provider_serviceVersion","features","getFavorites","checkIsFav","refreshFavorites","favoritesSaga","breadcrumbSelector","stateFavoritesStatus","favoritesFetched","stateFavorites","takeEvery","getCards","refreshCards","getCardsByEntity","cardsSaga","cancelled","getCardItemTypeFrom","getProviders","workflowSaga","lib","defaultCount","pending","countCards","countBy","getTree","treeSaga","getDocs","exportToCsv","docsSaga","FileSaver","saveAs","resetFilters","setFilterByRef","setFilterByName","getDocsLayout","setFilterText","resultSelector","currentItemSelector","formatIdSelector","ResetFilters","GetDefaults","colName","newfilters","newfilter","GetFilterValueAsString","newFilters","currentItemLoaded","currentItem","docsresult","loadSettings","calcCurrentItem","saveCurrentItem","currentItemSaga","togglesSelector","panesSelector","ignoredViews","isIgnoredView","currentItemName","getName","getKey","shouldPersist","viewStorage","cacheStorage","isPersisted","usePersistedToggles","def","getSearchResult","getSearchCountResult","renameSearchFavorite","updateResultToggle","updateResultToggles","resetSearch","updateSearchFormToggles","getSearchFormList","getSearchForm","getGlobalDefault","searchSaga","forms","thumbnailsSaga","getThumbnail","actionChannel","buffers","expanding","requestChan","cancel","getToken","notificationLoop","actionLoop","notificationsSaga","createSocket","HubConnectionBuilder","withAutomaticReconnect","nextRetryDelayInMilliseconds","retryContext","elapsedMilliseconds","configureLogging","withUrl","accessTokenFactory","build","signalChannel","connection","eventChannel","emit","onreconnecting","ping","onreconnected","connectionId","onclose","chan","triggerNotificationAPI","toastSaga","Notification","triggerReactToastify","toastOptions","theme","notificationType","handleCommandActionRequest","updateCommandActionStatus","handleQueueRequest","executeCommandAction","abortCommandAction","removeCommandAction","handleCommandActionQueueAction","pauseQueue","rebuildQueue","watchCommandActionQueue","commandActionSaga","actionHandler","actionMappings","queueMultiple","getToastType","getToastMessage","identifier","report","COMMANDACTION_ABORT","COMMANDACTION_QUEUE_PAUSE","COMMANDACTION_QUEUE_START","requests","docsLayoutSaga","ItemAction","RowResultByLayout","colIndexes","colIdx","extensionColIndex","nameColIndex","_onSingleClick","colIndex","colNameIndex","lastcell","Thumbs","thumb","ItemView_DocListGallery","stripRef","goLeft","goRight","useSwipeable","onSwipeLeft","onSwipeRight","strip","nav","stripInner","ItemView_DocList","onItemUriAction","setViewMode","ViewModes","DocListSimple","minRowHeight","RenderRowComponentClass","setSorting","requestShowFilter","showThumbnails","ItemView_ActivityList","WorkflowActions","workflowActions","page","ItemView_Workflow","wfid","wfs","progressBadge","EnumIcon","enumValues","ReminderItem","reminder","customAction","onEdit","onDelete","reminderTypeEnumValues","CustomActionReminder","reason","readonly","toLocaleDateString","recipient","getLocContextFor","ItemView_Reminder","reminders","setReminders","_reminders","handleSave","_reminder","creator","handleEdit","handleReadOnly","filterByValue","filterAddValue","filterRemove","getActionArgs","opType","ItemView_Filter","showAction","onActionClick","viewMappings","itemView_docList","itemView_activityList","itemView_workflow","itemView_reminder","itemView_filter","itemView","ViewModesMenu","ViewModeIcon","ViewModesButtons","large","right","ActionMenus","docactivity_context","docactivity_readonly_context","RenderActionMenuItem","menuName","onGetActionTextArguments","divider","RenderActionsMenu","actionMenus","openMenuOnHover","caret","showThumbnail","isMultiSelected","handleDoubleClick","renderName","statusColIndex","sizeColIndex","below","attrs","RowResultWithStickyToggle","_initCellMeasurerCache","handleRowMoreClick","handleRowContextMenu","_cellOnContextMenu","handleRowMouseEnter","NoDocs","OpenFiltersButton","isDocAssignmentAllowed","hasActiveFilter","IsFiltered","canUploadDocument","PageStatus","siteActiveCache","isSiteActive","qsuri","transforms","reducerName","loginInitialState","createTransform","inboundState","outboundState","persistConfig","persistStorage","autoRehydrate","persistReducer","persistStore","nodata","ip_commandAction","ip_archive","ip_browse","ip_edit","ip_properties","folder_delete","folder_editClassification","EnumRenderer","ButtonGroup","Dropdown","activeLabels","EnumEditorControl","handleFlagsChange","handleChange","Fragment","EnumRenderComponent","isEditable","shareType","getShareDate","expires","getBytes","bytes","pow","getActionKey","getEnumIcon","ShareActionForm","onConfirm","shareAction","handleShareAsChange","nameAndIndex","indexValue","shareAs","handleConfirmedChange","typeEnumValues","aclEnumValues","acl","isGreaterThanNow","ShareActionEditorControl","bsClass","PrincipalEditorControl","localNewUserIdRef","createUser","createGroup","newUserIdRef","setKeyword","getNewId","AsyncCreatable","Async","createOptionPosition","isValidNewOption","selectValue","selectOptions","principal","validationRules","getNewOptionData","optionLabel","handleInputChange","handleSearchAsYouType","optionRenderer","defaultOptions","SharePrincipalForm","onRemove","sharePrincipal","aclEnumValuesWithDefault","aclEnumValuesOrEmpty","withDefault","defaultAcl","SharePrincipalEditorControl","currentPrincipal","currentIdx","handleRemove","principals","empty","noBorder","ExternalUserViewerControl","ShareActionViewerControl","itemKey","docCount","folderCount","AttachmentsViewerControl","attachments","showBytes","attachment","ShareForm","setCanSubmit","handleConfirm","isAdvanced","setIsAdvanced","allowedShareActionFlags","disableSubmit","enableSubmit","isActionEdit","setIsActionEdit","oldAdvanced","setOldAdvanced","toggleFlag","flag","setFlag","newUserId","changedPrincipals","externalUsers","handleUserRemove","ShareAction","SharePrincipal","baseClassName","ExternalUser","Attachments","getShare","allowedFlags","ShareModal","canEdit","allowedShareActionFlagsFromProps","shareTypeFromProps","isAdvancedFromSettings","persistIsAdvancedToSettings","shareTypeFromSettings","persistShareTypeToSettings","persistIsPersisted","setShare","setShareAs","setIsSubmitting","setAllowedShareActionFlags","openShareModal","shareTypeKey","changeShareType","newShareTypeKey","handlePersistSettings","upsertShare","SHARE","names","proposedShareAs","proposed","getAttachment","getModalProps","allowedActions","allowedAcl","shareTypeFromContext","folder_emailAttachment","folder_preview","folderUri","form_cancel","form_clear","search_favorite","endpoint","search_preview","searchResultUrl","search_scope","searchForm_operator","searchForm_scope","doc_resetFilters","doc_exportCsv","downloadFile","temporaryDownloadLink","setAttribute","appendChild","removeChild","doc_download","doc_downloadZip","getFileName","disposition","utf8FilenameRegex","asciiFilenameRegex","filenameStart","partialDisposition","matches","zip","setProgress","progressPart","doc","arrayBuffer","buffer","generateAsync","metadata","percent","doc_downloadFilesAPI","showDirectoryPicker","directoryHandle","requestPermission","writable","getFileHandle","fileHandle","createWritable","write","doc_delete","ExpandButton","viewBox","CompressButton","ModalFullscreenButton","isFullscreen","openDocModal","activeRowIndexFromProps","onReopenWith","setActiveRowIndex","minCount","setMinCount","maxCount","fullScreenHandle","useFullScreenHandle","isNextDisabled","isPrevDisabled","handleDeletedWhileOpen","onNext","nextRowIndex","onPrev","toggleFullscreen","exit","enter","handle","allowTogglesFromQueryString","TopRowExtras","prevDisabled","nextDisabled","doc_preview","docModalProps","doc_related","relatedDocsProps","UploadModal","handleCancel","openUploadModal","doc_upload","UploadVersionModal","cancelAll","_onFileAdded","_onUploadSuccess","resp","uploadURL","callback","openUploadVersionModal","doc_uploadVersion","doc_emailLink","doc_emailAttachment","doc_editClassification","doc_editWebDav","webDavUrl","SupportedExtensions","doc_editCloud","webEditUrl","specs","useFormTokens","tokenizedUrl","lockApi","unlockApi","subscribeApi","unsubscribe","handleUnsubscribe","confirm","getFileNameFromContentDisposition","contentDisposition","decodeURI","share_web","isDocSendByEmailAllowed","isDocDownloadAllowed","NameModal","_isValid","newName","validationMessage","_validationState","validation","okButton","nameLabel","validationState","openNameModal","ValidateTemplate","newTargetFolderName","$NAME$","CheckJobStatus","times","interval","setInterval","clearInterval","newTargetItemUri","createFolder_template","workflows","ListWorkflowsModal","aria-labelledby","startLinkMode","startLink","openListWorkflowsModal","wf_start","FlowCardImage","ItemFlowsList","selectedFlow","suggested","isSuggested","renderCardItem","flexWrap","CategoryFilter","CustomItemFlow","setDefaultValues","nameField","onCreate","previewNewItem","onCreated","CustomUploadSelection","iframeRef","iframeTimeout","handleFile","isRemote","setLanguage","DocumentSelection","onFileAdded","onFileRemoved","openCustomUrl","numOfFiles","setOpen","DocumentSelectionWithRef","setFiles","_updateFiles","_onCreate","flowsMappings","itemFlow_custom","itemFlow_document","itemFlow_docTemplate","itemFlow_folder","itemFlow_folderTemplate","defaultValuesFromProps","defaultValuesFromStore","ComponentClass","_updateToggles","_getTotalCount","filteredFlows","_filterList","_getFilteredList","_onFilterTypeChange","_onFormCancel","_onCreated","onDone","selectedCategory","ItemFlowsContainer","setSelectedFlow","setSelectedCategory","visibleFlowIds","selectFlowId","ItemFlowsModal","openItemFlowsModal","itemFlows","transferApi","recyclebin_docClear","recyclebin_docRestore","recyclebin_folderClear","recyclebin_folderRestore","FormModal","formProps","footerRef","formmodal","notAuthorizedWrapper","notAuthorizedIcon","openFormModal","editClassification","clipboard_copyItemUri","clipboard_copyItemLink","RasterLayer","layer","onMoveUp","onMoveDown","layerContainer","arrows","btnDelete","LayersEditor","onMapEdit","removeLayer","renameLayer","newMap","editAction","moveUp","moveDown","RasterMapManagerModal","setMap","addLayer","saveMap","openRasterMapManagerModal","raster_manage","EnumViewerControl","renderedValue","ReminderForm","allowReminderTypeEdit","hasFlag","getReminder","setDate","ReminderManagerModal","reminderFromProps","setReminder","setIsDirty","handleCanSubmit","openReminderManagerModal","reminder_manage","offline_add","offline_delete","offline_syncItem","folder_emailLink","doclist_resetFilters","doclist_exportCsv","appInsights","trackEvent","TrimLocation","pos","parseFloat","rasterId","ParseRadius","RadiusToString","withItemUri","NotAvailable","extendPrototype","localForage","NoStorageDriver","_driver","_initStorage","getItem","clear","iterate","defineDriver","createInstance","driver","INDEXEDDB","LOCALSTORAGE","usage","quota","db","LayoutLoader","PP","showDocs","DocListFilterBar","quickFilter","prepFilters","filterBuckets","sortBucket","_getQuickFilterConfig","quickFilterCol","_findCol","defaultFilters","hasFilter","filterCaption","_getFilterDisplay","_getValueOrValues","nameCol","icons","boolean","readOnly","rawData","sectionRendered","rowStartIndex","operatorsPerType","Operators","currentYear","fromMonth","toMonth","YearMonthForm","getMonths","years","DatePicker","handleYearMonthChange","handleDayChange","setHours","valueIndex","utc","startOf","toJSON","Manager","disabledDays","before","captionElement","FilterDateValue","BoolPicker","FilterValue","DocListFilterModal","_onFilter","onFilter","_onOperatorChange","_onValueChange","_resetValues","_resetSelect","_onKeyPress","_getFocusColumnIndex","focusOnFilterName","focusColumnIndex","horizontal","ControlLabel","sm","UploadHandler","itemUriIndex","indexOrUndefined","docTracker","currentRow","setCurrentRow","refreshEvent","newState","_maybeSetActiveRow","DocListContainer","_setSorting","_onFilterClose","onFilterClose","_requestShowFilter","_rowStartIndexUpdated","_onContextClick","prevNotInitialFilters","isLayoutChanged","notDefaultFilters","GetDefaultFilters","showFilter","breadcrumbName","Bucket","enable","handleSelectAll","handleDeselectAll","handleInvert","Checkbox","isTouchEvent","touches","setMultiple","setActiveRows","handleEsc","keyCode","renderedBucket","ViewerKeysHandler","handleKeyDown","classList","contains","tagName","charCode","SuggestionHandler","docSearchProvider","itemUriFromLocation","errorDetail","setErrorDetail","setItemUri","pSplit","isSearchParam","errorMessage","showValidationBelow","_changeValue","_onFocus","_renderField","afterHeaderComponentClass","additionalRender","FormsyEditorBaseContainer","withFormsy","persisted_includeSubfolders","persisted_setIncludeSubfolders","changeFilter","toggleSubfolders","placeholderText","toggleTitle","toggleGroup","buttonDeep","si","useHandleSignedPdf","toastRef","useUnmount","useHandlePdfPrint","handleTriggerPrint","useViewerUrl","getDocUrl","usePdfArrowNavigation","iframe","onPdfReady","allowNav","PDFViewerApplication","pdfViewer","isHorizontalScrollbarEnabled","createEvent","initEvent","dispatchEvent","DocViewer","viewerUrl","InlineViewer","withContinuousPreview","isContinuousPreview","atEnd","setAtEnd","handlePrev","triggeredByHtmlViewer","handleNext","HtmlViewerAction","Top","Bottom","MediaViewer","ImageViewer","HtmlViewer","tokenFromProps","customViewerUrl","viewer","setViewer","setToken","offlineHandlerFactory","htmlViewerExtensions","docViewer","NarrowToggle","toggled","narrow","isToggled","setIsToggled","CombinedFiltersMenu","setHeight","setMaxWidth","isNarrow","setIsNarrow","onLoadMore","NoDataContent","_hasMore","_renderRow","isVisible","listGroupItem","treeItem","localizedWebDavName","listGroupItemActive","listLeft","numberOfChildren","expand","noexpand","elementIcon","listName","treeCount","_getActiveTreeNodeIndex","Tree","unfocused","totalItems","renderRow","onScroll","treeNodes","setAll","_onExpand","_onLoadMore","SupportGeoPointEdit","getGeoPointProvider","SupportGeoRadiusEdit","getGeoRadiusProvider","UppyExif","extractExif","reader","FileReader","readyState","parser","tags","readAsArrayBuffer","uppyPendingUploadsCountSelector","DEFAULT_UPPY_ID","pendingCount","fileId","uploadComplete","uppyIsResumingUploadsSelector","currentUploads","uploadStarted","mapToUppyLocale","bg","cs","de","en","es","fr","hu","it","ru","sk","sl","uk","lt","autoProceed","allowMultipleUploads","_uppy","authorization","use","Tus","withCredentials","resume","autoRetry","chunkSize","limit","retryDelays","removeFingerprintOnSuccess","Webcam","facingMode","countdown","modes","mirror","Lexmark","UppyLexmark","ThumbnailGenerator","thumbnailWidth","localStorage","GoldenRetriever","DOMException","UppyMsg","isNetworkError","exists","removeFile","ConfirmModal","confirmStyle","len","filterDef","GetDefaultOperatorForType","abbrNum","decPlaces","abbrev","forceUpdateGrid","LocalStore","localStore","PrevDocButton","NextDocButton","onFullscreen","flexShrink","wrapperStyle","GeoRadiusInput","_parseFromString","radiusIn","locRadius","_displayUnit","meter","_fireChangedValue","_onRadiusChange","_onManualLocation","onManualLocation","dropdownButton","InputGroup","unit","UNSAFE_componentWillReceiveProps","SearchValueTypeOperatorsMapping","SearchOperators","operators","getOperatorsForField","toSearchEditor","upstreamOnChange","_onChangeValue","_onChangeOperator","searchOperator","toBetweenEditor","WrappedComponent1","WrappedComponent2","value1","value2","_onChangeValue1","_onChangeValue2","GeoRadiusEditorControl","RelativeDateEditorControl","SearchLookupEditorControl","SearchTextEditorControl","SearchNumberEditorControl","SearchDateEditorControl","RelativeDateSearchControl","GeoSearchRadiusEditorControl","GeoSearchAreaEditorControl","SearchBetweenNumberEditorControl","SearchBetweenDateEditorControl","AttributeSearch","searchTextEditor","searchRelativeDataEditor","EASearchForm","fieldComponentClass","setIsValid","isChanged","setIsChanged","_onValidChanged","valid","onValidated","currentValues","SearchFormContainer","formsy","customId","updateInputsWithValue","_hasChanged","ind","_onValidated","oldValue","handleClearForm","_toFilterValue","changedField","keywordField","_handleSearchScopeChange","getRadianAngle","degreeValue","PI","createImage","Image","getCroppedImg","imageSrc","pixelCrop","rotation","rotRad","bBoxWidth","cos","sin","bBoxHeight","canvas","getContext","translate","rotate","drawImage","getImageData","putImageData","toDataURL","degrees","Rotation","onRotate","setRotation","array","clampInRange","Zoom","maxZoom","onZoom","ImageEditorModal","_onDone","croppedAreaPixels","croppedImage","_onCropChange","crop","_onCropComplete","croppedArea","_onZoomChange","zoom","_onRotationChange","aspect","cropShape","minZoom","onCropChange","onCropComplete","onZoomChange","onRotationChange","openImageEditorModal","UploadImage","_onDrop","_validateFile","_processFile","_onBrowse","_input","_onBrowseChange","accept","readAsDataURL","_onEdit","_parseValueAsImageResultDTO","fallback","hideEdit","middle","_path","_extends","arguments","apply","_objectWithoutProperties","excluded","sourceKeys","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","SvgTarget","svgRef","titleId","xmlns","xmlnsXlink","enableBackground","xmlSpace","ForwardRef","LocatorButton","onSetLocation","_buttonStatus","ariaLabel","GeoPointInput","changeValueFromPlace","_setCurrentLocation","_setLocationManually","_supportGeoPointEdit","onTriangulate","onSetLocationManually","withViewName","isDocClassificationEditAllowed","triggerEditModeFromProps","isFlatAU","searchTermFromProps","triggerPrintFromProps","setTriggerEditMode","versionFromStore","formInEditMode","setVersion","versionedItemUri","setVersionedItemUri","handleDrop","handleCancelForm","handleShowVersion","isDocEditAllowed","filedrop","mapViewerName","DocumentWithoutHash","FolderRow","RecentFolderSelect","filteredCards","selectedCard","recentFolder","recentFolderNative","selectClassName","actionClassName","setFolderItemUri","siteItemUri","setSiteItemUri","prevSearchScope","prevFolderItemUri","prevSiteItemUri","handleScopeChange","handleFolderPickerChange","_refreshId","_refreshRoute","parentItemUri","doRefresh","GeoRasterInput"],"mappings":"mHACA,8DAYA,MAAMA,EAAiB,EAAGC,QAAOC,QAAQ,OACrC,MAAMC,EAAaC,qBAAWC,KAG9B,OAFIF,IAAYD,EAAMI,MAAQH,GAE1BF,GAASM,OAAON,EAAMO,QAAQC,OAAS,EAEnC,cAAC,IAAD,CAAcC,UAAWC,IAAOV,MAAOW,MAAOX,EAAOC,MAAOA,EAA5D,SACKD,IAGN,MAEXD,EAAea,YAAc,iBACdb,O,oJC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MAER,IAEGy7D,EAAM5+F,uBAAa3L,IACrB+uC,EAAQsC,SAAWo2C,aAAa14C,EAAQsC,SACxCzyB,EAAOyyB,SACHzyB,EAAOyyB,QAAQ8nC,oBACX,WACAr/D,KAET,IAEG4+C,EAAkC5hD,mBACpC,MACIu7D,WAAYk4B,EACZh4B,YAAag4B,EACbj4B,aAAcgvB,KAElB,CAACA,EAAIiJ,IAIHo5B,EAAYh4H,uBACb3L,IAEqB,KAAdA,EAAE4jI,UACF5jI,EAAE8Z,iBACFk8E,OAGR,CAACA,IAELt8E,qBAAU,KACNlc,OAAOwrB,SAAS4gB,iBAAiB,UAAW+5F,GACrC,KACHnmI,OAAOwrB,SAASmwD,oBAAoB,UAAWwqD,MAEpD,CAACA,IAGJ,MAAME,EAAiB/sH,mBACnB,IACI,cAAC,EAAD,CACIqtB,SAAUA,EACV++F,OAAQA,EACRltC,QAASA,EACTf,WAAYA,EACZ8B,cAAeA,EACfosC,gBAAiBA,EACjBC,kBAAmBA,EACnBC,aAAcA,KAGtB,CACIH,EACAltC,EACAmtC,EACAC,EACAC,EACApuC,EACA9wD,EACA4yD,IAKF1N,EAAiB19E,uBACnB,CAACtJ,EAAOzF,IACJ,cAAC,EAAD,CACIyF,MAAOA,EACPzF,UAAWA,EACX4R,WAAYA,EACZsnF,aAAcA,KAGtB,CAACA,EAActnF,IAGb+D,EAAiCuE,mBACnC,MACI47D,YACAy1C,eACAryB,eACAqtC,kBACAC,oBACAC,kBAEJ,CACI3wD,EACAy1C,EACAryB,EACAqtC,EACAC,EACAC,IAIFtiH,EAAsCjK,mBACxC,MACI4hD,UACAv0B,WACA5xB,UACA/D,aACA66E,iBACAw6C,oBAEJ,CACInrE,EACAv0B,EACA5xB,EACA82E,EACA76E,EACAq1H,IAIF7uC,EAAsCl+E,mBACxC,MACIvE,UACA0iF,aACA8B,gBACAC,mBACAksC,SACAltC,UACAt9B,UACAv0B,WACA31B,gBAEJ,CACIkqD,EACAwqE,EACAltC,EACAzjF,EAC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E,YAAc,yBACtB+tE,O,oBC7Bf5qE,EAAOC,QAAU,CAAC,QAAU,2B,oBCA5BD,EAAOC,QAAU,CAAC,MAAQ,8B,wGCA1BD,EAAOC,QAAU,CAAC,OAAS,yB,oBCA3BD,EAAOC,QAAU,CAAC,QAAU,0B,oBCA5BD,EAAOC,QAAU,CAAC,YAAc,qC,oBCAhCD,EAAOC,QAAU,CAAC,OAAS,yB,oBCA3BD,EAAOC,QAAU,CAAC,SAAW,kC,oBCA7BD,EAAOC,QAAU,CAAC,QAAU,6B,oBCA5BD,EAAOC,QAAU,CAAC,OAAS,6B,oBCA3BD,EAAOC,QAAU,CAAC,UAAY,+B,oBCA9BD,EAAOC,QAAU,CAAC,KAAO,4B,oBCAzBD,EAAOC,QAAU,CAAC,SAAW,+B,oBCA7BD,EAAOC,QAAU,CAAC,MAAQ,2B,oBCA1BD,EAAOC,QAAU,CAAC,KAAO,qB,oBCAzBD,EAAOC,QAAU,CAAC,MAAQ,qC","file":"static/js/main.b179517c.chunk.js","sourcesContent":["// @flow\r\nimport React, { useContext } from \"react\";\r\nimport { LabelSizeContext } from \"data/context\";\r\nimport ControlLabel from \"react-bootstrap/lib/ControlLabel\";\r\nimport styles from \"./AttributeLabel.module.css\";\r\n\r\ntype Props = {\r\n /** the field's label to display */\r\n label?: ?string,\r\n /** optional CSS Styles to apply */\r\n style?: CSSStyleDeclaration,\r\n};\r\n\r\nconst AttributeLabel = ({ label, style = {} }: Props) => {\r\n const labelWidth = useContext(LabelSizeContext);\r\n if (labelWidth) style.width = labelWidth;\r\n // NOTE: to hide the labels one space will be used in the ExtraAttributeDefinition\r\n if (label && String(label.trim()).length > 1)\r\n return (\r\n \r\n {label}\r\n \r\n );\r\n return null;\r\n};\r\nAttributeLabel.displayName = \"AttributeLabel\";\r\nexport default AttributeLabel;\r\n","import { CustomHttpHeader } from \"data/types\";\r\nimport { hasConsole } from \"data/bowser\";\r\nimport { correlationId, accessToken } from \"data/storeHelper\";\r\nimport { JL } from \"jsnlog\";\r\n\r\nexport { JL };\r\n\r\nexport /* istanbul ignore next */ const setupLogging = () => {\r\n // configure jsnLog\r\n // http://jsnlog.com/Documentation/JSNLogJs/AjaxAppender/SetOptions\r\n const serverAppender = JL.createAjaxAppender(\"mainappender\");\r\n serverAppender.setOptions({\r\n batchSize: 20,\r\n bufferSize: 20,\r\n storeInBufferLevel: 1000,\r\n level: window.CONFIG.browserLoggingLevel || 4000,\r\n sendWithBufferLevel: 6000,\r\n url: `${window.CONFIG.host.basename}${window.CONFIG.general.api}/jsnlog.logger`,\r\n // #54890: Add CorrelationId to JsnLogs\r\n beforeSend: (xhr) => {\r\n xhr.setRequestHeader(\r\n CustomHttpHeader.Authorization,\r\n `Bearer ${accessToken()}`\r\n );\r\n xhr.setRequestHeader(\r\n CustomHttpHeader.CorrelationId,\r\n correlationId()\r\n );\r\n },\r\n });\r\n const consoleAppender = JL.createConsoleAppender(\"consoleAppender\");\r\n if (hasConsole()) {\r\n // https://github.com/mperdeck/jsnlog.js/issues/2\r\n // logs in devtools a serialized string instead of structured logs...\r\n consoleAppender.sendLogItems = (logItems, successCallback) => {\r\n for (const logItem of logItems) {\r\n try {\r\n const item = logItem.m.startsWith(\"{\")\r\n ? JSON.parse(logItem.m)\r\n : logItem.m;\r\n\r\n if (logItem.l <= JL.getDebugLevel()) {\r\n console.debug(\r\n \"[%s] %s\",\r\n logItem.n,\r\n item.msg || \"\",\r\n item\r\n );\r\n } else if (logItem.l <= JL.getInfoLevel()) {\r\n console.info(\r\n \"[%s] %s\",\r\n logItem.n,\r\n item.msg || \"\",\r\n item\r\n );\r\n } else if (logItem.l <= JL.getWarnLevel()) {\r\n console.warn(\r\n \"[%s] %s\",\r\n logItem.n,\r\n item.msg || \"\",\r\n item\r\n );\r\n } else {\r\n console.error(\r\n \"[%s] %s\",\r\n logItem.n,\r\n item.msg || \"\",\r\n item\r\n );\r\n }\r\n } catch (e) {}\r\n }\r\n if (typeof successCallback === \"function\") successCallback();\r\n };\r\n }\r\n consoleAppender.setOptions({\r\n level: window.CONFIG.browserLoggingLevel || 4000,\r\n });\r\n JL().setOptions({\r\n appenders: [consoleAppender /*, serverAppender*/],\r\n });\r\n};\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"header\":\"ShareAction_header__2l1Yj\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"info\":\"ShareAction_info__i6wY8\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"modal\":\"ProgressModal_modal__1ZVkJ\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"fullscreen\":\"DocModal_fullscreen__2ZG9O\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"gpi\":\"GeoPlaceInput_gpi__1aADj\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"option\":\"LookupEditorControl_option__1DYL2\"};","// @flow\r\nimport React, { useState } from \"react\";\r\nimport Measure from \"react-measure\";\r\nimport { PaneSizeContext } from \"data/context\";\r\n\r\ntype Props = {\r\n /** html id attribute */\r\n id: string,\r\n /** html class attribute */\r\n className: string,\r\n /** Components Children */\r\n children: Children,\r\n};\r\n\r\nconst Pane = ({ id, className, children, dataTest }: Props) => {\r\n const [dimensions, setDimensions] = useState({\r\n width: 0,\r\n height: 0,\r\n });\r\n return (\r\n \r\n setDimensions({\r\n width: measure.width,\r\n height: measure.height,\r\n })\r\n }\r\n >\r\n {({ measureRef }) => (\r\n
\r\n \r\n {children}\r\n \r\n
\r\n )}\r\n \r\n );\r\n};\r\n\r\nexport default Pane;\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"modal\":\"ImageEditorModal_modal__1IqC7\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"content\":\"Edit_content__2642Y\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"header\":\"Search_header__3aAYS\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"header\":\"Form_header__2xKzd\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrapper\":\"SearchResult_wrapper__30dY1\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"modal\":\"UploadVersionModal_modal__2h70W\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"itemflows\":\"ItemFlowsModal_itemflows__1RW_r\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrapper\":\"LayersEditor_wrapper__3Fsse\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"modal\":\"RasterMapModal_modal__m_kKJ\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"reminder\":\"ReminderManagerModal_reminder__3jeJJ\",\"modal\":\"ReminderManagerModal_modal__3LBpC\",\"button\":\"ReminderManagerModal_button__X91LK\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"enum\":\"EnumViewerControl_enum__1YC5A\"};","// @flow\r\nimport React, { type Node } from \"react\";\r\nimport queryString from \"data/queryString\";\r\nimport { Location } from \"history\";\r\n\r\nconst QueryMatchRoute = ({\r\n location,\r\n query,\r\n render,\r\n}: {\r\n location: Location,\r\n query: Object,\r\n render: (params: Object) => React.Element,\r\n}) => {\r\n // parse current URL\r\n const qs = queryString.parse(location.search);\r\n // when no required query parameters it will match only when no other URL parameters\r\n let isMatch = query == null && Object.keys(qs).length === 0;\r\n if (!isMatch) {\r\n isMatch =\r\n // no query but other URL parameters?\r\n query == null\r\n ? false // -> no match\r\n : Object.keys(query).every((key) => {\r\n // check each required URL parameter\r\n // required parameter can be anything -> make sure it's just there\r\n if (query[key] === null) return qs[key] != null;\r\n // required parameters needs to match a value -> make sure it's the same\r\n return qs[key] != null && qs[key] === query[key];\r\n });\r\n }\r\n // if matched then render component, otherwise null\r\n return isMatch ? render(qs) : null;\r\n};\r\nQueryMatchRoute.displayName = \"QueryMatchRoute\";\r\n\r\nconst QueryMatch = ({\r\n location,\r\n children,\r\n}: {\r\n location: Location,\r\n children: Node,\r\n}) =>\r\n React.Children.map(children, (child, index) => {\r\n // console.log(child);\r\n if (child.type === QueryMatchRoute) {\r\n return React.cloneElement(child, { location });\r\n } else {\r\n console.error(\r\n `Unsupported child of type ${child.type} for QueryMatch!`\r\n );\r\n }\r\n });\r\nQueryMatch.displayName = \"QueryMatch\";\r\n\r\nQueryMatch.Route = QueryMatchRoute;\r\nexport default QueryMatch;\r\n","// @flow\r\nimport React from \"react\";\r\nimport { usePendingUploads } from \"hooks\";\r\nimport {\r\n type CardItemResultDTO,\r\n CardType,\r\n CardItemType,\r\n SearchItemType,\r\n type SidebarItemDTO,\r\n} from \"data/types\";\r\nimport { type uppyFile } from \"data/uppy\";\r\nimport CardList from \"components/CardList\";\r\nimport { History } from \"history\";\r\nimport { withRouter } from \"react-router\";\r\nimport { isFileTypeMatch, isFileTagMatch } from \"./uppyFileMatchUtils\";\r\nimport queryString from \"data/queryString\";\r\nimport Constants from \"data/constants\";\r\nimport { globalSitesAreaSelector } from \"data/storeHelper\";\r\nimport \"./index.css\";\r\nimport { openPickerModal, PickerType } from \"components/PickerModal\";\r\nimport loc from \"i18next\";\r\n\r\nfunction createLink(archiveTarget: CardItemResultDTO): string {\r\n switch (archiveTarget.uri) {\r\n case \"at-fav\":\r\n case \"at-rec\":\r\n case \"at-search\":\r\n case \"at-picker\":\r\n return archiveTarget.uri;\r\n // return `at-sf/${archiveTarget.searchItem.id}`;\r\n\r\n default:\r\n // pre-defined searchform?\r\n if (\r\n archiveTarget.searchItem &&\r\n archiveTarget.searchItem.id !== -1\r\n ) {\r\n if (archiveTarget.searchItem.searchType === SearchItemType.Form)\r\n return \"sf-custom\";\r\n else return \"sf\";\r\n }\r\n return \"uri\"; //just open the card\r\n }\r\n}\r\n\r\n/**\r\n * will check if an archiveTargets should be visible, e.g. defined extras.fileTypes or extra.fileTags when it's supposed to be visible\r\n * by matching it with the first pending file upload, or hide with disabled Globalsites Area\r\n * @param {Array} archiveTargets\r\n * @param {?Array} pendingUploads\r\n * @param {?Array} globalSites\r\n */\r\nconst filterArchiveTargets = (\r\n archiveTargets: Array,\r\n pendingUploads: ?Array,\r\n globalSites: ?Array\r\n) =>\r\n archiveTargets.filter((at) => {\r\n // check if GlobalSites Area is disabled\r\n if (at.uri === \"at-picker\" && globalSites == null) {\r\n console.info(\r\n `ArchiveTarget '${at.name}' skipped due to disabled GlobalSites Area (inPoint.Standalone > Admin > GeneralSettings > show/hide Globalsites)`\r\n );\r\n return false;\r\n }\r\n /* istanbul ignore if */\r\n if (pendingUploads == null || pendingUploads.length === 0) return true;\r\n /* istanbul ignore if */\r\n if (at.extras == null || at.extras.length === 0) return true;\r\n\r\n // check for any fileType match\r\n /* istanbul ignore else */\r\n if (at.extras.fileTypes && at.extras.fileTypes.length > 0) {\r\n let result = isFileTypeMatch(\r\n pendingUploads[0],\r\n at.extras.fileTypes\r\n );\r\n /* istanbul ignore else */\r\n if (!result) {\r\n console.info(\r\n `ArchiveTarget '${at.name}' skipped due to .fileTypes requirement`,\r\n at.extras.fileTypes\r\n );\r\n return false;\r\n }\r\n }\r\n\r\n // check all required file tags\r\n /* istanbul ignore else */\r\n if (at.extras.fileTags && at.extras.fileTags.length > 0) {\r\n let result = isFileTagMatch(pendingUploads[0], at.extras.fileTags);\r\n /* istanbul ignore else */\r\n if (!result) {\r\n console.info(\r\n `ArchiveTarget '${at.name}' skipped due to .fileTags requirement`,\r\n at.extras.fileTags\r\n );\r\n return false;\r\n }\r\n }\r\n return true;\r\n });\r\n\r\ntype Props = {\r\n /** list of archiveTargets to display */\r\n archiveTargets: Array,\r\n /** React-Router withRouter History object */\r\n history: History,\r\n};\r\n\r\n/**\r\n * render the main archiveTargets as defined in appsettings.json\r\n */\r\nexport const ArchiveTargetList = ({ archiveTargets = [], history }: Props) => {\r\n const pendingUploads = usePendingUploads();\r\n const globalSites = globalSitesAreaSelector();\r\n\r\n const onCardClick = (archiveTarget: CardItemResultDTO, uri?: string) => {\r\n const qs = uri\r\n ? queryString.stringify({\r\n mode: \"uri-custom\",\r\n uri,\r\n })\r\n : queryString.stringify({\r\n id: archiveTarget.id,\r\n mode: createLink(archiveTarget),\r\n });\r\n history.push({\r\n search: \"?\" + qs,\r\n });\r\n };\r\n\r\n const showOnMoreClick = (card) =>\r\n card.type === CardType.Action && card.itemtype === CardItemType.Folder;\r\n\r\n const onMoreClick = async (card) => {\r\n const uri = await openPickerModal({\r\n pickerType: PickerType.Folder,\r\n scopeBreadcrumb: true,\r\n itemUri: card.uri,\r\n helpText: loc.t(\"upload:at-picker.description\"),\r\n });\r\n if (uri === false) return false;\r\n onCardClick(card, uri);\r\n };\r\n\r\n return (\r\n onCardClick(card)}\r\n />\r\n );\r\n};\r\n\r\nArchiveTargetList.displayName = \"ArchiveTargetList\";\r\nexport default withRouter(ArchiveTargetList);\r\n","// @flow\r\nimport { getFileExtension } from \"data/utils\";\r\nimport { type uppyFile } from \"data/uppy\";\r\nimport match from \"mime-match\";\r\n\r\nexport /**\r\n * will match an uppyFile to a list of allowed fileTypes (extension or media types)\r\n *\r\n * @param {uppyFile} file\r\n * @param {?Array} fileTypes\r\n * @returns {boolean} true if no fileTypes configured or a match, otherwise false if not matched\r\n */\r\nconst isFileTypeMatch = (\r\n file: uppyFile,\r\n fileTypes: ?Array\r\n): boolean => {\r\n if (fileTypes == null) return true;\r\n const ext = getFileExtension(file.name).toLowerCase();\r\n const isFileType = fileTypes.some((type) => {\r\n // is this is a mime-type\r\n if (type.indexOf(\"/\") > -1) {\r\n /* istanbul ignore next */\r\n if (!file.type) return false;\r\n return match(file.type.replace(/;.*?$/, \"\"), type);\r\n }\r\n\r\n // otherwise this is likely an extension\r\n /* istanbul ignore else */\r\n if (type[0] === \".\") {\r\n return ext === type.toLowerCase();\r\n }\r\n return false;\r\n });\r\n return isFileType;\r\n};\r\n\r\nexport /**\r\n * will validate that all fileTags are specified in uppyFile\r\n *\r\n * @param {uppyFile} file\r\n * @param {?Array} fileTags\r\n * @returns {boolean} true if no fileTags configured or all exist, otherwise false if any missing\r\n */\r\nconst isFileTagMatch = (file: uppyFile, fileTags: ?Array): boolean => {\r\n if (fileTags == null) return true;\r\n return fileTags.every((tag) =>\r\n Object.prototype.hasOwnProperty.call(file, tag)\r\n );\r\n};\r\n","// @flow\r\nimport React from \"react\";\r\nimport {\r\n type CardItemResultDTO,\r\n type CardItemDTO,\r\n type CardTypeEnum,\r\n CardItemType,\r\n} from \"data/types\";\r\nimport FormBarFactory from \"components/FormBar/Factory\";\r\nimport { FormBarView } from \"data/types\";\r\nimport CardList from \"components/CardList\";\r\nimport { type ConstantsEnum } from \"data/constants\";\r\n\r\ntype Props = {\r\n /** callback when user cancels */\r\n onCancel: () => void,\r\n /** callback when user clicks a card */\r\n onClick: (card: CardItemDTO) => void,\r\n /** current ArchiveTarget */\r\n archiveTarget: CardItemResultDTO,\r\n /** current cards loading status */\r\n status: ConstantsEnum,\r\n /** list of cards */\r\n cards: Array,\r\n /** filter by CardType */\r\n cardType: CardTypeEnum,\r\n};\r\n\r\ntype State = {\r\n filterText: string,\r\n};\r\n\r\nconst views = [FormBarView.ArchiveTarget];\r\n\r\nclass ArchiveTargetCards extends React.PureComponent {\r\n state = { filterText: \"\" };\r\n\r\n _onFilterTextChange = (filterText: ?string) =>\r\n this.setState({\r\n filterText: filterText || \"\",\r\n });\r\n\r\n _getFilteredCards = () =>\r\n this.props.cards.filter(\r\n (c) =>\r\n this.state.filterText.length === 0 ||\r\n c.name.toLowerCase().indexOf(this.state.filterText) >= 0\r\n );\r\n\r\n render() {\r\n const { onCancel, onClick, archiveTarget, status, cardType } =\r\n this.props;\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default ArchiveTargetCards;\r\n","// @flow\r\nimport React from \"react\";\r\nimport {\r\n type CardItemResultDTO,\r\n type CardItemDTO,\r\n type CardTypeEnum,\r\n} from \"data/types\";\r\nimport { connect, Dispatch } from \"react-redux\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport ArchiveTargetCards from \"./ArchiveTargetCards\";\r\nimport { getCardsAction } from \"data/actions\";\r\nimport * as s from \"data/reducers/selectors\";\r\n\r\ntype Props = {\r\n /** which card type to show - CardType.Rec or CardType.Fav */\r\n cardType: CardTypeEnum,\r\n /** current ArchiveTarget */\r\n archiveTarget: CardItemResultDTO,\r\n /** callback when user selects a Recent card */\r\n onClick: (card: CardItemDTO) => void,\r\n /** callback when user clicks Cancel */\r\n onCancel: () => void,\r\n /** Redux home cards loading status */\r\n status: ConstantsEnum,\r\n /** Redux home cards */\r\n cards: Array,\r\n /** Redux dispatch */\r\n dispatch: Dispatch,\r\n};\r\n\r\nexport const ArchiveTargetHomeCards = ({\r\n cardType,\r\n archiveTarget,\r\n onClick,\r\n onCancel,\r\n status,\r\n cards,\r\n dispatch,\r\n}: Props) => {\r\n if (status === Constants.NONE) {\r\n dispatch(getCardsAction());\r\n }\r\n return (\r\n \r\n );\r\n};\r\nArchiveTargetHomeCards.displayName = \"ArchiveTargetHomeCards\";\r\n\r\nconst mapStateToProps = /* istanbul ignore next */ (state, ownProps) => ({\r\n status: s.cardsStatusSelector(state),\r\n cards: s.cardsCardsSelector(state) || [],\r\n ...ownProps,\r\n});\r\nexport default connect(mapStateToProps)(ArchiveTargetHomeCards);\r\n","// @flow\r\nimport React from \"react\";\r\nimport {\r\n type CardItemResultDTO,\r\n type CardItemDTO,\r\n CardType,\r\n CardItemType,\r\n SearchItemType,\r\n type SearchFormInfoDTO,\r\n} from \"data/types\";\r\nimport { connect, Dispatch } from \"react-redux\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport ArchiveTargetCards from \"./ArchiveTargetCards\";\r\nimport { getSearchFormListAction } from \"data/actions\";\r\nimport * as s from \"data/reducers/selectors\";\r\n\r\ntype Props = {\r\n /** current ArchiveTarget */\r\n archiveTarget: CardItemResultDTO,\r\n /** callback when user selects a Recent card */\r\n onClick: (card: CardItemDTO) => void,\r\n /** callback when user clicks Cancel */\r\n onCancel: () => void,\r\n /** Redux searchForms loading status */\r\n status: ConstantsEnum,\r\n /** Redux searchForms */\r\n cards: Array,\r\n /** Redux Dispatch */\r\n dispatch: Dispatch,\r\n};\r\n\r\nexport const ArchiveTargetSearchFormCards = ({\r\n archiveTarget,\r\n onClick,\r\n onCancel,\r\n status,\r\n cards,\r\n dispatch,\r\n}: Props) => {\r\n if (status === Constants.NONE) {\r\n dispatch(getSearchFormListAction());\r\n }\r\n\r\n return (\r\n ({\r\n id: `sf-${sf.id}`,\r\n searchItem: {\r\n name: sf.name,\r\n id: sf.id,\r\n searchType: SearchItemType.Form,\r\n },\r\n type: CardType.Fav,\r\n itemtype: CardItemType.Search,\r\n name: sf.name,\r\n image: null,\r\n uri: null,\r\n count: -1,\r\n }))}\r\n onClick={onClick}\r\n onCancel={onCancel}\r\n />\r\n );\r\n};\r\nArchiveTargetSearchFormCards.displayName = \"ArchiveTargetSearchFormCards\";\r\n\r\nconst mapStateToProps = /* istanbul ignore next */ (state, ownProps) => ({\r\n status: s.searchFormListStatusSelector(state),\r\n cards: s.searchFormListResultSelector(state) || [],\r\n ...ownProps,\r\n});\r\nexport default connect(mapStateToProps)(ArchiveTargetSearchFormCards);\r\n","// @flow\r\nimport React, { PureComponent } from \"react\";\r\nimport SearchForm from \"containers/SearchForm\";\r\nimport { type SearchItemDTO, type SearchResultRowDTO } from \"data/types\";\r\nimport loc from \"i18next\";\r\nimport { SearchResultContainerWithoutMultiSelection } from \"containers/SearchResult\";\r\nimport Split from \"split.js\";\r\nimport styles from \"./ArchiveTargetSearchForm.module.css\";\r\nimport { getClassNames } from \"data/utils\";\r\n\r\ntype Props = {\r\n /** searchForm id to render */\r\n id: number,\r\n /** callback when target found\r\n * @param {string} targetItemUri target's itemUri to archive onto\r\n */\r\n onTargetItemUri: (targetItemUri: string) => void,\r\n /** callback when user clicks the Cancel button */\r\n onCancel: () => void,\r\n};\r\n\r\ntype State = {\r\n searchItem: ?SearchItemDTO,\r\n};\r\n\r\nexport class ArchiveTargetSearchForm extends PureComponent {\r\n splitView: Split;\r\n state = {\r\n searchItem: null,\r\n };\r\n\r\n componentDidMount() {\r\n this.splitView = Split(\r\n [`.${styles.searchPanel}`, `.${styles.searchResult}`],\r\n {\r\n sizes: [100, 0],\r\n direction: \"vertical\",\r\n minSize: 0,\r\n gutterSize: 10,\r\n elementStyle: /* istanbul ignore next */ (\r\n dimension,\r\n size,\r\n gutterSize\r\n ) => {\r\n return {\r\n \"flex-basis\":\r\n \"calc(\" + size + \"% - \" + gutterSize + \"px)\",\r\n };\r\n },\r\n gutterStyle: /* istanbul ignore next */ (\r\n dimension,\r\n gutterSize\r\n ) => {\r\n return { \"flex-basis\": gutterSize + \"px\" };\r\n },\r\n }\r\n );\r\n }\r\n\r\n componentDidUpdate(prevProps: Props, prevState: State) {\r\n if (this.props.id !== prevProps.id) {\r\n this.setState({ searchItem: null });\r\n }\r\n if (this.state.searchItem !== prevState.searchItem) {\r\n if (this.state.searchItem == null) {\r\n this.splitView.setSizes([0, 100]);\r\n } else {\r\n this.splitView.setSizes([30, 70]);\r\n }\r\n }\r\n }\r\n\r\n _onSearch = (searchItem: SearchItemDTO) => this.setState({ searchItem });\r\n\r\n _onSearchFormSetTarget = (\r\n activeRowIndex: number,\r\n row?: SearchResultRowDTO\r\n ) => {\r\n if (activeRowIndex !== -1 && row != null) {\r\n this.setState({ searchItem: null });\r\n /* istanbul ignore else */\r\n if (typeof this.props.onTargetItemUri === \"function\")\r\n this.props.onTargetItemUri(\r\n // take itemUri without EID\r\n row.breadcrumb.parts[row.breadcrumb.parts.length - 1]\r\n .itemUri\r\n );\r\n }\r\n return false;\r\n };\r\n\r\n render = () => (\r\n \r\n
\r\n \r\n
\r\n
\r\n {this.state.searchItem && (\r\n \r\n )}\r\n
\r\n \r\n );\r\n}\r\nexport default ArchiveTargetSearchForm;\r\n","// @flow\r\nimport React, { useCallback } from \"react\";\r\nimport { useSelector } from \"react-redux\";\r\nimport { useAsync } from \"hooks\";\r\nimport {\r\n type SearchItemDTO,\r\n type SearchResultRowDTO,\r\n SearchItemType,\r\n} from \"data/types\";\r\nimport SearchResultContainer from \"containers/SearchResult\";\r\nimport styles from \"./ArchiveTargetSearchItem.module.css\";\r\nimport FormBarFactory from \"components/FormBar/Factory\";\r\nimport { FormBarView } from \"data/types\";\r\nimport {\r\n createSearchItemAsync,\r\n fixSearchFilterName,\r\n} from \"components/CommandActions/searchResult_form\";\r\nimport Status from \"components/Status\";\r\nimport Constants from \"data/constants\";\r\nimport { type uppyFile, uppyPendingFilesMetaSelector } from \"data/uppy\";\r\nimport { tokenize } from \"data/utils\";\r\n\r\nconst updateFilesPlaceholders = (\r\n searchItem: SearchItemDTO,\r\n pendingUploads: Array\r\n) => {\r\n if (pendingUploads == null || pendingUploads.length === 0) return;\r\n if (searchItem.filters && searchItem.filters.length > 0) {\r\n searchItem.filters\r\n // process only filters actually including tokens/placeholders wrapped in {}\r\n .filter(\r\n (filter) =>\r\n filter.value &&\r\n String(filter.value).length > 0 &&\r\n filter.value.indexOf(\"{\") !== -1\r\n )\r\n .forEach((filter) => {\r\n // replace any tokens\r\n const newValue = tokenize(filter.value, pendingUploads[0]);\r\n // only if anything replaced set value\r\n if (newValue !== filter.value) {\r\n filter.value = newValue;\r\n filter.name = fixSearchFilterName(filter.name); //only overwrite value (see SearchQueryConversion.cs)\r\n }\r\n });\r\n }\r\n};\r\n\r\ntype Props = {\r\n /** searchItem to render */\r\n searchItem: SearchItemDTO,\r\n /** callback when target found\r\n * @param {string} targetItemUri target's itemUri to archive onto\r\n */\r\n onTargetItemUri: (targetItemUri: string) => void,\r\n /** callback when user clicks the Cancel button */\r\n onCancel: () => void,\r\n};\r\n\r\nconst views = [FormBarView.Search];\r\n\r\nconst ArchiveTargetSearchItem = ({\r\n searchItem,\r\n onTargetItemUri,\r\n onCancel,\r\n}: Props) => {\r\n const pendingUploads = useSelector(uppyPendingFilesMetaSelector);\r\n const newSearchItem = useAsync(async () => {\r\n if (searchItem.searchType === SearchItemType.Form) {\r\n // process {geolocation}/{barcode} tokens requiring async operations\r\n const newSearchItem = await createSearchItemAsync(searchItem);\r\n updateFilesPlaceholders(newSearchItem, pendingUploads);\r\n return newSearchItem;\r\n } else {\r\n // only searchItem.id provided\r\n return searchItem;\r\n }\r\n }, [searchItem]);\r\n\r\n const onSearchFormSetTarget = useCallback(\r\n (activeRowIndex: number, row?: SearchResultRowDTO) => {\r\n /* istanbul ignore else */\r\n if (\r\n activeRowIndex !== -1 &&\r\n row != null &&\r\n typeof onTargetItemUri === \"function\"\r\n ) {\r\n onTargetItemUri(\r\n // take itemUri without EID\r\n row.breadcrumb.parts[row.breadcrumb.parts.length - 1]\r\n .itemUri\r\n );\r\n }\r\n return false;\r\n },\r\n [onTargetItemUri]\r\n );\r\n\r\n return (\r\n
\r\n \r\n {newSearchItem.loading && }\r\n {newSearchItem.error && }\r\n {!newSearchItem.loading &&\r\n !newSearchItem.error &&\r\n newSearchItem.value && (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport default ArchiveTargetSearchItem;\r\n","// @flow\r\nimport React, { PureComponent } from \"react\";\r\nimport { connect } from \"react-redux\";\r\nimport { History, Location } from \"history\";\r\nimport { withRouter } from \"react-router\";\r\nimport { Dispatch } from \"react-redux\";\r\nimport QueryMatch from \"containers/QueryMatch\";\r\nimport produces from \"immer\";\r\n\r\nimport ArchiveTargetList from \"components/ArchiveTargets/ArchiveTargetList\";\r\nimport ArchiveTargetHomeCards from \"components/ArchiveTargets/ArchiveTargetList/ArchiveTargetHomeCards\";\r\nimport ArchiveTargetSearchFormCards from \"components/ArchiveTargets/ArchiveTargetList/ArchiveTargetSearchFormCards\";\r\nimport ArchiveTargetSearchForm from \"components/ArchiveTargets/ArchiveTargetSearchForm\";\r\nimport ArchiveTargetSearchItem from \"components/ArchiveTargets/ArchiveTargetSearchItem\";\r\nimport { openPickerModal, PickerType } from \"components/PickerModal\";\r\nimport { type ApiError, CardType, CardItemType } from \"data/types\";\r\nimport { getArchiveTargets /*, submitArchiveForm*/ } from \"data/api\";\r\nimport { getLocalizedText } from \"data/utils\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport Status from \"components/Status\";\r\nimport NoData from \"components/NoData\";\r\nimport { globalSitesAreaSelector } from \"data/storeHelper\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport loc from \"i18next\";\r\n\r\ntype Props = {\r\n /** whether to show list of archive targets */\r\n show: boolean,\r\n /** callback when target found\r\n * @param {string} targetItemUri target's itemUri to archive onto\r\n */\r\n onTargetItemUri: (targetItemUri: string) => void,\r\n /** Redux dispatch */\r\n dispatch: Dispatch,\r\n /** React-Router history object */\r\n history: History,\r\n /** redux isOnline */\r\n isOnline: boolean,\r\n location: Location,\r\n};\r\n\r\ntype State = {\r\n status: ConstantsEnum,\r\n targetItemUri: ?string,\r\n archiveTargets: ?Array,\r\n};\r\n\r\nexport class ArchiveTargetListContainer extends PureComponent {\r\n state = {\r\n targetItemUri: null,\r\n status: Constants.LOADING,\r\n archiveTargets: null,\r\n };\r\n\r\n componentDidMount = () => this._fetch();\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n if (this.props.isOnline !== prevProps.isOnline) {\r\n this._fetch();\r\n }\r\n }\r\n\r\n _fetch = () => {\r\n this.setState({ status: Constants.LOADING });\r\n getArchiveTargets(!this.props.isOnline)\r\n .catch((err: ApiError) => {\r\n this.setState({ status: Constants.ERROR });\r\n return null;\r\n })\r\n .then((result) => {\r\n if (result != null) {\r\n // TODO only one archiveForm -> preselect it - as long as we do not have suggestions, search, browse...\r\n this.setState({\r\n status: Constants.OK,\r\n archiveTargets: result.map((card) =>\r\n produces(card, (draft) => {\r\n draft[\"name\"] = getLocalizedText(draft[\"name\"]);\r\n draft[\"desc\"] = getLocalizedText(draft[\"desc\"]);\r\n })\r\n ),\r\n });\r\n }\r\n });\r\n };\r\n\r\n _setTargetItemUri = (targetItemUri: string) => {\r\n /* istanbul ignore else */\r\n if (targetItemUri != null) {\r\n /* istanbul ignore else */\r\n if (typeof this.props.onTargetItemUri === \"function\") {\r\n this.props.onTargetItemUri(targetItemUri);\r\n }\r\n }\r\n };\r\n\r\n _onCardClick = (cardItem: CardItemDTO) => {\r\n if (cardItem.itemtype === CardItemType.Search) {\r\n this.props.history.push(\"/upload?mode=si\", {\r\n searchItem: cardItem.searchItem,\r\n });\r\n } else {\r\n // direct folder itemUri, use it!\r\n this._setTargetItemUri(cardItem.uri);\r\n }\r\n };\r\n\r\n _onSearchFormClick = (cardItem: CardItemDTO) =>\r\n this.props.history.push(\r\n `/upload?mode=sfid&sfid=${cardItem.searchItem.id}`\r\n );\r\n\r\n _onCancel = () => this.props.history.push(\"/upload\");\r\n\r\n render() {\r\n // #1.....list ready?\r\n if (this.props.show === false) {\r\n return null;\r\n }\r\n\r\n // fetch pending...\r\n if (this.state.archiveTargets == null) {\r\n return ;\r\n }\r\n\r\n // no configured archiveTargets\r\n if (this.state.archiveTargets.length === 0) {\r\n return ;\r\n }\r\n\r\n return (\r\n \r\n {/* show list of archiveTargets */}\r\n (\r\n \r\n )}\r\n />\r\n {/* Recents */}\r\n (\r\n \r\n )}\r\n />\r\n {/* Favorites */}\r\n (\r\n \r\n )}\r\n />\r\n {/* List searchForms */}\r\n (\r\n \r\n )}\r\n />\r\n {/* when a searchForm is directly configured as a ArchiveTarget with searchType=FreeText */}\r\n (\r\n \r\n )}\r\n />\r\n {/* when clicking a searchForm from within the searchForms list */}\r\n (\r\n \r\n )}\r\n />\r\n {/* when a searchForm is directly configured as a ArchiveTarget with searchType=Form and filters */}\r\n (\r\n \r\n )}\r\n />\r\n {/* when clicking a Recent searchResult (=searchItem) */}\r\n {\r\n if (this.props.location.state == null) {\r\n // missing state - make sure to return to \"base\" if user refreshed browser\r\n this._onCancel();\r\n return ;\r\n } else {\r\n return (\r\n \r\n );\r\n }\r\n }}\r\n />\r\n {/* when a folder's itemUri is directly configured as a ArchiveTarget */}\r\n {\r\n const archiveTarget =\r\n this.state.archiveTargets[params.id];\r\n /* istanbul ignore else */\r\n if (String(archiveTarget.uri).startsWith(\"pam-item\")) {\r\n // make sure to return to \"base\" if user cancelled form submission\r\n this._onCancel();\r\n // let parent know they can now move forward\r\n this._setTargetItemUri(archiveTarget.uri);\r\n }\r\n\r\n return ;\r\n }}\r\n />\r\n {/* when a custom itemUri is passed by the picker */}\r\n {\r\n // istanbul ignore else\r\n if (String(params.uri).startsWith(\"pam-item\")) {\r\n // make sure to return to \"base\" if user cancelled form submission\r\n this._onCancel();\r\n // let parent know they can now move forward\r\n this._setTargetItemUri(params.uri);\r\n }\r\n\r\n return ;\r\n }}\r\n />\r\n\r\n {/* show Picker to choose target */}\r\n {\r\n // find GlobalSites root itemUri\r\n const globalSites = globalSitesAreaSelector();\r\n /* istanbul ignore next */\r\n if (globalSites == null) {\r\n console.warn(\r\n \"Could not figure out root GlobalSites for picker!\"\r\n );\r\n // make sure to return to \"base\" on error\r\n this._onCancel();\r\n return ;\r\n }\r\n // let user pick folder or doc\r\n openPickerModal({\r\n itemUri: globalSites.itemUri,\r\n pickerType: PickerType.Folder,\r\n helpText: loc.t(\"upload:at-picker.description\"),\r\n }).then((itemUri) => {\r\n // user clicked Cancel? Abort\r\n // make sure to return to \"base\" if user cancelled form submission\r\n this._onCancel();\r\n /* istanbul ignore else */\r\n if (itemUri !== false)\r\n // let parent know they can now move forward\r\n this._setTargetItemUri(itemUri);\r\n });\r\n return ;\r\n }}\r\n />\r\n \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = /* istanbul ignore next */ (state, ownProps) => ({\r\n isOnline: s.isOnlineSelector(state),\r\n ...ownProps,\r\n});\r\n\r\nexport default withRouter(connect(mapStateToProps)(ArchiveTargetListContainer));\r\n","// @flow\r\n//#region imports\r\nimport React, { PureComponent, type Node } from \"react\";\r\nimport { History } from \"history\";\r\nimport TogglesHandler from \"containers/TogglesHandler\";\r\nimport \"./index.css\";\r\nimport { connect, Dispatch } from \"react-redux\";\r\nimport { compose } from \"redux\";\r\nimport MainLayout from \"components/MainLayout\";\r\nimport ArchiveTargetListContainer from \"containers/ArchiveTargetList\";\r\nimport FormContainer from \"containers/Form\";\r\nimport UploadSelection from \"components/UploadSelection\";\r\nimport {\r\n setCurrentItemAction,\r\n backupCurrentItemAction,\r\n restoreCurrentItemAction,\r\n} from \"data/actions\";\r\nimport {\r\n type ToggleDTO,\r\n type ToggleItemDTO,\r\n NewFormType,\r\n UploadMode,\r\n} from \"data/types\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport { getDefaultsConfig } from \"data/constants\";\r\nimport SplitPanes from \"containers/SplitPanes\";\r\nimport loc from \"i18next\";\r\n// import FloatingBar from \"components/FloatingBar\";\r\nimport uppy, { uppyHasPendingUploadsSelector, type uppyFile } from \"data/uppy\";\r\nimport isEmpty from \"lodash/isEmpty\";\r\nimport isEqual from \"lodash/isEqual\";\r\nimport { replaceFileExtension } from \"data/utils\";\r\nimport produce from \"immer\";\r\nimport { setUppyRestrictions } from \"components/uppy-restrictions\";\r\nimport Pane from \"components/SplitPanes/Pane\";\r\n//#endregion\r\n\r\nexport const viewName = \"upload\";\r\n\r\n//#region flow types\r\ntype Props = {\r\n /** react-router History */\r\n history: History,\r\n /** whether shown as Modal or full View page */\r\n asModal?: boolean,\r\n /** React Node to show before toolbar */\r\n topRowBefore?: Node,\r\n /** React Node to show after toolbar */\r\n topRowEnd?: Node,\r\n /** callback when closing Modal dialog */\r\n onClose?: () => void,\r\n // from TogglesHandler\r\n /** TogglesHandler callback to set toggles */\r\n setToggles: Function,\r\n /** TogglesHandler this view's toggles definitions */\r\n toggles: ?ToggleDTO,\r\n // from redux\r\n /** current itemUri (or if {@link asModal} = true) */\r\n itemUri: string,\r\n /** current formatId */\r\n formatId: number,\r\n /** whether archive form should be displayed */\r\n noItemUri: boolean,\r\n /** current viewName */\r\n viewName: string,\r\n /** Redux dispatch */\r\n dispatch: Dispatch,\r\n /** which toggles are currently selected */\r\n selectedToggles: Array,\r\n /** whether there are any pending uploads */\r\n uppyHasPendingUploads: boolean,\r\n /** SplitPanes callback to set split sizes */\r\n setSplitSizes: Function,\r\n /** Redux formDefaults */\r\n defaults: ?Object,\r\n};\r\n\r\ntype State = {\r\n itemUri: ?string,\r\n isFormButtonEnabled: boolean,\r\n};\r\n//#endregion\r\n\r\nexport class Upload extends PureComponent {\r\n constructor(props: Props) {\r\n super(props);\r\n this.state = {\r\n itemUri: props.itemUri,\r\n isFormButtonEnabled: true,\r\n };\r\n this._updateUppyOptions(props.itemUri, props.formatId);\r\n }\r\n\r\n componentDidMount() {\r\n const { dispatch, itemUri, viewName } = this.props;\r\n dispatch(backupCurrentItemAction());\r\n dispatch(setCurrentItemAction({ name: viewName, itemUri }));\r\n this._updateFormToggle(this.props.uppyHasPendingUploads);\r\n this._maybeResetArchiveTarget(this.props.uppyHasPendingUploads);\r\n }\r\n\r\n componentWillUnmount() {\r\n const { dispatch } = this.props;\r\n this._updateFormToggle(false);\r\n dispatch(restoreCurrentItemAction());\r\n }\r\n\r\n componentDidUpdate(prevProps: Props, prevState: State) {\r\n const { dispatch, viewName, itemUri, uppyHasPendingUploads, formatId } =\r\n this.props;\r\n /* istanbul ignore else */\r\n if (prevProps.itemUri !== itemUri) {\r\n this.setState({ itemUri });\r\n // this.setState({ isFlatAU: undefined, formInEditMode: false });\r\n dispatch(\r\n setCurrentItemAction({\r\n name: viewName,\r\n itemUri,\r\n })\r\n );\r\n this._updateUppyOptions(itemUri, formatId);\r\n }\r\n /* istanbul ignore else */\r\n if (prevState.itemUri !== this.state.itemUri) {\r\n this._updateUppyOptions(this.state.itemUri, formatId);\r\n }\r\n /* istanbul ignore else */\r\n if (prevProps.uppyHasPendingUploads !== uppyHasPendingUploads) {\r\n // reset currently shown breadcrumb\r\n if (uppyHasPendingUploads === false) {\r\n this.setState({ itemUri });\r\n this._updateUppyOptions(itemUri, formatId);\r\n }\r\n this._maybeResetArchiveTarget(uppyHasPendingUploads);\r\n this._updateFormToggle(uppyHasPendingUploads);\r\n }\r\n }\r\n\r\n _updateUppyOptions = (itemUri: string, formatId: ?number) => {\r\n const defaults = getDefaultsConfig(\r\n itemUri || \"pam-item://\",\r\n formatId || -1\r\n );\r\n /* istanbul ignore else */\r\n if (defaults) setUppyRestrictions(uppy, defaults.upload);\r\n };\r\n\r\n _updateFormToggle = (uppyHasPendingUploads: boolean) => {\r\n /* istanbul ignore if */\r\n if (this.props.toggles == null) return;\r\n // form toggles visibility\r\n const toggles = produce(this.props.toggles, (draft) => {\r\n draft.toggles = draft.toggles.map((toggle: ToggleItemDTO) => {\r\n toggle.isDisabled =\r\n toggle.value === \"form\" && !uppyHasPendingUploads;\r\n toggle.isSelected =\r\n toggle.value === \"files\" ||\r\n (toggle.value === \"form\" && uppyHasPendingUploads);\r\n return toggle;\r\n });\r\n });\r\n /* istanbul ignore else */\r\n if (!isEqual(toggles.toggles, this.props.toggles.toggles)) {\r\n this.props.setToggles(toggles);\r\n }\r\n };\r\n\r\n _maybeResetArchiveTarget = (uppyHasPendingUploads: boolean) => {\r\n /* istanbul ignore else */\r\n // Reset upload if archive target can be set, and history is available\r\n if (\r\n this.props.noItemUri &&\r\n this.props.history &&\r\n !uppyHasPendingUploads\r\n ) {\r\n this.props.history.push(\"/upload\");\r\n }\r\n };\r\n\r\n // _onActionShouldBeVisible = (action: { id: string }): boolean => {\r\n // return true;\r\n // };\r\n\r\n // _onAction = (actionId: string): void => {\r\n // const { itemUri } = this.props;\r\n\r\n // switch (actionId) {\r\n // /* istanbul ignore next */\r\n // default:\r\n // console.warn(actionId + \": \" + itemUri);\r\n // break;\r\n // }\r\n // };\r\n\r\n /**\r\n * will try to get the first filename available\r\n * @returns {string} filename or null if nothing found\r\n * @memberof Upload\r\n */\r\n _getWebDavNameHint = () => {\r\n const files: Array = uppy.getFiles();\r\n const firstFile = files.find((f) => f.meta && f.meta.itemUri == null);\r\n return firstFile ? firstFile.meta.name : null;\r\n };\r\n\r\n /**\r\n * will return defaultValues to pass on to form\r\n * @returns defaultValues or null if no filename found\r\n * @memberof Upload\r\n */\r\n _getDefaultValues = () => {\r\n const defaults = Object.assign({}, this.props.defaults);\r\n const WebDavName = this._getWebDavNameHint();\r\n if (WebDavName) defaults[\"$NAME$\"] = WebDavName;\r\n if (!isEmpty(defaults)) return defaults;\r\n else return null;\r\n };\r\n\r\n /**\r\n * called when user clicks on Save in {@link FormContainer}\r\n * @async\r\n * @param {Object} model the form's values\r\n * @memberof Upload\r\n * @returns {boolean} true if success, false otherwise\r\n */\r\n _onSaveNew = async (\r\n model: Object,\r\n keepOriginalFilename: boolean = false,\r\n formatId: number\r\n ): Promise => {\r\n const files: Array = uppy.getFiles();\r\n if (files.length === 0) {\r\n // alert(\"No Files to archive!\");\r\n return;\r\n }\r\n this.setState({ isFormButtonEnabled: false });\r\n\r\n files.forEach((file) => {\r\n // has itemUri set (from previous failure?)\r\n if (file.meta.itemUri == null) {\r\n // #46997 let's fix the file extension\r\n // HACK\r\n const newModel = produce(model, (draft) => {\r\n draft.ip[\"$NAME$\"] = replaceFileExtension(\r\n model.ip[\"$NAME$\"], // first filename\r\n file.extension // current real extension\r\n );\r\n });\r\n // attach classification form (ip/ea) to each file's metadata (managed server-side by TusMiddleware.cs)\r\n uppy.setFileMeta(file.id, {\r\n itemUri: this.state.itemUri,\r\n formatId: formatId || this.props.formatId,\r\n mode: UploadMode.CreateDocument,\r\n model: JSON.stringify(newModel),\r\n keepOriginalFilename,\r\n });\r\n }\r\n });\r\n\r\n try {\r\n const result = await uppy.upload();\r\n this.setState({ isFormButtonEnabled: true });\r\n if (result && result.failed && result.failed.length === 0) {\r\n // all success -> reset uppy, close and refresh\r\n uppy.reset();\r\n /* istanbul ignore else */\r\n if (typeof this._onClose === \"function\") this._onClose();\r\n return true;\r\n }\r\n } catch (err) {\r\n /* istanbul ignore next */\r\n console.warn(\"Upload returned error: \", err);\r\n }\r\n this.setState({ isFormButtonEnabled: true });\r\n return false;\r\n };\r\n\r\n /**\r\n * called when user clicks Cancel in {@link FormContainer}\r\n * @memberof Upload\r\n */\r\n _onClose = () => {\r\n //#59285 Remove file from queue on Cancel\r\n uppy.reset();\r\n if (typeof this.props.onClose === \"function\") {\r\n this.props.onClose();\r\n } else {\r\n this.setState({ itemUri: null, formatId: -1 });\r\n }\r\n };\r\n\r\n render() {\r\n const { noItemUri, toggles, viewName, uppyHasPendingUploads } =\r\n this.props;\r\n const { itemUri } = this.state;\r\n return (\r\n \r\n {/* {this._renderFloatingBar()} */}\r\n \r\n \r\n \r\n \r\n {uppyHasPendingUploads && noItemUri && itemUri == null && (\r\n \r\n this.setState({ itemUri })\r\n }\r\n />\r\n )}\r\n {uppyHasPendingUploads && itemUri && (\r\n \r\n )}\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = /* istanbul ignore next */ (state, ownProps) => {\r\n return {\r\n noItemUri: ownProps.onClose == null, //whether archive form should be displayed\r\n itemUri:\r\n ownProps.onClose == null\r\n ? null\r\n : ownProps.itemUri || s.itemUriSelector(ownProps),\r\n formatId: s.breadcrumbFormatIdSelector(state, viewName),\r\n uppyHasPendingUploads: uppyHasPendingUploadsSelector(state),\r\n defaults: s.formDefaultsSelector(state),\r\n //onWindows: bowser.windows,\r\n viewName,\r\n ...ownProps,\r\n };\r\n};\r\n\r\nexport default compose(\r\n connect(mapStateToProps),\r\n TogglesHandler({\r\n viewName,\r\n }),\r\n SplitPanes({\r\n viewName,\r\n paneIds: [\"#upload_files\", \"#upload_form\"],\r\n toggleIds: [\"files\", \"form\"],\r\n direction: \"horizontal\",\r\n })\r\n)(Upload);\r\n","import actionTypes from \"data/actions/actionTypes\";\r\nimport Constants from \"data/constants\";\r\n\r\nexport const initialState = {\r\n displayName: \"N/A\",\r\n id: -1,\r\n status: Constants.NONE,\r\n sites: [],\r\n mainNavigation: [],\r\n isWfEnabled: false,\r\n isAdmin: false,\r\n avatar: undefined,\r\n hasOfflineItems: false,\r\n itemActions: [\r\n {\r\n categories: [],\r\n actions: [],\r\n },\r\n ],\r\n};\r\n\r\nconst userReducer = (state = initialState, action) => {\r\n switch (action.type) {\r\n case actionTypes.USER_FETCH_REQUESTED:\r\n return { ...state, ...action.payload };\r\n case actionTypes.USER_FETCH_RESULT:\r\n const { favorites, ...rest } = action.payload;\r\n return { ...state, ...rest };\r\n case actionTypes.USER_SITES_RESULT:\r\n return { ...state, ...action.payload };\r\n case actionTypes.LOGIN_SIGNOUT:\r\n return initialState;\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return initialState;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default userReducer;\r\n\r\nexport const userIdSelector = (state: Object) => state.user.id;\r\nexport const userStatusSelector = (state: Object) => state.user.status;\r\nexport const userCorrelationIdSelector = (state: Object) =>\r\n window.CONFIG.correlationId;\r\nexport const userSitesSelector = (state: Object) => state.user.sites;\r\nexport const userMainNavigationSelector = (state: Object) =>\r\n state.user.mainNavigation;\r\nexport const userIsAdminSelector = (state: Object) =>\r\n state.user.status === Constants.OK ? state.user.isAdmin : false;\r\nexport const userIsWfEnabledSelector = (state: Object) =>\r\n state.user.status === Constants.OK ? state.user.isWfEnabled : false;\r\nexport const userLanguageSelector = (state: Object) =>\r\n state.user.status === Constants.OK ? state.user.language : undefined;\r\nexport const userDecimalSeparator = (state: Object) =>\r\n state.user.status === Constants.OK ? state.user.decimalSeparator : \".\";\r\nexport const userThousandSeparator = (state: Object) =>\r\n state.user.status === Constants.OK ? state.user.thousandSeparator : \",\";\r\nexport const userItemActionsSelector = (state: Object) =>\r\n state.user.itemActions;\r\nexport const userFormActionsSelector = (state: Object) =>\r\n state.user.formActions;\r\nexport const userTopbarItemsSelector = (state: Object) =>\r\n state.user.topbar?.items;\r\nexport const userHasOfflineItemsSelector = (state: Object) =>\r\n state.user.status === Constants.OK ? state.user.hasOfflineItems : false;\r\n","import actionTypes from \"data/actions/actionTypes\";\r\nimport Constants from \"data/constants\";\r\nimport { type searchResultState } from \"./types\";\r\n\r\nexport const initialState: searchResultState = {\r\n status: Constants.NONE,\r\n error: undefined,\r\n result: undefined,\r\n count: {\r\n status: Constants.NONE,\r\n totalCount: -1,\r\n totalTime: -1,\r\n aggregations: [],\r\n },\r\n form: {\r\n id: -1,\r\n status: Constants.NONE,\r\n result: undefined,\r\n },\r\n changes: {},\r\n searchRequest: undefined,\r\n searchItem: undefined,\r\n};\r\n\r\nconst searchReducer = (state: searchResultState = initialState, action) => {\r\n switch (action.type) {\r\n case actionTypes.SEARCH_RESET:\r\n return {\r\n ...state,\r\n status: Constants.NONE,\r\n result: undefined,\r\n count: {\r\n status: Constants.NONE,\r\n totalCount: -1,\r\n totalTime: -1,\r\n aggregations: [],\r\n },\r\n searchRequest: undefined,\r\n searchItem: undefined,\r\n };\r\n\r\n case actionTypes.SEARCH_FAVRENAME_REQUEST:\r\n case actionTypes.SEARCH_FAVRENAME_RESULT:\r\n case actionTypes.SEARCH_FETCH_REQUEST:\r\n case actionTypes.SEARCH_FETCH_RESULT:\r\n case actionTypes.SEARCH_ITEM_SAVE:\r\n case actionTypes.SEARCH_FORM_CHANGES:\r\n return {\r\n ...state,\r\n ...action.payload,\r\n };\r\n\r\n case actionTypes.SEARCH_FORM_FETCH_REQUEST:\r\n return {\r\n ...state,\r\n form: Object.assign({}, state.form, {\r\n status: Constants.LOADING,\r\n id: action.payload.id,\r\n }),\r\n };\r\n\r\n case actionTypes.SEARCH_FORM_FETCH_RESULT:\r\n return {\r\n ...state,\r\n form: Object.assign({}, action.payload, {\r\n id: state.form && state.form.id,\r\n }),\r\n };\r\n case actionTypes.SEARCH_FORM_RESET:\r\n return {\r\n ...state,\r\n form: { ...initialState.form },\r\n changes: {},\r\n };\r\n\r\n case actionTypes.SEARCH_COUNT_REQUEST:\r\n return {\r\n ...state,\r\n count: { status: Constants.LOADING },\r\n };\r\n\r\n case actionTypes.SEARCH_COUNT_RESULT:\r\n return {\r\n ...state,\r\n count: action.payload,\r\n };\r\n\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return initialState;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default searchReducer;\r\n\r\nexport const searchStatusSelector = (state: Object) => state.search.status;\r\nexport const searchErrorSelector = (state: Object) => state.search.error;\r\nexport const searchResultSelector = (state: Object) => state.search.result;\r\nexport const searchResultTotalCountSelector = (state: Object) =>\r\n state.search.status === Constants.OK && state.search.result\r\n ? state.search.result.totalCount\r\n : -1;\r\nexport const searchRequestSelector = (state: Object) =>\r\n state.search.searchRequest;\r\nexport const searchTermsSelector = (state: Object) => state.search.terms;\r\nexport const searchItemSelector = (state: Object) => state.search.searchItem;\r\nexport const searchFormStatusSelector = (state: Object) =>\r\n state.search.form.status;\r\nexport const searchFormResultSelector = (state: Object) =>\r\n state.search.form.result;\r\nexport const searchFormIdSelector = (state: Object) => state.search.form.id;\r\nexport const searchFormChangesSelector = (state: Object) =>\r\n state.search.changes;\r\nexport const searchCountStatusSelector = (state: Object) =>\r\n state.search.count.status;\r\nexport const searchCountResultSelector = (state: Object) => state.search.count;\r\nexport const searchCountAggregationsSelector = (state: Object) =>\r\n state.search.count.aggregations;\r\n","// @flow\r\nimport React, { useMemo, useContext } from \"react\";\r\nimport { PaneSizeContext } from \"data/context\";\r\ntype Props = {\r\n /** html style attribute */\r\n style: CSSStyleDeclaration,\r\n /** html class attribute */\r\n className: string,\r\n /** Components Children */\r\n children: Children,\r\n};\r\n\r\nconst ViewerControlBase = ({\r\n className = \"form-group\",\r\n style = {},\r\n children,\r\n}: Props) => {\r\n const margins = 32;\r\n let width;\r\n const ctx = useContext(PaneSizeContext);\r\n if (ctx != null) {\r\n width = ctx.width;\r\n }\r\n const computedStyle: CSSStyleDeclaration = useMemo(() => {\r\n const styles = { ...style };\r\n if (width != null) {\r\n styles.maxWidth = width - margins;\r\n }\r\n return styles;\r\n }, [style, width]);\r\n return (\r\n
\r\n {children}\r\n
\r\n );\r\n};\r\n\r\nexport default ViewerControlBase;\r\n","// @flow\r\n//#region imports\r\nimport React, { useState, useMemo, useCallback, useEffect } from \"react\";\r\nimport { usePrevious, useEffectOnce } from \"hooks\";\r\nimport TogglesHandler from \"containers/TogglesHandler\";\r\nimport { useDispatch, useSelector, type Dispatch } from \"react-redux\";\r\nimport { compose } from \"redux\";\r\nimport MainLayout from \"components/MainLayout\";\r\nimport Status from \"components/Status\";\r\nimport {\r\n RefreshMode,\r\n ServerEventItemType,\r\n ServerEventActionType,\r\n type ToggleDTO,\r\n} from \"data/types\";\r\nimport TreeFilter from \"components/TreeFilter\";\r\nimport FolderTreeContainer from \"containers/FolderTree\";\r\nimport loc from \"i18next\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport DocListContainer from \"containers/DocList\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport SplitPanes from \"containers/SplitPanes\";\r\nimport GlobalEventsHandler from \"containers/GlobalEventsHandler\";\r\nimport CloseButton from \"@hs/close-button\";\r\nimport CommandActionHandler from \"components/CommandActions\";\r\nimport { LocalStoreHandler } from \"containers/LocalStore\";\r\nimport Pane from \"components/SplitPanes/Pane\";\r\nimport styles from \"./minipicker.module.css\";\r\nimport { sitesSelector } from \"data/storeHelper\";\r\nimport { getClassNames } from \"data/utils\";\r\n//#endregion\r\n\r\nexport const viewName = \"minipicker\";\r\n\r\n//#region flow types\r\ntype Props = {\r\n /** callback when closing Modal dialog */\r\n onClose?: () => void,\r\n\r\n // from TogglesHandler\r\n /** TogglesHandler: current toggles */\r\n toggles: ?ToggleDTO,\r\n\r\n /** DocList: callback on Document single click\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n * @param {string} itemUri the row's itemUri\r\n * @param {number} index the row's index\r\n */\r\n onDocSingleClick?: (\r\n e: SyntheticMouseEvent,\r\n itemUri: string,\r\n index: number\r\n ) => void,\r\n /** DocList: callback on Document double click\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n * @param {string} itemUri the row's itemUri\r\n * @param {number} index the row's index\r\n */\r\n onDocDoubleClick?: (\r\n e: SyntheticMouseEvent,\r\n itemUri: string,\r\n index: number\r\n ) => void,\r\n\r\n /** FolderTree callback on Folder single click */\r\n onFolderSingleClick: (itemUri: string, treeNodeId: number) => void,\r\n\r\n /** optional breadcrumbPart click event instead of history.push */\r\n onBreadcrumbPartClick?: (itemUri: string) => void,\r\n\r\n /** whether to limit breadcrumb scope */\r\n breadcrumbScopeFromLevel?: number,\r\n /** TogglesHandler: whether multiple toggles are allowed */\r\n isMultiple: boolean,\r\n /** TogglesHandler: currently selected toggles' names */\r\n selectedToggles: Array,\r\n};\r\n\r\nexport const MiniPicker = ({\r\n filterAction,\r\n toggles,\r\n onDocSingleClick,\r\n onDocDoubleClick,\r\n onFolderSingleClick,\r\n onBreadcrumbPartClick,\r\n itemUri,\r\n onClose,\r\n breadcrumbScopeFromLevel,\r\n canChangeSite = false,\r\n}: Props) => {\r\n //#region redux\r\n const dispatch: Dispatch = useDispatch();\r\n const treeStatus: ConstantsEnum = useSelector(s.treeStatusSelector);\r\n const treeIsBrowsable: boolean = useSelector(s.treeIsBrowsableSelector);\r\n const treeTotalCount: number = useSelector(s.treeTotalCountSelector);\r\n const treeAvailable = useMemo(\r\n () => treeIsBrowsable && treeTotalCount,\r\n [treeIsBrowsable, treeTotalCount]\r\n );\r\n // Note: Use default state for user specific data.\r\n const sites = useMemo(sitesSelector, []);\r\n //#endregion\r\n\r\n //#region state\r\n /** current tree name filter */\r\n const [treeFilter, setTreeFilter] = useState(\"\");\r\n /** wheather tree filter should include subfolders */\r\n const [includeSubfolders, setIncludeSubfolders] = useState(false);\r\n /** wheather tree is focused */\r\n const [isTreeFocused, setIsTreeFocused] = useState(false);\r\n /** the real itemUri currently selected */\r\n const [activeItemUri, setActiveItemUri] = useState(itemUri);\r\n /** folder row */\r\n const [currentFolderRow, setCurrentFolderRow] = useState(null);\r\n /** document row */\r\n const [currentDocumentRow, setCurrentDocumentRow] = useState(-1);\r\n //#endregion};\r\n\r\n //#region props\r\n const prevItemUri = usePrevious(itemUri) || itemUri;\r\n //#endregion\r\n\r\n //#region tree\r\n const handleTreeClick = useCallback(\r\n (itemUri: string, treeNodeId: number): void => {\r\n setCurrentFolderRow(treeNodeId);\r\n setActiveItemUri(itemUri);\r\n setIsTreeFocused(true);\r\n /* istanbul ignore else */\r\n if (typeof onFolderSingleClick === \"function\")\r\n onFolderSingleClick(itemUri, treeNodeId);\r\n },\r\n [onFolderSingleClick]\r\n );\r\n\r\n const handleTreeExpand = useCallback(\r\n (itemUri: string): void => {\r\n setTreeFilter(\"\");\r\n setActiveItemUri(itemUri);\r\n setCurrentFolderRow(null);\r\n setIsTreeFocused(false);\r\n /* istanbul ignore else */\r\n if (typeof onBreadcrumbPartClick === \"function\")\r\n onBreadcrumbPartClick(itemUri);\r\n },\r\n [onBreadcrumbPartClick]\r\n );\r\n\r\n const handleTreeFilterChange = useCallback(\r\n (value: ?string, includeSubfolders: boolean): void => {\r\n setTreeFilter(value || \"\");\r\n setIncludeSubfolders(includeSubfolders);\r\n setIsTreeFocused(false);\r\n },\r\n []\r\n );\r\n //#endregion\r\n\r\n //#region itemUri effect\r\n useEffect(() => {\r\n if (itemUri === prevItemUri) return;\r\n /* istanbul ignore else */\r\n if (itemUri !== activeItemUri) setActiveItemUri(itemUri);\r\n setTreeFilter(\"\");\r\n setIncludeSubfolders(false);\r\n setCurrentFolderRow(null);\r\n setCurrentDocumentRow(-1);\r\n }, [itemUri, prevItemUri, activeItemUri, dispatch]);\r\n //#endregion\r\n\r\n //#region callbacks\r\n const handleSingleClick = useCallback(\r\n (e: SyntheticMouseEvent<*>, itemUri: string, rowIndex: number) => {\r\n setCurrentDocumentRow(rowIndex);\r\n setIsTreeFocused(false);\r\n /* istanbul ignore else */\r\n if (typeof onDocSingleClick === \"function\") {\r\n onDocSingleClick(e, itemUri, rowIndex);\r\n }\r\n },\r\n [onDocSingleClick]\r\n );\r\n const handleIconClick = useCallback(\r\n (e: SyntheticMouseEvent<*>, itemUri: string, rowIndex: number) => {\r\n handleSingleClick(e, itemUri, rowIndex);\r\n e.preventDefault();\r\n CommandActionHandler(\"doc_preview\", {\r\n itemUri,\r\n newWindow: e.ctrlKey || e.altKey,\r\n });\r\n },\r\n [handleSingleClick]\r\n );\r\n //#endregion\r\n\r\n //#region mount effect\r\n // Always select first itemUri from Sites, if Picker is empty\r\n useEffectOnce(() => {\r\n if (itemUri == null) handleTreeExpand(sites?.[0]?.itemUri);\r\n });\r\n //#endregion\r\n\r\n return (\r\n }\r\n breadcrumbScopeFromLevel={breadcrumbScopeFromLevel}\r\n >\r\n \r\n {treeAvailable ? (\r\n \r\n ) : (\r\n
\r\n )}\r\n {itemUri ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n \r\n {activeItemUri ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n \r\n );\r\n};\r\n\r\nexport default compose(\r\n LocalStoreHandler({ name: viewName }),\r\n TogglesHandler({ viewName }),\r\n GlobalEventsHandler({\r\n items: [ServerEventItemType.folder],\r\n actions: [ServerEventActionType.delete],\r\n refreshMode: RefreshMode.Originator,\r\n refreshMessage: loc.t(\"globalEvents:folder.delete\"),\r\n refreshRoute: true,\r\n }),\r\n SplitPanes({\r\n viewName,\r\n paneIds: [\"#picker_tree\", \"#picker_doclist\"],\r\n toggleIds: [\"tree\", \"doclist\"],\r\n direction: \"horizontal\",\r\n })\r\n)(MiniPicker);\r\n","// @flow\r\nimport React, { useState, useCallback, useEffect, useMemo } from \"react\";\r\nimport Modal, { ModalSize } from \"components/Modal\";\r\nimport { createModal } from \"react-modal-promise\";\r\nimport styles from \"./PickerModal.module.css\";\r\nimport MiniPicker from \"views/minipicker\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport SplitButton from \"react-bootstrap/lib/SplitButton\";\r\nimport MenuItem from \"react-bootstrap/lib/MenuItem\";\r\nimport loc from \"i18next\";\r\nimport HelpBlock from \"react-bootstrap/lib/HelpBlock\";\r\nimport { fetchBreadcrumb } from \"data/api\";\r\nimport { useModalPostMessageHandler, useAbortController } from \"hooks\";\r\nimport { sitesSelector } from \"data/storeHelper\";\r\n\r\nexport const PickerType = {\r\n Folder: 0,\r\n File: 1,\r\n Any: 2,\r\n};\r\ntype PickerTypeEnum = $Values;\r\n\r\ntype PickerActionDTO = {\r\n label: string,\r\n eventKey: string,\r\n};\r\n\r\ntype Props = {\r\n /** react-modal-promise: whether to show dialog */\r\n open: boolean,\r\n /** react-modal-promise: callback when user closes Dialog */\r\n close: () => void,\r\n /** current folder's itemUri */\r\n itemUri: string,\r\n /** type of picker\r\n * @default {PickerTypeEnum} PickerType.File\r\n */\r\n pickerType: PickerTypeEnum,\r\n /** optional help text to display the user */\r\n helpText?: string,\r\n /** optional breadcrumb scoping */\r\n scopeBreadcrumb?: boolean,\r\n /** optional selectButton string */\r\n selectButton?: string,\r\n /** callback for additional actions */\r\n onSelect: (eventKey) => void,\r\n /** additional actions */\r\n additionalActions?: Array,\r\n};\r\n\r\n/** allows user to pick a Folder or Document */\r\nexport const PickerModal = ({\r\n open,\r\n close,\r\n itemUri,\r\n pickerType,\r\n helpText,\r\n onSelect,\r\n additionalActions,\r\n scopeBreadcrumb = false,\r\n canChangeSite = false,\r\n canSelectSite = false,\r\n selectButton = loc.t(\"minipicker:selectButton\"),\r\n}: Props) => {\r\n // remember the currently shown folder itemUri\r\n const [currentRootItemUri, setCurrentRootItemUri] = useState(itemUri);\r\n // remember the currently selected itemUri (folder/doc)\r\n const [currentItemUri, setCurrentItemUri] = useState(null);\r\n const [currentRootItemUriLevels, setCurrentItemUriLevels] = useState(-1);\r\n const sites = useMemo(sitesSelector, []);\r\n\r\n /* istanbul ignore next*/\r\n useEffect(() => {\r\n canSelectSite &&\r\n scopeBreadcrumb &&\r\n console.warn(\r\n \"Site Selection disabled: Prop canSelectSite will be false, when scopeBreadcrumb is true!\"\r\n );\r\n }, [canSelectSite, scopeBreadcrumb]);\r\n\r\n const handleFolderSelect = useCallback(\r\n (itemUri, treeNodeId) =>\r\n pickerType !== PickerType.File && setCurrentItemUri(itemUri),\r\n [pickerType]\r\n );\r\n const handleDocumentSelect = useCallback(\r\n (e, itemUri, index) =>\r\n pickerType !== PickerType.Folder && setCurrentItemUri(itemUri),\r\n [pickerType]\r\n );\r\n const setRootItemUri = useCallback(\r\n (itemUri: string) => {\r\n setCurrentRootItemUri(itemUri);\r\n if (pickerType !== PickerType.File) {\r\n handleFolderSelect(\r\n canSelectSite || !sites.some((s) => s.itemUri === itemUri)\r\n ? itemUri\r\n : null\r\n );\r\n } else {\r\n setCurrentItemUri(null);\r\n }\r\n },\r\n [pickerType, handleFolderSelect, canSelectSite, sites]\r\n );\r\n /* istanbul ignore next */\r\n const handleClose = useCallback(() => {\r\n close(false);\r\n }, [close]);\r\n\r\n useModalPostMessageHandler(handleClose);\r\n\r\n const handleSelect = useCallback(() => {\r\n close(currentItemUri);\r\n }, [close, currentItemUri]);\r\n\r\n const abortController = useAbortController();\r\n useEffect(() => {\r\n async function fetchData() {\r\n if (scopeBreadcrumb) {\r\n const bc = await fetchBreadcrumb(\r\n itemUri,\r\n abortController(true).signal\r\n );\r\n setCurrentItemUriLevels(bc.parts.length - 1);\r\n }\r\n }\r\n fetchData();\r\n }, [scopeBreadcrumb, itemUri, abortController]);\r\n\r\n const disabled = currentItemUri == null || currentItemUri === itemUri;\r\n\r\n return (\r\n \r\n \r\n \r\n pickerType !== PickerType.Folder && close(itemUri)\r\n }\r\n onFolderSingleClick={handleFolderSelect}\r\n onBreadcrumbPartClick={setRootItemUri}\r\n breadcrumbScopeFromLevel={currentRootItemUriLevels}\r\n canChangeSite={!scopeBreadcrumb && canChangeSite}\r\n />\r\n \r\n \r\n {helpText && (\r\n {helpText}\r\n )}\r\n {!additionalActions?.length ? (\r\n \r\n {selectButton}\r\n \r\n ) : (\r\n {\r\n e.stopPropagation(); // HACK: prevent closing of Menu within Modal.Footer\r\n }}\r\n onClick={handleSelect}\r\n bsStyle=\"primary\"\r\n title={selectButton}\r\n className={styles.button}\r\n pullRight\r\n dropup\r\n >\r\n {additionalActions.map((action, i) => (\r\n {\r\n onSelect(action.eventKey);\r\n handleSelect();\r\n }}\r\n >\r\n {action.label}\r\n \r\n ))}\r\n \r\n )}\r\n \r\n \r\n );\r\n};\r\nPickerModal.displayName = \"PickerModal\";\r\nPickerModal.defaultProps = {\r\n pickerType: PickerType.File,\r\n};\r\nexport const openPickerModal = createModal(PickerModal);\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"icon\":\"SearchBucket_icon__2JAIn\",\"value\":\"SearchBucket_value__brB2H\",\"margin\":\"SearchBucket_margin__3eJZx\",\"badge\":\"SearchBucket_badge__3cSnH\"};","export const postMessageTo = (type, data, target = window.parent) =>\r\n target.postMessage({ source: \"inPoint\", type, data }, \"*\");\r\n","/* istanbul ignore next */\r\nif (!Date.prototype.toLocalJSON) {\r\n //Use local Timezone (not UTC) for JSON\r\n (function () {\r\n function pad(number) {\r\n return number < 10 ? `0${number}` : number;\r\n }\r\n // eslint-disable-next-line\r\n Date.prototype.toLocalJSON = function () {\r\n return `${this.getFullYear()}-${pad(this.getMonth() + 1)}-${pad(\r\n this.getDate()\r\n )}T${pad(this.getHours())}:${pad(this.getMinutes())}:${pad(\r\n this.getSeconds()\r\n )}.${(this.getMilliseconds() / 1000).toFixed(3).slice(2, 5)}`;\r\n };\r\n })();\r\n}\r\n\r\n/* istanbul ignore next */\r\nif (typeof window.crypto === \"undefined\") {\r\n window.crypto = require(\"crypto\");\r\n}\r\n\r\n/* istanbul ignore next */\r\nif (typeof window.crypto.randomUUID !== \"function\") {\r\n window.crypto.randomUUID = function () {\r\n return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) =>\r\n (\r\n c ^\r\n (window.crypto.getRandomValues(new Uint8Array(1))[0] &\r\n (15 >> (c / 4)))\r\n ).toString(16)\r\n );\r\n };\r\n}\r\n","// @flow\r\nimport loc from \"i18next\";\r\nimport {\r\n DocListFilterOperators,\r\n type DocListFilterOperatorsEnum,\r\n SystemWebDavName,\r\n} from \"data/types\";\r\n// import template from \"lodash/template\";\r\n\r\n/**\r\n * checks if value is included in list (case-insensitive)\r\n *\r\n * @param {string} value to search for in list\r\n * @param {Array} list of string to search\r\n */\r\nexport const isListed = (value: string, list: Array): boolean =>\r\n list.some((l) => l.toLowerCase() === value.toLowerCase());\r\n\r\n/** returns file extension (with .)\r\n * @param {string} fileName the filename (without path)\r\n */\r\nexport const getFileExtension = (fileName: string): string =>\r\n fileName.slice(((fileName.lastIndexOf(\".\") - 1) >>> 0) + 1);\r\n\r\n/**\r\n * will replace the file extension in filename with newExt\r\n *\r\n * @param {string} filename the filename (without path) to fix\r\n * @param {string} newExt new file extension to assign (without .)\r\n * @returns {string} filename with the new extension\r\n * @memberof Upload\r\n */\r\nexport const replaceFileExtension = (\r\n filename: ?string,\r\n newExt: string\r\n): string =>\r\n (filename || \"\").substr(\r\n 0,\r\n (((filename || \"\").lastIndexOf(\".\") - 1) >>> 0) + 1\r\n ) +\r\n \".\" +\r\n newExt;\r\n\r\n/** returns true if any of element's DOM parent has the className */\r\nexport const hasSomeParentTheClass = (\r\n element: any,\r\n className: string\r\n): boolean => {\r\n //\r\n // If we are here we didn't find the searched class in any parents node\r\n //\r\n if (!element.parentNode) return false;\r\n //\r\n // If the current node has the class return true, otherwise we will search\r\n // it in the parent node\r\n /* istanbul ignore next */\r\n if (\r\n String(element.getAttribute(\"class\")).split(\" \").indexOf(className) >= 0\r\n )\r\n return true;\r\n return hasSomeParentTheClass(element.parentNode, className);\r\n};\r\n\r\n/**\r\n * will check if text starts with $ signaling our own internal i18next localization id\r\n * @param {string} text freetext or $loc.id\r\n * @returns {string} localized text\r\n */\r\nexport const getLocalizedText = (text: ?string, context?: any): ?string => {\r\n if (text && text.startsWith(\"$\")) {\r\n return loc.t(text.substr(1), context);\r\n }\r\n return text;\r\n};\r\n\r\nexport /**\r\n * @returns {boolean} true if itemUri starts with pam-item://\r\n * @param {string} itemUri to validate\r\n */\r\nconst isValidItemUri = (itemUri: string = \"\") =>\r\n itemUri.startsWith(\"pam-item://\");\r\n\r\nexport /**\r\n * converts a document's itemUri into a folder itemUri\r\n * @param {string} itemUri full itemUri (either for folder or document)\r\n * @returns {string} folder's itemUri\r\n */\r\nconst getFolderUri = (itemUri: string) =>\r\n itemUri.indexOf(\"@eid\") === -1\r\n ? itemUri\r\n : itemUri.substring(0, itemUri.indexOf(\"@eid\"));\r\n\r\nexport /**\r\n * simple js string templates\r\n * https://gist.github.com/pbroschwitz/3891293\r\n * @param {string} input source string including reference variables enclosed in single {}\r\n * @param {Object} data object defining the variables\r\n * @returns result after replacing tokens\r\n */\r\nconst tokenize = (input: string, data: Object) =>\r\n input.replaceAll(/(?:([^?&=#]+)=)?{([^{}]*)}/g, (original, prop, key) => {\r\n const prefix = prop != null ? `${prop}=` : \"\";\r\n const joinWith = prop != null ? `&${prop}=` : \", \";\r\n switch (typeof data[key]) {\r\n case \"object\":\r\n return Array.isArray(data[key])\r\n ? `${prefix}${data[key].join(joinWith)}`\r\n : original;\r\n case \"string\":\r\n case \"number\":\r\n return `${prefix}${data[key]}`;\r\n default:\r\n return original;\r\n }\r\n });\r\n\r\n// export /**\r\n// * js string templating\r\n// * @note although lodash.template is very powerful, there is no way to disable javascript execution - to avoid XSS cross script attacks!\r\n// * @param {string} input source string including reference variables\r\n// * @param {Object} data object defining the variables\r\n// * @returns compiled template result\r\n// */\r\n// const interpolate = (input: string, data: Object) => {\r\n// // https://lodash.com/docs/4.17.15#template\r\n// const compiled = template(input, {\r\n// evaluate: null,\r\n// imports: null,\r\n// escape: /{-([\\s\\S]+?)}/g,\r\n// interpolate: /{([\\s\\S]+?)}/g\r\n// });\r\n// return compiled(data);\r\n// };\r\n\r\nexport /**\r\n * map an object by changing it's values\r\n * @note although lodash.mapValues exists, it's 26KB big!\r\n * @param {Object} o input object\r\n * @param {(value: any) => any} f value transformation callback function\r\n * @returns {Object} transformed object with the same keys\r\n */\r\nconst mapValues = (o: Object, f: (value: any) => any) =>\r\n Object.entries(o).reduce((a, [key, value]) => {\r\n a[key] = Array.isArray(value)\r\n ? value.map((v) => f(v?.K ?? v?.V ?? v))\r\n : f(value?.K ?? value?.V ?? value);\r\n return a;\r\n }, {});\r\n\r\nexport /**\r\n * Moves an item in an array to a new position\r\n * @returns {Array} cloned array with updated item's position\r\n */\r\nconst moveArrayItem = (arr: Array, from: number, to: number) => {\r\n const clone = [...arr];\r\n Array.prototype.splice.call(\r\n clone,\r\n to,\r\n 0,\r\n Array.prototype.splice.call(clone, from, 1)[0]\r\n );\r\n return clone;\r\n};\r\n\r\nexport /** checks if browser support Caching */\r\nconst hasCacheSupport = () => \"caches\" in window;\r\n\r\nexport /** executes fn() and logs performance statistics */\r\nconst performanceTester = async (\r\n fn: () => Promise,\r\n log: (ms: number) => void\r\n): any | null => {\r\n /* istanbul ignore if */\r\n if (typeof fn !== \"function\")\r\n throw new Error(\"performanceTester function not defined!\");\r\n const t0 = performance.now();\r\n const result = await fn();\r\n log(performance.now() - t0);\r\n return result;\r\n};\r\n\r\n// export const calcSha256 = async (message) => {\r\n// // encode as UTF-8\r\n// const msgBuffer = new TextEncoder().encode(message);\r\n\r\n// // hash the message\r\n// const hashBuffer = await crypto.subtle.digest(\"SHA-256\", msgBuffer);\r\n\r\n// // convert ArrayBuffer to Array\r\n// const hashArray = Array.from(new Uint8Array(hashBuffer));\r\n\r\n// // convert bytes to hex string\r\n// const hashHex = hashArray\r\n// .map((b) => (\"00\" + b.toString(16)).slice(-2))\r\n// .join(\"\");\r\n// return hashHex;\r\n// };\r\n\r\n// https://advancedweb.hu/how-to-use-async-functions-with-array-filter-in-javascript/\r\nexport const asyncFilter = async (arr, predicate) =>\r\n arr.reduce(\r\n async (memo, e) => ((await predicate(e)) ? [...(await memo), e] : memo),\r\n []\r\n );\r\n\r\n// https://advancedweb.hu/how-to-use-async-functions-with-array-some-and-every-in-javascript/\r\nexport const asyncEvery = async (arr, predicate) => {\r\n for (let e of arr) {\r\n if (!(await predicate(e))) return false;\r\n }\r\n return true;\r\n};\r\n\r\nexport /* istanbul ignore next */ const sleep = (ms) =>\r\n new Promise((resolve) => setTimeout(resolve, ms));\r\n\r\nexport const getClassNames = (...classNames) =>\r\n classNames.filter((className) => className).join(\" \");\r\n\r\nexport /* istanbul ignore next */ const closeMenuOnScroll = (e: Event) =>\r\n e.target &&\r\n !(\r\n e.target.getAttribute(\"class\") &&\r\n e.target.getAttribute(\"class\").match(/__menu-list/)\r\n );\r\n\r\nexport /*istanbul ignore next */ const getValue = (value, param = \"value\") =>\r\n value != null && Object.prototype.hasOwnProperty.call(value, \"$type\")\r\n ? value[param] || value.value\r\n : value;\r\n\r\nexport const parseSaveDocListFilterOperators = (\r\n value: ?string\r\n): DocListFilterOperatorsEnum => {\r\n if (value == null) return DocListFilterOperators.None;\r\n return (\r\n Object.keys(DocListFilterOperators)\r\n .map((k) => ({\r\n key: k.toUpperCase(),\r\n value: DocListFilterOperators[k],\r\n }))\r\n .find((op) => op.key === value.toUpperCase())?.value ??\r\n DocListFilterOperators.None\r\n );\r\n};\r\n\r\nexport const maybeLocalizeBreadcrumb = ({\r\n bcText,\r\n siteType,\r\n delimiter = \"/\",\r\n}: {\r\n bcText: ?string,\r\n siteType: SiteTypeEnum,\r\n delimiter: string,\r\n}) => {\r\n if (bcText == null) return \"\";\r\n const idx = bcText.indexOf(delimiter);\r\n if (idx === -1) return maybeHandleSiteName(bcText);\r\n return `${maybeHandleSiteName(\r\n bcText.substr(0, idx),\r\n siteType\r\n )}${bcText.substr(idx)}`;\r\n};\r\n\r\nexport const maybeHandleSiteName = (text, siteType) =>\r\n text == null || Object.values(SystemWebDavName).some((s) => s === text)\r\n ? loc.t(`siteItemType.${String(siteType)}`)\r\n : text;\r\n","import React, { type Node, useEffect } from \"react\";\r\nimport { usePersistSetting } from \"hooks\";\r\nimport Icons from \"@hs/icons\";\r\nimport Collapse from \"react-bootstrap/lib/Collapse\";\r\nimport styles from \"./Divider.module.css\";\r\nimport { getClassNames } from \"data/utils\";\r\n\r\ntype Props = {\r\n /** optional CSS classname to apply */\r\n className?: string,\r\n /** caption to show on top left */\r\n header: string | Node,\r\n /** setting name (for persistance) */\r\n name?: string,\r\n /** whether to hide HorizontalRow */\r\n hideHR?: boolean,\r\n /** whether per default it should be expanded */\r\n defaultExpanded?: boolean,\r\n /** prop to control expanded state */\r\n expanded?: boolean,\r\n /** for Collapse: whether per default child component unmounts on exit */\r\n unmountOnExit?: boolean,\r\n /** for Collapse: whether component is mounted on enter */\r\n mountOnEnter?: boolean,\r\n};\r\n\r\nconst Divider = ({\r\n className,\r\n header,\r\n name,\r\n hideHR,\r\n defaultExpanded,\r\n children,\r\n expanded: expandedFromProps,\r\n unmountOnExit = true,\r\n mountOnEnter = false,\r\n}: Props) => {\r\n const [expanded, setExpanded] = usePersistSetting({\r\n name: name || \"NA\",\r\n defaultValue: defaultExpanded != null ? defaultExpanded : true,\r\n });\r\n useEffect(() => {\r\n setExpanded(expandedFromProps);\r\n }, [setExpanded, expandedFromProps]);\r\n return (\r\n <>\r\n {\r\n name && setExpanded(!expanded);\r\n }}\r\n className={getClassNames(styles.main, className)}\r\n aria-expanded={expanded}\r\n >\r\n {children ? (\r\n \r\n \r\n <>{header}\r\n \r\n ) : (\r\n <>{header}\r\n )}\r\n {hideHR !== true &&
}\r\n
\r\n {children && (\r\n \r\n {children}\r\n \r\n )}\r\n \r\n );\r\n};\r\nDivider.displayName = \"Divider\";\r\nexport default Divider;\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"Activity_container__uejwU\",\"table\":\"Activity_table__1XxiZ\",\"tbody\":\"Activity_tbody__nfvxC\",\"text\":\"Activity_text__5hnjX\",\"row\":\"Activity_row__3T3BS\",\"header\":\"Activity_header__3IuAV\",\"avatar\":\"Activity_avatar__26j0D\",\"what\":\"Activity_what__1n8dn\",\"actions\":\"Activity_actions__1y-L9\",\"version\":\"Activity_version__2UEbe\",\"article\":\"Activity_article__2O__4\",\"icon\":\"Activity_icon__3HvXO\"};","import actionTypes from \"data/actions/actionTypes\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport immutable from \"object-path-immutable\";\r\nimport { type docsResultState, type docFilterText } from \"./types\";\r\n\r\nconst initialState: docsResultState = {\r\n status: Constants.NONE,\r\n error: undefined,\r\n filters: [],\r\n sorts: [],\r\n totalCount: 0,\r\n rowCount: 0,\r\n pageNum: 0,\r\n pageSize: 0,\r\n itemUri: null,\r\n rows: {},\r\n cols: [],\r\n filterText: null,\r\n};\r\n\r\nconst docsReducer = (state: docsResultState = initialState, action) => {\r\n switch (action.type) {\r\n case actionTypes.CURRENTITEM_SET:\r\n if (\r\n action.payload.name !== \"docmodal\" &&\r\n action.payload.name !== \"itemflows\" &&\r\n action.payload.itemUri !== state.itemUri\r\n )\r\n return { ...initialState };\r\n else return state;\r\n\r\n case actionTypes.DOCS_FILTERTEXT_SET:\r\n return { ...state, filterText: action.payload };\r\n\r\n case actionTypes.DOCS_FETCH_REQUEST:\r\n if (action.payload.itemUri !== state.itemUri) {\r\n return { ...initialState, ...action.payload };\r\n }\r\n return {\r\n ...state,\r\n ...action.payload,\r\n };\r\n\r\n case actionTypes.DOCS_FETCH_RESULT:\r\n switch (action.payload.status) {\r\n case Constants.ERROR:\r\n return {\r\n ...initialState,\r\n itemUri: state.itemUri,\r\n status: action.payload.status,\r\n error: action.payload.error,\r\n receivedAt: action.payload.receivedAt,\r\n };\r\n case Constants.OK:\r\n if (state.pageNum <= 0) {\r\n return {\r\n ...state,\r\n // req specific\r\n totalCount: action.payload.totalCount,\r\n status: action.payload.status,\r\n error: action.payload.error,\r\n receivedAt: action.payload.receivedAt,\r\n\r\n rowCount: action.payload.result.rowCount,\r\n ...action.payload.result,\r\n };\r\n } else {\r\n return {\r\n // kept\r\n cols: state.cols,\r\n // TODO remove filters/sorts - should be retrieved from DocLayout!\r\n filters: state.filters,\r\n sorts: state.sorts,\r\n itemUri: state.itemUri,\r\n pageSize: state.pageSize,\r\n totalCount: state.totalCount,\r\n pageNum: state.pageNum,\r\n // req specific\r\n status: action.payload.status,\r\n error: action.payload.error,\r\n receivedAt: action.payload.receivedAt,\r\n\r\n rowCount: action.payload.result.rowCount,\r\n rows: immutable.assign(\r\n state,\r\n \"rows\",\r\n action.payload.result.rows\r\n ).rows,\r\n };\r\n }\r\n\r\n /* istanbul ignore next */\r\n default:\r\n return {\r\n ...state,\r\n ...action.payload,\r\n };\r\n }\r\n\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return initialState;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default docsReducer;\r\n\r\nexport const docsItemUriSelector = (state: Object): string =>\r\n state.docs.itemUri;\r\nexport const docsStatusSelector = (state: Object): ConstantsEnum =>\r\n state.docs.status;\r\nexport const docsPageNumSelector = (state: Object): ConstantsEnum =>\r\n state.docs.pageNum;\r\nexport const docsErrorSelector = (state: Object) => state.docs.error;\r\nexport const docsColsSelector = (state: Object) => state.docs.cols;\r\nexport const docsRowsSelector = (state: Object) => state.docs.rows;\r\nexport const docsFilterTextSelector = (state: Object): docFilterText =>\r\n state.docs.filterText;\r\nexport const docsTotalCountSelector = (state: Object): number =>\r\n state.docs.totalCount;\r\nexport const docsFiltersSelector = (state: Object) => state.docs.filters;\r\nexport const docsSortsSelector = (state: Object) => state.docs.sorts;\r\n","// @flow\r\nimport React, { type ComponentType } from \"react\";\r\nimport { getDisplayName } from \"data/constants\";\r\nimport { usePersistSetting } from \"hooks\";\r\n\r\ntype Config = {\r\n /** setting name in store */\r\n name: string,\r\n /** namespace for props */\r\n namespace: string,\r\n /** defaultValue to assign when not found in storage */\r\n defaultValue?: ?Object,\r\n};\r\n\r\nexport type SettingValueProps = {\r\n value: ?Object,\r\n setValue: (value: Object) => void,\r\n};\r\n\r\n/** will return the current setting's value and dispatch an action on change\r\n * @deprecated please use hooks/usePersistSetting\r\n */\r\nconst SettingValue =\r\n ({ name, namespace, defaultValue }: Config) =>\r\n (WrappedComponent: ComponentType) => {\r\n const HOC = (props) => {\r\n const extraProps = {\r\n [namespace]: usePersistSetting({\r\n name,\r\n defaultValue,\r\n asObject: true,\r\n }),\r\n };\r\n return ;\r\n };\r\n HOC.displayName = `SettingValue(${getDisplayName(WrappedComponent)})`;\r\n return HOC;\r\n };\r\n\r\nexport default SettingValue;\r\n","// @flow\r\nimport React, { PureComponent } from \"react\";\r\nimport { createPortal } from \"react-dom\";\r\nimport { Manager, Reference, Popper } from \"react-popper\";\r\nimport FormsyEditorBase from \"./FormsyEditorBase\";\r\nimport moment from \"moment\";\r\nimport Moment from \"containers/Moment\";\r\nimport LocaleUtils, { formatDate, parseDate } from \"react-day-picker/moment\";\r\nimport DayPickerInput from \"react-day-picker/DayPickerInput\";\r\nimport \"react-day-picker/lib/style.css\";\r\nimport loc from \"i18next\";\r\nimport { DateTimeFormat, type DateTimeFormatValues } from \"data/types\";\r\nimport { userLanguage } from \"data/storeHelper\";\r\nimport ClearableInput from \"@hs/clearable-input\";\r\n\r\ntype Props = {\r\n /** Field name */\r\n name: string,\r\n /** Field value */\r\n value: ?string,\r\n /** whether this field is required */\r\n isRequired: boolean,\r\n /** whether this field is readonly */\r\n isReadonly: boolean,\r\n /** how to render component */\r\n type: DateTimeFormatValues,\r\n};\r\n\r\ntype State = {\r\n day: Date,\r\n time: Date,\r\n dateValue: string,\r\n timeValue: string,\r\n};\r\n\r\n/* istanbul ignore next */\r\nexport const DatePickerReference = React.forwardRef((inputProps, inputRef) => (\r\n \r\n {({ ref }) => (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n));\r\n\r\n/* istanbul ignore next */\r\nexport const DatePickerPopper = ({\r\n children,\r\n classNames,\r\n onFocus,\r\n onBlur,\r\n tabIndex,\r\n}) =>\r\n createPortal(\r\n \r\n {({ ref, style, placement }) => (\r\n \r\n {children}\r\n \r\n )}\r\n ,\r\n document.getElementById(\"root\")\r\n );\r\n\r\nexport class DateEditorControl extends PureComponent {\r\n format: string;\r\n\r\n static defaultProps = {\r\n value: \"\",\r\n isRequired: false,\r\n isReadonly: false,\r\n type: DateTimeFormat.Date,\r\n };\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n // set user's locale for parsing/formatting\r\n moment.locale(userLanguage());\r\n // full date&time format\r\n this.format = this._getFormat(props);\r\n // parse pristine value or set NOW\r\n if (props.value != null && String(props.value).length > 0) {\r\n const dt = moment(props.value, this.format);\r\n this.state = {\r\n day: dt.toDate(),\r\n time: dt.toDate(),\r\n dateValue: this.getValueAsDate(props.value),\r\n timeValue: this.getValueAsDate(\r\n props.value,\r\n moment.HTML5_FMT[\r\n props.type.toLowerCase().includes(\"long\")\r\n ? \"TIME_SECONDS\"\r\n : \"TIME\"\r\n ]\r\n ),\r\n };\r\n } else {\r\n this.state = { day: new Date(), time: new Date() };\r\n }\r\n }\r\n\r\n _getFormat = (props) => {\r\n switch (props.type) {\r\n case DateTimeFormat.Time:\r\n return moment.localeData().longDateFormat(\"LT\");\r\n case DateTimeFormat.LongTime:\r\n return moment.localeData().longDateFormat(\"LTS\");\r\n case DateTimeFormat.DateTime:\r\n return `${moment.localeData().longDateFormat(\"L\")} ${moment\r\n .localeData()\r\n .longDateFormat(\"LT\")}`;\r\n case DateTimeFormat.DateLongTime:\r\n return `${moment.localeData().longDateFormat(\"L\")} ${moment\r\n .localeData()\r\n .longDateFormat(\"LTS\")}`;\r\n case DateTimeFormat.Date:\r\n return moment.localeData().longDateFormat(\"L\");\r\n case DateTimeFormat.JsonDate:\r\n return `YYYY-MM-DD[T]00:00:00.000`;\r\n case DateTimeFormat.JsonDateEnd:\r\n return `YYYY-MM-DD[T]23:59:59.000`;\r\n case DateTimeFormat.JsonDateTime:\r\n return `YYYY-MM-DD[T]HH:mm:ss.SSS`;\r\n default:\r\n console.error(\r\n \"Wrong DateTimeFormat provided. Defaulting to DatetimeFormat.Date\"\r\n );\r\n return moment.localeData().longDateFormat(\"L\");\r\n }\r\n };\r\n\r\n _getDate = () => {\r\n const { day, time } = this.state;\r\n const m = moment(\r\n new Date(\r\n day.getFullYear(),\r\n day.getMonth(),\r\n day.getDate(),\r\n time.getHours(),\r\n time.getMinutes(),\r\n time.getSeconds()\r\n )\r\n );\r\n return m.format(this.format);\r\n };\r\n\r\n _onDayChange = (\r\n day: ?Date,\r\n modifiers: Object,\r\n dayPickerInput: DayPickerInput,\r\n changeValue: Function\r\n ) => {\r\n const input = dayPickerInput.getInput();\r\n // typedValue should be the right property, but this callback\r\n // is called before setState is finished, so we have to access\r\n // the current value ourselfs by using input._ref.value\r\n const value =\r\n input._ref?.value /*istanbul ignore next*/ ||\r\n dayPickerInput.state.value;\r\n\r\n if (day != null) {\r\n this.setState(\r\n {\r\n day,\r\n dateValue: this.getValueAsDate(\r\n dayPickerInput.state.value,\r\n undefined,\r\n \"L\"\r\n ),\r\n },\r\n () =>\r\n changeValue({\r\n currentTarget: {\r\n value:\r\n !this.shouldRenderTime() ||\r\n this.getValueAsDate(this.state.timeValue) !== \"\"\r\n ? this._getDate()\r\n : this.invalidate(\r\n dayPickerInput.state.value\r\n ),\r\n },\r\n })\r\n );\r\n } else {\r\n this.setState((prevState) => {\r\n const dateValue = this.invalidate(value);\r\n const nextState = {\r\n dateValue,\r\n timeValue: prevState.timeValue,\r\n };\r\n // Clear was pressed\r\n if (\r\n prevState.dateValue === value ||\r\n prevState.dateValue === dateValue ||\r\n value === \"\"\r\n ) {\r\n nextState.dateValue = this.shouldRenderTime()\r\n ? this.invalidate()\r\n : null;\r\n if (prevState.timeValue === \"__INVALID__\")\r\n nextState.timeValue = null;\r\n if (nextState.timeValue == null) nextState.dateValue = null;\r\n }\r\n changeValue({\r\n currentTarget: {\r\n value: nextState.dateValue,\r\n },\r\n });\r\n return nextState;\r\n });\r\n }\r\n };\r\n\r\n _onTimeChange = (event: SyntheticInputEvent<*>, changeValue: Function) => {\r\n const value = event.currentTarget.value;\r\n const time = moment(value, \"LTS\").toDate();\r\n if (\r\n value?.trim().length > 0 &&\r\n !isNaN(time) &&\r\n (!this.shouldRenderSeconds() || value.match(/:/g).length === 2) //HACK: do validate long time correctly\r\n ) {\r\n this.setState({ time, timeValue: value }, () =>\r\n changeValue({\r\n currentTarget: {\r\n value:\r\n !this.shouldRenderDate() ||\r\n this.getValueAsDate(this.state.dateValue) !== \"\"\r\n ? this._getDate()\r\n : this.invalidate(value),\r\n },\r\n })\r\n );\r\n } else {\r\n this.setState((prevState) => {\r\n const timeValue = this.invalidate(value);\r\n const nextState = {\r\n timeValue,\r\n dateValue: prevState.dateValue,\r\n };\r\n // Clear was pressed\r\n if (value === \"\") {\r\n nextState.timeValue = this.shouldRenderDate()\r\n ? this.invalidate()\r\n : null;\r\n // Handle date with time invalidation\r\n if (prevState.dateValue === \"__INVALID__\")\r\n nextState.dateValue = null;\r\n if (nextState.dateValue == null) nextState.timeValue = null;\r\n }\r\n changeValue({\r\n currentTarget: {\r\n value: nextState.timeValue,\r\n },\r\n });\r\n return nextState;\r\n });\r\n }\r\n };\r\n\r\n shouldRenderDate = () => this.props.type.toLowerCase().includes(\"date\");\r\n shouldRenderTime = () => this.props.type.toLowerCase().includes(\"time\");\r\n shouldRenderSeconds = () => this.props.type.toLowerCase().includes(\"long\");\r\n\r\n invalidate = (value: string = \"\"): string => `__INVALID__${value}`;\r\n\r\n /* istanbul ignore next */\r\n getValueAsDate = (\r\n value: ?string,\r\n format: string = \"L\",\r\n valueFormat: string = this.format\r\n ) =>\r\n value &&\r\n String(value).length > 0 &&\r\n !String(value).startsWith(\"__INVALID__\")\r\n ? moment(value, valueFormat).format(format)\r\n : \"\";\r\n\r\n getValidValue = (value: ?string): any =>\r\n value && typeof value === \"string\"\r\n ? value.replace(\"__INVALID__\", \"\")\r\n : value;\r\n\r\n render = () => (\r\n void,\r\n isValid: boolean\r\n ) => (\r\n \r\n {this.shouldRenderDate() && (\r\n \r\n this._onDayChange(\r\n day,\r\n modifiers,\r\n dayPickerInput,\r\n changeValue\r\n )\r\n }\r\n placeholder={moment\r\n .localeData()\r\n .longDateFormat(\"L\")}\r\n format={\"L\"}\r\n component={DatePickerReference}\r\n overlayComponent={DatePickerPopper}\r\n />\r\n )}\r\n {this.shouldRenderTime() && (\r\n \r\n this._onTimeChange(event, changeValue)\r\n }\r\n style={{\r\n flexGrow: 0,\r\n }}\r\n className=\"TimePickerInput form-control\"\r\n />\r\n )}\r\n \r\n )}\r\n {...this.props}\r\n />\r\n );\r\n}\r\n\r\nexport default Moment(DateEditorControl);\r\n","// @flow\r\nimport React, { useMemo } from \"react\";\r\nimport { connect } from \"react-redux\";\r\nimport FormsyEditorBase from \"./FormsyEditorBase\";\r\nimport MaskedInput from \"@hs/masked-input\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport { getClassNames } from \"data/utils\";\r\nimport IMask from \"imask\";\r\nimport loc from \"i18next\";\r\n\r\ntype Props = {\r\n /** precision - how many digits */\r\n decimalScale: number,\r\n /** currency identifier */\r\n currency?: string,\r\n /** localization setting for Thousands separator */\r\n thousandSeparator: string,\r\n /** localization setting for Decimal separator */\r\n decimalSeparator: string,\r\n /** whether field is readonly (disabled) */\r\n isReadonly: boolean,\r\n /** whether field is required (validation) */\r\n isRequired: boolean,\r\n /** placeholder text to display when @see {value} is empty */\r\n placeholder?: string,\r\n /** CSS Style to apply */\r\n style?: Object,\r\n /** CSS Classname to apply */\r\n className?: string,\r\n};\r\n\r\nconst IMaskNumberDefault = ({\r\n decimalScale,\r\n thousandSeparator,\r\n decimalSeparator,\r\n}) => {\r\n const props = {\r\n mask: Number,\r\n scale: decimalScale,\r\n signed: false,\r\n normalizeZeros: true,\r\n thousandsSeparator: thousandSeparator,\r\n padFractionalZeros: false,\r\n radix: \"\\u200B\", //HACK: Use zero-width space as commaseparator to enforce integer\r\n mapToRadix: [],\r\n };\r\n if (decimalScale > 0) {\r\n props.padFractionalZeros = true;\r\n props.radix = decimalSeparator;\r\n props.mapToRadix = [decimalSeparator];\r\n }\r\n return props;\r\n};\r\n\r\nconst IMaskCurrencyDefault = ({ currency, ...numberProps }) => ({\r\n mask: `${currency} num`,\r\n blocks: {\r\n num: { ...IMaskNumberDefault(numberProps) },\r\n },\r\n});\r\n\r\nexport const NumberEditorControl = ({\r\n mask,\r\n currency,\r\n decimalScale,\r\n thousandSeparator,\r\n decimalSeparator,\r\n ...props\r\n}: Props) => {\r\n const maskProps = useMemo(() => {\r\n if (mask) {\r\n return { mask };\r\n }\r\n if (currency) {\r\n return IMaskCurrencyDefault({\r\n currency,\r\n decimalScale,\r\n thousandSeparator,\r\n decimalSeparator,\r\n });\r\n }\r\n return IMaskNumberDefault({\r\n decimalScale,\r\n thousandSeparator,\r\n decimalSeparator,\r\n });\r\n }, [mask, currency, decimalScale, thousandSeparator, decimalSeparator]);\r\n return (\r\n (\r\n \r\n )}\r\n {...props}\r\n validations={{\r\n ...props.validations,\r\n notEmptyMask: /*istanbul ignore next*/ (values, value) => {\r\n if (!props.isRequired) return true;\r\n const rawValue = IMask.pipe(\r\n value ?? \"\",\r\n {\r\n ...maskProps,\r\n definitions: {\r\n \"#\": /[0-9]/,\r\n \"&\": /./,\r\n A: /[0-9a-zA-Z]/,\r\n a: /[0-9a-zA-Z]/,\r\n 9: /[0-9]/,\r\n C: /./,\r\n \"?\": /./,\r\n n: /[0-9]/,\r\n },\r\n },\r\n IMask.PIPE_TYPE.MASKED,\r\n IMask.PIPE_TYPE.UNMASKED\r\n );\r\n return String(rawValue) !== \"\";\r\n },\r\n }}\r\n validationErrors={{\r\n ...props.validationErrors,\r\n notEmptyMask: loc.t(\"common:validation.required\"),\r\n }}\r\n />\r\n );\r\n};\r\n\r\nconst mapStateToProps = /* istanbul ignore next */ (state, ownProps) => ({\r\n thousandSeparator: s.userThousandSeparator(state),\r\n decimalSeparator: s.userDecimalSeparator(state),\r\n ...ownProps,\r\n});\r\n\r\nexport default connect(mapStateToProps)(NumberEditorControl);\r\n","import React from \"react\";\r\nimport { ApiErrorResult } from \"data/types\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport ButtonGroup from \"react-bootstrap/lib/ButtonGroup\";\r\nimport { get } from \"data/constants\";\r\nimport { getLocalizedText } from \"data/utils\";\r\nimport { toastActionResult, toastStyled, toastTypes } from \"data/toast\";\r\nimport copy from \"copy-to-clipboard\";\r\nimport { JL } from \"data/logging\";\r\n\r\nexport const HTTP_ERROR_CONFLICT = 412;\r\n\r\nconst _log = JL(\"apiError\");\r\nexport class ApiErrorContainer extends Error {\r\n data: ApiErrorResult;\r\n\r\n constructor(response: ApiErrorResult) {\r\n super(response.message);\r\n /* istanbul ignore else */\r\n if (Error.captureStackTrace)\r\n Error.captureStackTrace(this, ApiErrorContainer);\r\n this.data = response;\r\n }\r\n}\r\n\r\nexport class ApiError extends ApiErrorContainer {\r\n constructor(...args) {\r\n super({\r\n message: args.length > 0 ? args[0] : \"Unknown\",\r\n isError: true,\r\n });\r\n }\r\n}\r\n\r\nexport class ApiNetworkError extends ApiErrorContainer {\r\n constructor(...args) {\r\n const response: Response = args[0];\r\n super({\r\n ...(args.length > 1 ? args[1] : {}),\r\n statusCode: response.status,\r\n statusText: response.statusText,\r\n isError: true,\r\n });\r\n }\r\n}\r\n\r\nexport class ApiConflictError extends ApiNetworkError {}\r\n\r\nexport class ApiNetworkOfflineError extends ApiErrorContainer {\r\n constructor(...args) {\r\n super({\r\n message: args[0],\r\n detail: args.length > 1 ? args[1] : null,\r\n isError: true,\r\n eventId: { id: 0, name: \"OFFLINE\" },\r\n });\r\n }\r\n}\r\n\r\nexport const notifyOnError = (response) => {\r\n _log.error(() => ({\r\n msg: \"Fetch.Api.Error\",\r\n response,\r\n }));\r\n\r\n if (!response.extra || response.extra.notify !== true) {\r\n return;\r\n }\r\n\r\n const { extra, isError, ...rest } = response;\r\n /* istanbul ignore next */\r\n const {\r\n email = false,\r\n text = \"\",\r\n url = false,\r\n } = get(window.CONFIG, [\"general\", \"localContactInfo\"], {});\r\n const message = getLocalizedText(\"$fetch.clipboard_copy.message\");\r\n const handleClick = () =>\r\n copy(JSON.stringify(rest), {\r\n message,\r\n format: \"text/plain\",\r\n onCopy: /* istanbul ignore next */ (clipboardData: Object) =>\r\n toastActionResult(true, \"fetch.clipboard_copy\"),\r\n });\r\n\r\n const details = () => (\r\n \r\n {email && (\r\n \r\n )}\r\n {url && (\r\n \r\n {url}\r\n \r\n )}\r\n \r\n \r\n );\r\n\r\n toastStyled({\r\n ...toastTypes.failure,\r\n autoClose: false,\r\n details,\r\n message: getLocalizedText(response.extra.loc || \"$fetch.error\", {\r\n text,\r\n }),\r\n });\r\n};\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"row\":\"RowResult_row__XIpu8\",\"multi\":\"RowResult_multi__VKNpr\",\"ext\":\"RowResult_ext__2okQw\",\"thumbnail\":\"RowResult_thumbnail__2-QGf\",\"active\":\"RowResult_active__kpxqP\",\"hovered\":\"RowResult_hovered__1Iq4t\",\"below\":\"RowResult_below__2auZK\",\"name\":\"RowResult_name__21RYa\",\"attrs\":\"RowResult_attrs__2Tbfn\",\"checkbox\":\"RowResult_checkbox__3VzO7\"};","// @flow\r\nimport actionTypes from \"./actionTypes\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport type {\r\n ApiErrorResult,\r\n Dictionary,\r\n UserInfoResultDTO,\r\n CardItemResultDTO,\r\n SAYTOptionDTO,\r\n DocListFilterRequestDTO,\r\n DocListFilterOperatorsEnum,\r\n BreadcrumbResultDTO,\r\n DocListSortRequestDTO,\r\n TreeDTO,\r\n DocsResultDTO,\r\n DocListLayout,\r\n SearchRequestDTO,\r\n SearchResultDTO,\r\n ListViewModeEnum,\r\n ToggleItemDTO,\r\n SearchFormResultDTO,\r\n SearchFormInfoDTO,\r\n SearchItemDTO,\r\n SearchCountResultDTO,\r\n SearchValueTypeEnum,\r\n OfflineSyncStatusEnum,\r\n OfflineItemDTO,\r\n NotificationDTO,\r\n NotificationId,\r\n NotificationStatusFlagEnum,\r\n GUID,\r\n CommandActionLog,\r\n CommandActionStatusFlagEnum,\r\n} from \"data/types\";\r\nimport { OfflineSyncStatus } from \"data/types\";\r\nimport { type actionResult } from \"./types\";\r\nimport { docFilterText } from \"data/reducers/types\";\r\n\r\n//#region Toggles\r\n// called to set but not persist toggle\r\nexport const togglesChangeAction = (\r\n name: string,\r\n toggles: Array\r\n): actionResult => ({\r\n type: actionTypes.TOGGLES_CHANGE,\r\n payload: { name, toggles },\r\n});\r\n\r\n// called by containers/ToggleBarContainer to switch a toggle\r\nexport const persistTogglesAction = (\r\n name: string,\r\n toggles: Array\r\n): actionResult => ({\r\n type: actionTypes.TOGGLES_PERSIST,\r\n payload: { name, toggles },\r\n});\r\n\r\n// update toggle counters\r\n// counts: { name: count, name: count, ... }\r\n// status: { name: status, name: status, ... }\r\n// use status=Constants.LOADING to show spinner\r\nexport const togglesUpdateCounterAction = ({\r\n name,\r\n counts,\r\n status,\r\n}: {\r\n name: string,\r\n counts: Dictionary,\r\n status?: Dictionary,\r\n}): actionResult => ({\r\n type: actionTypes.TOGGLES_UPDATECOUNTER,\r\n payload: { name, counts, status },\r\n});\r\n//#endregion\r\n\r\n//#region USER\r\n\r\n// called by containers/UserContainer to load current user's info\r\nexport const getUserAction = (status?: ConstantsEnum): actionResult => ({\r\n type: actionTypes.USER_FETCH_REQUESTED,\r\n payload: { status: status || Constants.LOADING },\r\n});\r\n\r\n// called by sagas/userSaga to load current user's info\r\nexport const getUserResultAction = ({\r\n status,\r\n message,\r\n info,\r\n}: {\r\n status: ConstantsEnum,\r\n message?: string,\r\n info?: UserInfoResultDTO,\r\n}): actionResult => ({\r\n type: actionTypes.USER_FETCH_RESULT,\r\n payload: { status, message, ...info },\r\n receivedAt: Date.now(),\r\n});\r\n\r\nexport const setSitesAction = (sites: Array) => ({\r\n type: actionTypes.USER_SITES_RESULT,\r\n payload: { sites },\r\n});\r\n\r\nexport const setLoginResultAction = ({\r\n idToken,\r\n accessToken,\r\n expiresOn,\r\n expiresIn,\r\n status,\r\n message,\r\n}: {\r\n idToken: string,\r\n accessToken: string,\r\n expiresOn?: number,\r\n expiresIn?: number,\r\n status: ConstantsEnum,\r\n message?: string,\r\n}): actionResult => ({\r\n type: actionTypes.LOGIN_RESULT,\r\n payload: { status, message, idToken, accessToken, expiresOn, expiresIn },\r\n receivedAt: Date.now(),\r\n});\r\n\r\nexport const loginSignoutAction = (): actionResult => ({\r\n type: actionTypes.LOGIN_SIGNOUT,\r\n payload: {},\r\n});\r\n//#endregion\r\n\r\n//#region GlobalSearch\r\n\r\nexport const getGlobalSearchDefaultAction = (): actionResult => ({\r\n type: actionTypes.GLOBALDEFAULTSEARCH_FETCH_REQUEST,\r\n payload: {},\r\n});\r\n\r\nexport const globalSearchDefaultResultAction = ({\r\n status,\r\n message,\r\n options,\r\n}: {\r\n status: ConstantsEnum,\r\n message?: string,\r\n options: Array,\r\n}): actionResult => ({\r\n type: actionTypes.GLOBALDEFAULTSEARCH_FETCH_RESULT,\r\n payload: {\r\n status,\r\n message,\r\n options,\r\n },\r\n receivedAt: Date.now(),\r\n});\r\n\r\n//#endregion\r\n\r\n//#region Favorites\r\n\r\nexport const getFavoritesAction = (status?: ConstantsEnum): actionResult => ({\r\n type: actionTypes.FAVORITES_FETCH_REQUEST,\r\n payload: { status: status || Constants.LOADING },\r\n});\r\n\r\nexport const getFavoritesResultAction = ({\r\n status,\r\n message,\r\n favorites,\r\n}: {\r\n status: ConstantsEnum,\r\n message?: string,\r\n favorites: Array,\r\n}): actionResult => ({\r\n type: actionTypes.FAVORITES_FETCH_RESULT,\r\n payload: {\r\n status,\r\n message,\r\n favorites,\r\n },\r\n receivedAt: Date.now(),\r\n});\r\n\r\n//#endregion\r\n\r\n//#region Workflows\r\n\r\nexport const getWorkflowProviders = (): actionResult => ({\r\n type: actionTypes.WF_PROVIDERS_FETCH_REQUESTED,\r\n payload: { status: Constants.LOADING },\r\n});\r\n\r\nexport const getWorkflowProvidersResult = ({\r\n status,\r\n providers,\r\n message,\r\n}: {\r\n status: ConstantsEnum,\r\n providers: Array,\r\n message?: string,\r\n}): actionResult => ({\r\n type: actionTypes.WF_PROVIDERS_FETCH_RESULT,\r\n payload: { status, providers, message },\r\n});\r\n\r\nexport const getWorkflowCards = (status?: ConstantsEnum): actionResult => ({\r\n type: actionTypes.WF_FETCH_REQUESTED,\r\n payload: { status: status || Constants.LOADING },\r\n});\r\n\r\nexport const getWorkflowCardsResult = ({\r\n status,\r\n cards,\r\n message,\r\n}: {\r\n status: ConstantsEnum,\r\n cards: Array,\r\n message?: string,\r\n}): actionResult => ({\r\n type: actionTypes.WF_FETCH_RESULT,\r\n payload: {\r\n status,\r\n message,\r\n cards,\r\n },\r\n receivedAt: Date.now(),\r\n});\r\n//#endregion\r\n\r\n//#region Cards\r\n\r\n// called by sagas/cardsSaga to load current user's home cards\r\nexport const getCardsAction = (status?: ConstantsEnum): actionResult => ({\r\n type: actionTypes.CARDS_FETCH_REQUESTED,\r\n payload: { status: status || Constants.LOADING },\r\n});\r\n\r\nexport const getCardsByEntityAction = (\r\n cardTypes: Array,\r\n cardItemTypes: Array,\r\n status?: ConstantsEnum\r\n): actionResult => ({\r\n type: actionTypes.CARDS_FETCH_ENTITY_REQUESTED,\r\n payload: { status: status || Constants.LOADING, cardTypes, cardItemTypes },\r\n});\r\n\r\nexport const getCardsResultAction = ({\r\n status,\r\n cards,\r\n message, //optional error message\r\n}: {\r\n status: ConstantsEnum,\r\n cards: Array,\r\n message?: string,\r\n}): actionResult => ({\r\n type: actionTypes.CARDS_FETCH_RESULT,\r\n payload: {\r\n status,\r\n message,\r\n cards,\r\n },\r\n receivedAt: Date.now(),\r\n});\r\n\r\nexport const getCardsByEntityResultAction = ({\r\n status,\r\n cards,\r\n cardTypes,\r\n cardItemTypes,\r\n}: {\r\n status: ConstantsEnum,\r\n cards: Array,\r\n cardTypes: Array,\r\n cardItemTypes: Array,\r\n}): actionResult => ({\r\n type: actionTypes.CARDS_FETCH_ENTITY_RESULT,\r\n payload: {\r\n status,\r\n cards,\r\n cardTypes,\r\n cardItemTypes,\r\n },\r\n receivedAt: Date.now(),\r\n});\r\n\r\nexport const setTreeStatus = (\r\n status: ContantsEnum = Constants.LOADING\r\n): actionResult => ({\r\n type: actionTypes.TREE_SET_STATUS,\r\n payload: { status },\r\n});\r\n\r\nexport const getTreeAction = ({\r\n itemUri,\r\n filter,\r\n deep,\r\n all,\r\n}: {\r\n itemUri: string,\r\n filter: ?string,\r\n deep: boolean,\r\n all: boolean,\r\n}): actionResult => ({\r\n type: actionTypes.TREE_FETCH_REQUEST,\r\n payload: { itemUri, filter, deep, all, status: Constants.LOADING },\r\n});\r\n\r\nexport const getTreeResultAction = ({\r\n status,\r\n tree,\r\n error,\r\n}: {\r\n status: ConstantsEnum,\r\n tree: TreeDTO,\r\n error?: Error,\r\n}): actionResult => ({\r\n type: actionTypes.TREE_FETCH_RESULT,\r\n payload: {\r\n status,\r\n error,\r\n nodes:\r\n tree && Object.prototype.hasOwnProperty.call(tree, \"items\")\r\n ? tree.items\r\n : [],\r\n isRoot:\r\n tree && Object.prototype.hasOwnProperty.call(tree, \"isRoot\")\r\n ? tree.isRoot\r\n : false,\r\n isBrowsable:\r\n tree && Object.prototype.hasOwnProperty.call(tree, \"isBrowsable\")\r\n ? tree.isBrowsable\r\n : true,\r\n totalCount: (tree && tree.totalCount) || 0,\r\n },\r\n receivedAt: Date.now(),\r\n});\r\n\r\n//#endregion\r\n\r\n//#region Search\r\n\r\nexport const searchResetAction = (): actionResult => ({\r\n type: actionTypes.SEARCH_RESET,\r\n payload: {},\r\n});\r\n\r\nexport const getSearchFormListAction = (): actionResult => ({\r\n type: actionTypes.SEARCH_FORM_LIST_FETCH_REQUEST,\r\n payload: { status: Constants.LOADING },\r\n});\r\n\r\nexport const getSearchFormListResultAction = ({\r\n status,\r\n result,\r\n message,\r\n}: {\r\n status: ConstantsEnum,\r\n result: Array,\r\n message?: string,\r\n}): actionResult => ({\r\n type: actionTypes.SEARCH_FORM_LIST_FETCH_RESULT,\r\n payload: { status, result, message },\r\n receivedAt: Date.now(),\r\n});\r\n\r\nexport const setSearchFormChangesAction = (changes: Object): actionResult => ({\r\n type: actionTypes.SEARCH_FORM_CHANGES,\r\n payload: { changes },\r\n});\r\n\r\nexport const getSearchFormAction = ({\r\n id,\r\n model,\r\n}: {\r\n id: number,\r\n model: Object,\r\n}): actionResult => ({\r\n type: actionTypes.SEARCH_FORM_FETCH_REQUEST,\r\n payload: { id, model, status: Constants.LOADING },\r\n});\r\n\r\nexport const getSearchFormResultAction = ({\r\n status,\r\n result,\r\n message,\r\n}: {\r\n status: ConstantsEnum,\r\n result: SearchFormResultDTO,\r\n message?: string,\r\n}): actionResult => ({\r\n type: actionTypes.SEARCH_FORM_FETCH_RESULT,\r\n payload: { status, result, message },\r\n receivedAt: Date.now(),\r\n});\r\n\r\nexport const searchFormResetAction = (): actionResult => ({\r\n type: actionTypes.SEARCH_FORM_RESET,\r\n});\r\n\r\nexport const setSearchItemAction = ({\r\n searchItem,\r\n}: {\r\n searchItem: SearchItemDTO,\r\n}): actionResult => ({\r\n type: actionTypes.SEARCH_ITEM_SAVE,\r\n payload: { searchItem },\r\n});\r\n\r\nexport const getSearchAction = ({\r\n searchRequest,\r\n}: {\r\n searchRequest: SearchRequestDTO,\r\n}): actionResult => ({\r\n type: actionTypes.SEARCH_FETCH_REQUEST,\r\n payload: { searchRequest, status: Constants.LOADING },\r\n});\r\n\r\nexport const getSearchResultAction = ({\r\n status,\r\n result,\r\n terms,\r\n error,\r\n}: {\r\n status: ConstantsEnum,\r\n result: SearchResultDTO,\r\n terms: Array,\r\n error?: ApiErrorResult,\r\n}): actionResult => ({\r\n type: actionTypes.SEARCH_FETCH_RESULT,\r\n payload: { status, error, result, terms },\r\n receivedAt: Date.now(),\r\n});\r\n\r\nexport const getSearchCountAction = ({\r\n searchRequest,\r\n}: {\r\n searchRequest: SearchRequestDTO,\r\n}): actionResult => ({\r\n type: actionTypes.SEARCH_COUNT_REQUEST,\r\n payload: { searchRequest, status: Constants.LOADING },\r\n});\r\n\r\nexport const getSearchCountResultAction = ({\r\n status,\r\n result,\r\n message,\r\n}: {\r\n status: ConstantsEnum,\r\n result: SearchCountResultDTO,\r\n message?: string,\r\n}): actionResult => ({\r\n type: actionTypes.SEARCH_COUNT_RESULT,\r\n payload: { status, message, ...result },\r\n receivedAt: Date.now(),\r\n});\r\n\r\nexport const renameSearchFavoriteAction = ({\r\n name,\r\n}: {\r\n name: string,\r\n}): actionResult => ({\r\n type: actionTypes.SEARCH_FAVRENAME_REQUEST,\r\n payload: { name },\r\n});\r\n\r\nexport const renameSearchFavoriteResultAction = ({\r\n status,\r\n searchRequest,\r\n message,\r\n}: {\r\n status: ConstantsEnum,\r\n searchRequest: SearchRequestDTO,\r\n message?: string,\r\n}): actionResult => ({\r\n type: actionTypes.SEARCH_FAVRENAME_RESULT,\r\n payload: { status, message, searchRequest },\r\n receivedAt: Date.now(),\r\n});\r\n\r\n//#endregion\r\n\r\n//#region Documents\r\n\r\nexport const docThumbnailRequestAction = (itemUri: string): actionResult => ({\r\n type: actionTypes.DOCS_THUMBNAIL_REQUEST,\r\n payload: { itemUri },\r\n});\r\n\r\nexport const docThumbnailResultAction = ({\r\n itemUri,\r\n result,\r\n status,\r\n message,\r\n}: {\r\n itemUri: string,\r\n result: string,\r\n status: ConstantsEnum,\r\n message?: string,\r\n}): actionResult => ({\r\n type: actionTypes.DOCS_THUMBNAIL_RESULT,\r\n payload: { itemUri, result, status, message },\r\n});\r\n\r\nexport const setDocListViewModeAction = (\r\n viewMode: ListViewModeEnum\r\n): actionResult => ({\r\n type: actionTypes.SETTINGS_DOCLIST_VIEWMODE,\r\n payload: { viewMode },\r\n});\r\n\r\nexport const exportDocsToCsvAction = (): actionResult => ({\r\n type: actionTypes.DOCS_EXPORT_CSV,\r\n});\r\n\r\nexport const getDocsAction = ({\r\n itemUri,\r\n pageNum,\r\n sorts,\r\n filters,\r\n}: {\r\n itemUri: string,\r\n pageNum?: number,\r\n sorts?: Array,\r\n filters?: Array,\r\n}): actionResult => ({\r\n type: actionTypes.DOCS_FETCH_REQUEST,\r\n payload: { itemUri, pageNum, filters, sorts, status: Constants.LOADING },\r\n});\r\n\r\nexport const getDocsResultAction = ({\r\n status,\r\n result,\r\n error,\r\n totalCount,\r\n}: {\r\n status: ConstantsEnum,\r\n result: DocsResultDTO,\r\n error?: Error,\r\n totalCount?: number,\r\n}): actionResult => ({\r\n type: actionTypes.DOCS_FETCH_RESULT,\r\n payload: {\r\n status,\r\n error,\r\n result,\r\n totalCount,\r\n },\r\n receivedAt: Date.now(),\r\n});\r\n\r\n//#endregion\r\n\r\n//#region Settings\r\n\r\nexport const setSettingAction = (\r\n name: string,\r\n value: Object\r\n): actionResult => ({\r\n type: actionTypes.SETTINGS_SET,\r\n payload: { name, value },\r\n});\r\n\r\nexport const setSplitPanesAction = ({\r\n view,\r\n name,\r\n dimensions,\r\n}: {\r\n view: string,\r\n name: string,\r\n dimensions: Array,\r\n}): actionResult => ({\r\n type: actionTypes.SPLITPANES_SET,\r\n payload: { view, name, dimensions },\r\n});\r\n\r\nexport const persistSplitPanesAction = ({\r\n view,\r\n name,\r\n dimensions,\r\n}: {\r\n view: string,\r\n name: string,\r\n dimensions: Array,\r\n}): actionResult => ({\r\n type: actionTypes.SPLITPANES_PERSIST,\r\n payload: { view, name, dimensions },\r\n});\r\n\r\nexport const setSidebarMini = (mini: boolean): actionResult => ({\r\n type: actionTypes.SETTINGS_SIDEBAR_MINI,\r\n payload: { mini },\r\n});\r\n\r\nexport const setCurrentBreadcrumb = ({\r\n breadcrumb,\r\n isFav,\r\n viewName,\r\n}: {\r\n breadcrumb: BreadcrumbResultDTO,\r\n isFav?: boolean,\r\n viewName: string,\r\n}): actionResult => ({\r\n type: actionTypes.CURRENT_BREADCRUMB,\r\n payload: { isFav, breadcrumb, viewName },\r\n});\r\n\r\nexport const setCurrentItemAction = (payload: Object): actionResult => ({\r\n type: actionTypes.CURRENTITEM_SET,\r\n payload,\r\n});\r\n\r\nexport const backupCurrentItemAction = (): actionResult => ({\r\n type: actionTypes.CURRENTITEM_BAK,\r\n});\r\n\r\nexport const restoreCurrentItemAction = (): actionResult => ({\r\n type: actionTypes.CURRENTITEM_RESTORE,\r\n});\r\n\r\nexport const setDocsLayoutAction = (layout?: DocListLayout): actionResult => ({\r\n type: actionTypes.DOCS_LAYOUT_SET,\r\n payload: {\r\n status: Constants.OK,\r\n ...layout,\r\n },\r\n});\r\n\r\nexport const requestDocsLayoutAction = (\r\n itemUri: string,\r\n allowPreFetch?: boolean\r\n): actionResult => ({\r\n type: actionTypes.DOCS_LAYOUT_REQUEST,\r\n payload: { itemUri, allowPreFetch, status: Constants.LOADING },\r\n});\r\n\r\nexport const setDocFilterTextAction = ({\r\n name,\r\n value,\r\n valueType,\r\n operator,\r\n}: docFilterText): actionResult => ({\r\n type: actionTypes.DOCS_FILTERTEXT_SET,\r\n payload: { name, value, valueType, operator },\r\n});\r\n\r\nexport const resetDocFilters = (): actionResult => ({\r\n type: actionTypes.DOCS_FILTERS_RESET,\r\n payload: {},\r\n});\r\n\r\nexport const setDocFilterByRef = (\r\n docContextClick: {\r\n rowIndex: number,\r\n columnIndex: number,\r\n },\r\n resetValues: boolean\r\n): actionResult => ({\r\n type: actionTypes.DOCS_FILTERS_SETBYREF,\r\n payload: { docContextClick, resetValues },\r\n});\r\n\r\nexport const setDocFilterByName = ({\r\n name,\r\n valueType,\r\n value,\r\n operator,\r\n}: {\r\n name: string,\r\n valueType: SearchValueTypeEnum,\r\n value: any,\r\n operator?: DocListFilterOperatorsEnum,\r\n}): actionResult => ({\r\n type: actionTypes.DOCS_FILTERS_SETBYNAME,\r\n payload: { name, valueType, operator, value },\r\n});\r\n\r\n// persist=>TRUE save in long storage,\r\n// parise=>FALSE save only in session cache\r\nexport const saveCurrentItemAction = ({\r\n name,\r\n key,\r\n value,\r\n persist,\r\n}: {\r\n name: string,\r\n key: string,\r\n value: Object,\r\n persist: boolean,\r\n}): actionResult => ({\r\n type: actionTypes.CURRENTITEM_SAVE,\r\n payload: { name, key, value, persist },\r\n});\r\n\r\nexport const currentItemLoadedAction = (value?: Object): actionResult => ({\r\n type: actionTypes.CURRENTITEM_LOADED,\r\n payload: { status: Constants.OK, ...value },\r\n});\r\n\r\n//#endregion\r\n\r\n//#region Forms\r\n\r\nexport const formSetDefaultsAction = (defaults: Object): actionResult => ({\r\n type: actionTypes.FORM_DEFAULTS_SET,\r\n payload: { defaults },\r\n});\r\n\r\nexport const formSetEditModeAction = (\r\n name: string,\r\n isEditMode: boolean\r\n): actionResult => ({\r\n type: actionTypes.FORM_EDITMODE_SET,\r\n payload: { name, isEditMode },\r\n});\r\n\r\nexport const extraAttributesSetTabIndexAction = ({\r\n name,\r\n itemUri,\r\n tabIndex,\r\n}: {\r\n name: string,\r\n itemUri: string,\r\n tabIndex: number,\r\n}): actionResult => ({\r\n type: actionTypes.EA_TABINDEX_SET,\r\n payload: { name, itemUri, tabIndex },\r\n});\r\n\r\nexport const extraAttributesClearAction = (): actionResult => ({\r\n type: actionTypes.EA_CLEAR,\r\n payload: {},\r\n});\r\n\r\nexport const extraAttributesSetDetailViewAction = (\r\n values?: Object\r\n): actionResult => ({\r\n type: actionTypes.EA_DETAILVIEW_SET,\r\n payload: values,\r\n});\r\n\r\nexport const extraAttributesSetField = (\r\n ns: string,\r\n name: string,\r\n value: Object\r\n): actionResult => ({\r\n type: actionTypes.EA_FIELD_SET,\r\n payload: { ns, name, value },\r\n});\r\n\r\nexport const extraAttributesAuditLogUpdateRow = (\r\n name: string,\r\n seqId: string,\r\n values: Array\r\n): actionResult => ({\r\n type: actionTypes.EA_AUDITLOG_UPDATE,\r\n payload: { name, seqId: String(seqId), values },\r\n});\r\n\r\nexport const extraAttributesAuditLogDeleteRow = (\r\n name: string,\r\n seqId: string\r\n): actionResult => ({\r\n type: actionTypes.EA_AUDITLOG_DEL,\r\n payload: { name, seqId: String(seqId) },\r\n});\r\n\r\nexport const extraAttributesAuditLogClearRow = (\r\n name: string,\r\n seqId: string,\r\n values: Array\r\n): actionResult => ({\r\n type: actionTypes.EA_AUDITLOG_CLEAR,\r\n payload: { name, seqId: String(seqId), values },\r\n});\r\n\r\nexport const extraAttributesAuditLogInsertRow = (\r\n name: string,\r\n rowIndex: number,\r\n values: Array\r\n): actionResult => ({\r\n type: actionTypes.EA_AUDITLOG_INSERT,\r\n payload: { name, rowIndex, values },\r\n});\r\n\r\nexport const extraAttributesGridSetCurrentRow = (\r\n name: string,\r\n rowIndex: number,\r\n seqId: string\r\n): actionResult => ({\r\n type: actionTypes.EA_GRID_CURRENTROW,\r\n payload: { name, rowIndex, seqId: String(seqId) },\r\n});\r\n\r\n//#endregion\r\n\r\n//#region ServerSentEvents\r\n\r\nexport const serverEventAction = (evt: any): actionResult => ({\r\n type: actionTypes.GLOBALEVENTS_SERVER,\r\n payload: evt,\r\n receivedAt: Date.now(),\r\n});\r\n\r\n//#endregion\r\n\r\n//#region Offline\r\n\r\nexport /* istanbul ignore next */ const startOfflineSyncAction = (\r\n items?: Array\r\n): actionResult => ({\r\n type: actionTypes.OFFLINE_SYNC_REQUEST,\r\n payload: { items },\r\n receivedAt: Date.now(),\r\n});\r\n\r\nexport const offlineSyncStartedAction = (\r\n {\r\n status,\r\n message,\r\n }: {\r\n status?: OfflineSyncStatusEnum,\r\n message?: string,\r\n } = { status: OfflineSyncStatus.Syncing }\r\n): actionResult => ({\r\n type: actionTypes.OFFLINE_SYNC_STARTED,\r\n payload: { status, message },\r\n receivedAt: Date.now(),\r\n});\r\n\r\nexport const offlineSyncDoneAction = (\r\n {\r\n status,\r\n message,\r\n }: {\r\n status: OfflineSyncStatusEnum,\r\n message?: string,\r\n } = { status: OfflineSyncStatus.Synced }\r\n): actionResult => ({\r\n type: actionTypes.OFFLINE_SYNC_DONE,\r\n payload: { status, message },\r\n receivedAt: Date.now(),\r\n});\r\n\r\nexport /*istanbul ignore next */ const offlineSyncUpdateAction =\r\n (): actionResult => ({\r\n type: actionTypes.OFFLINE_SYNC_UPDATE,\r\n });\r\n\r\nexport const setOfflineItemSyncStatusAction = ({\r\n item,\r\n status,\r\n took,\r\n message,\r\n}: {\r\n item: OfflineItemStatus,\r\n status: OfflineSyncStatusEnum,\r\n took: number,\r\n message?: string,\r\n}): actionResult => ({\r\n type: actionTypes.OFFLINEITEM_SYNC_STATUS,\r\n payload: { status, item, took, message },\r\n receivedAt: Date.now(),\r\n});\r\n\r\nexport const removeOfflineItemAction = (\r\n item: OfflineItemStatus\r\n): actionResult => ({\r\n type: actionTypes.OFFLINEITEM_REMOVE,\r\n payload: { item },\r\n receivedAt: Date.now(),\r\n});\r\n\r\nexport /* istanbul ignore next */ const getOfflineItemDepsMapAction = (\r\n item: OfflineItemStatus\r\n): actionResult => ({\r\n type: actionTypes.OFFLINEITEM_DEPSMAP_REQUEST,\r\n payload: { item },\r\n receivedAt: Date.now(),\r\n});\r\n\r\nexport const setOfflineItemDepsMapAction = (\r\n item: OfflineItemStatus,\r\n depsMap: Object\r\n): actionResult => ({\r\n type: actionTypes.OFFLINEITEM_DEPSMAP_RESULT,\r\n payload: { item, depsMap },\r\n receivedAt: Date.now(),\r\n});\r\n//#endregion\r\n\r\n//#region ServiceWorker\r\nexport const serviceWorkerInitializedAction = ({\r\n registration,\r\n error,\r\n}: {\r\n registration?: ServiceWorkerRegistration,\r\n error?: Error,\r\n}): actionResult => ({\r\n type: actionTypes.SW_INIT,\r\n payload: { registration, error },\r\n receivedAt: Date.now(),\r\n});\r\n\r\nexport const serviceWorkerUpdatedAction = ({\r\n registration,\r\n}: {\r\n registration: ServiceWorkerRegistration,\r\n}): actionResult => ({\r\n type: actionTypes.SW_UPDATE,\r\n payload: { registration },\r\n receivedAt: Date.now(),\r\n});\r\n//#endregion\r\n\r\n//#region Notification\r\nexport const notificationUpsertAction = (\r\n payload: NotificationDTO\r\n): actionResult => ({\r\n type: actionTypes.NOTIFICATION_UPSERT,\r\n payload,\r\n});\r\n\r\nexport const notificationDelAction = (\r\n notificationId: NotificationId\r\n): actionResult => ({\r\n type: actionTypes.NOTIFICATION_DEL,\r\n payload: { notificationId },\r\n});\r\n\r\nexport const notificationStatusAction = (\r\n status: NotificationStatusFlagEnum,\r\n notificationId: NotificationId,\r\n replace: boolean = false\r\n): actionResult => ({\r\n type: actionTypes.NOTIFICATION_STATUS,\r\n payload: { notificationId, status, replace },\r\n});\r\n\r\nexport const notificationClearAction = (\r\n payload: NotificationDTO\r\n): actionResult => ({\r\n type: actionTypes.NOTIFICATION_CLEAR,\r\n payload,\r\n});\r\n\r\nexport const notificationToastAction = (\r\n payload: NotificationDTO\r\n): actionResult => ({\r\n type: actionTypes.NOTIFICATION_TOAST,\r\n payload,\r\n});\r\n//#endregion\r\n\r\n//#region CommandAction\r\nexport const commandActionRequestAction = (\r\n payload: CommandActionRequestDTO\r\n): actionResult => ({\r\n type: actionTypes.COMMANDACTION_REQUEST,\r\n payload: { guid: window.crypto.randomUUID(), ...payload },\r\n});\r\n\r\nexport const commandActionQueueAddAction = (payload): actionResult => ({\r\n type: actionTypes.COMMANDACTION_QUEUE_ADD,\r\n payload,\r\n});\r\nexport const commandActionQueueRemoveAction = (guid: GUID): actionResult => ({\r\n type: actionTypes.COMMANDACTION_QUEUE_REMOVE,\r\n payload: { guid },\r\n});\r\nexport const commandActionQueuePauseAction = (): actionResult => ({\r\n type: actionTypes.COMMANDACTION_QUEUE_PAUSE,\r\n});\r\nexport const commandActionQueueStartAction = (): actionResult => ({\r\n type: actionTypes.COMMANDACTION_QUEUE_START,\r\n});\r\n\r\nexport const commandActionRemoveAction = (guid: GUID): actionResult => ({\r\n type: actionTypes.COMMANDACTION_REMOVE,\r\n payload: { guid },\r\n});\r\n\r\nexport const commandActionAbortAction = (guid: GUID): actionResult => ({\r\n type: actionTypes.COMMANDACTION_ABORT,\r\n payload: { guid },\r\n});\r\n\r\nexport const commandActionLogAction = (\r\n guid: GUID,\r\n log: CommandActionLog\r\n): actionResult => ({\r\n type: actionTypes.COMMANDACTION_LOG,\r\n payload: { guid, log },\r\n});\r\n\r\nexport const commandActionStatusAction = (\r\n guid: GUID,\r\n status: CommandActionStatusFlagEnum,\r\n replace: boolean = false\r\n): actionResult => ({\r\n type: actionTypes.COMMANDACTION_STATUS,\r\n payload: { guid, status, replace },\r\n});\r\n\r\nexport const commandActionItemStatusAction = (\r\n guid: GUID,\r\n itemUri: string,\r\n status: ConstantsEnum\r\n): actionResult => ({\r\n type: actionTypes.COMMANDACTION_ITEM_STATUS,\r\n payload: { guid, itemUri, status },\r\n});\r\n//#endregion\r\n","// @flow\r\nimport React, { type Node, useMemo } from \"react\";\r\nimport styles from \"./Avatar.module.css\";\r\nimport { useSelector } from \"react-redux\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport { getClassNames } from \"data/utils\";\r\n\r\ntype Props = {\r\n id: number,\r\n style?: StyleSheet | Object,\r\n title?: string,\r\n className?: string,\r\n children?: Node,\r\n};\r\n\r\nconst Avatar = ({ id, style, title, className, children }: Props) => {\r\n const isOnline = useSelector(s.isOnlineSelector);\r\n const correlationId = useSelector(s.userCorrelationIdSelector);\r\n\r\n const imgUrl = useMemo(() => {\r\n let result = `${window.CONFIG.host.basename}${window.CONFIG.general.api}/user/avatar/${id}`;\r\n if (isOnline)\r\n result += `?correlationId=${encodeURIComponent(correlationId)}`;\r\n return result;\r\n }, [id, isOnline, correlationId]);\r\n\r\n const avatarStyle = useMemo(\r\n () =>\r\n Object.assign(\r\n {},\r\n {\r\n backgroundImage: `url(${imgUrl})`,\r\n },\r\n style\r\n ),\r\n [imgUrl, style]\r\n );\r\n\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n};\r\nAvatar.displayName = \"Avatar\";\r\nexport default Avatar;\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"expand\":\"FolderTree_expand__1mzmT\",\"noexpand\":\"FolderTree_noexpand__388Tp\",\"listLeft\":\"FolderTree_listLeft__3a5E-\",\"listGroupItem\":\"FolderTree_listGroupItem__3RbNs\",\"treeCount\":\"FolderTree_treeCount__HQ7wx\",\"listGroupItemActive\":\"FolderTree_listGroupItemActive__1zjWs\",\"unfocused\":\"FolderTree_unfocused__hOH3r\",\"elementIcon\":\"FolderTree_elementIcon__3XY-Q\",\"listName\":\"FolderTree_listName__1B74y\",\"hasMore\":\"FolderTree_hasMore__37Bgu\"};","// https://github.com/EventMobi/redux-saga-network-status/blob/master/src/reducer.js\r\n\r\n// // True when we have been online at least once\r\n// hasBeenOnline: false,\r\n// // Whether we have pinged the server at least once\r\n// hasDetectedNetworkStatus: false,\r\n// // Whether the browser is connected to a network\r\n// isNavigatorOnline: false,\r\n// // Whether the server is reachable over the network\r\n// isOnline: false,\r\n// // Whether we are currently pinging the server\r\n// isPinging: false,\r\n// // Number of milliseconds until the next ping attempt\r\n// msUntilNextPing: 0,\r\n// // The most recent ping error\r\n// pingError: null,\r\n\r\nexport const isApiOnlineSelector = (state) => state.network.isOnline;\r\nexport const isNavigatorOnlineSelector = (state) =>\r\n state.network.isNavigatorOnline;\r\nexport const hasDetectedNetworkStatusSelector = (state) =>\r\n state.network.hasDetectedNetworkStatus;\r\nexport const hasBeenOnlineSelector = (state) => state.network.hasBeenOnline;\r\n\r\nexport const isOnlineSelector = (state) =>\r\n hasDetectedNetworkStatusSelector(state)\r\n ? isNavigatorOnlineSelector(state) && isApiOnlineSelector(state)\r\n : isNavigatorOnlineSelector(state); // do not block even if not ping'ed api yet\r\n","// export all selectors at once to make imports easier\r\nimport queryString from \"data/queryString\";\r\nimport { Location } from \"history\";\r\nimport {\r\n favoritesStatusSelector,\r\n favoritesFavoritesSelector,\r\n} from \"./favoritesReducer\";\r\nimport {\r\n userIdSelector,\r\n userStatusSelector,\r\n userCorrelationIdSelector,\r\n userSitesSelector,\r\n userMainNavigationSelector,\r\n userLanguageSelector,\r\n userDecimalSeparator,\r\n userThousandSeparator,\r\n userItemActionsSelector,\r\n userFormActionsSelector,\r\n userHasOfflineItemsSelector,\r\n userIsWfEnabledSelector,\r\n userTopbarItemsSelector,\r\n userIsAdminSelector,\r\n} from \"./userReducer\";\r\nimport {\r\n loginStatusSelector,\r\n loginIdTokenSelector,\r\n loginAccessTokenSelector,\r\n loginExpiresOnSelector,\r\n loginExpiresInSelector,\r\n} from \"./loginReducer\";\r\nimport {\r\n treeStatusSelector,\r\n treeErrorSelector,\r\n treeNodesSelector,\r\n treeIsRootSelector,\r\n treeIsBrowsableSelector,\r\n treeTotalCountSelector,\r\n} from \"./treeReducer\";\r\nimport {\r\n docsItemUriSelector,\r\n docsStatusSelector,\r\n docsPageNumSelector,\r\n docsErrorSelector,\r\n docsColsSelector,\r\n docsRowsSelector,\r\n docsTotalCountSelector,\r\n docsFiltersSelector,\r\n docsSortsSelector,\r\n docsFilterTextSelector,\r\n} from \"./docsReducer\";\r\nimport {\r\n thumbnailStatusSelector,\r\n thumbnailResultSelector,\r\n} from \"./thumbnailsReducer\";\r\nimport {\r\n docsLayoutStatusSelector,\r\n docsLayoutFiltersSelector,\r\n docsLayoutSortsSelector,\r\n} from \"./docsLayoutReducer\";\r\nimport { cardsStatusSelector, cardsCardsSelector } from \"./cardsReducer\";\r\nimport {\r\n workflowStatusSelector,\r\n workflowProvidersSelector,\r\n workflowCardsSelector,\r\n workflowPendingCountSelector,\r\n} from \"./workflowReducer\";\r\nimport {\r\n breadcrumbIsFavSelector,\r\n breadcrumbItemUriSelector,\r\n breadcrumbNameSelector,\r\n breadcrumbLevelsCountSelector,\r\n breadcrumbVersionSelector,\r\n breadcrumbFormatIdSelector,\r\n breadcrumbSiteTypeSelector,\r\n} from \"./breadcrumbReducer\";\r\nimport {\r\n currentStatusSelector,\r\n currentItemUriSelector,\r\n currentNameSelector,\r\n} from \"./currentItemReducer\";\r\nimport {\r\n sidebarMiniSelector,\r\n docListViewModeSelector,\r\n settingValueSelector,\r\n} from \"./settingsReducer\";\r\nimport {\r\n formDetailViewSelector,\r\n formLastChangeSelector,\r\n formAuditLogSelector,\r\n formGridRowIndexSelector,\r\n formGridRowSeqIdSelector,\r\n formDefaultsSelector,\r\n formIsEditModeSelector,\r\n formTabIndexSelector,\r\n} from \"./formReducer\";\r\nimport {\r\n selectedTogglesSelector,\r\n togglesPersistedSelector,\r\n} from \"./togglesReducer\";\r\nimport { panesViewSelector } from \"./panesReducer\";\r\nimport { globalSearchOptionsSelector } from \"./globalSearchReducer\";\r\nimport {\r\n searchStatusSelector,\r\n searchErrorSelector,\r\n searchResultSelector,\r\n searchResultTotalCountSelector,\r\n searchRequestSelector,\r\n searchTermsSelector,\r\n searchItemSelector,\r\n searchFormStatusSelector,\r\n searchFormChangesSelector,\r\n searchFormResultSelector,\r\n searchFormIdSelector,\r\n searchCountStatusSelector,\r\n searchCountResultSelector,\r\n searchCountAggregationsSelector,\r\n} from \"./searchReducer\";\r\nimport {\r\n searchFormListStatusSelector,\r\n searchFormListResultSelector,\r\n searchFormListCountSelector,\r\n} from \"./searchFormsReducer\";\r\nimport {\r\n offlineSyncStatusSelector,\r\n offlineItemsSelector,\r\n offlineItemDepsMapSelector,\r\n} from \"./offlineReducer\";\r\nimport { globalEventsSelector } from \"./globalEventsReducer\";\r\nimport {\r\n isOnlineSelector,\r\n isApiOnlineSelector,\r\n isNavigatorOnlineSelector,\r\n hasDetectedNetworkStatusSelector,\r\n hasBeenOnlineSelector,\r\n} from \"./networkSelectors\";\r\nimport {\r\n isSwInitializedSelector,\r\n isSwFailedSelector,\r\n isSwUpdatedSelector,\r\n swRegistrationSelector,\r\n} from \"./serviceWorkerReducer\";\r\n\r\nimport { notificationSelector } from \"./notificationReducer\";\r\n\r\nimport {\r\n commandActionRequestSelector,\r\n commandActionRequestItemSelector,\r\n} from \"./commandActionReducer\";\r\n\r\nexport const itemUriSelector = (props: Object & { location: Location }) =>\r\n \"pam-item://\" + queryString.parse(props.location.search).uri;\r\n\r\n// export const urlParamSelector = (\r\n// paramName: string,\r\n// props: Object & { location: Location }\r\n// ) => queryString.parse(props.location.search)[paramName];\r\n\r\nexport {\r\n isOnlineSelector,\r\n isApiOnlineSelector,\r\n isNavigatorOnlineSelector,\r\n hasDetectedNetworkStatusSelector,\r\n hasBeenOnlineSelector,\r\n favoritesStatusSelector,\r\n favoritesFavoritesSelector,\r\n userIdSelector,\r\n userStatusSelector,\r\n userSitesSelector,\r\n userMainNavigationSelector,\r\n userLanguageSelector,\r\n userCorrelationIdSelector,\r\n userDecimalSeparator,\r\n userThousandSeparator,\r\n userItemActionsSelector,\r\n userFormActionsSelector,\r\n userHasOfflineItemsSelector,\r\n userIsWfEnabledSelector,\r\n userIsAdminSelector,\r\n userTopbarItemsSelector,\r\n loginStatusSelector,\r\n loginIdTokenSelector,\r\n loginAccessTokenSelector,\r\n loginExpiresOnSelector,\r\n loginExpiresInSelector,\r\n treeStatusSelector,\r\n treeErrorSelector,\r\n treeNodesSelector,\r\n treeIsRootSelector,\r\n treeIsBrowsableSelector,\r\n treeTotalCountSelector,\r\n docsItemUriSelector,\r\n docsStatusSelector,\r\n docsPageNumSelector,\r\n docsErrorSelector,\r\n docsColsSelector,\r\n docsRowsSelector,\r\n docsTotalCountSelector,\r\n docsFiltersSelector,\r\n docsSortsSelector,\r\n thumbnailStatusSelector,\r\n thumbnailResultSelector,\r\n docsFilterTextSelector,\r\n docsLayoutStatusSelector,\r\n docsLayoutFiltersSelector,\r\n docsLayoutSortsSelector,\r\n cardsStatusSelector,\r\n cardsCardsSelector,\r\n workflowStatusSelector,\r\n workflowProvidersSelector,\r\n workflowCardsSelector,\r\n workflowPendingCountSelector,\r\n breadcrumbIsFavSelector,\r\n breadcrumbItemUriSelector,\r\n breadcrumbNameSelector,\r\n breadcrumbLevelsCountSelector,\r\n breadcrumbVersionSelector,\r\n breadcrumbFormatIdSelector,\r\n breadcrumbSiteTypeSelector,\r\n currentStatusSelector,\r\n currentItemUriSelector,\r\n currentNameSelector,\r\n sidebarMiniSelector,\r\n docListViewModeSelector,\r\n settingValueSelector,\r\n formDetailViewSelector,\r\n formLastChangeSelector,\r\n formAuditLogSelector,\r\n formGridRowIndexSelector,\r\n formGridRowSeqIdSelector,\r\n formDefaultsSelector,\r\n formIsEditModeSelector,\r\n formTabIndexSelector,\r\n selectedTogglesSelector,\r\n togglesPersistedSelector,\r\n panesViewSelector,\r\n globalSearchOptionsSelector,\r\n searchStatusSelector,\r\n searchErrorSelector,\r\n searchResultSelector,\r\n searchResultTotalCountSelector,\r\n searchRequestSelector,\r\n searchTermsSelector,\r\n searchItemSelector,\r\n searchCountStatusSelector,\r\n searchCountResultSelector,\r\n searchCountAggregationsSelector,\r\n searchFormStatusSelector,\r\n searchFormResultSelector,\r\n searchFormIdSelector,\r\n searchFormChangesSelector,\r\n searchFormListStatusSelector,\r\n searchFormListResultSelector,\r\n searchFormListCountSelector,\r\n globalEventsSelector,\r\n offlineSyncStatusSelector,\r\n offlineItemsSelector,\r\n offlineItemDepsMapSelector,\r\n isSwInitializedSelector,\r\n isSwFailedSelector,\r\n isSwUpdatedSelector,\r\n swRegistrationSelector,\r\n notificationSelector,\r\n commandActionRequestSelector,\r\n commandActionRequestItemSelector,\r\n};\r\n","import actionTypes from \"../actions/actionTypes\";\r\nimport immutable from \"object-path-immutable\";\r\nimport {\r\n parseSeqId,\r\n isGridRowDeleted,\r\n} from \"components/ExtraAttributes/GridEditorControl/GridUtils\";\r\n\r\nexport const initialState = {\r\n detailView: {},\r\n defaults: {},\r\n isEditMode: {},\r\n \"ea.tab\": {},\r\n};\r\n\r\nconst formReducer = (state = initialState, action) => {\r\n let isNew, seqId;\r\n switch (action.type) {\r\n case actionTypes.EA_AUDITLOG_UPDATE:\r\n return {\r\n ...immutable.merge(\r\n state,\r\n [\r\n action.payload.name,\r\n \"auditLog\",\r\n \"updatedRows\",\r\n action.payload.seqId,\r\n ],\r\n action.payload.values\r\n ),\r\n };\r\n\r\n case actionTypes.EA_AUDITLOG_DEL:\r\n [isNew, seqId] = parseSeqId(action.payload.seqId);\r\n if (isNew) {\r\n return {\r\n ...immutable.del(state, [\r\n action.payload.name,\r\n \"auditLog\",\r\n \"newRows\",\r\n seqId,\r\n ]),\r\n };\r\n }\r\n if (\r\n state[action.payload.name] &&\r\n isGridRowDeleted(state[action.payload.name].auditLog, seqId)\r\n ) {\r\n return state;\r\n }\r\n return {\r\n ...immutable.push(\r\n state,\r\n [action.payload.name, \"auditLog\", \"deletedIds\"],\r\n seqId\r\n ),\r\n };\r\n case actionTypes.EA_AUDITLOG_INSERT:\r\n return {\r\n ...immutable.merge(\r\n state,\r\n [\r\n action.payload.name,\r\n \"auditLog\",\r\n \"newRows\",\r\n action.payload.rowIndex,\r\n ],\r\n action.payload.values\r\n ),\r\n };\r\n\r\n case actionTypes.EA_AUDITLOG_CLEAR:\r\n [isNew, seqId] = parseSeqId(action.payload.seqId);\r\n if (isNew) {\r\n return {\r\n ...immutable.set(\r\n state,\r\n [action.payload.name, \"auditLog\", \"newRows\", seqId],\r\n action.payload.values\r\n ),\r\n };\r\n }\r\n // Clear Updates\r\n let _state = immutable.del(state, [\r\n action.payload.name,\r\n \"auditLog\",\r\n \"updatedRows\",\r\n action.payload.seqId,\r\n ]);\r\n // Clear Deletes\r\n if (\r\n state[action.payload.name] &&\r\n isGridRowDeleted(state[action.payload.name].auditLog, seqId)\r\n ) {\r\n _state = immutable.del(_state, [\r\n action.payload.name,\r\n \"auditLog\",\r\n \"deletedIds\",\r\n state[action.payload.name].auditLog.deletedIds.indexOf(\r\n seqId\r\n ),\r\n ]);\r\n }\r\n return {\r\n ..._state,\r\n };\r\n\r\n case actionTypes.EA_GRID_CURRENTROW:\r\n return {\r\n ...immutable.merge(state, [action.payload.name], {\r\n rowIndex: action.payload.rowIndex,\r\n seqId: action.payload.seqId,\r\n }),\r\n };\r\n\r\n case actionTypes.EA_DETAILVIEW_SET:\r\n if (action.payload == null) {\r\n return { ...state, detailView: {} };\r\n } else {\r\n return {\r\n ...immutable.merge(state, \"detailView\", action.payload),\r\n };\r\n }\r\n\r\n case actionTypes.EA_FIELD_SET:\r\n if (action.payload == null) {\r\n return state;\r\n } else {\r\n return {\r\n ...state,\r\n lastChange: action.payload,\r\n };\r\n }\r\n\r\n case actionTypes.EA_TABINDEX_SET:\r\n return {\r\n ...immutable.merge(\r\n state,\r\n [\"ea.tab\", action.payload.itemUri, action.payload.name],\r\n { tabIndex: action.payload.tabIndex }\r\n ),\r\n };\r\n\r\n case actionTypes.EA_CLEAR:\r\n // make sure not to clear the default form values (set by containers/DefaultValuesHandler)\r\n return {\r\n ...initialState,\r\n defaults: state.defaults,\r\n isEditMode: state.isEditMode,\r\n \"ea.tab\": state[\"ea.tab\"],\r\n };\r\n\r\n case actionTypes.FORM_DEFAULTS_SET:\r\n return { ...initialState, defaults: action.payload.defaults };\r\n\r\n case actionTypes.FORM_EDITMODE_SET:\r\n // if (state.current && state.current.name)\r\n let isEditMode = {};\r\n // HACK tricky to get called to pass in viewName, so we set everything here\r\n if (action.payload.name === \"doc\") {\r\n isEditMode.docmodal = action.payload.isEditMode;\r\n isEditMode.document = action.payload.isEditMode;\r\n } else {\r\n /* istanbul ignore else */ if (\r\n action.payload.name === \"folder\"\r\n ) {\r\n isEditMode.folder = action.payload.isEditMode;\r\n } else alert(\"Unknown form named \" + action.payload.name);\r\n }\r\n return {\r\n ...initialState,\r\n isEditMode,\r\n \"ea.tab\": state[\"ea.tab\"],\r\n };\r\n\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return initialState;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default formReducer;\r\n\r\nexport const formDetailViewSelector = (state: Object) => state.form.detailView;\r\nexport const formLastChangeSelector = (state: Object) => state.form.lastChange;\r\nexport const formAuditLogSelector = (state: Object, name: string) =>\r\n state.form && state.form[name] != null && state.form[name].auditLog != null\r\n ? state.form[name].auditLog\r\n : null;\r\nexport const formGridRowIndexSelector = (state: Object, name: string) =>\r\n state.form && state.form[name] && state.form[name].rowIndex != null\r\n ? state.form[name].rowIndex\r\n : -1;\r\nexport const formGridRowSeqIdSelector = (state: Object, name: string) =>\r\n state.form && state.form[name] && state.form[name].seqId != null\r\n ? state.form[name].seqId\r\n : -1;\r\nexport const formDefaultsSelector = (state: Object) => state.form.defaults;\r\nexport const formIsEditModeSelector = (state: Object, name: string) =>\r\n state.form && state.form.isEditMode[name]\r\n ? state.form.isEditMode[name]\r\n : false;\r\nexport const formTabIndexSelector = (\r\n state: Object,\r\n name: string,\r\n itemUri: string\r\n) =>\r\n state.form &&\r\n state.form[\"ea.tab\"] &&\r\n state.form[\"ea.tab\"][itemUri] &&\r\n state.form[\"ea.tab\"][itemUri][name]\r\n ? state.form[\"ea.tab\"][itemUri][name].tabIndex\r\n : -1;\r\n","var map = {\n\t\"./bg\": [\n\t\t1050,\n\t\t0\n\t],\n\t\"./bg.js\": [\n\t\t1050,\n\t\t0\n\t],\n\t\"./cs\": [\n\t\t1051,\n\t\t1\n\t],\n\t\"./cs.js\": [\n\t\t1051,\n\t\t1\n\t],\n\t\"./de\": [\n\t\t1054,\n\t\t2\n\t],\n\t\"./de-at\": [\n\t\t1052,\n\t\t3\n\t],\n\t\"./de-at.js\": [\n\t\t1052,\n\t\t3\n\t],\n\t\"./de-ch\": [\n\t\t1053,\n\t\t4\n\t],\n\t\"./de-ch.js\": [\n\t\t1053,\n\t\t4\n\t],\n\t\"./de.js\": [\n\t\t1054,\n\t\t2\n\t],\n\t\"./en-gb\": [\n\t\t1055,\n\t\t5\n\t],\n\t\"./en-gb.js\": [\n\t\t1055,\n\t\t5\n\t],\n\t\"./es\": [\n\t\t1056,\n\t\t6\n\t],\n\t\"./es.js\": [\n\t\t1056,\n\t\t6\n\t],\n\t\"./fr\": [\n\t\t1057,\n\t\t7\n\t],\n\t\"./fr.js\": [\n\t\t1057,\n\t\t7\n\t],\n\t\"./hr\": [\n\t\t1058,\n\t\t8\n\t],\n\t\"./hr.js\": [\n\t\t1058,\n\t\t8\n\t],\n\t\"./hu\": [\n\t\t1059,\n\t\t9\n\t],\n\t\"./hu.js\": [\n\t\t1059,\n\t\t9\n\t],\n\t\"./it\": [\n\t\t1060,\n\t\t10\n\t],\n\t\"./it.js\": [\n\t\t1060,\n\t\t10\n\t],\n\t\"./lt\": [\n\t\t1061,\n\t\t11\n\t],\n\t\"./lt.js\": [\n\t\t1061,\n\t\t11\n\t],\n\t\"./ru\": [\n\t\t1062,\n\t\t12\n\t],\n\t\"./ru.js\": [\n\t\t1062,\n\t\t12\n\t],\n\t\"./sk\": [\n\t\t1063,\n\t\t13\n\t],\n\t\"./sk.js\": [\n\t\t1063,\n\t\t13\n\t],\n\t\"./sl\": [\n\t\t1064,\n\t\t14\n\t],\n\t\"./sl.js\": [\n\t\t1064,\n\t\t14\n\t],\n\t\"./uk\": [\n\t\t1065,\n\t\t15\n\t],\n\t\"./uk.js\": [\n\t\t1065,\n\t\t15\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(function() {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn __webpack_require__.e(ids[1]).then(function() {\n\t\treturn __webpack_require__.t(id, 7);\n\t});\n}\nwebpackAsyncContext.keys = function webpackAsyncContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackAsyncContext.id = 1632;\nmodule.exports = webpackAsyncContext;","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"SummaryAttribute_container__2SVTU\",\"wrapper\":\"SummaryAttribute_wrapper__vowL8\",\"caption\":\"SummaryAttribute_caption__xkbEO\",\"value\":\"SummaryAttribute_value__1onpP\",\"avatar\":\"SummaryAttribute_avatar__2LLNl\",\"link\":\"SummaryAttribute_link__2yzxB\"};","import React from \"react\";\r\nimport sharedStyles from \"./SummaryAttribute.module.css\";\r\nimport styles from \"./ValueFacePile.module.css\";\r\nimport Badge from \"react-bootstrap/lib/Badge\";\r\nimport PrincipalAvatar from \"components/User/PrincipalAvatar\";\r\nimport CommandActionHandler from \"components/CommandActions\";\r\nimport loc from \"i18next\";\r\nimport { getClassNames } from \"data/utils\";\r\n\r\nimport { type SummaryAttributeValueFacePile } from \"data/types\";\r\n\r\nconst ValueFacePile = ({\r\n value,\r\n className,\r\n}: {\r\n value: SummaryAttributeValueFacePile,\r\n}) => (\r\n \r\n {value.pile.map((p, index) => (\r\n \r\n ))}\r\n {value.total != null && value.total > value.pile.length && (\r\n \r\n value.onMoreCommand != null &&\r\n CommandActionHandler(\r\n value.onMoreCommand.name,\r\n value.onMoreCommand.props\r\n )\r\n }\r\n >\r\n +{value.total - value.pile.length}\r\n \r\n )}\r\n \r\n);\r\nValueFacePile.displayName = \"AttributeSummaryValue.FacePile\";\r\nexport default ValueFacePile;\r\n","import React, { useMemo } from \"react\";\r\nimport sharedStyles from \"./SummaryAttribute.module.css\";\r\nimport styles from \"./ValueUser.module.css\";\r\nimport Icons from \"@hs/icons\";\r\nimport Avatar from \"components/User/Avatar\";\r\nimport { getClassNames, getLocalizedText } from \"data/utils\";\r\n\r\nimport { type SummaryAttributeValuePrincipal } from \"data/types\";\r\n\r\nconst UserName = ({ value, Component = \"span\", ...props }) => (\r\n \r\n \r\n {value.email && (\r\n \r\n )}\r\n {value.displayName}\r\n \r\n {value.description && {value.description}}\r\n {value.id > -1 && (\r\n \r\n )}\r\n \r\n);\r\n\r\nconst ValueUser = ({\r\n value,\r\n className,\r\n}: {\r\n value: SummaryAttributeValuePrincipal,\r\n className: string,\r\n}) => {\r\n const props = useMemo(\r\n () =>\r\n value.email != null\r\n ? {\r\n href: `mailto:${value.email}`,\r\n rel: \"noopener external noreferrer\",\r\n target: \"_blank\",\r\n title: getLocalizedText(\"$summaryAttribute:user.email\", {\r\n name: value.displayName,\r\n }),\r\n Component: \"a\",\r\n }\r\n : {},\r\n [value.email, value.displayName]\r\n );\r\n\r\n if (value.displayName == null) return null;\r\n return (\r\n \r\n );\r\n};\r\nValueUser.displayName = \"AttributeSummaryValue.User\";\r\nexport default ValueUser;\r\n","import React from \"react\";\r\nimport styles from \"./ValueProgress.module.css\";\r\nimport ProgressBar from \"react-bootstrap/lib/ProgressBar\";\r\nimport { getClassNames } from \"data/utils\";\r\n\r\nimport { type SummaryAttributeValueProgress } from \"data/types\";\r\n\r\nconst ValueProgress = ({\r\n value,\r\n className,\r\n}: {\r\n value: SummaryAttributeValueProgress,\r\n className: string,\r\n}) => {\r\n if (value.progress) {\r\n return (\r\n \r\n {value.progress.map((p, index) => (\r\n \r\n ))}\r\n \r\n );\r\n }\r\n\r\n return null;\r\n};\r\nValueProgress.displayName = \"AttributeSummaryValue.Progress\";\r\nexport default ValueProgress;\r\n","import React, { useMemo } from \"react\";\r\nimport { Img } from \"react-image\";\r\nimport Icons from \"@hs/icons\";\r\n\r\nexport const ValueVisualRules = ({\r\n className,\r\n caption,\r\n value,\r\n}: {\r\n className: string,\r\n caption: string,\r\n value: SummaryAttributeValueVisualRules,\r\n}) => {\r\n const [style, icon] = useMemo(() => {\r\n const style = value.color ? { color: value.color } : undefined;\r\n const icon = value.icon ? (\r\n }\r\n src={value.icon.iconUrl}\r\n alt={caption}\r\n />\r\n ) : null;\r\n return [style, icon];\r\n }, [value, caption]);\r\n return (\r\n \r\n {icon != null && icon} {value.value}\r\n \r\n );\r\n};\r\nValueVisualRules.displayName = \"SummaryAttribute.Value.VisualRules\";\r\n\r\nexport default ValueVisualRules;\r\n","import React, { useCallback } from \"react\";\r\nimport Icons from \"@hs/icons\";\r\nimport { getLocalizedText, getClassNames } from \"data/utils\";\r\nimport styles from \"./ValueEnum.module.css\";\r\n\r\nexport const ValueEnum = ({\r\n className,\r\n caption,\r\n value,\r\n}: {\r\n className: string,\r\n caption: string,\r\n value: SummaryAttributeValueEnum,\r\n}) => {\r\n const renderEnumValue = useCallback(\r\n (enumValue: EnumValue) =>\r\n enumValue ? (\r\n \r\n {enumValue.icon && }{\" \"}\r\n {getLocalizedText(enumValue.label)}\r\n \r\n ) : null,\r\n [caption]\r\n );\r\n return (\r\n \r\n {value.isMulti\r\n ? value.enum\r\n .filter((e) => (value.value & e.value) > 0)\r\n .map((e) => renderEnumValue(e))\r\n : renderEnumValue(\r\n value.enum.find((e) => e.value === value.value)\r\n )}\r\n \r\n );\r\n};\r\nValueEnum.displayName = \"SummaryAttribute.Value.Enum\";\r\n\r\nexport default ValueEnum;\r\n","import React from \"react\";\r\nimport { LinkViewer } from \"components/ExtraAttributes/ViewerControl/LinkViewerControl\";\r\nimport { type SummaryAttributeValueTextLink } from \"data/types\";\r\nimport styles from \"./SummaryAttribute.module.css\";\r\n\r\n/* istanbul ignore next */\r\nconst handleClick = (e: SyntheticEvent) => {\r\n e.stopPropagation();\r\n};\r\n\r\nexport const ValueTextLink = ({\r\n className,\r\n value,\r\n}: {\r\n className: string,\r\n value: SummaryAttributeValueTextLink,\r\n}) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\nValueTextLink.displayName = \"SummaryAttribute.Value.TextLink\";\r\n\r\nexport default ValueTextLink;\r\n","import React from \"react\";\r\nimport { type SummaryAttributeValueFilesize } from \"data/types\";\r\n\r\nexport const ValueFilesize = ({\r\n className,\r\n value,\r\n}: {\r\n className: string,\r\n value: SummaryAttributeValueFilesize,\r\n}) => {\r\n return {value.value};\r\n};\r\nValueFilesize.displayName = \"SummaryAttribute.Value.Filesize\";\r\n\r\nexport default ValueFilesize;\r\n","import React from \"react\";\r\nimport { type SummaryAttributeValueDatetime } from \"data/types\";\r\n\r\nexport const ValueDatetime = ({\r\n className,\r\n value,\r\n}: {\r\n className: string,\r\n value: SummaryAttributeValueDatetime,\r\n}) => {\r\n return (\r\n \r\n {value.value}\r\n \r\n );\r\n};\r\nValueDatetime.displayName = \"SummaryAttribute.Value.Datetime\";\r\n\r\nexport default ValueDatetime;\r\n","import React from \"react\";\r\nimport {\r\n type SummaryAttributeValue,\r\n SummaryAttributeValueType,\r\n} from \"data/types\";\r\nimport styles from \"./SummaryAttribute.module.css\";\r\n\r\nimport ValueFacePile from \"./ValueFacePile\";\r\nimport ValueUser from \"./ValueUser\";\r\nimport ValueProgress from \"./ValueProgress\";\r\nimport ValueVisualRules from \"./ValueVisualRules\";\r\nimport ValueEnum from \"./ValueEnum\";\r\nimport ValueTextLink from \"./ValueTextLink\";\r\nimport ValueFilesize from \"./ValueFilesize\";\r\nimport ValueDatetime from \"./ValueDatetime\";\r\nimport { SimpleAttributeValue } from \"../SimpleAttribute\";\r\n\r\nconst SummaryAttributeValueFactory = (props: {\r\n value: SummaryAttributeValue,\r\n className: boolean,\r\n}) => {\r\n switch (props.value.$type) {\r\n case SummaryAttributeValueType.FacePile:\r\n return ;\r\n\r\n case SummaryAttributeValueType.VisualRules:\r\n return ;\r\n\r\n case SummaryAttributeValueType.Enum:\r\n return ;\r\n\r\n case SummaryAttributeValueType.TextLink:\r\n return ;\r\n\r\n case SummaryAttributeValueType.Filesize:\r\n return ;\r\n\r\n case SummaryAttributeValueType.User:\r\n return ;\r\n\r\n case SummaryAttributeValueType.Progress:\r\n return ;\r\n\r\n case SummaryAttributeValueType.Datetime:\r\n return ;\r\n\r\n // for internal use - will never be passed from the Server\r\n case SummaryAttributeValueType.ReactElement:\r\n return props.value.element;\r\n\r\n default:\r\n return ;\r\n }\r\n};\r\nSummaryAttributeValueFactory.displayName = \"SummaryAttribute.ValueFactory\";\r\nexport default SummaryAttributeValueFactory;\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"reminder\":\"ReminderItem_reminder__2qE4d\",\"date\":\"ReminderItem_date__kKrtv\",\"actions\":\"ReminderItem_actions__hX4vX\",\"avatar\":\"ReminderItem_avatar__SFNdD\",\"reason\":\"ReminderItem_reason__1Vn30\",\"icon\":\"ReminderItem_icon__1nG6x\",\"customAction\":\"ReminderItem_customAction__3j_0d\",\"readonly\":\"ReminderItem_readonly__2Dy5i\",\"error\":\"ReminderItem_error__3O7NC\"};","var map = {\n\t\"./bg_BG\": [\n\t\t1066,\n\t\t16\n\t],\n\t\"./bg_BG.js\": [\n\t\t1066,\n\t\t16\n\t],\n\t\"./cs_CZ\": [\n\t\t1067,\n\t\t17\n\t],\n\t\"./cs_CZ.js\": [\n\t\t1067,\n\t\t17\n\t],\n\t\"./de_DE\": [\n\t\t1068,\n\t\t18\n\t],\n\t\"./de_DE.js\": [\n\t\t1068,\n\t\t18\n\t],\n\t\"./en_US\": [\n\t\t1069,\n\t\t19\n\t],\n\t\"./en_US.js\": [\n\t\t1069,\n\t\t19\n\t],\n\t\"./es_ES\": [\n\t\t1070,\n\t\t20\n\t],\n\t\"./es_ES.js\": [\n\t\t1070,\n\t\t20\n\t],\n\t\"./fr_FR\": [\n\t\t1071,\n\t\t21\n\t],\n\t\"./fr_FR.js\": [\n\t\t1071,\n\t\t21\n\t],\n\t\"./hr_HR\": [\n\t\t1072,\n\t\t22\n\t],\n\t\"./hr_HR.js\": [\n\t\t1072,\n\t\t22\n\t],\n\t\"./hu_HU\": [\n\t\t1073,\n\t\t23\n\t],\n\t\"./hu_HU.js\": [\n\t\t1073,\n\t\t23\n\t],\n\t\"./it_IT\": [\n\t\t1074,\n\t\t24\n\t],\n\t\"./it_IT.js\": [\n\t\t1074,\n\t\t24\n\t],\n\t\"./ru_RU\": [\n\t\t1075,\n\t\t25\n\t],\n\t\"./ru_RU.js\": [\n\t\t1075,\n\t\t25\n\t],\n\t\"./sk_SK\": [\n\t\t1076,\n\t\t26\n\t],\n\t\"./sk_SK.js\": [\n\t\t1076,\n\t\t26\n\t],\n\t\"./sl_SL\": [\n\t\t1077,\n\t\t27\n\t],\n\t\"./sl_SL.js\": [\n\t\t1077,\n\t\t27\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(function() {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn __webpack_require__.e(ids[1]).then(function() {\n\t\treturn __webpack_require__.t(id, 7);\n\t});\n}\nwebpackAsyncContext.keys = function webpackAsyncContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackAsyncContext.id = 1685;\nmodule.exports = webpackAsyncContext;","import store from \"data/store\";\r\nimport { isMiniView, isFeatureOn, type FeatureEnum } from \"data/constants\";\r\nimport { isValidItemUri } from \"data/utils\";\r\nimport bowser from \"data/bowser\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport {\r\n ItemStatuses,\r\n UploadProvider,\r\n SpecialFoldersItemURIs,\r\n SiteType,\r\n type ItemActionConfigBase,\r\n} from \"data/types\";\r\nimport { get } from \"data/constants\";\r\n\r\n/**\r\n * Apply any selection context (itemUri, formatId and isDoc) to existing callback (check_*) function\r\n *\r\n * @param {Function} cb check_* function to apply any selection context to\r\n */\r\nexport const applyAnySelectionContext =\r\n (cb: Function): Function =>\r\n (args: any): boolean => {\r\n const { contextProps } = args;\r\n return check_isMultiSelection(args)\r\n ? contextProps?.items.every((item) =>\r\n cb({\r\n ...args,\r\n ...item,\r\n contextProps: { ...args.contextProps, ...item },\r\n })\r\n )\r\n : cb(args);\r\n };\r\n\r\nexport const check_isFavorite = ({ itemUri }: { itemUri: string }) =>\r\n s.favoritesFavoritesSelector(store.getState()).includes(itemUri);\r\n\r\nexport const check_isDoc = ({ contextProps: { isDoc = false } }) =>\r\n isDoc === true;\r\n\r\nexport const check_isSpecialFolder = ({ itemUri }) =>\r\n Object.values(SpecialFoldersItemURIs).includes(itemUri);\r\n\r\nexport const check_isAdmin = () => s.userIsAdminSelector(store.getState());\r\n\r\nexport const check_isValidItemUri = ({ itemUri }) => isValidItemUri(itemUri);\r\n\r\n// export const check_isSyncEnabled = ({\r\n// itemUri,\r\n// formatId,\r\n// }: {\r\n// itemUri?: string,\r\n// formatId?: number,\r\n// }) => {\r\n// const def = getDefaultsConfig(itemUri, formatId);\r\n// if (def && def.inPointSyncIntegration === false) return false;\r\n// return true;\r\n// };\r\n\r\nexport const check_isOnline = () => s.isOnlineSelector(store.getState());\r\n\r\nexport const check_isWindows = () => bowser.is(\"windows\");\r\n\r\nexport const check_isMiniView = () => isMiniView(window.location);\r\n\r\nexport const check_hasSiteType = ({ contextProps, params }) => {\r\n const siteType = SiteType[params];\r\n if (siteType == null) {\r\n console.warn(`Unknown SiteType: ${params}`);\r\n }\r\n return (\r\n siteType ===\r\n ((contextProps && contextProps.siteType) || SiteType.NotSet)\r\n );\r\n};\r\n\r\n/** returns a property from the contextProps (boolean) */\r\nexport const check_hasContext = ({ contextProps, params }) =>\r\n get(contextProps, params.split(\".\"), false);\r\n\r\nexport const check_licenseAllowEdit = () => window.CONFIG.licenseAllowEdit;\r\n\r\nexport const check_isSyncForced = () =>\r\n window.CONFIG.general.uploadProvider === UploadProvider.Sync;\r\n\r\nexport const check_isSyncUpload = (props) =>\r\n check_isWindows() &&\r\n check_isSyncForced() &&\r\n check_hasContext({\r\n ...props,\r\n params: \"inPointSyncIntegration\",\r\n });\r\n\r\nexport const check_isWorkflowEnabled = () =>\r\n s.userIsWfEnabledSelector(store.getState());\r\n\r\nexport const check_hasItemStatus = ({\r\n contextProps: { itemStatus = ItemStatuses.Nothing },\r\n params,\r\n}) => itemStatus & ItemStatuses[params];\r\n\r\nexport const check_hasSearchType = ({\r\n contextProps: { searchRequest },\r\n params,\r\n}) => {\r\n if (!searchRequest) return false;\r\n return (\r\n searchRequest.searchType === parseInt(params, 10) &&\r\n !searchRequest.isCustom\r\n );\r\n};\r\n\r\n// whether browser supports WebShareAPI (used by CommandActions/share_web)\r\nexport const check_browser_webShareApi = () =>\r\n navigator.share !== undefined && navigator.canShare !== undefined;\r\n\r\nexport const check_hasFeature = ({ name }: { name: FeatureEnum }) =>\r\n isFeatureOn(name);\r\n\r\nexport const check_isMultiSelection = ({ contextProps: { multiple } }) =>\r\n !!multiple;\r\n\r\nexport const check_hasExtension = ({ contextProps: { ext }, params }) =>\r\n String(\r\n ext && ext.startsWith(\".\") ? ext.substring(1) : ext || \"\"\r\n ).toUpperCase() === params.toUpperCase();\r\n\r\nconst checkMapping = {\r\n isOnline: check_isOnline,\r\n isAdmin: check_isAdmin,\r\n isFav: applyAnySelectionContext(check_isFavorite),\r\n isDoc: applyAnySelectionContext(check_isDoc),\r\n isFolder: applyAnySelectionContext((props) => !check_isDoc(props)),\r\n isSpecialFolder: applyAnySelectionContext(check_isSpecialFolder),\r\n isValidItemUri: applyAnySelectionContext(check_isValidItemUri),\r\n isSyncEnabled: (props) =>\r\n check_hasContext({\r\n ...props,\r\n params: \"inPointSyncIntegration\",\r\n }),\r\n isSyncForced: check_isSyncForced,\r\n isSyncUpload: check_isSyncUpload,\r\n isWindows: check_isWindows,\r\n isMiniView: check_isMiniView,\r\n hasSiteType: check_hasSiteType,\r\n hasContext: check_hasContext,\r\n hasFeature: (props) => check_hasFeature({ name: props.params }),\r\n hasBrowser_webShareApi: check_browser_webShareApi,\r\n isCreateAllowed: (props) =>\r\n check_hasContext({ ...props, params: \"isEditAllowed\" }) ||\r\n check_hasContext({ ...props, params: \"isDocAssignmentAllowed\" }),\r\n hasItemStatus: check_hasItemStatus,\r\n isRecycleBin: (props) =>\r\n check_hasItemStatus({ ...props, params: \"Deleted\" }) ||\r\n check_hasItemStatus({ ...props, params: \"ParentDeleted\" }),\r\n hasSearchType: check_hasSearchType,\r\n licenseAllowEdit: check_licenseAllowEdit,\r\n isWorkflowEnabled: check_isWorkflowEnabled,\r\n isAnyOnlineStatus: () => true,\r\n isAnySelection: () => true,\r\n isMultiSelection: check_isMultiSelection,\r\n hasExtension: check_hasExtension,\r\n hasRowAndColId: ({ contextProps }) =>\r\n contextProps.columnIndex != null && contextProps.rowIndex != null,\r\n};\r\n\r\nexport const shouldBeVisible = ({\r\n item,\r\n itemUri,\r\n contextProps,\r\n}: {\r\n item: ItemActionConfigBase,\r\n itemUri: string,\r\n contextProps: ?Object,\r\n}): Promise =>\r\n item.shouldBeVisible?.every((expr) => {\r\n let negate = false;\r\n const split = expr.split(\":\");\r\n let conditionName = split[0];\r\n if (conditionName.startsWith(\"!\")) {\r\n negate = true;\r\n conditionName = conditionName.substr(1);\r\n }\r\n const func = checkMapping[conditionName];\r\n if (func == null) {\r\n console.warn(\"Unknown shouldBeVisible expression: \" + expr);\r\n return false;\r\n }\r\n const result = func({ itemUri, params: split[1], contextProps });\r\n return negate ? !result : result;\r\n }) ?? true;\r\n","var map = {\n\t\"./algoliaProvider.js\": [\n\t\t1766,\n\t\t76\n\t],\n\t\"./bingProvider.js\": [\n\t\t1774,\n\t\t77\n\t],\n\t\"./esriProvider.js\": [\n\t\t1767,\n\t\t78\n\t],\n\t\"./geoApiFrProvider.js\": [\n\t\t1768,\n\t\t79\n\t],\n\t\"./geocodeEarthProvider.js\": [\n\t\t1769,\n\t\t74\n\t],\n\t\"./googleProvider.js\": [\n\t\t1770,\n\t\t80\n\t],\n\t\"./hereProvider.js\": [\n\t\t1775,\n\t\t81\n\t],\n\t\"./index.js\": [\n\t\t1776,\n\t\t71\n\t],\n\t\"./locationIQProvider.js\": [\n\t\t1771,\n\t\t75\n\t],\n\t\"./mapBoxProvider.js\": [\n\t\t1773,\n\t\t82\n\t],\n\t\"./openCageProvider.js\": [\n\t\t1772,\n\t\t83\n\t],\n\t\"./openStreetMapProvider.js\": [\n\t\t1765,\n\t\t84\n\t],\n\t\"./peliasProvider.js\": [\n\t\t1764,\n\t\t85\n\t],\n\t\"./provider.js\": [\n\t\t1763,\n\t\t87\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(function() {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn __webpack_require__.e(ids[1]).then(function() {\n\t\treturn __webpack_require__(id);\n\t});\n}\nwebpackAsyncContext.keys = function webpackAsyncContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackAsyncContext.id = 1696;\nmodule.exports = webpackAsyncContext;","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMAAAADACAYAAABS3GwHAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+g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orkerRegistration\");\r\n\r\n/* istanbul ignore next */\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === \"localhost\" ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === \"[::1]\" ||\r\n // 127.0.0.0/8 are considered localhost for IPv4.\r\n window.location.hostname.match(\r\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n )\r\n);\r\n\r\nexport /* istanbul ignore next */ function register(config, now) {\r\n if (process.env.NODE_ENV === \"production\" && \"serviceWorker\" in navigator) {\r\n // Basename should be here instead of \".\" otherwise the serviceWorker scope is wrong so /mini/ wont work!\r\n // The URL constructor is available in all browsers that support SW.\r\n const publicUrl = new URL(\r\n window.CONFIG.host.basename || \"/\" /*process.env.PUBLIC_URL*/,\r\n window.location.href\r\n );\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n const install = () => {\r\n // Basename should be here instead of \".\" otherwise the serviceWorker scope is wrong so /mini/ wont work!\r\n const swUrl = `${\r\n window.CONFIG.host.basename || \"\" /*process.env.PUBLIC_URL*/\r\n }/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Let's check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl, config);\r\n\r\n // Add some additional logging to localhost, pointing developers to the\r\n // service worker/PWA documentation.\r\n navigator.serviceWorker.ready.then(() => {\r\n _log.info(() => \"Service-Worker is ready!\");\r\n });\r\n } else {\r\n // Is not localhost. Just register service worker\r\n registerValidSW(swUrl, config);\r\n }\r\n };\r\n\r\n if (now === true) install();\r\n else window.addEventListener(\"load\", install);\r\n }\r\n}\r\n\r\n/* istanbul ignore next */\r\nfunction registerValidSW(swUrl, config) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then((registration) => {\r\n _log.trace(\"after register\", registration);\r\n const activeWorker = registration.active;\r\n if (activeWorker != null) {\r\n if (activeWorker.state === \"activated\") {\r\n // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\r\n } else {\r\n activeWorker.onstatechange = () => {\r\n _log.trace(() => ({\r\n msg: \"activeWorker.state\",\r\n state: activeWorker.state,\r\n }));\r\n if (activeWorker.state === \"activated\") {\r\n // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\r\n }\r\n };\r\n }\r\n }\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n if (installingWorker == null) {\r\n return;\r\n }\r\n installingWorker.onstatechange = () => {\r\n _log.trace(() => ({\r\n msg: \"installingWorker.state\",\r\n state: installingWorker.state,\r\n }));\r\n if (installingWorker.state === \"installed\") {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the updated precached content has been fetched,\r\n // but the previous service worker will still serve the older\r\n // content until all client tabs are closed.\r\n _log.info(\r\n () =>\r\n \"New content is available and will be used when all \" +\r\n \"tabs for this page are closed.\"\r\n );\r\n\r\n // Execute callback\r\n if (config && config.onUpdate) {\r\n config.onUpdate(registration);\r\n }\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n _log.info(\r\n () => \"Content is cached for offline use.\"\r\n );\r\n\r\n // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch((error) => {\r\n _log.fatalException(\r\n \"Error during service worker registration\",\r\n error\r\n );\r\n if (config && config.onFailure) {\r\n config.onFailure(error);\r\n }\r\n });\r\n}\r\n\r\n/* istanbul ignore next */\r\nfunction checkValidServiceWorker(swUrl, config) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl, {\r\n headers: { \"Service-Worker\": \"script\" },\r\n })\r\n .then((response) => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get(\"content-type\");\r\n if (\r\n response.status === 404 ||\r\n (contentType != null &&\r\n contentType.indexOf(\"javascript\") === -1)\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then((registration) => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl, config);\r\n }\r\n })\r\n .catch(() => {\r\n _log.info(\r\n () =>\r\n \"No internet connection found. App is running in offline mode.\"\r\n );\r\n });\r\n}\r\n\r\nexport /* istanbul ignore next */ function unregister() {\r\n if (\"serviceWorker\" in navigator) {\r\n navigator.serviceWorker.ready\r\n .then((registration) => {\r\n registration.unregister();\r\n })\r\n .catch((error) => {\r\n _log.fatalException(\r\n \"While un-registering serviceWorker\",\r\n error\r\n );\r\n });\r\n }\r\n}\r\n","import \"core-js/stable\";\r\nimport \"data/extensions\"; // Extension methods for vanilla js objects\r\nimport React from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\nimport Loader from \"components/Loader\";\r\nimport bowser from \"data/bowser\";\r\nimport \"font-awesome/css/font-awesome.css\";\r\nimport \"font-awesome-animation/css/font-awesome-animation.css\";\r\nimport \"bootstrap-no-fonts-no-js/css/bootstrap.css\";\r\nimport \"bootstrap-no-fonts-no-js/css/bootstrap-theme.css\";\r\nimport \"./index.css\";\r\nimport \"@hs/clearable-input/build/ClearableInput.css\";\r\nimport \"@hs/close-button/build/CloseButton.css\";\r\nimport \"@hs/dropdown/build/Dropdown.css\";\r\nimport \"@hs/form-bar/build/FormBar.css\";\r\nimport \"@hs/grid-list/build/GridList.css\";\r\nimport \"@hs/search-input/build/SearchInput.css\";\r\nimport store, { sagaMiddleware } from \"data/store\";\r\nimport { Provider } from \"react-redux\";\r\nimport {\r\n serviceWorkerInitializedAction,\r\n serviceWorkerUpdatedAction,\r\n} from \"data/actions\";\r\nimport * as serviceWorkerRegistration from \"data/offline/serviceWorkerRegistration\";\r\nimport { isFeatureOn, Feature } from \"data/constants\";\r\nimport rootSaga from \"data/sagas/rootSaga\";\r\n\r\n// run the rootSaga which forks all the others\r\nsagaMiddleware.run(rootSaga);\r\n\r\n// import reportWebVitals from \"./reportWebVitals\";\r\n\r\n/* istanbul ignore next */\r\nconst Root = Loader({\r\n loader: () => import(\"containers/Root\" /* webpackChunkName: \"Root\" */),\r\n});\r\n\r\nexport function browserCheck() {\r\n // Browser detection\r\n //console.log(`Browser ${bowser.getBrowserName()} v${bowser.getBrowserVersion()}`, bowser);\r\n // Browser/OS mappings: https://github.com/lancedikson/bowser/blob/master/src/constants.js\r\n /* istanbul ignore next */\r\n if (\r\n !bowser.satisfies({\r\n chrome: \">41\",\r\n edge: \">90\",\r\n firefox: \">89\",\r\n safari: \">13\",\r\n opera: \">76\",\r\n android: \">7\",\r\n iOS: \">13\",\r\n samsung_internet: \">13\",\r\n blackberry: \">10\",\r\n electron: \">10\",\r\n })\r\n ) {\r\n window.alert(\r\n \"Sorry, your Browser or Version is unsupported - see Browser Requirements\"\r\n );\r\n window.location.assign(\r\n \"https://serviceportal.hs.ag/docs/inPoint.Web/docs/admin-gettingstarted.html#client\"\r\n );\r\n return false;\r\n }\r\n return true;\r\n}\r\n\r\n/* istanbul ignore next */\r\nif (browserCheck()) {\r\n if (isFeatureOn(Feature.offline)) {\r\n serviceWorkerRegistration.register({\r\n onSuccess: (registration) => {\r\n store.dispatch(\r\n serviceWorkerInitializedAction({ registration })\r\n );\r\n },\r\n onUpdate: (registration) => {\r\n store.dispatch(serviceWorkerUpdatedAction({ registration }));\r\n },\r\n onFailure: (error) => {\r\n store.dispatch(serviceWorkerInitializedAction({ error }));\r\n },\r\n });\r\n } else {\r\n serviceWorkerRegistration.unregister();\r\n }\r\n\r\n // If you want to start measuring performance in your app, pass a function\r\n // to log results (for example: reportWebVitals(console.log))\r\n // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\r\n // reportWebVitals(console.log);\r\n if (process.env.JEST_WORKER_ID === undefined) {\r\n ReactDOM.render(\r\n // \r\n \r\n \r\n ,\r\n // ,\r\n document.getElementById(\"root\")\r\n );\r\n }\r\n}\r\n","import actionTypes from \"../actions/actionTypes\";\r\nimport { SiteType } from \"data/types\";\r\n\r\nexport const initialState = {};\r\n\r\nconst breadcrumbReducer = (state = initialState, action) => {\r\n switch (action.type) {\r\n case actionTypes.CURRENT_BREADCRUMB:\r\n const { parts } = action.payload.breadcrumb;\r\n return {\r\n ...state,\r\n [action.payload.viewName]: {\r\n ...action.payload.breadcrumb,\r\n isFav: action.payload.isFav,\r\n //viewName: action.payload.viewName,\r\n itemUri:\r\n parts == null ||\r\n !Array.isArray(parts) ||\r\n parts.length === 0\r\n ? undefined\r\n : parts[parts.length - 1].itemUri,\r\n },\r\n };\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return initialState;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default breadcrumbReducer;\r\n\r\nexport const breadcrumbIsFavSelector = (state: Object, name: string) =>\r\n (state.breadcrumb[name] && state.breadcrumb[name].isFav) || false;\r\nexport const breadcrumbItemUriSelector = (state: Object, name: string) =>\r\n state.breadcrumb[name] && state.breadcrumb[name].itemUri;\r\nexport const breadcrumbNameSelector = (state: Object, name: string) =>\r\n state.breadcrumb[name] && state.breadcrumb[name].parts\r\n ? state.breadcrumb[name].parts[state.breadcrumb[name].parts.length - 1]\r\n .text\r\n : \"\";\r\nexport const breadcrumbLevelsCountSelector = (state: Object, name: string) =>\r\n state.breadcrumb[name] && state.breadcrumb[name].parts\r\n ? state.breadcrumb[name].parts.length\r\n : -1;\r\nexport const breadcrumbVersionSelector = (state: Object, name: string) =>\r\n state.breadcrumb[name] && state.breadcrumb[name].version;\r\nexport const breadcrumbFormatIdSelector = (state: Object, name: string) =>\r\n state.breadcrumb[name] && state.breadcrumb[name].formatId;\r\nexport const breadcrumbSiteTypeSelector = (state: Object, name: string) =>\r\n (state.breadcrumb[name] && state.breadcrumb[name].siteType) ||\r\n SiteType.NotSet;\r\n","import actionTypes from \"data/actions/actionTypes\";\r\nimport Constants from \"data/constants\";\r\n\r\nexport const initialState = {\r\n idToken: null,\r\n accessToken: null,\r\n status: Constants.NONE,\r\n expiresOn: null,\r\n};\r\n\r\nconst loginReducer = (state = initialState, action) => {\r\n switch (action.type) {\r\n case actionTypes.LOGIN_RESULT:\r\n return {\r\n ...state,\r\n ...action.payload,\r\n };\r\n case actionTypes.LOGIN_SIGNOUT:\r\n /* istanbul ignore next */\r\n // eslint-disable-next-line no-fallthrough\r\n case actionTypes.PERSIST_PURGE:\r\n return initialState;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default loginReducer;\r\n\r\nexport const loginStatusSelector = (state: Object) => state.login.status;\r\nexport const loginIdTokenSelector = (state: Object) =>\r\n state.login.status === Constants.OK\r\n ? state.login.idToken\r\n : /* istanbul ignore next */ null;\r\nexport const loginAccessTokenSelector = (state: Object) =>\r\n state.login.status === Constants.OK\r\n ? state.login.accessToken\r\n : /* istanbul ignore next */ null;\r\nexport const loginExpiresOnSelector = (state: Object) => state.login.expiresOn;\r\nexport const loginExpiresInSelector = (state: Object) => state.login.expiresIn;\r\n","import React from \"react\";\r\nimport { toast } from \"react-toastify\";\r\nimport Icons from \"@hs/icons\";\r\nimport styles from \"./toast.module.css\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport { withRouter } from \"react-router\";\r\nimport loc from \"i18next\";\r\nimport {\r\n settingValue,\r\n isOnline,\r\n dispatch,\r\n getNotification,\r\n} from \"data/storeHelper\";\r\nimport {\r\n NotificationType,\r\n ToastProps,\r\n ToastType,\r\n NotificationStyle,\r\n NotificationStatusFlag,\r\n} from \"data/types\";\r\nimport { notificationToastAction } from \"data/actions\";\r\nimport { getLocalizedText } from \"data/utils\";\r\nimport globalloc from \"data/i18n.global\";\r\n\r\nexport const toastPosition = toast.POSITION;\r\n\r\nexport const toastId = {\r\n PdfJs: \"pdfjs\",\r\n NetworkStatus: \"network-status\",\r\n NoNetwork: \"offline\",\r\n OfflineChanges: \"offline-changes\",\r\n ServiceWorker: \"sw\",\r\n ServiceWorkerOfflineQueue: \"swoq\",\r\n UppyInfo: \"uppy-info\",\r\n UppyRecovered: \"uppy-recovered\",\r\n UppySuccess: \"uppy-success\",\r\n};\r\n\r\nexport const toastTypes: Object = {\r\n refresh: {\r\n icon: \"refresh\",\r\n style: NotificationStyle.Info,\r\n autoClose: false,\r\n details: /* istanbul ignore next */ ({ handleClick }) => (\r\n \r\n {loc.t(\"globalEvents:refresh.button\")}\r\n \r\n ),\r\n toastId: \"refresh\",\r\n },\r\n success: {\r\n style: NotificationStyle.Success,\r\n },\r\n partial: {\r\n style: NotificationStyle.Warning,\r\n },\r\n failure: {\r\n style: NotificationStyle.Error,\r\n },\r\n uppyComplete: {\r\n message: \"$upload:complete\",\r\n style: NotificationStyle.Success,\r\n toastId: toastId.UppySuccess,\r\n },\r\n uppyError: {\r\n style: NotificationStyle.Error,\r\n toastId: toastId.UppyInfo,\r\n },\r\n uppyRecovered: {\r\n icon: \"upload\",\r\n style: NotificationStyle.Info,\r\n toastId: toastId.UppyRecovered,\r\n isRouted: true,\r\n },\r\n uppyInfo: {\r\n icon: \"upload\",\r\n style: NotificationStyle.Info,\r\n toastId: toastId.UppyInfo,\r\n },\r\n uppyResuming: {\r\n message: \"$upload:resuming\",\r\n icon: \"upload\",\r\n style: NotificationStyle.Info,\r\n },\r\n pdfSignature: {\r\n toastId: toastId.PdfJs,\r\n style: NotificationStyle.Warning,\r\n autoClose: false,\r\n position: toast.POSITION.TOP_CENTER,\r\n },\r\n swReady: {\r\n message: globalloc.cache.done,\r\n toastId: toastId.ServiceWorker,\r\n icon: \"cloud-download\",\r\n style: NotificationStyle.Info,\r\n },\r\n swFailed: {\r\n message: globalloc.cache.failed,\r\n toastId: toastId.ServiceWorker,\r\n style: NotificationStyle.Error,\r\n },\r\n swReload: {\r\n message: globalloc.cache.reload,\r\n toastId: toastId.ServiceWorker,\r\n icon: \"cloud-download\",\r\n style: NotificationStyle.Info,\r\n },\r\n swOfflineQueueAdd: {\r\n toastId: toastId.ServiceWorkerOfflineQueue,\r\n icon: \"cloud-download\",\r\n style: NotificationStyle.Info,\r\n autoClose: true,\r\n message: \"$common:offline.add\",\r\n },\r\n swOfflineQueueAddFile: {\r\n toastId: toastId.ServiceWorkerOfflineQueue,\r\n icon: \"cloud-download\",\r\n style: NotificationStyle.Info,\r\n autoClose: true,\r\n message: \"$common:offline.addFile\",\r\n },\r\n offlinePendingChanges: {\r\n message: \"$common:offline.pending\",\r\n icon: \"hourglass-2\",\r\n style: NotificationStyle.Info,\r\n toastId: toastId.OfflineChanges,\r\n },\r\n};\r\n\r\nexport const Toast = ({\r\n message,\r\n icon,\r\n details,\r\n handleClick,\r\n style,\r\n ...rest\r\n}: ToastProps) => (\r\n
\r\n {icon && }\r\n {message}\r\n {typeof details === \"function\" && (\r\n
{details({ handleClick })}
\r\n )}\r\n
\r\n);\r\n\r\nexport const RoutedToast = withRouter(Toast);\r\n\r\n/**\r\n * will toast a message depending on @see {ToastType}\r\n *\r\n * @param {ToastType} toastType\r\n */\r\nexport const toastStyled = ({\r\n message,\r\n style,\r\n icon,\r\n status = NotificationStatusFlag.New,\r\n ...toast\r\n}: ToastType): Notification | string => {\r\n dispatch(\r\n notificationToastAction({\r\n notificationId: toast?.toastId,\r\n icon,\r\n message: getLocalizedText(message),\r\n timestamp: Date.now(),\r\n style,\r\n status,\r\n toast,\r\n })\r\n );\r\n};\r\n\r\nexport const dismissToast = (toastId: ToastId) => {\r\n const { toast: notification } = getNotification(toastId);\r\n settingValue(\"notificationType\") === NotificationType.API\r\n ? notification?.close()\r\n : toast.dismiss(toastId);\r\n};\r\n\r\n/**\r\n * will toast a success/failure message depending on @see {success}\r\n *\r\n * @param {boolean} success\r\n * @param {string} locPrefix localization name prefix (will append .success or .failure accordingly)\r\n * @param {any} locParams localization parameters\r\n */\r\nexport const toastActionResult = (\r\n success: boolean,\r\n locPrefix: string,\r\n locParams?: any,\r\n toastId?: string\r\n): void => {\r\n //#56010 in case of success+!isOnline there should be no toast\r\n if (success && !isOnline()) return;\r\n const message = success\r\n ? loc.t(locPrefix + \".success\", locParams)\r\n : loc.t(locPrefix + \".failure\", locParams);\r\n const type = toastTypes[success ? \"success\" : \"failure\"];\r\n toastStyled({ ...type, message, toastId });\r\n};\r\n","// @flow\r\nimport React from \"react\";\r\nimport globalloc from \"data/i18n.global\";\r\n\r\nconst Loading = ({\r\n isLoading,\r\n pastDelay,\r\n error,\r\n}: {\r\n isLoading: boolean,\r\n pastDelay: boolean,\r\n error: boolean,\r\n}) => {\r\n if (isLoading) {\r\n // While our other component is loading...\r\n /*if (props.timedOut) {\r\n // In case we've timed out loading our other component.\r\n return
Loader timed out!
;\r\n } else*/ if (\r\n pastDelay\r\n ) {\r\n // Display a loading screen after a set delay.\r\n return
{globalloc.modules.loading}
;\r\n } else {\r\n // Don't flash \"Loading...\" when we don't need to.\r\n return null;\r\n }\r\n } else if (error) {\r\n console.error(\"Loader error\", error);\r\n // If we aren't loading, maybe\r\n return
{globalloc.modules.error}
;\r\n } else {\r\n // This case shouldn't happen... but we'll return null anyways.\r\n return null;\r\n }\r\n};\r\n\r\nexport default Loading;\r\n","// @flow\r\nimport React from \"react\";\r\nimport Status from \"./index\";\r\nimport Constants from \"data/constants\";\r\n\r\nconst Loading = ({\r\n isLoading,\r\n pastDelay,\r\n error,\r\n}: {\r\n isLoading: boolean,\r\n pastDelay: boolean,\r\n error: boolean,\r\n}) => {\r\n if (!pastDelay && isLoading) return null;\r\n let status = error ? Constants.ERROR : Constants.LOADING;\r\n return ;\r\n};\r\n\r\nexport default Loading;\r\n","//@flow\r\nimport Loadable from \"react-loadable\";\r\nimport Loading from \"./Loading\";\r\nimport StatusLoading from \"components/Status/Loading\";\r\nimport { LoadingType, type LoadingTypeEnum } from \"data/types\";\r\n\r\nconst getDefaltsByLoadingType = (loadingType: LoadingTypeEnum) => {\r\n switch (loadingType) {\r\n case LoadingType.Default:\r\n return {\r\n loading: Loading,\r\n delay: 5000,\r\n timeout: 10,\r\n };\r\n case LoadingType.Status:\r\n return {\r\n loading: StatusLoading,\r\n delay: 0,\r\n timeout: 10,\r\n };\r\n /* istanbul ignore next */\r\n default:\r\n console.warn(\"Unknown LoadingType provided for Loader\");\r\n }\r\n};\r\n\r\ntype LoaderOptions = {\r\n loading: React.Node,\r\n delay: number,\r\n timeout: number,\r\n};\r\n\r\nconst Loader = (\r\n opts: LoaderOptions,\r\n loadingType: LoadingTypeEnum = LoadingType.Default\r\n) => Loadable(Object.assign(getDefaltsByLoadingType(loadingType), opts));\r\n\r\nexport default Loader;\r\n","// https://github.com/ReactTraining/react-router/blob/master/FAQ.md#how-do-i-access-the-history-object-outside-of-components\r\nimport { createBrowserHistory } from \"history\";\r\nimport { get } from \"data/constants\";\r\n\r\nexport default createBrowserHistory({\r\n basename: get(window.CONFIG, [\"host\", \"basename\"], \"\"),\r\n});\r\n","//@flow\r\nimport React, {\r\n useState,\r\n useCallback,\r\n useMemo,\r\n useRef,\r\n useEffect,\r\n useContext,\r\n} from \"react\";\r\nimport { MultiSelectionContext } from \"data/context\";\r\nimport { createPortal } from \"react-dom\";\r\nimport { getDisplayName } from \"data/constants\";\r\nimport ActionsButton from \"components/ActionPanel/ActionsButton\";\r\nimport styles from \"./StickyToggle.module.css\";\r\nimport { isHandheld } from \"data/bowser\";\r\n\r\ntype Config = {\r\n // Wheather to render a DIV tag (e.g. if the wrapped component does not support a ref or mouse events)\r\n renderDiv: boolean,\r\n usePortal: boolean,\r\n portalTargetSelector: string,\r\n portalTargetSelectionMethod: \"pop\" | \"shift\",\r\n //\r\n getStyle: ({\r\n node: React.DOMElement,\r\n isActive: boolean,\r\n isHovered: boolean,\r\n }) => CSStyleDefinition,\r\n rowIndexProp: number,\r\n isActiveProp: string,\r\n isHoveredProp: string,\r\n // props name for onClick callback of ActionsButton\r\n actionsHandlerProp: string,\r\n // props name for disabled boolean of ActionsButton\r\n actionsDisabledProp: string,\r\n // Callback to check if item should be rendered at all; defaults to true\r\n shouldRender: () => boolean,\r\n};\r\n\r\nconst DEFAULT_CONFIG = {\r\n renderDiv: true,\r\n usePortal: true,\r\n portalTargetSelector: \"#root\",\r\n portalTargetSelectionMethod: \"pop\",\r\n getStyle: /* istanbul ignore next*/ ({ node }) => ({\r\n position: \"absolute\",\r\n transform: \"translateX(-100%)\",\r\n zIndex: 99,\r\n top: node?.getBoundingClientRect().y,\r\n left: window.innerWidth,\r\n }),\r\n rowIndexProp: \"index\",\r\n isActiveProp: \"isActive\",\r\n isHoveredProp: \"isHovered\",\r\n actionsHandlerProp: \"onMoreClick\",\r\n actionsDisabledProp: \"actionsDisabled\",\r\n shouldRender: () => true,\r\n};\r\n\r\ntype Props = {\r\n style?: CSStyleDefinition,\r\n onMoreClick: () => void,\r\n};\r\n\r\nconst withStickyToggle =\r\n ({\r\n renderDiv = DEFAULT_CONFIG.renderDiv,\r\n usePortal = DEFAULT_CONFIG.usePortal,\r\n portalTargetSelector = DEFAULT_CONFIG.portalTargetSelector,\r\n portalTargetSelectionMethod = DEFAULT_CONFIG.portalTargetSelectionMethod,\r\n getStyle = DEFAULT_CONFIG.getStyle,\r\n rowIndexProp = DEFAULT_CONFIG.rowIndexProp,\r\n isActiveProp = DEFAULT_CONFIG.isActiveProp,\r\n isHoveredProp = DEFAULT_CONFIG.isHoveredProp,\r\n actionsHandlerProp = DEFAULT_CONFIG.actionsHandlerProp,\r\n actionsDisabledProp = DEFAULT_CONFIG.actionsDisabledProp,\r\n shouldRender = DEFAULT_CONFIG.shouldRender,\r\n }: Config = DEFAULT_CONFIG) =>\r\n (WrappedComponent: ComponentType) => {\r\n const HOC = ({\r\n style,\r\n onMouseEnter,\r\n onMouseLeave,\r\n ...props\r\n }: Props) => {\r\n /* istanbul ignore next */\r\n const { multiple, isSelected } = useContext(\r\n MultiSelectionContext\r\n ) || {\r\n multiple: false,\r\n isSelected: (index: number) => false,\r\n };\r\n const divRef = useRef(null);\r\n const actionsHandler = props[actionsHandlerProp];\r\n const actionsDisabled = props[actionsDisabledProp];\r\n const isActive = multiple\r\n ? isSelected(props[rowIndexProp])\r\n : props[isActiveProp];\r\n const isHovered = props[isHoveredProp];\r\n const [show, setShow] = useState(isHandheld());\r\n const handleMouseEnter = useCallback(\r\n (...p) => {\r\n setShow(true);\r\n /* istanbul ignore else */\r\n if (typeof onMouseEnter === \"function\") {\r\n onMouseEnter(...p);\r\n }\r\n },\r\n [onMouseEnter]\r\n );\r\n\r\n const handleMouseLeave = useCallback(\r\n (...p) => {\r\n setShow(isHandheld());\r\n /* istanbul ignore else */\r\n if (typeof onMouseLeave === \"function\") {\r\n onMouseLeave(...p);\r\n }\r\n },\r\n [onMouseLeave]\r\n );\r\n\r\n const handleClick = useCallback(\r\n (...p) => {\r\n const [event] = p;\r\n event.stopPropagation();\r\n /* istanbul ignore else */\r\n if (typeof actionsHandler === \"function\") {\r\n actionsHandler(...p);\r\n }\r\n },\r\n [actionsHandler]\r\n );\r\n const wrapperProps = useMemo(\r\n () => ({\r\n divRef: renderDiv ? null : divRef,\r\n onMouseEnter: handleMouseEnter,\r\n onMouseLeave: handleMouseLeave,\r\n }),\r\n [handleMouseEnter, handleMouseLeave]\r\n );\r\n\r\n const calculatedStyle = Object.assign(\r\n getStyle({\r\n node: divRef.current,\r\n isActive,\r\n isHovered,\r\n }),\r\n {\r\n opacity: show ? 1 : 0,\r\n },\r\n style\r\n );\r\n\r\n // Get Target from DOM\r\n const getPortalTarget = useCallback(\r\n () =>\r\n [...document.querySelectorAll(portalTargetSelector)]?.[\r\n portalTargetSelectionMethod\r\n ](),\r\n []\r\n );\r\n\r\n // Handle Portal Target (if DOM is not rendered yet)\r\n const [portalTarget, setPortalTarget] = useState(getPortalTarget());\r\n useEffect(() => {\r\n /* istanbul ignore next */\r\n if (portalTarget == null) {\r\n setPortalTarget(getPortalTarget);\r\n }\r\n }, [portalTarget, getPortalTarget]);\r\n\r\n return (\r\n <>\r\n \r\n {renderDiv && (\r\n \r\n )}\r\n {shouldRender(props) &&\r\n show &&\r\n typeof actionsHandler === \"function\" &&\r\n (usePortal ? (\r\n /*istanbul ignore next */ portalTarget &&\r\n createPortal(\r\n ,\r\n portalTarget\r\n )\r\n ) : (\r\n \r\n ))}\r\n \r\n );\r\n };\r\n HOC.displayName = `withStickyToggle(${getDisplayName(\r\n WrappedComponent\r\n )})`;\r\n return HOC;\r\n };\r\n\r\nexport default withStickyToggle;\r\n","import { isHandheld } from \"data/bowser\";\r\n\r\nconst GridList = ({ node, isActive, isHovered }) => {\r\n const config = {\r\n outer: \".ReactVirtualized__Grid\",\r\n inner: \".ReactVirtualized__Grid__innerScrollContainer\",\r\n };\r\n const outer = node?.closest(config.outer);\r\n const inner = node?.closest(config.inner);\r\n const rect = {\r\n current: node?.getBoundingClientRect(),\r\n outer: outer?.getBoundingClientRect(),\r\n inner: inner?.getBoundingClientRect(),\r\n };\r\n const rgb = isActive\r\n ? \"0,152,170\"\r\n : isHovered\r\n ? \"245,245,245\"\r\n : \"255,255,255\";\r\n const borderColor = isActive\r\n ? `rgb(${rgb})`\r\n : isHovered\r\n ? \"#ededed\"\r\n : \"#ededed\";\r\n const scrollbarWidth = !isHandheld() ? 17 : 0;\r\n const scrollbarHeight =\r\n !isHandheld() && rect.outer?.width < rect.inner?.width ? 16 : 0;\r\n const style = {\r\n position: \"absolute\",\r\n transform: \"translateX(-100%)\",\r\n zIndex: 99,\r\n // Scroll container\r\n top: rect.current?.y + 1 - (rect.outer?.y - outer?.scrollTop),\r\n left:\r\n rect.outer?.width < rect.inner?.width + scrollbarWidth\r\n ? rect.outer?.width +\r\n outer?.scrollLeft -\r\n (rect.outer?.height - scrollbarHeight < rect.inner?.height\r\n ? scrollbarWidth\r\n : 0)\r\n : rect.inner?.width,\r\n // Root\r\n // top: rect.current?.y + 1,\r\n // left:\r\n // rect.outer?.x +\r\n // (rect.outer?.width < rect.inner?.width\r\n // ? rect.outer?.width -\r\n // (rect.outer?.height < rect.inner?.height && !isHandheld()\r\n // ? 17\r\n // : 0)\r\n // : rect.inner?.width),\r\n minHeight: 40,\r\n color: isActive ? \"white\" : \"black\",\r\n // Box Layout\r\n /*minWidth: 37,\r\n background: `rgb(${rgb})`,\r\n borderLeft: `1px solid ${borderColor}`,\r\n borderBottom: `1px solid ${borderColor}`,*/\r\n // Gradient Layout\r\n minWidth: 42,\r\n justifyContent: \"flex-end\",\r\n background: `linear-gradient(90deg, rgba(${rgb},0) 0%, rgba(${rgb},1) 50%)`,\r\n };\r\n if (isHandheld()) {\r\n style.transform = \"translate(-100%, -1px) translateX(-1px)\";\r\n style.minWidth = undefined;\r\n style.background = `rgb(${rgb})`;\r\n style.borderLeft = `1px solid ${borderColor}`;\r\n style.borderBottom = `1px solid ${borderColor}`;\r\n style.minHeight = 42;\r\n }\r\n return style;\r\n};\r\n\r\nconst List = ({ node, isActive, isHovered }) => {\r\n return {\r\n position: \"absolute\",\r\n transform: \"translateX(-100%)\",\r\n zIndex: 99,\r\n top: 1,\r\n left: \"100%\",\r\n color: isActive ? \"white\" : \"black\",\r\n minHeight: 32,\r\n };\r\n};\r\n\r\nconst StickyToggleStyle = {\r\n List,\r\n GridList,\r\n};\r\nexport default StickyToggleStyle;\r\n","import { getDisplayName } from \"data/constants\";\r\nimport { useOfflineHandler } from \"hooks\";\r\n\r\nconst withOfflineHandler = (WrappedComponent) => {\r\n const HOC = (props) => {\r\n const offlineHandler = useOfflineHandler({\r\n itemUri: props.itemUri,\r\n name: props.name,\r\n });\r\n return ;\r\n };\r\n HOC.displayName = `withOfflineHandler(${getDisplayName(WrappedComponent)})`;\r\n return HOC;\r\n};\r\n\r\nexport default withOfflineHandler;\r\n","import React from \"react\";\r\nimport styles from \"./SummaryAttribute.module.css\";\r\nimport { type SummaryAttributeDTO } from \"data/types\";\r\nimport ValueFactory from \"./ValueFactory\";\r\n\r\nconst SummaryAttribute = ({\r\n attribute,\r\n useDefaultStyle = false,\r\n}: {\r\n attribute: SummaryAttributeDTO,\r\n useDefaultStyle: boolean,\r\n}) => {\r\n /* istanbul ignore if */\r\n if (attribute == null || attribute.value == null) return null;\r\n return (\r\n \r\n \r\n {attribute.caption}\r\n {\" \"}\r\n \r\n \r\n );\r\n};\r\nSummaryAttribute.displayName = \"SummaryAttribute\";\r\nexport default SummaryAttribute;\r\n","import React from \"react\";\r\nimport { type SummaryAttributeDTO } from \"data/types\";\r\nimport SimpleAttribute from \"./SimpleAttribute\";\r\nimport SummaryAttribute from \"./SummaryAttribute\";\r\n\r\nexport const AttributeFactory = ({\r\n attribute,\r\n useDefaultStyle,\r\n}: {\r\n attribute: SummaryAttributeDTO | Array,\r\n useDefaultStyle?: boolean,\r\n}) => {\r\n return Array.isArray(attribute) ? (\r\n \r\n ) : (\r\n \r\n );\r\n};\r\nAttributeFactory.displayName = \"AttributeFactory\";\r\n\r\nconst Attributes = ({\r\n attributes,\r\n className,\r\n style,\r\n useDefaultStyle = true,\r\n}: {\r\n attributes: Array>,\r\n className?: string,\r\n style?: CSStyleDefinition,\r\n useDefaultStyle?: boolean,\r\n}) => (\r\n
\r\n {attributes.map((attribute, index) => (\r\n \r\n ))}\r\n
\r\n);\r\nAttributes.displayName = \"Attributes\";\r\nexport default Attributes;\r\n","// @flow\r\nimport React, { PureComponent } from \"react\";\r\nimport loc from \"i18next\";\r\nimport { ParseLocation } from \"components/MapViewer/utils\";\r\nimport GeoPlaceInput from \"components/GeoPlaceInput\";\r\nimport FormGroup from \"react-bootstrap/lib/FormGroup\";\r\nimport InputGroup from \"react-bootstrap/lib/InputGroup\";\r\nimport Icons from \"@hs/icons\";\r\nimport styles from \"./PlaceInput.module.css\";\r\n\r\ntype Props = {\r\n /** callback when user sets location */\r\n onChange: (location: Location) => void,\r\n};\r\n\r\n/**\r\n * MapModal's Places search input\r\n */\r\nclass PlaceInput extends PureComponent {\r\n _onChangePlace = (location: string) => {\r\n if (typeof this.props.onChange === \"function\") {\r\n const latlng = ParseLocation(location);\r\n if (latlng != null) {\r\n this.props.onChange(latlng);\r\n }\r\n }\r\n };\r\n\r\n render = () => (\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 PlaceInput;\r\n","// @flow\r\nimport React, { PureComponent } from \"react\";\r\nimport Modal from \"components/Modal\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport {\r\n type MapLocationInfo,\r\n type Location,\r\n type MapEditLocationResult,\r\n} from \"data/types\";\r\nimport loc from \"i18next\";\r\nimport { createModal } from \"react-modal-promise\";\r\nimport { SupportGeoPlaceInput } from \"components/MapViewer/providerSupport\";\r\nimport MapViewer from \"components/MapViewer\";\r\nimport PlaceInput from \"./PlaceInput\";\r\nimport Icons from \"@hs/icons\";\r\nimport styles from \"./MapModal.module.css\";\r\n\r\ntype Props = {\r\n /** current itemUri */\r\n itemUri: string,\r\n /** react-modal-promise: whether to show dialog */\r\n open: boolean,\r\n /** react-modal-promise: callback when user closes Dialog */\r\n close: () => void,\r\n /** name of provider to use\r\n * @default null retrieve default mapProvider from config.general.geo.name\r\n */\r\n mapProvider: ?string,\r\n /** callback when the user clicks the Set button\r\n * @param {MapEditLocationResult} editLocationResult latitude and longitude (or Radius, or Area) of user editing\r\n */\r\n onSet: ?(editLocationResult: MapEditLocationResult) => void,\r\n /** label to show on Button\r\n * @default common:map.setPosition\r\n */\r\n setButtonLabel?: string,\r\n /** list of locations (markers / areas) to show on the map */\r\n locations: ?Array,\r\n /** whether to render a \"center\" draggable pin marker\r\n * @default false\r\n */\r\n useMarker?: boolean,\r\n /** the current radius circle (in meters) - used by GeoRadiusInput */\r\n radius?: number,\r\n /** whether to show place input box (geocoding) */\r\n usePlaceInput?: boolean,\r\n /** optional modal title\r\n * @default {string} common:map.title\r\n */\r\n title?: string,\r\n};\r\n\r\ntype State = {\r\n viewerLoaded: boolean,\r\n};\r\n\r\nclass MapModal extends PureComponent {\r\n mapRef: { current: null | MapViewer };\r\n\r\n static defaultProps = {\r\n usePlaceInput: true,\r\n };\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n this.mapRef = React.createRef();\r\n this.state = {\r\n viewerLoaded: false,\r\n };\r\n }\r\n\r\n _onSet = () => {\r\n /* istanbul ignore else */\r\n if (this.mapRef != null && this.mapRef.current != null) {\r\n const editLocation = this.mapRef.current.GetEditLocationResult();\r\n /* istanbul ignore else */\r\n if (typeof this.props.onSet === \"function\")\r\n this.props.onSet(editLocation);\r\n this.props.close();\r\n }\r\n };\r\n\r\n _onChangeFromPlaceInput = (location: Location) =>\r\n this.mapRef.current.SetCenterMarker(location);\r\n\r\n _showGeoInput = (): boolean =>\r\n this.props.usePlaceInput === true &&\r\n SupportGeoPlaceInput() &&\r\n this.props.useMarker === true &&\r\n this.props.locations != null &&\r\n this.props.locations.length > 0 &&\r\n this.props.locations[0].allowEdit !== false;\r\n\r\n _onViewerLoad = (success: boolean) =>\r\n this.setState({ viewerLoaded: success });\r\n\r\n render = () => (\r\n \r\n \r\n \r\n {\" \"}\r\n {this.props.title || loc.t(\"common:map.title\")}\r\n \r\n \r\n \r\n \r\n \r\n {this.state.viewerLoaded &&\r\n typeof this.props.onSet === \"function\" && (\r\n \r\n {this._showGeoInput() && (\r\n \r\n )}\r\n \r\n {this.props.setButtonLabel ||\r\n loc.t(\"common:map.setPosition\")}\r\n \r\n \r\n )}\r\n \r\n );\r\n}\r\nMapModal.displayName = \"MapModal\";\r\nexport default MapModal;\r\nexport const openMapModal = createModal(MapModal);\r\n","import React, { useCallback, useState, useEffect, useMemo } from \"react\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { usePrevious } from \"hooks\";\r\nimport { persistTogglesAction } from \"data/actions\";\r\nimport { getDisplayName } from \"data/constants\";\r\nimport getToggles from \"data/toggles\";\r\nimport queryString from \"data/queryString\";\r\nimport isEqual from \"lodash/isEqual\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport produce from \"immer\";\r\n\r\ntype Props = {\r\n /** Current URL location */\r\n location?: Location,\r\n /** Selected Toggles from props */\r\n toggles?: Array,\r\n /** Viewname from props */\r\n viewName?: string,\r\n};\r\n\r\ntype Config = {\r\n viewName?: string,\r\n onInit?: () => void,\r\n};\r\n\r\n// will manage initially loading default localized toggles\r\n// and changing local state based on selectedToggles\r\nconst TogglesHandler =\r\n ({ viewName, onInit }: Config): Node =>\r\n (WrappedComponent: ReactClass) => {\r\n const HOC = ({\r\n toggles: selectedTogglesFromProps,\r\n viewName: viewNameFromProps,\r\n location,\r\n ...props\r\n }: Props) => {\r\n /* istanbul ignore next */\r\n const usedViewName = viewName || viewNameFromProps;\r\n const prevSelectedTogglesFromProps = usePrevious(\r\n selectedTogglesFromProps\r\n );\r\n const togglesFromViewName = useMemo(\r\n () =>\r\n produce(getToggles(usedViewName), (draft) => {\r\n /* istanbul ignore else */\r\n if (typeof onInit === \"function\") {\r\n onInit(draft);\r\n }\r\n }),\r\n [usedViewName]\r\n );\r\n const [toggles, setToggles] = useState(togglesFromViewName);\r\n const allowMultiple = useSelector(\r\n (state) => state.browser.greaterThanOrEqual.medium\r\n );\r\n const prevAllowMultiple =\r\n usePrevious(allowMultiple) ?? allowMultiple;\r\n const dispatch = useDispatch();\r\n const selectedTogglesFromStore = useSelector((state) =>\r\n s.selectedTogglesSelector(state, usedViewName)\r\n );\r\n const prevSelectedTogglesFromStore = usePrevious(\r\n selectedTogglesFromStore\r\n );\r\n const selectedTogglesFromQueryString = useMemo(\r\n () =>\r\n queryString\r\n .parse(location?.search ?? \"\")\r\n ?.toggles?.split(\",\"),\r\n [location?.search]\r\n );\r\n const prevSelectedTogglesFromQueryString = usePrevious(\r\n selectedTogglesFromQueryString\r\n );\r\n const [selectedToggles, setSelectedToggles] = useState(\r\n togglesFromViewName.toggles\r\n .filter((t) => t.isSelected)\r\n .map((t) => t.value)\r\n );\r\n const prevSelectedToggles =\r\n usePrevious(selectedToggles) || selectedToggles;\r\n const handleSetToggles = useCallback(\r\n (toggles, persist = true) => {\r\n const selectedToggles = toggles.toggles\r\n .filter((t) => t.isSelected)\r\n .map((t) => t.value);\r\n setSelectedToggles(\r\n selectedToggles.length\r\n ? selectedToggles\r\n : [\r\n toggles.toggles.find((t) => !t.isDisabled)\r\n ?.value,\r\n ]\r\n );\r\n setToggles(toggles);\r\n persist &&\r\n dispatch(\r\n persistTogglesAction(usedViewName, toggles.toggles)\r\n );\r\n },\r\n [dispatch, usedViewName]\r\n );\r\n\r\n const availableToggles = toggles.toggles\r\n .filter((t) => !t.isHidden)\r\n .map((t) => t.value);\r\n\r\n // handle selected toggles from store\r\n useEffect(() => {\r\n if (selectedTogglesFromStore == null) return;\r\n if (\r\n isEqual(selectedToggles, selectedTogglesFromStore) ||\r\n isEqual(\r\n prevSelectedTogglesFromStore,\r\n selectedTogglesFromStore\r\n )\r\n )\r\n return;\r\n // console.log(\r\n // \"aaa\",\r\n // \"selectedTogglesFromStore\",\r\n // selectedTogglesFromStore\r\n // );\r\n if (\r\n selectedTogglesFromStore.some((t) =>\r\n availableToggles.includes(t)\r\n )\r\n )\r\n setSelectedToggles(selectedTogglesFromStore);\r\n else setSelectedToggles([availableToggles[0]]);\r\n }, [\r\n selectedToggles,\r\n prevSelectedTogglesFromStore,\r\n selectedTogglesFromStore,\r\n availableToggles,\r\n ]);\r\n\r\n // handle selected toggles from props\r\n useEffect(() => {\r\n if (selectedTogglesFromProps == null) return;\r\n if (\r\n isEqual(selectedToggles, selectedTogglesFromProps) ||\r\n isEqual(\r\n prevSelectedTogglesFromProps,\r\n selectedTogglesFromProps\r\n )\r\n )\r\n return;\r\n // console.log(\r\n // \"aaa\",\r\n // \"selectedTogglesFromProps\",\r\n // selectedTogglesFromProps\r\n // );\r\n setSelectedToggles(selectedTogglesFromProps);\r\n }, [\r\n selectedToggles,\r\n prevSelectedTogglesFromProps,\r\n selectedTogglesFromProps,\r\n ]);\r\n\r\n // handle selected toggles from query string\r\n useEffect(() => {\r\n if (selectedTogglesFromQueryString == null) return;\r\n if (\r\n isEqual(selectedToggles, selectedTogglesFromQueryString) ||\r\n isEqual(\r\n prevSelectedTogglesFromQueryString,\r\n selectedTogglesFromQueryString\r\n )\r\n )\r\n return;\r\n // console.log(\r\n // \"aaa\",\r\n // \"selectedTogglesFromQueryString\",\r\n // selectedTogglesFromQueryString\r\n // );\r\n const validToggles = selectedTogglesFromQueryString.filter(\r\n (t) => availableToggles.includes(t)\r\n );\r\n if (validToggles.length < 1) {\r\n const msg =\r\n \"[TogglesHandler] Invalid toggle names provided. Please read the docs to setup properly.\";\r\n alert(msg);\r\n console.error(\r\n msg,\r\n selectedTogglesFromQueryString,\r\n \"https://serviceportal.hs.ag/docs/inPoint.Web/docs/feature-integration-miniviews.html#view-toggles\"\r\n );\r\n } else {\r\n if (\r\n validToggles.length !==\r\n selectedTogglesFromQueryString.length\r\n ) {\r\n console.warn(\r\n \"[TogglesHandler] Not all provided toggles can be set\",\r\n \"https://serviceportal.hs.ag/docs/inPoint.Web/docs/feature-integration-miniviews.html#view-toggles\"\r\n );\r\n }\r\n /* istanbul ignore else */ if (\r\n !isEqual(selectedToggles, validToggles)\r\n ) {\r\n setSelectedToggles(validToggles);\r\n }\r\n }\r\n }, [\r\n selectedToggles,\r\n prevSelectedTogglesFromQueryString,\r\n selectedTogglesFromQueryString,\r\n toggles.toggles,\r\n availableToggles,\r\n ]);\r\n\r\n const handleToggleChange = useCallback(\r\n (map) => {\r\n const togglesBySelected = produce(toggles, (draft) => {\r\n draft.isMultiple =\r\n allowMultiple && togglesFromViewName.isMultiple;\r\n /* istanbul ignore else */ if (\r\n typeof map === \"function\"\r\n )\r\n draft.toggles = draft.toggles.map(map);\r\n });\r\n if (!isEqual(toggles, togglesBySelected)) {\r\n // console.log(\"aaa\", \"handleToggleChange\");\r\n setToggles(togglesBySelected);\r\n dispatch(\r\n persistTogglesAction(\r\n usedViewName,\r\n togglesBySelected.toggles\r\n )\r\n );\r\n }\r\n },\r\n [\r\n toggles,\r\n usedViewName,\r\n dispatch,\r\n allowMultiple,\r\n togglesFromViewName.isMultiple,\r\n ]\r\n );\r\n\r\n useEffect(() => {\r\n if (allowMultiple === prevAllowMultiple) return;\r\n const isMultiple =\r\n togglesFromViewName.isMultiple && allowMultiple;\r\n // console.log(\"aaa\", \"allowMultiple changed\", allowMultiple);\r\n let hasSelection = false;\r\n handleToggleChange((toggle) => {\r\n toggle.isSelected =\r\n toggle.isSelected &&\r\n (isMultiple || (!isMultiple && !hasSelection));\r\n if (toggle.isSelected) {\r\n hasSelection = true;\r\n }\r\n return toggle;\r\n });\r\n }, [\r\n handleToggleChange,\r\n allowMultiple,\r\n prevAllowMultiple,\r\n togglesFromViewName.isMultiple,\r\n ]);\r\n\r\n // Effect to fix selected toggles\r\n useEffect(() => {\r\n if (isEqual(prevSelectedToggles, selectedToggles)) return;\r\n // console.log(\"aaa\", \"selectedToggles effect\", selectedToggles);\r\n handleToggleChange((toggle) => {\r\n toggle.isSelected = selectedToggles.includes(toggle.value);\r\n return toggle;\r\n });\r\n }, [prevSelectedToggles, selectedToggles, handleToggleChange]);\r\n\r\n return (\r\n \r\n );\r\n };\r\n HOC.displayName = `TogglesHandler(${getDisplayName(WrappedComponent)})`;\r\n return HOC;\r\n };\r\n\r\nexport default TogglesHandler;\r\n","import actionTypes from \"data/actions/actionTypes\";\r\nimport Constants from \"data/constants\";\r\n\r\nconst initialState = {\r\n nodes: [],\r\n status: Constants.NONE,\r\n error: undefined,\r\n isRoot: undefined,\r\n isBrowsable: undefined,\r\n totalCount: 0,\r\n};\r\n\r\nconst treeReducer = (state = initialState, action) => {\r\n switch (action.type) {\r\n case actionTypes.TREE_SET_STATUS:\r\n return {\r\n ...state,\r\n status: action.payload.status,\r\n };\r\n case actionTypes.TREE_FETCH_REQUEST:\r\n return {\r\n ...state,\r\n itemUri: action.payload.itemUri,\r\n status: action.payload.status,\r\n // ...action.payload,\r\n };\r\n case actionTypes.TREE_FETCH_RESULT:\r\n return { ...state, ...action.payload };\r\n\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return initialState;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default treeReducer;\r\n\r\n// ------ selectors\r\n\r\nexport const treeNodesSelector = (state: Object) => state.tree.nodes;\r\nexport const treeStatusSelector = (state: Object) => state.tree.status;\r\nexport const treeErrorSelector = (state: Object) => state.tree.error;\r\nexport const treeIsRootSelector = (state: Object) => !!state.tree.isRoot;\r\nexport const treeIsBrowsableSelector = (state: Object) =>\r\n state.tree.isBrowsable;\r\nexport const treeTotalCountSelector = (state: Object) => state.tree.totalCount;\r\n","// @flow\r\nimport React, {\r\n useRef,\r\n useEffect,\r\n useCallback,\r\n type ComponentType,\r\n} from \"react\";\r\nimport { useEffectOnce, usePrevious } from \"hooks\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport isEqual from \"lodash/isEqual\";\r\nimport Split from \"split.js\";\r\nimport panesDefaultState from \"data/panes\";\r\nimport { getDisplayName } from \"data/constants\";\r\nimport { setSplitPanesAction, persistSplitPanesAction } from \"data/actions\";\r\nimport {\r\n panesViewSelector,\r\n selectedTogglesSelector,\r\n} from \"data/reducers/selectors\";\r\n\r\ntype Props = {\r\n viewName?: string,\r\n};\r\n\r\ntype Config = {\r\n viewName?: string,\r\n paneIds: Array,\r\n toggleIds: Array,\r\n direction?: string,\r\n};\r\n\r\nconst SplitPanes =\r\n ({ viewName, paneIds, toggleIds, direction = \"vertical\" }: Config) =>\r\n (WrappedComponent: ComponentType) => {\r\n const HOC = ({\r\n viewName: viewNameFromProps,\r\n selectedToggles: selectedTogglesFromProps,\r\n ...props\r\n }: Props) => {\r\n const split1 = useRef();\r\n const split2 = useRef();\r\n /* istanbul ignore next */\r\n const usedViewName = viewName || viewNameFromProps;\r\n const panes = useSelector((state) =>\r\n panesViewSelector(state, usedViewName)\r\n );\r\n const selectedToggles =\r\n useSelector((state) =>\r\n selectedTogglesSelector(state, usedViewName)\r\n ) || selectedTogglesFromProps;\r\n const prevSelectedToggles = usePrevious(selectedToggles);\r\n const dispatch = useDispatch();\r\n const handleDispatch = useCallback(\r\n ({\r\n persist,\r\n ...action\r\n }: {\r\n persist: boolean,\r\n view: string,\r\n name: number,\r\n dimensions: Array,\r\n }) =>\r\n dispatch(\r\n persist\r\n ? persistSplitPanesAction(action)\r\n : setSplitPanesAction(action)\r\n ),\r\n [dispatch]\r\n );\r\n\r\n const setSplitSizes = useCallback(\r\n (paneIdx: number, dimensions: Array) => {\r\n /* istanbul ignore else */\r\n if (paneIdx === 0) {\r\n split1.current?.setSizes(dimensions);\r\n } else if (paneIdx === 1) {\r\n split2.current?.setSizes(dimensions);\r\n } else {\r\n alert(\"Unknown paneIdx=\" + paneIdx);\r\n }\r\n },\r\n []\r\n );\r\n useEffectOnce(() => {\r\n let paneIdx = 0;\r\n split1.current = Split(\r\n [paneIds[paneIdx++], paneIds[paneIdx++]],\r\n {\r\n sizes: panes[0],\r\n direction:\r\n paneIds.length === 2\r\n ? direction /*\"vertical\"*/\r\n : \"horizontal\",\r\n minSize: 0,\r\n gutterSize: 10,\r\n onDragEnd: () => {\r\n // adjust toggles based on panes' dimensions\r\n const dimensions = split1.current.getSizes();\r\n\r\n handleDispatch({\r\n persist: true,\r\n view: usedViewName,\r\n name: 0,\r\n dimensions,\r\n });\r\n },\r\n\r\n elementStyle: /* istanbul ignore next */ (\r\n dimension,\r\n size,\r\n gutterSize\r\n ) => {\r\n return {\r\n \"flex-basis\":\r\n \"calc(\" +\r\n size +\r\n \"% - \" +\r\n gutterSize +\r\n \"px)\",\r\n };\r\n },\r\n gutterStyle: /* istanbul ignore next */ (\r\n dimension,\r\n gutterSize\r\n ) => {\r\n return { \"flex-basis\": gutterSize + \"px\" };\r\n },\r\n }\r\n );\r\n\r\n if (paneIdx < paneIds.length) {\r\n split2.current = Split(\r\n [paneIds[paneIdx++], paneIds[paneIdx++]],\r\n {\r\n sizes: panes[1],\r\n minSize: 0,\r\n gutterSize: 10,\r\n direction: \"vertical\",\r\n onDragEnd: () => {\r\n handleDispatch({\r\n persist: true,\r\n view: usedViewName,\r\n name: 1,\r\n dimensions: split2.current.getSizes(),\r\n });\r\n },\r\n elementStyle: /* istanbul ignore next */ (\r\n dimension,\r\n size,\r\n gutterSize\r\n ) => {\r\n return {\r\n \"flex-basis\":\r\n \"calc(\" +\r\n size +\r\n \"% - \" +\r\n gutterSize +\r\n \"px)\",\r\n };\r\n },\r\n gutterStyle: /* istanbul ignore next */ (\r\n dimension,\r\n gutterSize\r\n ) => {\r\n return { \"flex-basis\": gutterSize + \"px\" };\r\n },\r\n }\r\n );\r\n }\r\n });\r\n useEffect(() => {\r\n if (paneIds.length === 2) {\r\n split1.current.setSizes(panes[0]);\r\n } else {\r\n split1.current.setSizes(panes[0]);\r\n split2.current.setSizes(panes[1]);\r\n }\r\n }, [panes]);\r\n useEffect(() => {\r\n if (selectedToggles == null) return;\r\n /* istanbul ignore if */\r\n if (isEqual(prevSelectedToggles, selectedToggles)) return;\r\n if (paneIds.length === 2) {\r\n let master = panesDefaultState[usedViewName][0].slice(0);\r\n if (!selectedToggles.includes(toggleIds[0])) {\r\n master = [0, 100];\r\n } else if (!selectedToggles.includes(toggleIds[1])) {\r\n master = [100, 0];\r\n }\r\n\r\n split1.current.setSizes(master);\r\n handleDispatch({\r\n persist: prevSelectedToggles != null, //Do not persist initial set of toggles\r\n view: usedViewName,\r\n name: 0,\r\n dimensions: master,\r\n });\r\n } else {\r\n let master = panesDefaultState[usedViewName][0].slice(0);\r\n\r\n if (!selectedToggles.includes(toggleIds[0])) {\r\n master = [0, 100];\r\n }\r\n\r\n let slave = panesDefaultState[usedViewName][1].slice(0);\r\n if (!selectedToggles.includes(toggleIds[1])) slave[0] = 0;\r\n if (!selectedToggles.includes(toggleIds[2])) slave[1] = 0;\r\n if (\r\n !selectedToggles.includes(toggleIds[1]) &&\r\n !selectedToggles.includes(toggleIds[2]) &&\r\n selectedToggles.includes(toggleIds[0])\r\n ) {\r\n master = [100, 0];\r\n }\r\n if (\r\n selectedToggles.includes(toggleIds[1]) &&\r\n !selectedToggles.includes(toggleIds[2])\r\n ) {\r\n slave[0] = 100;\r\n } else if (\r\n !selectedToggles.includes(toggleIds[1]) &&\r\n selectedToggles.includes(toggleIds[2])\r\n ) {\r\n slave[1] = 100;\r\n }\r\n\r\n split1.current.setSizes(master);\r\n handleDispatch({\r\n persist: prevSelectedToggles != null, //Do not persist initial set of toggles\r\n view: usedViewName,\r\n name: 0,\r\n dimensions: master,\r\n });\r\n split2.current.setSizes(slave);\r\n handleDispatch({\r\n persist: prevSelectedToggles != null, //Do not persist initial set of toggles\r\n view: usedViewName,\r\n name: 1,\r\n dimensions: slave,\r\n });\r\n }\r\n }, [\r\n handleDispatch,\r\n selectedToggles,\r\n prevSelectedToggles,\r\n usedViewName,\r\n ]);\r\n return (\r\n \r\n );\r\n };\r\n HOC.displayName = `SplitPanes(${getDisplayName(WrappedComponent)})`;\r\n return HOC;\r\n };\r\n\r\nexport default SplitPanes;\r\n","// @flow\r\nimport { type ConstantsEnum } from \"./constants\";\r\nimport { toast } from \"react-toastify\";\r\n\r\nexport type Dictionary = { [key: K]: T };\r\n\r\n// --------- ApiCatalog\r\n\r\nexport const HttpMethod = {\r\n GET: \"GET\", // default\r\n PUT: \"PUT\",\r\n DELETE: \"DELETE\",\r\n POST: \"POST\",\r\n HEAD: \"HEAD\",\r\n};\r\nexport type HttpMethodEnum = $Values;\r\n\r\nexport const ContentType = {\r\n NONE: -1,\r\n AUTO: 0, // default (identify json / text by Response.ContentType)\r\n JSON: 1,\r\n BLOB: 2,\r\n TEXT: 3,\r\n};\r\nexport type ContentTypeEnum = $Values;\r\n\r\n// https://developers.google.com/web/tools/workbox/modules/workbox-strategies\r\nexport const CacheStrategy = {\r\n None: -1,\r\n StaleWhileRevalidate: 0,\r\n CacheFirst: 1,\r\n NetworkFirst: 2,\r\n NetworkOnly: 3,\r\n CacheOnly: 4,\r\n};\r\nexport type CacheStrategyEnum = $Values;\r\n\r\n/** Default Cache Name used by service-worker */\r\nexport const DEFAULT_CACHE_NAME = \"api\";\r\n\r\nexport type OfflineSettings = {\r\n /**\r\n * Whether offline editing is allowed. Will then be by data/offline/offlineQueue.js\r\n * @default {boolean} false\r\n */\r\n allowEdit?: boolean,\r\n /**\r\n * Whether to show user a toast that item has been queued\r\n * @default {boolean} false\r\n */\r\n showToast?: boolean,\r\n /**\r\n * Result object to return when called offline\r\n */\r\n transformer?: (params: Object) => Object,\r\n};\r\n\r\nexport type CacheSettings = {\r\n /**\r\n * Workbox Cache strategy to use\r\n * @description https://developers.google.com/web/tools/workbox/modules/workbox-strategies\r\n * @default CacheStrategy.NetworkOnly\r\n * @type {CacheStrategyEnum}\r\n */\r\n strategy?: CacheStrategyEnum,\r\n\r\n /**\r\n * Specify which params to use when creating the cacheKey\r\n */\r\n keyParams?: (params) => Object,\r\n\r\n // ApiManagerMakeAvailableOffline will transform result before caching\r\n transformer?: (data: Object) => Object,\r\n\r\n depsAnalyzer: (data: FormResultDTO, params: Object) => Array,\r\n};\r\n\r\nexport type ApiMethod = {\r\n url: string,\r\n /**\r\n * @default HttpMethod.GET\r\n * @type {HttpMethodEnum}\r\n */\r\n method?: HttpMethodEnum,\r\n params?: Object,\r\n contentType: ContentTypeEnum,\r\n cache?: boolean | CacheSettings,\r\n offline?: OfflineSettings,\r\n};\r\n\r\nexport type ApiMethodRef = {\r\n name: string,\r\n params?: Object,\r\n signal?: AbortSignal,\r\n};\r\n\r\n// const OperationTypeEnum = {\r\n// ReadOnly: 0,\r\n// WriteOnly: 1,\r\n// WriteResilient: 2,\r\n// }\r\n// when resilient -> connect to which Readonly method should return it (+transformer)\r\n\r\nexport const CustomHttpHeader = {\r\n /** name of HTTP header for CacheStrategy passed by ApiManager and parsed by service-worker.js */\r\n CacheStrategy: \"X-WB-CACHE-STRATEGY\",\r\n /** name of HTTP header for custom CacheKey passed by ApiManager and parsed by service-worker.js */\r\n CacheKey: \"X-WB-CACHE-KEY\",\r\n /** used by the server to correlate logging events (in Root.js) */\r\n CorrelationId: \"x-correlation-id\",\r\n /** Bearer token */\r\n Authorization: \"authorization\",\r\n /** instead not using standard Authorization header */\r\n CustomAuthorization: \"X-inPoint-Auth\",\r\n /** used to pass original secureParams token */\r\n SecureParams: \"X-SECURE-PARAMS\",\r\n /** \"1\"=running /mini/ view, \"0\"=full */\r\n MiniView: \"X-MINI-VIEW\",\r\n /** itemUri when storing in offline queue */\r\n OfflineItemUri: \"x-wb-api-uri\",\r\n /** apiCatalog.name ref when storing in offline queue */\r\n OfflineApiName: \"x-wb-api-name\",\r\n /** used by the server/Controllers to identify offline requests; \"true\" when online */\r\n OfflineSync: \"x-wb-sync\",\r\n};\r\n\r\n// --------- Offline\r\n\r\nexport type OfflineQueueItem = {\r\n name: string,\r\n params?: any,\r\n retries?: number,\r\n error?: any,\r\n};\r\n\r\nexport const OfflineQueueItemType = {\r\n ApiCall: \"api\",\r\n UppyFile: \"uppy\",\r\n};\r\nexport type OfflineQueueItemTypeEnum = $Values;\r\n\r\n// --------- Toggles\r\n\r\nexport type ToggleItemDTO = {\r\n value: string,\r\n text: string,\r\n icon?: string,\r\n count?: number,\r\n status?: string,\r\n isSelected: boolean,\r\n isHidden?: boolean,\r\n isDisabled?: boolean,\r\n};\r\n\r\nexport type ToggleDTO = {\r\n name: string,\r\n isMultiple: boolean,\r\n toggles: Array,\r\n};\r\n\r\n// --------- SiteItems\r\n\r\nexport const SiteType = {\r\n NotSet: 0,\r\n GlobalSites: 1,\r\n MySites: 2,\r\n SharedSites: 3,\r\n RecycleBin: 4,\r\n MailBox: 5,\r\n AUSites: 6,\r\n};\r\nexport type SiteTypeEnum = $Values;\r\n\r\nexport const ViewNameType = {\r\n folder: 0,\r\n flat: 1,\r\n mailbox: 2,\r\n};\r\nexport type ViewNameTypeEnum = $Values;\r\n\r\nexport const SystemWebDavName = {\r\n GlobalSite: \"GLOBALSITE\",\r\n MySite: \"MYSITE\",\r\n SharedSite: \"SHARESITE\",\r\n MailBox: \"MAILBOX\",\r\n RecycleBin: \"RECYCLEBIN\",\r\n};\r\nexport type SystemWebDavNameEnum = $Values;\r\n\r\nexport const SidebarItemSource = {\r\n System: 0,\r\n Custom: 1,\r\n User: 2,\r\n Offline: 3,\r\n};\r\nexport type SidebarItemSourceEnum = $Values;\r\n\r\nexport type SidebarItemDTO = {\r\n id?: string,\r\n source: SidebarItemSourceEnum,\r\n webDavName: SystemWebDavNameEnum | string,\r\n caption: string,\r\n itemUri: string,\r\n mini: boolean,\r\n siteType: SiteTypeEnum,\r\n viewName: ViewNameTypeEnum,\r\n shouldBeVisible?: Array,\r\n};\r\n\r\n// --------- Breadcrumb\r\n\r\nexport type BreadcrumbPartDTO = {\r\n text: string,\r\n itemUri: string,\r\n};\r\n\r\nexport type BreadcrumbResultDTO = {\r\n text: string,\r\n siteType: SiteTypeEnum,\r\n parts: Array,\r\n itemUri?: string,\r\n version?: number,\r\n formatId: number,\r\n};\r\n\r\n// --------- NavigationItems\r\n\r\nexport const NavigationItemType = {\r\n Home: \"home\",\r\n News: \"news\",\r\n Report: \"report\",\r\n Search: \"search\",\r\n SearchResult: \"searchResult\",\r\n Wf: \"wf\",\r\n Upload: \"upload\",\r\n CommandAction: \"commandAction\",\r\n};\r\nexport type NavigationItemTypeEnum = $Values;\r\n\r\nexport type CommandActionPropsDTO = {\r\n name: string,\r\n props?: Object,\r\n};\r\n\r\nexport type NavigationItemDTO = {\r\n id: string,\r\n type: NavigationItemTypeEnum,\r\n icon: ?string,\r\n title: ?string,\r\n description: ?string,\r\n href: ?string,\r\n commandAction: ?CommandActionPropsDTO,\r\n shouldBeVisible?: Array,\r\n};\r\n\r\n// ------ Attributes\r\n\r\nexport const SummaryAttributeValueType = {\r\n FacePile: \"face-pile\",\r\n Group: \"group\",\r\n User: \"user\",\r\n Progress: \"progress\",\r\n VisualRules: \"visual-rules\",\r\n Enum: \"enum\",\r\n TextLink: \"text-link\",\r\n Filesize: \"filesize\",\r\n ReactElement: \"react-element\",\r\n Datetime: \"datetime\",\r\n};\r\n\r\nexport type SummaryAttributeValueTypeEnum = $Values<\r\n typeof SummaryAttributeValueType\r\n>;\r\nexport type SummaryAttributeValue = {\r\n type: SummaryAttributeValueTypeEnum,\r\n};\r\n\r\nexport type SummaryAttributeDTO = {\r\n caption: string,\r\n name?: string,\r\n value: SummaryAttributeValue,\r\n format?: string,\r\n};\r\n\r\nexport const PrincipalType = {\r\n User: \"user\",\r\n Group: \"group\",\r\n};\r\n\r\nexport type PrincipalTypeEnum = $Values;\r\n\r\nexport const SharePrincipalType = {\r\n User: \"user\",\r\n Group: \"group\",\r\n Share: \"share\",\r\n};\r\nexport type SharePrincipalTypeEnum = $Values;\r\n\r\ntype IPrincipalDTO = {\r\n $type: PrincipalTypeEnum,\r\n id: int,\r\n displayName: string,\r\n};\r\n\r\ntype ISharePrincipalDTO = {\r\n $type: SharePrincipalTypeEnum,\r\n};\r\n\r\nexport type GroupPrincipalDTO = IPrincipalDTO & ISharePrincipalDTO;\r\n\r\nexport type UserPrincipalDTO = IPrincipalDTO &\r\n ISharePrincipalDTO & {\r\n description?: string,\r\n email?: string,\r\n };\r\n\r\nexport type SummaryAttributeValuePrincipal =\r\n | UserPrincipalDTO\r\n | GroupPrincipalDTO;\r\n\r\nexport type SummaryAttributeValueProgress = SummaryAttributeValue & {\r\n progress: Array,\r\n};\r\n\r\nexport type SummaryAttributeValueFacePile = SummaryAttributeValue & {\r\n total?: number,\r\n onMoreCommand?: CommandActionPropsDTO,\r\n pile: Array,\r\n};\r\n\r\nexport type SummaryAttributeValueTextLink = SummaryAttributeValue & {\r\n value: string,\r\n rawValue?: string,\r\n caption?: string,\r\n};\r\n\r\nexport type SummaryAttributeValueFilesize = SummaryAttributeValue & {\r\n value: string,\r\n rawValue?: string,\r\n};\r\n\r\nexport type SummaryAttributeValueDatetime = SummaryAttributeValue & {\r\n value: string,\r\n rawValue?: Date,\r\n};\r\n\r\nexport type SummaryAttributeValueReactElement = SummaryAttributeValue & {\r\n element: React.ReactElement,\r\n};\r\n\r\n// export type SummaryAttributeValueUser = SummaryAttributeValuePrincipal & {\r\n// }\r\n\r\n// export type SummaryAttributeValueGroup = SummaryAttributeValuePrincipal & {\r\n// }\r\n\r\nexport type IconDTO = {\r\n iconUrl: string,\r\n iconSize?: Array,\r\n};\r\n\r\nexport type MarkerDTO = IconDTO & {\r\n iconAnchor?: Array,\r\n};\r\nexport type SummaryAttributeValueVisualRules = {\r\n $type: SummaryAttributeValueTypeEnum,\r\n value: any,\r\n icon?: IconDTO,\r\n marker?: MarkerDTO,\r\n color?: string,\r\n};\r\n\r\n// --------- UserInfo\r\n\r\n// what we actually received from Server.IOfflineService\r\nexport type OfflineItemDTO = {\r\n id: string,\r\n itemUri: string,\r\n isDoc: boolean,\r\n lastUpdate: ?Date,\r\n breadcrumb: BreadcrumbResultDTO,\r\n};\r\n\r\nexport const OfflineSyncStatus = {\r\n Unknown: \"Unknown\",\r\n Synced: \"Synced\",\r\n SyncedWithErrors: \"SyncedWithErrors\",\r\n Syncing: \"Syncing\",\r\n Conflict: \"Conflict\",\r\n Error: \"Error\",\r\n};\r\nexport type OfflineSyncStatusEnum = $Values;\r\n\r\n// what we actually store in our Redux-Store\r\nexport type OfflineItemStatus = OfflineItemDTO & {\r\n status: OfflineSyncStatusEnum,\r\n took?: number,\r\n at: Date,\r\n};\r\n\r\nexport type UserInfoResultDTO = {\r\n id: number,\r\n displayName: number,\r\n isAdmin: boolean,\r\n language: string,\r\n status: ConstantsEnum,\r\n wfEnabled: boolean,\r\n features: Array,\r\n sites: Array,\r\n favorites: Array,\r\n decimalSeparator: string,\r\n thousandSeparator: string,\r\n avatar: string,\r\n hasOfflineItems: boolean,\r\n};\r\n\r\n// --------- UserSettings\r\n\r\nexport type UserSettingsDTO = {\r\n language: string,\r\n};\r\n\r\nexport const NotificationType = {\r\n Toast: 0,\r\n API: 1,\r\n};\r\n\r\nexport type NotificationTypeEnum = $Values;\r\n\r\nexport type UserSettingsResultDTO = {\r\n current: UserSettingsDTO,\r\n allLanguages: Array<{ name: string, code: string }>,\r\n notification?: NotificationTypeEnum,\r\n identityChangePasswordUri?: string,\r\n identity2FaUri?: string,\r\n};\r\n\r\n// --------- Folder's Tree\r\n\r\nexport type TreeItemDTO = {\r\n elementType: number,\r\n id: number,\r\n itemUri: string,\r\n numberOfChildren: number,\r\n webDavName: string,\r\n bc?: string,\r\n};\r\n\r\nexport type TreeDTO = {\r\n isRoot: boolean,\r\n isBrowsable: boolean,\r\n totalCount: number,\r\n items: Array,\r\n};\r\n\r\nexport const SpecialFoldersItemURIs = {\r\n SharedDocumentsUri: \"shareddocuments\",\r\n RecycledDocumentsUri: \"recycleddocuments\",\r\n RecycleBinUri: \"recyclebin\",\r\n};\r\n\r\nexport type SpecialFoldersItemURIsEnum = $Values;\r\n// --------- Item Status\r\n\r\n/** @enum {number} */\r\nexport const ItemStatuses = {\r\n /** Nothing set */\r\n Nothing: 0,\r\n /** There is an reminder on this item. */\r\n Reminder: 1,\r\n /** This item is shared. */\r\n Share: 2,\r\n /** This item has a relation to another item. */\r\n Relation: 4,\r\n /** This item has a converted PDF of itself. */\r\n PDF: 8,\r\n /** This item has at least one Workflow-Report */\r\n WFReport: 16,\r\n /** This item has a note */\r\n Note: 32,\r\n /** This item has a link to another item. (Shortcut) */\r\n Link: 64,\r\n /** When this item is an msg and it has some attachments. */\r\n MailHasAttachment: 128,\r\n /** When this item is an msg and it was replied to someone. */\r\n MailReplied: 256,\r\n /** When this item is an msg and it was forwarded to someone. */\r\n MailForwarded: 512,\r\n /** When this item is checked out. */\r\n Locked: 1024,\r\n /** When this item is has a DocTemplate applied. */\r\n Template: 2048,\r\n /** There is a subscription on this item. */\r\n Subscribed: 4096,\r\n /** This item managed via CloudSync. */\r\n CloudSync: 8192,\r\n /** This item is marked for deletion. */\r\n Deleted: 16384,\r\n /** Any of this items parents is marked for deletion. */\r\n ParentDeleted: 32768,\r\n /** This item is marked for offline access. */\r\n //Offline: TBD,\r\n};\r\n\r\nexport type ItemStatusesDTO = $Values;\r\n\r\n// --------- DocInfo\r\n\r\nexport /**\r\n * @deprecated Will be removed in 2023.3\r\n */ type DocInfoResultDTO = {\r\n name: string,\r\n ext: string,\r\n size: number,\r\n hasPdf: boolean,\r\n isPdf: boolean,\r\n canPdf: boolean,\r\n isFlatAU: boolean,\r\n flags: number,\r\n itemStatus: ItemStatusesDTO,\r\n // workflow: any,\r\n};\r\n\r\nexport /**\r\n * @deprecated Will be removed in 2023.3\r\n */ type DocInfoResultWithTokenDTO = DocInfoResultDTO & {\r\n token: string,\r\n};\r\n\r\n// --------- Documents\r\n\r\nexport const ListViewMode = {\r\n Thumbnails: \"Thumbnails\",\r\n List: \"List\",\r\n Grid: \"Grid\",\r\n Map: \"Map\",\r\n Calendar: \"Calendar\",\r\n};\r\nexport type ListViewModeEnum = $Keys;\r\n\r\nexport const DocListFilterOperators = {\r\n None: \"None\",\r\n Equals: \"Equals\",\r\n NotEquals: \"NotEquals\",\r\n LessThan: \"LessThan\",\r\n LessThanOrEqualsTo: \"LessThanOrEqualsTo\",\r\n GreaterThan: \"GreaterThan\",\r\n GreaterThanOrEqualsTo: \"GreaterThanOrEqualsTo\",\r\n Contains: \"Contains\",\r\n DoesNotContain: \"DoesNotContain\",\r\n //Like: \"Like\",\r\n //NotLike: \"NotLike\",\r\n StartsWith: \"StartsWith\",\r\n DoesNotStartWith: \"DoesNotStartWith\",\r\n EndsWith: \"EndsWith\",\r\n DoesNotEndWith: \"DoesNotEndWith\",\r\n Between: \"Between\",\r\n NotBetween: \"NotBetween\",\r\n DateRelative: \"DateRelative\",\r\n};\r\n\r\nexport type DocListFilterOperatorsEnum = $Keys;\r\n\r\nexport const DocListColumnType = {\r\n StringValue: \"StringValue\",\r\n WebDavName: \"WebDavName\",\r\n FileSize: \"FileSize\",\r\n IntValue: \"IntValue\",\r\n BooleanValue: \"BooleanValue\",\r\n LongValue: \"LongValue\",\r\n ShortValue: \"ShortValue\",\r\n DoubleValue: \"DoubleValue\",\r\n DecimalValue: \"DecimalValue\",\r\n SingleValue: \"SingleValue\",\r\n DateTimeValue: \"DateTimeValue\",\r\n DateTimeOffsetValue: \"DateTimeOffsetValue\",\r\n ByteValue: \"ByteValue\",\r\n ObjectValue: \"ObjectValue\",\r\n};\r\n\r\nexport type DocListColumnTypeEnum = $Keys;\r\n\r\nexport type DocColumnResultDTO = {\r\n name: string,\r\n caption: string,\r\n width: number,\r\n type: DocListColumnTypeEnum,\r\n canSort: boolean,\r\n};\r\n\r\nexport type DocsResultDTO = {\r\n itemUri: string,\r\n pageSize: number,\r\n rowCount: number,\r\n rows: Object,\r\n cols: Array,\r\n flags: number,\r\n};\r\n\r\nexport const SortDirectionOptions = {\r\n Ascending: \"Ascending\",\r\n Descending: \"Descending\",\r\n};\r\nexport type SortDirectionEnum = $Keys;\r\n\r\nexport type DocListSortRequestDTO = {\r\n name: string,\r\n direction: SortDirectionEnum,\r\n};\r\n\r\nexport type DocListFilterRequestDTO = {\r\n operator: DocListFilterOperatorsEnum,\r\n name: string,\r\n values: Array,\r\n};\r\n\r\nexport type DocListLayout = {\r\n filters?: Array,\r\n sorts?: Array,\r\n cols?: Array,\r\n};\r\n\r\nexport const ActivityType = {\r\n create: \"create\",\r\n modifyContent: \"modifyContent\",\r\n modifyField: \"modifyField\",\r\n comment: \"comment\",\r\n locked: \"locked\",\r\n delete: \"delete\",\r\n};\r\nexport type ActivityTypeEnum = $Keys;\r\n\r\nexport type ActivityFieldDTO = {\r\n caption: string,\r\n oldVal: ?string,\r\n newVal: ?string,\r\n};\r\n\r\nexport type ActivityDTO = {\r\n id: number,\r\n on: DateTime,\r\n what: ActivityTypeEnum,\r\n extras?: any,\r\n userId: number,\r\n userName: string,\r\n text: string,\r\n changes: Array,\r\n};\r\n\r\nexport const ItemNoteType = {\r\n Default: \"default\",\r\n PdfHighlight: \"pdfHighlight\",\r\n};\r\n\r\nexport type ItemNoteTypeEnum = $Values;\r\n\r\nexport const ItemNoteTypeIcon = {\r\n default: \"comment-o\",\r\n pdfHighlight: \"commenting-o\",\r\n};\r\n\r\nexport type IItemNoteExtras = {\r\n $type: ItemNoteTypeEnum,\r\n};\r\n\r\nexport type ItemNoteExtrasDefault = IItemNoteExtras & {\r\n data: Array,\r\n};\r\n\r\nexport const PdfShapeType = {\r\n Rectangle: \"rectangle\",\r\n};\r\n\r\nexport type PdfShapeTypeEnum = $Values;\r\n\r\nexport type IPdfShape = {\r\n $type: PdfShapeTypeEnum,\r\n};\r\n\r\nexport type PdfShapeRectangle = {\r\n scale: number,\r\n pageNumber: number,\r\n x: number,\r\n y: number,\r\n width: number,\r\n height: number,\r\n};\r\n\r\nexport type ItemNoteExtrasPdfHighlight = IItemNoteExtras & {\r\n shapes: Array,\r\n};\r\n\r\n// export type ItemNoteDTO = {\r\n// itemUri: string,\r\n// text: string,\r\n// id?: number,\r\n// parentId?: number,\r\n// extras?: IItemNoteExtras,\r\n// date?: DateTime,\r\n// creationDate?: DateTime,\r\n// creator?: IPrincipalDTO,\r\n// };\r\n\r\nexport const CleanupKeepVersionType = {\r\n All: \"all\",\r\n Last: \"last\",\r\n PerDay: \"perDay\",\r\n PerUser: \"perUser\",\r\n};\r\nexport type CleanupKeepVersionTypeEnum = $Keys;\r\n\r\nexport type CleanupKeepInfoDTO = {\r\n type: CleanupKeepVersionTypeEnum,\r\n count: number,\r\n};\r\n\r\nexport const RetentionType = {\r\n Default: \"default\",\r\n Forever: \"forever\",\r\n Custom: \"custom\",\r\n};\r\nexport type RetentionTypeEnum = $Keys;\r\n\r\nexport type RetentionInfoDTO = {\r\n type: RetentionTypeEnum,\r\n months: number,\r\n};\r\n\r\nexport type ActivitiesDTO = {\r\n items: Array,\r\n keep: CleanupKeepInfoDTO,\r\n retention: RetentionInfoDTO,\r\n};\r\n// --------- Form\r\n\r\nexport type LastChangeState = {\r\n ns?: string,\r\n name: string,\r\n value: Object,\r\n};\r\n\r\nexport const FormLookupType = {\r\n ip: 0,\r\n ea_lookup: 1,\r\n ea_ftlookup: 2,\r\n sf_ftlookup: 3,\r\n};\r\nexport type FormLookupTypeEnum = $Values;\r\n\r\nexport type FormLookupValue = {\r\n T: string,\r\n K?: string,\r\n};\r\n\r\n// export type GetLookupValuesRequestDTO = {\r\n// keyword: string,\r\n// pageNum: number,\r\n// itemUri: string,\r\n// name: string,\r\n// lookupType: FormLookupTypeEnum,\r\n// valueType: SearchValueTypeEnum,\r\n// values: any\r\n// }\r\n\r\nexport type LookupValuesResultDTO = {\r\n values: Array,\r\n hasMore: boolean,\r\n};\r\n\r\nexport const NewFormType = {\r\n Document: \"Document\",\r\n Folder: \"Folder\",\r\n};\r\nexport type NewFormTypeEnum = $Values;\r\n\r\nexport const ExtraAttributeEmbeddedGridRowStatus = {\r\n None: 0,\r\n Updated: 1,\r\n Added: 2,\r\n Deleted: 3,\r\n};\r\nexport type ExtraAttributeEmbeddedGridRowStatusEnum = $Values<\r\n typeof ExtraAttributeEmbeddedGridRowStatus\r\n>;\r\n\r\nexport type ExtraAttributeEmbeddedGridColumnDTO = {\r\n name: string,\r\n visible: boolean,\r\n width: number,\r\n};\r\n\r\nexport type ExtraAttributesEmbeddedGridDTO = {\r\n columns: Array,\r\n //rows: Dictionary>,\r\n rows: Array>,\r\n pageSize: number,\r\n showFilter: boolean,\r\n sortColumn: string,\r\n sortDirection: SortDirectionEnum,\r\n seqIdColumn: number,\r\n};\r\n\r\nexport type ExtraAttributeDataAuditLogDTO = {\r\n deletedIds: Array,\r\n updatedRows: Object,\r\n newRows: Array>,\r\n};\r\n\r\nexport const DateTimeFormat = {\r\n Time: \"Time\",\r\n LongTime: \"LongTime\",\r\n DateTime: \"DateTime\",\r\n DateLongTime: \"DateLongTime\",\r\n Date: \"Date\",\r\n //For non-formatted DateTimes, e.g. Reminder, Share, DocListFilter\r\n JsonDate: \"JsonDate\",\r\n JsonDateEnd: \"JsonDateEnd\", //Time should point to end of day\r\n JsonDateTime: \"JsonDateTime\",\r\n};\r\n\r\nexport type DateTimeFormatValues = $Values;\r\n\r\ntype FieldDefinitionBaseDTO = {\r\n id: number,\r\n header?: string,\r\n name: string,\r\n value: null | any | ExtraAttributesEmbeddedGridDTO,\r\n};\r\n\r\ntype FieldDefinitionWithExtrasBaseDTO = FieldDefinitionBaseDTO & {\r\n ro: boolean,\r\n req: boolean,\r\n format: string, // CustomFormats enum\r\n extra?: ?Object,\r\n};\r\n\r\nexport type FieldDefinitionDTO = FieldDefinitionWithExtrasBaseDTO & {\r\n width: number,\r\n height: number,\r\n};\r\n\r\nexport type FormFieldDTO = FieldDefinitionWithExtrasBaseDTO & {\r\n max?: number,\r\n};\r\n\r\nexport const ItemLinkType = {\r\n Manual: 0,\r\n WorkflowReport: 1,\r\n Shortcut: 2,\r\n};\r\nexport type ItemLinkTypeEnum = $Values;\r\n\r\ntype IFormResultDTO = {\r\n name: string,\r\n};\r\n\r\nexport type FormResultDTO = IFormResultDTO & {\r\n formatId: number,\r\n isDoc: boolean,\r\n layoutXml?: string,\r\n attributes?: Array,\r\n fields: Array,\r\n formTitle?: string,\r\n grids?: Array,\r\n labelWidth: number,\r\n isEditAllowed: boolean,\r\n status: ItemStatusesDTO,\r\n etag: string,\r\n};\r\n\r\nexport type LockResultDTO = {\r\n lockedById: number,\r\n lockedByName: string,\r\n lockedOnMachine: string,\r\n lockedDate: string,\r\n};\r\n\r\nexport type DocFormResultDTO = FormResultDTO & {\r\n isLocked: boolean,\r\n lockInfo?: LockResultDTO,\r\n};\r\n\r\nexport type FormFieldProps = {\r\n name?: string,\r\n header: string,\r\n value: null | any | ExtraAttributesEmbeddedGridDTO,\r\n width?: number,\r\n userid?: number,\r\n marker?: any,\r\n isGridCell?: boolean,\r\n formatId?: number,\r\n};\r\n\r\nexport type FormFieldInfo = {\r\n Component: React.Component,\r\n props: FormFieldProps,\r\n};\r\n\r\n// --------- Workflow\r\n\r\nexport const WorkflowProvider = {\r\n inPointWorkflow: \"inPointWf\",\r\n AxonIvy: \"AxonIvy\",\r\n};\r\nexport type WorkflowProviderEnum = $Values;\r\n\r\nexport const WorkflowType = {\r\n Unknown: \"unknown\",\r\n Routing: \"routing\",\r\n Process: \"process\",\r\n ToDo: \"todo\",\r\n};\r\nexport type WorkflowTypeEnum = $Values;\r\n\r\nexport const WorkflowStartLinkMode = {\r\n Window: \"window\",\r\n Docked: \"docked\",\r\n Modal: \"modal\",\r\n};\r\nexport type WorkflowStartLinkModeEnum = $Values;\r\n\r\nexport type WorkflowDTO = {\r\n provider: string,\r\n id: string,\r\n icon?: string,\r\n name: string,\r\n description: string,\r\n startLink: string,\r\n startLinkMode: WorkflowStartLinkModeEnum,\r\n deadline?: string,\r\n progress?: number,\r\n itemUri?: string,\r\n};\r\n\r\nexport type WorkflowAction = {\r\n name: string,\r\n icon?: string,\r\n caption: string,\r\n description?: string,\r\n page: string,\r\n};\r\n\r\nexport type WorkflowInfoDTO = {\r\n provider: string,\r\n id: string,\r\n name: string,\r\n progress?: number,\r\n status?: string,\r\n attributes?: Array,\r\n actions?: Array,\r\n};\r\n\r\nexport type WorkflowProviderDTO = {\r\n provider: string,\r\n caption: string,\r\n icon?: string,\r\n};\r\n\r\n// --------- Search\r\n\r\nexport const SearchOperator = {\r\n NotSet: 0,\r\n Contextor: 1,\r\n From: 2,\r\n To: 3,\r\n FromTo: 4,\r\n FromToWithTime: 5,\r\n FromWithTime: 6,\r\n ToWithTime: 7,\r\n Equals: 8,\r\n EqualsWithTime: 9,\r\n RelativeDate: 10,\r\n // #46483 remove not working date searchform Operators\r\n // FromRelativeTo: 11,\r\n // FromRelativeToWithTime: 12,\r\n // FromToRelative: 13,\r\n // FromWithTimeToRelative: 14,\r\n FromRelative: 15,\r\n ToRelative: 16,\r\n Contains: 17,\r\n StartsWith: 18,\r\n EndsWith: 19,\r\n GeoRadius: 20,\r\n GeoArea: 21,\r\n GeoRadiusIntersect: 22,\r\n GeoRadiusWithin: 23,\r\n GeoAreaIntersect: 24,\r\n GeoAreaWithin: 25,\r\n GeoAreaPoint: 26,\r\n ContextorContains: 27,\r\n};\r\nexport type SearchOperatorEnum = $Values;\r\n\r\nexport const SearchNodeType = {\r\n AllNodes: 0,\r\n LeafNode: 1,\r\n CustomNode: 2,\r\n Auto: 3,\r\n};\r\nexport type SearchNodeTypeEnum = $Values;\r\n\r\nexport type SearchFormInfoDTO = {\r\n id: number,\r\n name: string,\r\n // scope: string,\r\n // itemUri: string,\r\n // breadcrumb: string,\r\n // image: string\r\n};\r\n\r\nexport const SearchScope = {\r\n AllSites: 0,\r\n AllFolders: 1,\r\n CurrentFolder: 2,\r\n};\r\nexport type SearchScopeEnum = $Values;\r\n\r\nexport const SearchValueType = {\r\n NotSet: 0,\r\n String: 1,\r\n RelativeDate: 2,\r\n DateTime: 3,\r\n FileSize: 4,\r\n ItemType: 5,\r\n Decimal: 6,\r\n GeoPoint: 7,\r\n GeoArea: 8,\r\n StringFieldOnly: 9,\r\n DecimalFieldOnly: 10,\r\n Link: 11,\r\n IUID: 100,\r\n};\r\nexport type SearchValueTypeEnum = $Values;\r\n\r\nexport type SearchBucketValueDTO = {\r\n value: string | number,\r\n caption?: string,\r\n count?: number,\r\n};\r\n\r\nexport type SearchBucketDTO = {\r\n visible?: boolean,\r\n name: string,\r\n caption?: string,\r\n hideName?: boolean,\r\n hideMenu?: boolean,\r\n hideAllReset?: boolean,\r\n selected?: Array,\r\n valueType?: SearchValueTypeEnum,\r\n buckets: Array,\r\n};\r\n\r\nexport const SearchRequestType = {\r\n Favorite: 0,\r\n Recent: 1,\r\n Freetext: 2,\r\n Form: 3,\r\n Url: 4,\r\n};\r\nexport type SearchRequestTypeEnum = $Values;\r\n\r\nexport type SearchFilterDTO = {\r\n name: string,\r\n valueType: SearchValueTypeEnum,\r\n value: any,\r\n op: SearchOperatorEnum,\r\n boostLeafNode?: number,\r\n nodeType?: SearchNodeTypeEnum,\r\n};\r\n\r\nexport type SearchSortDTO = {\r\n name: string,\r\n valueType: SearchValueTypeEnum,\r\n direction: SortDirectionEnum,\r\n};\r\n\r\nexport type SearchRequestDTO = {\r\n id: number,\r\n name: ?string,\r\n searchType: SearchRequestTypeEnum,\r\n scope?: SearchScopeEnum,\r\n isCustom: boolean,\r\n searchText?: ?string,\r\n pageNum: number,\r\n itemUri?: string,\r\n filters: Array,\r\n sorts: Array,\r\n fakeUris?: Array,\r\n};\r\n\r\nexport const SearchItemType = {\r\n Favorite: 0,\r\n Recent: 1,\r\n Freetext: 2,\r\n Form: 3,\r\n Url: 4, // passing Url parameters\r\n};\r\nexport type SearchItemTypeEnum = $Values;\r\n\r\nexport type SearchItemDTO = {\r\n name: string,\r\n searchText: ?string,\r\n scope?: SearchScopeEnum,\r\n id: number,\r\n searchType: SearchItemTypeEnum,\r\n param?: Array,\r\n nodeType?: SearchNodeTypeEnum,\r\n\r\n // TODO those do not exist in server-side object!\r\n itemUri?: string,\r\n filters?: Array,\r\n sorts?: Array,\r\n fakeUris?: Array,\r\n};\r\n\r\nexport type SAYTOptionDTO = {\r\n /* required by react-select */\r\n className?: string,\r\n label: string,\r\n /* our custom values */\r\n count: number,\r\n item: SearchItemDTO,\r\n};\r\n\r\nexport type SearchResultRowDTO = {\r\n title: string,\r\n itemUri: string,\r\n isDoc: boolean,\r\n elementType: ?number,\r\n ext: string,\r\n summary: ?string,\r\n foundTerms: ?Array,\r\n breadcrumb: BreadcrumbResultDTO,\r\n attributes: Array,\r\n};\r\n\r\ntype IGridColumn = {\r\n type: string,\r\n name: string,\r\n caption: string,\r\n width: number,\r\n canSort: boolean,\r\n};\r\ntype IGridRow = any;\r\n\r\ntype IGridList = {\r\n cols: Array,\r\n rows: { [rowId: number]: IGridRow },\r\n pageSize: number,\r\n};\r\n\r\nexport type SearchResultDTO = IGridList & {\r\n pageNum: number,\r\n totalCount: number,\r\n aggregations?: Array,\r\n autoBrowseToItem?: boolean,\r\n listViewMode: ListViewModeEnum,\r\n};\r\n\r\nexport type SearchCountResultDTO = {\r\n totalCount: number,\r\n totalTime: number,\r\n aggregations?: Array,\r\n};\r\n\r\n// searchForms\r\n\r\nexport type SearchFieldDefinitionDTO = FieldDefinitionBaseDTO & {\r\n hidden?: boolean,\r\n valueType: SearchValueTypeEnum,\r\n op: SearchOperatorEnum,\r\n boostLeafNode?: number,\r\n nodeType?: SearchNodeTypeEnum,\r\n};\r\n\r\nexport type SearchFormResultDTO = IFormResultDTO & {\r\n layoutXml?: string,\r\n attributes?: Array,\r\n sort?: Array,\r\n itemUri: string,\r\n};\r\n\r\n// --------- Cards\r\n\r\nexport const CardType = {\r\n Rec: \"rec\",\r\n Fav: \"fav\",\r\n Task: \"task\",\r\n Action: \"action\",\r\n};\r\nexport type CardTypeEnum = $Values;\r\n\r\nexport const CardItemType = {\r\n Folder: \"folder\",\r\n Doc: \"doc\",\r\n Search: \"search\",\r\n Task: \"task\",\r\n SearchForm: \"searchForm\",\r\n CommandAction: \"commandAction\",\r\n ArchiveTarget: \"archiveTarget\",\r\n};\r\nexport type CardItemTypeEnum = $Values;\r\n\r\nexport type CardListRequest = {\r\n cardTypes: Array,\r\n cardItemTypes: Array,\r\n};\r\n\r\nexport type CardItemResultDTO = {\r\n id: string,\r\n type: CardTypeEnum,\r\n itemtype: CardItemTypeEnum,\r\n siteType: SiteTypeEnum,\r\n image: ?string,\r\n name: string,\r\n desc?: string,\r\n uri: ?string,\r\n searchItem?: SearchItemDTO, // only for search\r\n bcText?: string, // only for recent folders,\r\n commandAction?: CommandActionPropsDTO,\r\n extras?: Object, // any additional properties\r\n};\r\n\r\nexport type ItemActionViewConfig = {\r\n name: string,\r\n header?: string,\r\n};\r\n\r\nexport type ItemActionConfigBase = {\r\n id?: string,\r\n visible?: boolean,\r\n itemUriRegex?: string,\r\n loc?: string, //only used in data/itemActions.js\r\n name: string,\r\n desc?: string,\r\n icon?: string,\r\n shouldBeVisible?: Array,\r\n views?: Array,\r\n view?: ItemActionViewConfig,\r\n};\r\n\r\nexport type ItemActionCategoryConfig = ItemActionConfigBase & {\r\n renderHeader?: boolean,\r\n expanded?: boolean,\r\n};\r\n\r\nexport type ItemActionConfig = ItemActionConfigBase & {\r\n category?: string,\r\n commandAction?: CommandActionPropsDTO,\r\n};\r\n\r\nexport type ItemActionsConfigDTO = {\r\n categories: Array,\r\n actions: Array,\r\n};\r\n\r\nexport type FormActionsConfigDTO = Array;\r\n\r\n// ---------- Errors\r\n\r\nexport type ApiErrorEventId = {\r\n id: number,\r\n name: string,\r\n};\r\n\r\nexport type ApiErrorResult = {\r\n detail: string | null,\r\n message: string,\r\n isError: boolean,\r\n eventId: ApiErrorEventId,\r\n extra?: any,\r\n};\r\n\r\nexport type ApiError = {\r\n data: ApiErrorResult,\r\n};\r\n\r\n// ----------- NewsFeed\r\n\r\nexport type NewsFeedItemDTO = {\r\n date: Object,\r\n title: string,\r\n itemStatus: ItemStatusesDTO,\r\n name: string,\r\n ext: string,\r\n category: string,\r\n itemUri: string,\r\n isDoc: boolean,\r\n elementType: number,\r\n breadcrumb: BreadcrumbResultDTO,\r\n summary: string,\r\n};\r\n\r\nexport type NewsFeedDTO = {\r\n items: Array,\r\n};\r\n\r\nexport type SubscribeResponseDTO = {\r\n id: number,\r\n name: string,\r\n itemUri: string,\r\n};\r\n\r\nexport type SubscribeRequestDTO = {\r\n itemUri: string,\r\n name: string,\r\n};\r\n\r\n// ----------- Upload\r\n\r\n/** whether TusHandler.cs should Create or Modify a document */\r\nexport const UploadMode = {\r\n CreateDocument: \"CreateDocument\",\r\n ModifyDocument: \"ModifyDocument\",\r\n};\r\n\r\n// ------------ Map\r\n\r\ntype MapProviderOnClickConfig = {\r\n // HACK will set commandAction.props.defaultValues[locationTargetFieldName] to clicked location\r\n locationTargetFieldName?: string,\r\n commandAction: CommandActionPropsDTO,\r\n};\r\n\r\nexport type MapProviderConfig = {\r\n name?: string,\r\n enabled?: boolean,\r\n key?: string,\r\n isRaster?: boolean,\r\n rasterMapIdSelector?: string, // only when isRaster=true\r\n onClick?: MapProviderOnClickConfig,\r\n layers?: Array, // references to public/__map/indoor-raster/*\r\n};\r\n\r\nexport type Location = {\r\n latitude: number,\r\n longitude: number,\r\n};\r\n\r\nexport type RasterLocation = {\r\n x: number,\r\n y: number,\r\n rasterId: string,\r\n};\r\n\r\n/** returned in callback methods from map providers */\r\nexport type MapEditLocationResult = {\r\n /** new Point location (or setRadius center) */\r\n location?: Location,\r\n /** setRadius setting */\r\n radius?: number,\r\n /** area path */\r\n area?: Array,\r\n};\r\n\r\nexport type MapLocationInfo = Location & {\r\n /** field's common name */\r\n attribute: string,\r\n /** item's name */\r\n label: string,\r\n /** item's rendered InfoPopup in HTML */\r\n preview?: string,\r\n /** item's image thumbnail either in URL format or base64 blob */\r\n thumbnail?: string | Blob,\r\n /** marker custom icon */\r\n icon?: MarkerDTO,\r\n /** item's itemUri */\r\n itemUri?: string,\r\n /** optional polygon area points */\r\n area?: Array,\r\n /** whether this marker can be dragged/edited */\r\n allowEdit?: boolean,\r\n};\r\n\r\n// export const MapEditMode = {\r\n// Readonly: 0,\r\n// Point: 1,\r\n// Area: 2,\r\n// Radius: 3\r\n// };\r\n\r\n// export type MapEditModeEnum = $Values;\r\n\r\n// ---- Server Sent Events\r\n\r\nexport const ServerEventItemType = {\r\n document: \"document\",\r\n folder: \"folder\",\r\n activity: \"activity\",\r\n task: \"task\",\r\n search: \"search\",\r\n favorite: \"favorite\",\r\n subscription: \"subscription\",\r\n offline: \"offline\",\r\n};\r\n\r\nexport type ServerEventItemEnum = $Values;\r\n\r\nexport const ServerEventActionType = {\r\n notSet: 0,\r\n add: \"add\",\r\n modify: \"modify\",\r\n edit: \"edit\",\r\n delete: \"delete\",\r\n refresh: \"refresh\",\r\n view: \"view\",\r\n};\r\n\r\nexport type ServerEventActionEnum = $Values;\r\n\r\nexport type ServerEventData = {\r\n userId: number,\r\n /** ServerEventItemUriData */\r\n itemUri: ?string,\r\n parentItemUri: ?string,\r\n /** ServerEventSearchData */\r\n formId: ?number,\r\n};\r\n\r\nexport type ServerEventMessage = {\r\n id: string,\r\n item: ServerEventItemEnum,\r\n action: ServerEventActionEnum,\r\n data: ServerEventData,\r\n};\r\n\r\nexport const RefreshMode = {\r\n All: 0, // Auto refresh all\r\n Originator: 1, // Auto refresh Originator, ask Others\r\n Self: 2, // Auto refresh Originator, ignore Others\r\n};\r\n\r\nexport type RefreshModeEnum = $Values;\r\n\r\nexport type ImageResultDTO = {\r\n /** base64 encoded src string */\r\n src: string,\r\n /** indicates if src is a default or editable source */\r\n fallback: boolean,\r\n};\r\n\r\n// ------ ArrowNavigation\r\n\r\nexport type ArrowNavigationSetter = {\r\n /** source (itemUri) of master => to target source specific child windows only */\r\n setSource: (source: string) => void,\r\n /** target setter => for action panel context */\r\n setTarget: (target: string) => void,\r\n /** set DocModal rows => context */\r\n setRows: (rows: Array) => void,\r\n /** callback to set */\r\n setCurrentIndex: (index: number) => void,\r\n};\r\n\r\n// ------ ItemFlows\r\n\r\nexport const ItemFlowDirection = {\r\n in: \"in\",\r\n out: \"out\",\r\n};\r\n\r\nexport type ItemFlowDirectionEnum = $Values;\r\n\r\nexport const ItemFlowTemplateType = {\r\n Document: \"Document\",\r\n DocTemplate: \"DocTemplate\",\r\n Folder: \"Folder\",\r\n FolderTemplate: \"FolderTemplate\",\r\n};\r\n\r\nexport type ItemFlowTemplateTypeEnum = $Values;\r\n\r\nexport type ItemFlowConfigDTO = ItemActionConfig & {\r\n isSuggested: boolean,\r\n};\r\n\r\nexport type ItemFlowCategoryConfig = ItemActionConfigBase & {};\r\n\r\nexport type ItemFlowsConfigDTO = {\r\n selectFlowId?: string,\r\n categories: Array,\r\n flows: Array,\r\n};\r\n\r\nexport const UploadProvider = {\r\n Any: \"Any\",\r\n Uppy: \"Uppy\",\r\n Sync: \"Sync\",\r\n};\r\n\r\nexport type UploadProviderEnum = $Values;\r\n\r\nexport type NewItemResultDTO = {\r\n success: boolean,\r\n itemUri: string,\r\n name: string,\r\n formatId: number,\r\n elementType: number,\r\n};\r\n\r\n// ------ Loading\r\n\r\nexport const LoadingType = {\r\n Default: \"Default\",\r\n Status: \"Status\",\r\n};\r\n\r\nexport type LoadingTypeEnum = $Values;\r\n\r\n// ------ Raster maps\r\n\r\nexport type RasterMapLayerDTO = {\r\n id: string,\r\n name: string,\r\n itemUri: string,\r\n dim: Array,\r\n zoom: Array,\r\n};\r\n\r\nexport type RasterMapResultDTO = {\r\n id: string,\r\n layers: Array,\r\n};\r\n\r\nexport const RasterMapLayerEditAction = {\r\n none: 0,\r\n delete: 1,\r\n add: 2,\r\n rename: 3,\r\n};\r\nexport type RasterMapLayerEditActionEnum = $Values<\r\n typeof RasterMapLayerEditAction\r\n>;\r\n\r\nexport type RasterMapLayerSaveRequestDTO = RasterMapLayerDTO & {\r\n editAction: RasterMapLayerEditAction,\r\n};\r\n\r\nexport type RasterMapSaveRequestDTO = {\r\n id: string,\r\n layers: Array,\r\n};\r\n\r\nexport const LocalDateStringOption = {\r\n DateTimeLong: {\r\n year: \"numeric\",\r\n month: \"2-digit\",\r\n day: \"2-digit\",\r\n hour: \"2-digit\",\r\n minute: \"2-digit\",\r\n second: \"2-digit\",\r\n },\r\n DateTime: {\r\n year: \"numeric\",\r\n month: \"2-digit\",\r\n day: \"2-digit\",\r\n hour: \"2-digit\",\r\n minute: \"2-digit\",\r\n },\r\n Date: {\r\n year: \"numeric\",\r\n month: \"2-digit\",\r\n day: \"2-digit\",\r\n },\r\n // Browser does not natively support displaying only Time from Date Object\r\n // TimeLong: {\r\n // hour: \"2-digit\",\r\n // minute: \"2-digit\",\r\n // second: \"2-digit\",\r\n // },\r\n // Time: {\r\n // hour: \"2-digit\",\r\n // minute: \"2-digit\",\r\n // },\r\n};\r\n\r\n// ------ Reminder\r\n\r\nexport const ReminderPriority = {\r\n NotSet: 0,\r\n High: 1,\r\n Normal: 2,\r\n Low: 3,\r\n};\r\nexport type ReminderPriorityEnum = $Values;\r\n\r\nexport const ReminderTypeFlags = {\r\n NotSet: 0,\r\n Calendar: 1,\r\n Task: 2,\r\n Mail: 4,\r\n CustomAction: 8,\r\n};\r\nexport type ReminderTypeFlagsEnum = $Values;\r\n\r\nexport const CustomActionState = {\r\n NotSet: 0,\r\n NotStarted: 1,\r\n Retry: 2,\r\n Error: 9,\r\n Done: 10,\r\n Abort: 11,\r\n};\r\n\r\nexport type CustomActionStateEnum = $Values;\r\nexport type CustomActionDTO = {\r\n id: string,\r\n displayName: string,\r\n state: CustomActionStateEnum,\r\n executedDate: DateTime,\r\n error: string,\r\n};\r\nexport type ReminderDTO = {\r\n id?: int,\r\n itemUri: string,\r\n date: DateTime,\r\n creationDate?: DateTime,\r\n creator?: UserPrincipalDTO,\r\n recipient?: UserPrincipalDTO | GroupPrincipalDTO,\r\n reason: string,\r\n priority: ReminderPriorityEnum,\r\n type?: ReminderTypeFlagsEnum,\r\n isReadOnly: boolean,\r\n customAction?: CustomActionDTO,\r\n};\r\n\r\nexport type EnumValue = {\r\n value: T,\r\n label: string,\r\n icon?: string,\r\n};\r\n\r\nexport type SummaryAttributeValueEnum = SummaryAttributeValue & {\r\n enum: EnumValue,\r\n value: T,\r\n};\r\n\r\nexport const ReminderTypeFlagsEnumValues: Array<\r\n EnumValue\r\n> = [\r\n {\r\n value: ReminderTypeFlags.Calendar,\r\n label: \"$reminder:type.calendar\",\r\n icon: \"calendar\",\r\n },\r\n {\r\n value: ReminderTypeFlags.Task,\r\n label: \"$reminder:type.task\",\r\n icon: \"list-alt\",\r\n },\r\n {\r\n value: ReminderTypeFlags.Mail,\r\n label: \"$reminder:type.mail\",\r\n icon: \"envelope-o\",\r\n },\r\n];\r\n\r\nexport const ReminderPriorityEnumValues: Array<\r\n EnumValue\r\n> = [\r\n {\r\n value: ReminderPriority.High,\r\n label: \"$reminder:priority.high\",\r\n icon: \"exclamation\",\r\n },\r\n {\r\n value: ReminderPriority.Normal,\r\n label: \"$reminder:priority.normal\",\r\n },\r\n {\r\n value: ReminderPriority.Low,\r\n label: \"$reminder:priority.low\",\r\n icon: \"long-arrow-down\",\r\n },\r\n];\r\n\r\n// ----- Share\r\n\r\nconst AllowedShareActionFlags = {\r\n NotSet: 0,\r\n Link: 1,\r\n Web: 2,\r\n Sync: 4,\r\n Share: 8,\r\n Attachment: 16,\r\n Pdf: 32,\r\n Anonym: 64,\r\n WebShare: 128,\r\n};\r\nAllowedShareActionFlags.Default =\r\n AllowedShareActionFlags.Link |\r\n AllowedShareActionFlags.Web |\r\n AllowedShareActionFlags.Share;\r\n\r\nexport { AllowedShareActionFlags };\r\n\r\nexport type AllowedShareActionFlagsEnum = $Values<\r\n typeof AllowedShareActionFlags\r\n>;\r\n\r\nexport const ShareType = {\r\n Anonym: \"anonym\", // SAS (not implemented yet)\r\n WebShare: \"webshare\", // Cloud Webshare\r\n Share: \"share\", // Create Share and Provide as Web/Client Link\r\n Link: \"link\", // Provide as Web/Client Link\r\n Attachment: \"attachment\", // Provide Document as Attachment via Mail\r\n Pdf: \"pdf\", // Provide Document as PDF via Mail\r\n};\r\n\r\nexport type ShareTypeEnum = $Values;\r\n\r\nexport const ShareAccessControlListType = {\r\n View: \"view\",\r\n Edit: \"edit\",\r\n Delete: \"delete\",\r\n};\r\n\r\nexport type ShareAccessControlListTypeEnum = $Values<\r\n typeof ShareAccessControlListType\r\n>;\r\n\r\nexport type ShareActionDTO = {\r\n allowedFlags: AllowedShareActionFlagsEnum,\r\n type: ShareTypeEnum,\r\n acl: ShareAccessControlListTypeEnum,\r\n expires?: DateTime,\r\n shareAs?: string,\r\n};\r\n\r\nexport type SharePrincipalDTO = ISharePrincipalDTO & {\r\n principal: GroupPrincipalDTO | UserPrincipalDTO,\r\n acl: ShareAccessControlListTypeEnum,\r\n};\r\n\r\nexport type ShareDTO = {\r\n names: Array,\r\n itemUris: Array,\r\n action: ShareActionDTO,\r\n principals: Array,\r\n message?: string,\r\n};\r\n\r\nexport type ShareFormDTO = ShareDTO & {\r\n message: string,\r\n};\r\n\r\nexport type ShareAllowedDTO = {\r\n allowedAcl: Array,\r\n};\r\n\r\nexport type ShareAttachment = {\r\n name: string,\r\n ext: string,\r\n size: number,\r\n};\r\n\r\nexport const SORT_BUCKET_NAME = \"__SORT__\";\r\n\r\nexport const GridListConstant = {\r\n ExtensionIcon: \"ExtensionIcon\",\r\n IconItemStatus: \"IconItemStatus\",\r\n ItemUri: \"ITEMURI\",\r\n};\r\n\r\nexport type ItemContextResponseDTO = {\r\n isDoc: boolean,\r\n siteType: SiteTypeEnum,\r\n isFlatAU: boolean,\r\n isReadOnly: boolean,\r\n viewNameType: ViewNameTypeEnum,\r\n itemStatus?: ItemStatusesDTO,\r\n isFolderClassificationEditAllowed?: boolean,\r\n isEditAllowed?: boolean,\r\n isDocClassificationEditAllowed?: boolean,\r\n isDocEditAllowed?: boolean,\r\n isDocDownloadAllowed?: boolean,\r\n isDocAssignmentAllowed?: boolean,\r\n isDocSendByEmailAllowed?: boolean,\r\n inPointSyncIntegration?: boolean,\r\n isOffline?: boolean,\r\n name?: string,\r\n ext?: string,\r\n size?: number,\r\n customViewerUrl?: string,\r\n isContinuousPreview?: boolean,\r\n};\r\n\r\nconst ItemContextsFlags = {\r\n NotSet: 0,\r\n ItemType: 1,\r\n ItemStatus: 2,\r\n ResultFlags: 4,\r\n Offline: 8,\r\n Pdf: 16,\r\n WebDavName: 32,\r\n Extension: 64,\r\n Filesize: 128,\r\n ViewerUrl: 256,\r\n ViewName: 512,\r\n Workflow: 1024,\r\n};\r\nItemContextsFlags.All =\r\n ItemContextsFlags.ItemType |\r\n ItemContextsFlags.ItemStatus |\r\n ItemContextsFlags.ResultFlags |\r\n ItemContextsFlags.Offline |\r\n ItemContextsFlags.WebDavName |\r\n ItemContextsFlags.Pdf |\r\n ItemContextsFlags.Extension |\r\n ItemContextsFlags.Filesize |\r\n ItemContextsFlags.ViewerUrl |\r\n ItemContextsFlags.ViewName |\r\n ItemContextsFlags.Workflow;\r\n\r\nexport { ItemContextsFlags };\r\n\r\nexport type ItemContextsFlagsEnum = $Values;\r\n\r\nexport const ItemContextKey = {\r\n IsDoc: \"isDoc\",\r\n IsFlatAU: \"isFlatAU\",\r\n IsReadOnly: \"isReadOnly\",\r\n ViewName: \"viewNameType\",\r\n ItemStatus: \"itemStatus\",\r\n HasWorkflow: \"hasWorkflow\",\r\n WebDavName: \"name\",\r\n InPointSyncIntegration: \"inPointSyncIntegration\",\r\n IsFolderClassificationEditAllowed: \"isFolderClassificationEditAllowed\",\r\n IsEditAllowed: \"isEditAllowed\",\r\n Extension: \"ext\",\r\n Filesize: \"size\",\r\n IsDocClassificationEditAllowed: \"isDocClassificationEditAllowed\",\r\n IsDocEditAllowed: \"isDocEditAllowed\",\r\n IsDocDownloadAllowed: \"isDocDownloadAllowed\",\r\n IsDocAssignmentAllowed: \"isDocAssignmentAllowed\",\r\n IsDocSendByEmailAllowed: \"isDocSendByEmailAllowed\",\r\n IsOffline: \"isOffline\",\r\n HasPdf: \"hasPdf\",\r\n CanPdf: \"canPdf\",\r\n IsPdf: \"isPdf\",\r\n SiteType: \"siteType\",\r\n ViewerUrl: \"customViewerUrl\",\r\n IsContinuousPreview: \"isContinuousPreview\",\r\n CanBeShared: \"canBeShared\",\r\n};\r\nexport type ItemContextKeyEnum = $Values;\r\n\r\nexport type ItemContextRequestDTO = {\r\n itemUri: string,\r\n formatId: number,\r\n itemContexts: ItemContextsFlagsEnum,\r\n};\r\n\r\nexport const TransferType = {\r\n Copy: \"copy\",\r\n Move: \"move\",\r\n Link: \"link\",\r\n};\r\n\r\nexport type TransferTypeEnum = $Values;\r\n\r\nexport type TransferItemRequestDTO = {\r\n type: TransferTypeEnum,\r\n name: string,\r\n itemUri: string,\r\n targetItemUri: string,\r\n};\r\n\r\nexport type MultiSelectionActions = {\r\n handleAdd: (id: number) => void,\r\n handleRemove: (id: number) => void,\r\n handleToggle: (id: number) => void,\r\n handleSelectAll: () => void,\r\n handleDeselectAll: () => void,\r\n handleInvert: () => void,\r\n};\r\n\r\nexport type MultiSelectionHandlers = {\r\n onTouchEnd: () => void,\r\n onTouchMove: () => void,\r\n onTouchStart: () => void,\r\n};\r\n\r\nexport type MultiSelectionContextProps = {\r\n handler: MultiSelectionHandlers,\r\n multiple: boolean,\r\n actions: MultiSelectionActions,\r\n isSelected: (index: number) => boolean,\r\n renderedBucket: React.Component,\r\n renderCheckbox: (index: number) => React.Component,\r\n};\r\n\r\nexport type MultiSelectionProps = {\r\n actions: MultiSelectionActions,\r\n activeRows: any,\r\n availableRows: any,\r\n setAvailableRows: () => void,\r\n enable: () => void,\r\n disable: () => void,\r\n handler: MultiSelectionHandlers,\r\n multiple: boolean,\r\n isSelected: (index: number) => boolean,\r\n};\r\n\r\nexport const NotificationStyle = {\r\n Info: \"info\",\r\n Success: \"success\",\r\n Warning: \"warning\",\r\n Error: \"error\",\r\n Default: \"default\",\r\n};\r\nexport type NotificationStyleEnum = $Values;\r\n\r\nexport const NotificationStatusFlag = {\r\n New: 0,\r\n Read: 1,\r\n Pending: 2,\r\n Error: 4,\r\n};\r\nexport type NotificationStatusFlagEnum = $Values;\r\n\r\nexport type ToastProps = {\r\n message: string,\r\n icon?: string,\r\n details?: (props: ToastProps) => any,\r\n handleClick?: () => void,\r\n};\r\n\r\nexport type ToastType = ToastProps & {\r\n style?: NotificationStyleEnum,\r\n status?: NotificationStatusFlagEnum,\r\n toastId?: string,\r\n isRouted?: boolean,\r\n autoClose?: number | boolean,\r\n position?: $Keys,\r\n className?: string,\r\n};\r\n\r\nexport type GUID = string;\r\nexport type ToastId = string;\r\nexport type NotificationId = string;\r\n\r\nexport const PriorityType = {\r\n Low: 0,\r\n Intermediate: 1,\r\n High: 2,\r\n};\r\nexport type PriorityTypeEnum = $Values;\r\n\r\nexport type NotificationDTO = {\r\n notificationId: NotificationId,\r\n icon: string,\r\n message: string,\r\n priority: PriorityEnum,\r\n style: NotificationStyleEnum,\r\n status: NotificationStatusFlagEnum,\r\n toast?: any,\r\n Component?: React.Component,\r\n timestamp: Date,\r\n};\r\n\r\nexport const CommandActionStatusFlag = {\r\n NotSet: 0,\r\n Loading: 1,\r\n Done: 2,\r\n Success: 4,\r\n Partial: 8,\r\n Error: 16,\r\n};\r\nexport type CommandActionStatusFlagEnum = $Values<\r\n typeof CommandActionStatusFlag\r\n>;\r\n\r\nexport type CommandActionItem = {\r\n status: ConstantsEnum,\r\n itemUri: string,\r\n formatId: number,\r\n isDoc: boolean,\r\n};\r\n\r\nexport type CommandActionLog = {\r\n timestamp: Date,\r\n message: string,\r\n status: ConstantsEnum,\r\n details: any,\r\n itemUri: string,\r\n};\r\n\r\nexport type CommandActionRequest = {\r\n guid: GUID,\r\n status: CommandActionStatusFlagEnum,\r\n items: Array,\r\n commandAction: string,\r\n log: Array,\r\n};\r\n\r\nexport const FormBarView = {\r\n Document: \"document\",\r\n DocModal: \"docmodal\",\r\n Folder: \"folder\",\r\n Search: \"search\",\r\n LockInfo: \"lock_info\",\r\n ArchiveTarget: \"archive_target\",\r\n SearchScope: \"search_scope\",\r\n Upload: \"upload\",\r\n ItemFlows: \"itemflows\",\r\n};\r\n\r\nexport type FormBarViewEnum = $Values;\r\n","import ApiManagerBase, { type Context } from \"./ApiManagerBase\";\r\nimport { ContentType, HttpMethod, OfflineQueueItemType } from \"data/types\";\r\nimport { JL } from \"data/logging\";\r\nimport { ApiNetworkOfflineError } from \"data/apiError\";\r\nimport { addToOfflineQueue } from \"data/offline/offlineQueue\";\r\nimport { isOnline } from \"data/storeHelper\";\r\nimport { toastStyled, toastTypes } from \"data/toast\";\r\n\r\nconst QueuedOfflineStatusText = \"[OFFLINE]\";\r\n\r\n/**\r\n * Adds Offline capabilities\r\n *\r\n * @export\r\n * @class ApiManagerOffline\r\n * @extends {ApiManagerBase}\r\n */\r\nexport default class ApiManagerOffline extends ApiManagerBase {\r\n constructor(args) {\r\n super(args);\r\n this._log = JL(\"ApiManagerOffline\");\r\n this.OnFetch = this.OnFetch.bind(this);\r\n this.AfterFetch = this.AfterFetch.bind(this);\r\n this.CheckLicense = this.CheckLicense.bind(this);\r\n }\r\n\r\n /**\r\n * Runs actual data fetch\r\n * @param {Context} context query context\r\n * @returns {Promise} current context with fetch .response\r\n * @memberof ApiManagerOffline\r\n * @virtual\r\n */\r\n async OnFetch(context: Context): Promise {\r\n if (false === isOnline()) {\r\n this._log.debug(() => ({\r\n msg: `${context.request.name}: OnFetch`,\r\n apiContext: context,\r\n }));\r\n context = await this._handleOfflineRequest(context);\r\n } else {\r\n context = await super.OnFetch(context);\r\n }\r\n return context;\r\n }\r\n\r\n /**\r\n * First response in fetch response chain\r\n * @param {Context} context query context\r\n * @returns {Promise} current context\r\n * @memberof ApiManager\r\n * @virtual\r\n */\r\n async AfterFetch(context: Context): Promise {\r\n context = await super.AfterFetch(context);\r\n\r\n const { response } = context;\r\n const addedToOfflineQueue =\r\n response.status === 202 &&\r\n response.statusText === QueuedOfflineStatusText;\r\n\r\n if (\r\n addedToOfflineQueue &&\r\n context.request.offline &&\r\n context.request.offline.showToast !== false\r\n ) {\r\n toastStyled(toastTypes.swOfflineQueueAdd);\r\n }\r\n return context;\r\n }\r\n\r\n /**\r\n * Logic for handling a Request while network is offline\r\n * Note: we handle offline requests by ourselves, since:\r\n * 1. workbox only checks ONE cache at a time\r\n * 2. workbox cannot handle PUT/POST requests (tricky with plugins)\r\n * 3. we handle our own offlineItems (ApiManagerOffline)\r\n * 4. we return custom error for non-cached methods\r\n * @param {Context} context\r\n * @returns {Promise}\r\n * @memberof ApiManager\r\n * @private\r\n */\r\n async _handleOfflineRequest(context: Context): Promise {\r\n // do we have request pre-cached?\r\n const cacheKey = this._getFullCacheKey(context);\r\n const match = await window.caches.match(cacheKey);\r\n if (match != null) {\r\n this._log.debug(() => ({\r\n msg: `${context.request.name}: OnFetch (from cache)`,\r\n apiContext: context,\r\n cacheKey,\r\n }));\r\n context.response = match;\r\n } else {\r\n // is this a Save request and the ApiMethod supports it?\r\n const shouldSaveOffline =\r\n context.request.offline &&\r\n context.request.offline.allowEdit &&\r\n [HttpMethod.POST, HttpMethod.PUT, HttpMethod.DELETE].includes(\r\n context.request.method\r\n );\r\n\r\n if (shouldSaveOffline) {\r\n context = await this._handleOfflineSave(context, cacheKey);\r\n } else {\r\n // not managed offline - throw offline error\r\n this._log.warn(() => ({\r\n msg: `${context.request.name}: OnFetch (from cache) - NOT FOUND`,\r\n apiContext: context,\r\n cacheKey,\r\n }));\r\n throw new ApiNetworkOfflineError(\"OFFLINE\", cacheKey);\r\n }\r\n }\r\n return context;\r\n }\r\n\r\n async _handleOfflineTransformer(context: Context): Promise {\r\n if (\r\n context.request.contentType !== ContentType.AUTO &&\r\n context.request.contentType !== ContentType.JSON\r\n ) {\r\n throw new Error(\r\n `ApiCatalog method ${context.request.name} error: cache.transformer can only be used on ContentType.AUTO or JSON!`\r\n );\r\n }\r\n\r\n // transform it and convert back to body\r\n const resultBody = JSON.stringify(\r\n context.request.offline.transformer(context.request.params)\r\n );\r\n\r\n // return this response instead\r\n const headers = new Headers();\r\n headers.append(\"Content-Type\", \"application/json\");\r\n context.response = new Response(resultBody, {\r\n status: 202, // Accepted\r\n statusText: QueuedOfflineStatusText,\r\n headers,\r\n });\r\n return context;\r\n }\r\n\r\n /**\r\n * Logic for handling a Save Request while offline\r\n * @param {Context} context\r\n * @param {string} cacheKey\r\n * @returns {Promise}\r\n * @memberof ApiManager\r\n * @private\r\n */\r\n async _handleOfflineSave(\r\n context: Context,\r\n cacheKey: string\r\n ): Promise {\r\n this._log.info(() => ({\r\n msg: `${context.request.name}: OnFetch while offline - add to offline queue`,\r\n apiContext: context,\r\n cacheKey,\r\n }));\r\n\r\n await addToOfflineQueue({\r\n type: OfflineQueueItemType.ApiCall,\r\n name: context.request.name,\r\n params: context.request.params,\r\n });\r\n\r\n if (typeof context.request.offline.transformer === \"function\") {\r\n // #56022 Support offline save also for items not marked as offline\r\n // return the success body expected by the relevant apiCatalog method\r\n context = await this._handleOfflineTransformer(context);\r\n } else {\r\n // ...and return meaningful info e.g. \"will be saved once online...\" -> handled by AfterFetch()\r\n context.response = new Response(null, {\r\n status: 202, // Accepted\r\n statusText: QueuedOfflineStatusText,\r\n });\r\n }\r\n return context;\r\n }\r\n\r\n /**\r\n * We skip licensing check when offline\r\n * @param {Context} context query context\r\n * @returns {Promise} current context\r\n * @memberof ApiManagerOffline\r\n * @override\r\n */\r\n async CheckLicense(context: Context): Promise {\r\n return context;\r\n }\r\n}\r\n","import ApiManagerBase from \"./ApiManagerBase\";\r\nimport ApiManagerOffline from \"./ApiManagerOffline\";\r\nimport { isFeatureOn, Feature } from \"data/constants\";\r\n\r\nconst ApiManager = isFeatureOn(Feature.offline)\r\n ? new ApiManagerOffline()\r\n : new ApiManagerBase();\r\nexport default ApiManager;\r\n","// @flow\r\n//#region imports\r\nimport type {\r\n UserInfoResultDTO,\r\n CardItemResultDTO,\r\n TreeDTO,\r\n BreadcrumbResultDTO,\r\n FormResultDTO,\r\n SearchFormResultDTO,\r\n DocInfoResultDTO,\r\n DocInfoResultWithTokenDTO,\r\n DocListFilterRequestDTO,\r\n DocListSortRequestDTO,\r\n DocsResultDTO,\r\n WorkflowDTO,\r\n WorkflowInfoDTO,\r\n WorkflowProviderDTO,\r\n SAYTOptionDTO,\r\n SearchResultDTO,\r\n SearchCountResultDTO,\r\n SearchRequestDTO,\r\n SearchFilterDTO,\r\n UserPrincipalDTO,\r\n GroupPrincipalDTO,\r\n ExtraAttributesEmbeddedGridDTO,\r\n SortDirectionEnum,\r\n ItemLinkTypeEnum,\r\n ActivitiesDTO,\r\n NewFormTypeEnum,\r\n LookupValuesResultDTO,\r\n FormLookupTypeEnum,\r\n NewsFeedDTO,\r\n SubscribeResponseDTO,\r\n UserSettingsResultDTO,\r\n SearchFormInfoDTO,\r\n UserSettingsDTO,\r\n ItemFlowsConfigDTO,\r\n ItemFlowDirectionEnum,\r\n NewItemResultDTO,\r\n RasterMapResultDTO,\r\n ReminderDTO,\r\n ItemContextResponseDTO,\r\n TransferItemRequestDTO,\r\n ShareAttachment,\r\n // SearchValueTypeEnum\r\n} from \"data/types\";\r\nimport { ItemContextsFlags } from \"data/types\";\r\nimport API from \"./ApiManager\";\r\nimport { correlationId, isOnline } from \"data/storeHelper\";\r\nimport qs from \"data/queryString\";\r\n//#endregion\r\n\r\n//#region AbortSignal\r\n// https://github.com/flow-typed/flow-typed/issues/1652\r\n// translation of https://dom.spec.whatwg.org/#abortcontroller\r\ndeclare interface AbortSignal extends EventTarget {\r\n +aborted: boolean;\r\n onabort: EventHandler;\r\n}\r\ndeclare class AbortController {\r\n +signal: AbortSignal;\r\n abort: () => void;\r\n}\r\n//#endregion\r\n\r\n// helper\r\nconst nameof = (o) => Object.keys(o)[0];\r\n\r\n//#region SiteItems\r\nexport const fetchSites = (): Promise> =>\r\n API.call(nameof({ fetchSites }));\r\n//#endregion\r\n\r\n//#region UserInfo\r\n\r\n// retrieves the user's info object from WebApi\r\nexport const fetchUser = (): Promise =>\r\n API.call(nameof({ fetchUser }));\r\n//#endregion\r\n//#region UserSettings\r\n\r\nexport const fetchUserSettings = (): Promise =>\r\n API.call(nameof({ fetchUserSettings }));\r\n\r\nexport const saveUserSettings = (params: UserSettingsDTO): Promise =>\r\n API.call(nameof({ saveUserSettings }), { params });\r\n//#endregion\r\n//#region Cards\r\n\r\n// retrieves the user's home cards from WebApi\r\n/* istanbul ignore next */\r\nexport const fetchCards = (\r\n signal?: AbortController\r\n): Promise> =>\r\n API.call(nameof({ fetchCards }), { signal });\r\n\r\nexport const fetchCardsByEntity = (\r\n params: CardListRequest,\r\n signal?: AbortController\r\n): Promise> =>\r\n API.call(nameof({ fetchCardsByEntity }), { params, signal });\r\n//#endregion\r\n//#region Favorites\r\n\r\nexport const fetchNews = (): Promise =>\r\n API.call(nameof({ fetchNews }));\r\n\r\nexport const fetchFavorites = (): Promise> =>\r\n API.call(nameof({ fetchFavorites }));\r\n\r\nexport const addFavorite = (itemUri: string, name: string): Promise =>\r\n API.call(nameof({ addFavorite }), { params: { itemUri, name } });\r\n\r\nexport const delFavorite = (itemUri: string): Promise =>\r\n API.call(nameof({ delFavorite }), { params: { itemUri } });\r\n\r\nexport const addSearchFavorite = (params: SearchRequestDTO): Promise =>\r\n API.call(nameof({ addSearchFavorite }), {\r\n params,\r\n });\r\n\r\nexport const delFavoriteLink = (linkId: number): Promise =>\r\n API.call(nameof({ delFavoriteLink }), {\r\n params: { linkId },\r\n });\r\n//#endregion\r\n//#region Mails\r\n\r\nexport /* istanbul ignore next */ const sendMail = (\r\n params: SendNotificationRequestDTO\r\n): Promise =>\r\n API.call(nameof({ sendMail }), {\r\n params,\r\n });\r\n\r\nexport /* istanbul ignore next */ const sendMailAttachments = (\r\n params: SendDocumentsRequestDTO\r\n): Promise =>\r\n API.call(nameof({ sendMailAttachments }), {\r\n params,\r\n });\r\n//#endregion\r\n//#region Folder's Tree\r\n\r\nexport /* istanbul ignore next */ const fetchTree = ({\r\n itemUri,\r\n filter = \"\",\r\n deep = false,\r\n all = false,\r\n signal,\r\n}: {\r\n itemUri: string,\r\n filter: string,\r\n deep: boolean,\r\n all: boolean,\r\n signal?: AbortSignal,\r\n}): Promise =>\r\n API.call(nameof({ fetchTree }), {\r\n params: {\r\n itemUri,\r\n filter,\r\n deep,\r\n all,\r\n },\r\n signal,\r\n });\r\n//#endregion\r\n//#region Folder\r\n\r\nexport const createFolder = ({\r\n itemUri,\r\n formatId,\r\n elementType,\r\n values,\r\n}: {\r\n itemUri: string,\r\n formatId: number,\r\n elementType?: number,\r\n values: Object,\r\n}): Promise =>\r\n API.call(nameof({ createFolder }), {\r\n params: {\r\n itemUri,\r\n formatId,\r\n elementType,\r\n values,\r\n },\r\n });\r\n\r\nexport const createFolderFromTemplate = (\r\n template: string,\r\n itemUri: string,\r\n targetFolderName: string\r\n) =>\r\n API.call(nameof({ createFolderFromTemplate }), {\r\n params: { template, itemUri, targetFolderName },\r\n });\r\n\r\nexport const createFolderTemplateGetItemUri = (jobId: number) =>\r\n API.call(nameof({ createFolderTemplateGetItemUri }), {\r\n params: { jobId },\r\n });\r\n//#endregion\r\n//#region ItemFlows\r\n\r\nexport const fetchItemFlows = (\r\n itemUri: string,\r\n dir: ItemFlowDirectionEnum\r\n): Promise =>\r\n API.call(nameof({ fetchItemFlows }), {\r\n params: {\r\n itemUri,\r\n dir,\r\n },\r\n });\r\n\r\nexport const fetchItemFlowForm = ({\r\n formType,\r\n itemUri,\r\n templateId,\r\n templateType,\r\n}: {\r\n formType: NewFormTypeEnum,\r\n itemUri: string,\r\n templateId: string,\r\n templateType: string,\r\n}): Promise =>\r\n API.call(nameof({ fetchItemFlowForm }), {\r\n params: {\r\n formType,\r\n itemUri,\r\n templateId,\r\n templateType,\r\n },\r\n });\r\n\r\n//#endregion\r\n//#region Breadcrumb\r\n\r\nexport const fetchBreadcrumb = (\r\n itemUri: string,\r\n signal?: AbortSignal\r\n): Promise =>\r\n API.call(nameof({ fetchBreadcrumb }), { params: { itemUri }, signal });\r\n//#endregion\r\n//#region Item\r\nexport const delItemUri = (itemUri: string): Promise =>\r\n API.call(nameof({ delItemUri }), { params: { itemUri } });\r\n//#endregion\r\n//#region Form\r\nexport const fetchSearchFormList = (): Promise> =>\r\n API.call(nameof({ fetchSearchFormList }));\r\n\r\nexport const fetchNewForm = (\r\n formType: NewFormTypeEnum,\r\n itemUri: string\r\n): Promise =>\r\n API.call(nameof({ fetchNewForm }), {\r\n params: { itemUri },\r\n });\r\n\r\nexport const fetchForm = (itemUri: string): Promise =>\r\n API.call(nameof({ fetchForm }), { params: { itemUri } });\r\n\r\nexport const fetchSearchForm = (\r\n id: number,\r\n values: Object\r\n): Promise =>\r\n API.call(nameof({ fetchSearchForm }), {\r\n params: { id, values },\r\n });\r\n\r\nexport const fetchFormLookup = ({\r\n keyword,\r\n pageNum,\r\n isDoc,\r\n formatId,\r\n name,\r\n lookupType,\r\n id,\r\n filters,\r\n values,\r\n itemUri,\r\n}: {\r\n keyword: string,\r\n pageNum: number,\r\n isDoc: boolean,\r\n formatId: number,\r\n name: string,\r\n lookupType: FormLookupTypeEnum,\r\n id: ?number,\r\n filters: Array,\r\n values: Object,\r\n itemUri: string,\r\n}): Promise =>\r\n API.call(nameof({ fetchFormLookup }), {\r\n params: {\r\n keyword,\r\n pageNum,\r\n isDoc,\r\n formatId,\r\n name,\r\n lookupType,\r\n id,\r\n filters,\r\n values,\r\n itemUri,\r\n },\r\n });\r\n\r\nexport const fetchFormLookupDependencies = ({\r\n isDoc,\r\n formatId,\r\n name,\r\n lookupType,\r\n currentLookupValues,\r\n itemUri,\r\n}: {\r\n isDoc: boolean,\r\n formatId: number,\r\n name: string,\r\n lookupType: FormLookupTypeEnum,\r\n currentLookupValues: Array,\r\n itemUri: string,\r\n}) =>\r\n API.call(nameof({ fetchFormLookupDependencies }), {\r\n params: {\r\n isDoc,\r\n formatId,\r\n name,\r\n lookupType,\r\n currentLookupValues,\r\n itemUri,\r\n },\r\n });\r\n\r\nexport const fetchExtraAttributesEmbeddedGrid = (\r\n itemUri: string,\r\n name: string,\r\n filter: string,\r\n pageNum: number,\r\n sortColumn: string,\r\n sortDirection: SortDirectionEnum,\r\n signal?: AbortController\r\n): Promise =>\r\n API.call(nameof({ fetchExtraAttributesEmbeddedGrid }), {\r\n params: {\r\n itemUri,\r\n name,\r\n filter,\r\n pageNum,\r\n sortColumn,\r\n sortDirection,\r\n },\r\n signal,\r\n });\r\n\r\nexport const saveForm = (\r\n itemUri: string,\r\n formatId: number,\r\n values: Object,\r\n etag: string\r\n): Promise =>\r\n API.call(nameof({ saveForm }), {\r\n params: {\r\n itemUri,\r\n formatId,\r\n values,\r\n etag,\r\n },\r\n });\r\n\r\nexport const saveNewDocFromTemplate = ({\r\n templateId,\r\n itemUri,\r\n values,\r\n}: {\r\n templateId: string,\r\n itemUri: string,\r\n values: Object,\r\n}) =>\r\n API.call(nameof({ saveNewDocFromTemplate }), {\r\n params: {\r\n templateId,\r\n itemUri,\r\n values,\r\n },\r\n });\r\n\r\n/**\r\n * Will call the server to Validate a form's values\r\n * @export\r\n * @param {boolean} isNew create or update form?\r\n * @param {boolean} isDoc document or folder?\r\n * @param {string} itemUri if create then parent's itemUri, if update then item's itemUri\r\n * @param {boolean} validateWebdavName validate WebdavName?\r\n * @param {Object} values\r\n * @param {AbortController} [signal] AbortController's signal for cancelling\r\n * @returns {Promise} validationErrors - any resource names to localize will start with $\r\n */\r\nexport const validateForm = (\r\n isNew: boolean,\r\n isDoc: boolean,\r\n itemUri: string,\r\n validateWebdavName: boolean,\r\n values: Object,\r\n signal?: AbortSignal\r\n): Promise =>\r\n API.call(nameof({ validateForm }), {\r\n params: {\r\n isNew,\r\n isDoc,\r\n itemUri,\r\n validateWebdavName,\r\n values,\r\n },\r\n signal,\r\n });\r\n\r\nexport const getArchiveTargets = (\r\n offline?: boolean\r\n): Promise> =>\r\n API.call(nameof({ getArchiveTargets }), {\r\n params: { offline },\r\n });\r\n//#endregion\r\n//#region Documents\r\n\r\nexport const fetchActivities = (\r\n itemUri: string\r\n): Promise> =>\r\n API.call(nameof({ fetchActivities }), {\r\n params: { itemUri },\r\n });\r\n\r\nexport /* istanbul ignore next */ const fetchItemNote = (\r\n itemUri: string,\r\n noteId: number\r\n): Promise =>\r\n API.call(nameof({ fetchItemNote }), {\r\n params: { itemUri, noteId },\r\n });\r\n\r\nexport const addItemNote = (params: ActivityDTO): Promise =>\r\n API.call(nameof({ addItemNote }), {\r\n params,\r\n });\r\n\r\nexport const updateItemNote = (params: ActivityDTO): Promise =>\r\n API.call(nameof({ updateItemNote }), {\r\n params,\r\n });\r\n\r\nexport const deleteItemNote = (itemUri: string, noteId: number): Promise =>\r\n API.call(nameof({ deleteItemNote }), {\r\n params: { itemUri, noteId },\r\n });\r\n\r\nexport const delDocVersion = (\r\n itemUri: string,\r\n version: number\r\n): Promise =>\r\n API.call(nameof({ delDocVersion }), {\r\n params: { itemUri, version },\r\n });\r\n\r\nexport const restoreDocVersion = (\r\n itemUri: string,\r\n version: number\r\n): Promise =>\r\n API.call(nameof({ restoreDocVersion }), {\r\n params: { itemUri, version },\r\n });\r\n\r\nexport const fetchDocCount = (\r\n itemUri: string,\r\n filters?: Array,\r\n signal?: AbortController\r\n): Promise =>\r\n API.call(nameof({ fetchDocCount }), {\r\n params: {\r\n itemUri,\r\n pageNum: 0,\r\n filters,\r\n },\r\n signal,\r\n });\r\n\r\nexport const fetchDocsCsv = (\r\n itemUri: string,\r\n sorts?: DocListSortRequestDTO | Array,\r\n filters?: Array\r\n): Promise /* istanbul ignore next */ =>\r\n API.call(nameof({ fetchDocsCsv }), {\r\n params: {\r\n itemUri,\r\n sorts,\r\n filters,\r\n },\r\n });\r\n\r\nexport const fetchDocs = (\r\n itemUri: string,\r\n pageNum?: number,\r\n sorts?: DocListSortRequestDTO | Array,\r\n filters?: Array,\r\n cols?: Array,\r\n signal?: AbortSignal\r\n): Promise /* istanbul ignore next */ =>\r\n API.call(nameof({ fetchDocs }), {\r\n params: { itemUri, pageNum, sorts, filters, cols },\r\n signal,\r\n });\r\n\r\n/* istanbul ignore next */\r\nexport const fetchDownloadToken = (\r\n itemUri: string\r\n): Promise /* istanbul ignore next */ =>\r\n API.call(nameof({ fetchDownloadToken }), {\r\n params: { itemUri },\r\n });\r\n\r\n/* istanbul ignore next */\r\nexport function downloadDocToken(\r\n token: string,\r\n inline: ?boolean,\r\n pdf: ?boolean,\r\n stream: ?boolean\r\n): string /* istanbul ignore next */ {\r\n let data = { token };\r\n if (isOnline()) data.correlationId = correlationId();\r\n if (inline === true) data.inline = true;\r\n if (pdf === true) data.pdf = true;\r\n if (stream === true) data.stream = true;\r\n\r\n // if (uri !== undefined) {\r\n // return `${uri}?${qs.stringify(data)}`;\r\n // } else {\r\n const host =\r\n window.CONFIG.host.bridge ||\r\n `${window.CONFIG.host.basename}${window.CONFIG.general.api}`;\r\n return `${host}/doc/download?${qs.stringify(data)}`;\r\n // }\r\n}\r\n\r\n/* istanbul ignore next */\r\nconst downloadDocUri = (\r\n itemUri: string,\r\n inline: ?boolean,\r\n pdf: ?boolean\r\n): Promise =>\r\n fetchDownloadToken(itemUri).then((token: string) =>\r\n downloadDocToken(token, inline, pdf)\r\n );\r\n\r\nexport { downloadDocUri };\r\n\r\nexport const fetchThumbnail = (\r\n itemUri: string,\r\n signal?: AbortSignal\r\n): Promise =>\r\n API.call(nameof({ fetchThumbnail }), {\r\n params: { itemUri },\r\n signal,\r\n });\r\n\r\nexport const fetchRelatedDocs = (\r\n itemUri: string,\r\n itemLinkType: ItemLinkTypeEnum,\r\n getSource: ?boolean\r\n): Promise> =>\r\n API.call(nameof({ fetchRelatedDocs }), {\r\n params: { itemUri, itemLinkType, getSource },\r\n });\r\n\r\n/* istanbul ignore next */\r\nexport const getWebDavHttpLink = (\r\n itemUri: string,\r\n webDavName: string\r\n): Promise =>\r\n API.call(nameof({ getWebDavHttpLink }), {\r\n params: { itemUri, webDavName },\r\n });\r\n\r\n/* istanbul ignore next */\r\nexport const getCloudInfo = (\r\n itemUri: string,\r\n webDavName: string\r\n): Promise> =>\r\n API.call(nameof({ getCloudInfo }), { params: { itemUri, webDavName } });\r\n\r\n//#endregion\r\n//#region (Un)lock\r\n\r\nexport const lock = (itemUri: string): Promise =>\r\n API.call(nameof({ lock }), {\r\n params: { itemUri },\r\n });\r\n\r\nexport const unlock = (itemUri: string): Promise =>\r\n API.call(nameof({ unlock }), {\r\n params: { itemUri },\r\n });\r\n//#endregion\r\n//#region (Un)subscribe\r\n\r\nexport const subscribe = (itemUri: string, name: string): Promise =>\r\n API.call(nameof({ subscribe }), {\r\n params: { itemUri, name },\r\n });\r\n\r\nexport const isSubscribed = (itemUri: string): Promise =>\r\n API.call(nameof({ isSubscribed }), {\r\n params: { itemUri },\r\n });\r\n\r\nexport const unsubscribeByItemUri = (itemUri: string): Promise =>\r\n API.call(nameof({ unsubscribeByItemUri }), {\r\n params: { itemUri },\r\n });\r\n\r\nexport const unsubscribeById = ({\r\n linkID,\r\n itemUri,\r\n}: {\r\n linkID: number,\r\n itemUri: string,\r\n}): Promise =>\r\n API.call(nameof({ unsubscribeById }), {\r\n params: { linkID, itemUri },\r\n });\r\n//#endregion\r\n//#region Workflow\r\nexport const fetchWorkflowProviders = (\r\n signal?: AbortController\r\n): Promise> =>\r\n API.call(nameof({ fetchWorkflowProviders }), {\r\n signal,\r\n });\r\n\r\nexport const fetchWorkflowCards = (\r\n signal?: AbortController\r\n): Promise> =>\r\n API.call(nameof({ fetchWorkflowCards }), {\r\n signal,\r\n });\r\n\r\nexport const fetchNewWorkflows = (\r\n itemUri: string,\r\n signal?: AbortSignal\r\n): Promise> =>\r\n API.call(nameof({ fetchNewWorkflows }), {\r\n params: { itemUri },\r\n signal,\r\n });\r\nexport const fetchWorkflowInfo = ({\r\n provider,\r\n wfId,\r\n itemUri,\r\n signal,\r\n}: {\r\n provider: string,\r\n wfId?: string,\r\n itemUri?: string,\r\n signal?: AbortSignal,\r\n}): Promise> =>\r\n API.call(nameof({ fetchWorkflowInfo }), {\r\n params: { provider, wfId, itemUri },\r\n signal,\r\n });\r\n\r\n//#endregion\r\n//#region Recycle Bin\r\nexport const delDefiniteItemUri = (itemUri: string): Promise =>\r\n API.call(nameof({ delDefiniteItemUri }), {\r\n params: { itemUri },\r\n });\r\n\r\nexport const restoreItemUri = (itemUri: string): Promise =>\r\n API.call(nameof({ restoreItemUri }), {\r\n params: { itemUri },\r\n });\r\n\r\n//#endregion\r\n//#region Raster maps\r\nexport const fetchRasterMapLayers = ({\r\n itemUri,\r\n rasterMapIdSelector,\r\n create,\r\n}: {\r\n itemUri: string,\r\n rasterMapIdSelector: ?string,\r\n create?: boolean,\r\n}): Promise =>\r\n API.call(nameof({ fetchRasterMapLayers }), {\r\n params: { itemUri, rasterMapIdSelector, create },\r\n });\r\n\r\nexport const saveRasterMapLayers = ({\r\n map,\r\n}: {\r\n map: RasterMapSaveRequestDTO,\r\n}): Promise =>\r\n API.call(nameof({ saveRasterMapLayers }), {\r\n params: map,\r\n });\r\n//#endregion\r\n//#region Search\r\n\r\nexport const fetchSAYT = (\r\n keyword: ?string,\r\n itemUri: ?string\r\n): Promise> /* istanbul ignore next */ =>\r\n API.call(nameof({ fetchSAYT }), {\r\n params: { keyword, itemUri },\r\n });\r\n\r\nexport const fetchSearchCount = (\r\n params: SearchRequestDTO,\r\n signal?: AbortSignal\r\n): Promise /* istanbul ignore next */ =>\r\n API.call(nameof({ fetchSearchCount }), {\r\n params,\r\n signal,\r\n });\r\n\r\nexport const fetchSearchResult = (\r\n params: SearchRequestDTO\r\n): Promise /* istanbul ignore next */ =>\r\n API.call(nameof({ fetchSearchResult }), {\r\n params,\r\n });\r\n\r\n/* istanbul ignore next */\r\nexport const fetchSearchPrincipal = (\r\n keyword: string,\r\n includeUsers: boolean = true,\r\n includeGroups: boolean = false,\r\n signal?: AbortSignal\r\n): Promise> =>\r\n API.call(nameof({ fetchSearchPrincipal }), {\r\n params: { keyword, includeUsers, includeGroups },\r\n signal,\r\n });\r\n\r\nexport const fetchSearchSuggestion = (\r\n provider: string,\r\n filters: Array\r\n): Promise =>\r\n API.call(nameof({ fetchSearchSuggestion }), {\r\n params: { provider, filters },\r\n });\r\n//#endregion\r\n//#region Reminder\r\nexport const fetchReminders = (\r\n itemUri: string,\r\n signal?: AbortSignal\r\n): Promise> =>\r\n API.call(nameof({ fetchReminders }), {\r\n params: { itemUri },\r\n signal,\r\n });\r\n\r\nexport const upsertReminder = (\r\n params: ReminderDTO,\r\n signal?: AbortSignal\r\n): int =>\r\n API.call(nameof({ upsertReminder }), {\r\n params,\r\n signal,\r\n });\r\n\r\nexport const deleteReminder = (\r\n reminderId: number,\r\n itemUri: string,\r\n signal?: AbortSignal\r\n): int =>\r\n API.call(nameof({ deleteReminder }), {\r\n params: { reminderId, itemUri },\r\n signal,\r\n });\r\n//#endregion\r\n//#region Share\r\n\r\nexport const fetchShare = (\r\n itemUri: string,\r\n signal?: AbortSignal\r\n): Promise =>\r\n API.call(nameof({ fetchShare }), { params: { itemUri }, signal });\r\n\r\nexport const createShare = (\r\n shareRequest: ShareDTO,\r\n signal?: AbortSignal\r\n): Promise =>\r\n API.call(nameof({ createShare }), { params: shareRequest }, signal);\r\n\r\nexport const updateShare = (\r\n shareRequest: ShareDTO,\r\n signal?: AbortSignal\r\n): Promise =>\r\n API.call(nameof({ updateShare }), { params: shareRequest }, signal);\r\n\r\nexport const deleteShare = (\r\n itemUri: string,\r\n signal?: AbortSignal\r\n): Promise =>\r\n API.call(nameof({ deleteShare }), { params: { itemUri }, signal });\r\n\r\nexport const checkShareName = (\r\n itemUris: Array,\r\n webDavNames: Array,\r\n signal?: AbortSignal\r\n): Promise =>\r\n API.call(nameof({ checkShareName }), {\r\n params: { itemUris, webDavNames },\r\n signal,\r\n });\r\n\r\nexport const fetchShareContext = (\r\n itemUris: Array,\r\n formatIds: Array,\r\n signal?: AbortSignal\r\n): Promise =>\r\n API.call(nameof({ fetchShareContext }), {\r\n params: { itemUris, formatIds },\r\n signal,\r\n });\r\n\r\n//#endregion\r\n//#region Offline\r\n\r\nexport const fetchOfflineItems = (): Promise> =>\r\n API.call(nameof({ fetchOfflineItems }));\r\n\r\nexport const addOfflineItem = (itemUri: string): Promise =>\r\n API.call(nameof({ addOfflineItem }), {\r\n params: { itemUri },\r\n });\r\n\r\nexport const delOfflineItem = (itemUri: string): Promise =>\r\n API.call(nameof({ delOfflineItem }), {\r\n params: { itemUri },\r\n });\r\n\r\n// called directly by service-worker.custom.js\r\n// export const fetchOfflinePrecache = (): Promise> =>\r\n// API.call(nameof({ fetchOfflinePrecache }));\r\n//#endregion\r\n\r\n//#region transfer\r\nexport const transfer = (\r\n transferRequest: TransferItemRequestDTO\r\n): Promise =>\r\n API.call(nameof({ transfer }), { params: transferRequest });\r\n//#endregion\r\n\r\n//#region context\r\nexport const context = (\r\n itemUris,\r\n formatIds,\r\n /* istanbul ignore next */\r\n itemContexts = ItemContextsFlags.All\r\n): Promise =>\r\n API.call(nameof({ context }), {\r\n params: { itemUris, formatIds, itemContexts },\r\n });\r\n\r\nexport const fetchItemContexts = (...args) => context(...args);\r\n\r\nexport const fetchShareAttachment = (\r\n itemUri: string\r\n): Promise =>\r\n context(\r\n [itemUri],\r\n null,\r\n ItemContextsFlags.WebDavName |\r\n ItemContextsFlags.Extension |\r\n ItemContextsFlags.Filesize\r\n );\r\n\r\nexport const fetchDocResultFlags = (\r\n itemUri: string,\r\n formatId: number\r\n): Promise =>\r\n context([itemUri], [formatId], ItemContextsFlags.ResultFlags);\r\n\r\nexport const fetchItemContext = (\r\n itemUri: string\r\n): Promise =>\r\n context([itemUri], null, ItemContextsFlags.All);\r\n\r\nexport /* istanbul ignore next */ const fetchViewNameType = (\r\n itemUri: string\r\n): Promise =>\r\n context([itemUri], null, ItemContextsFlags.ViewName);\r\n\r\n//#endregion\r\n","import ApiManager from \"data/ApiManagerBase\";\r\nimport { offlineQueueStorage, getAllItems } from \"data/storage\";\r\nimport { toastActionResult, dismissToast, toastId } from \"data/toast\";\r\nimport { sleep } from \"data/utils\";\r\nimport { JL } from \"data/logging\";\r\nimport { openConflictModal } from \"components/ConflictModal\";\r\nimport produce from \"immer\";\r\nimport { OfflineQueueItem, OfflineQueueItemType } from \"data/types\";\r\n// import uppy from \"data/uppy\";\r\n\r\nconst _log = JL(\"offlineQueue\");\r\nconst UPDATE_CONFLICT_EVENTID = 1201;\r\n\r\nexport /**\r\n * Add an ApiCatalog call to the offlineQueue\r\n * @param {string} name ApiCatalog.name\r\n * @param {*} params parameters to pass to ApiManager.call\r\n * @returns {Promise}\r\n */\r\nconst addToOfflineQueue = ({\r\n key,\r\n type,\r\n name,\r\n params,\r\n}: {\r\n key?: string,\r\n type: OfflineQueueItemTypeEnum,\r\n name: string,\r\n params: any,\r\n}): Promise => {\r\n let dbKey = key;\r\n if (dbKey == null) {\r\n dbKey = String(Date.now());\r\n if (params && params.hasOwnProperty(\"itemUri\")) {\r\n dbKey = params.itemUri + \"_\" + dbKey;\r\n }\r\n }\r\n return offlineQueueStorage.setItem(dbKey, {\r\n type,\r\n name,\r\n params,\r\n });\r\n};\r\n\r\nexport const anyPendingChanges = (keyPrefix: string): Promise =>\r\n // TODO review anyPendingChanges for exact or startsWith itemUri?\r\n offlineQueueStorage\r\n .keysStartingWith(keyPrefix)\r\n .then((result) => result.length > 0);\r\n\r\n/**\r\n * Works through the offlineQueue and retries the ApiCatalog calls\r\n */\r\nexport async function replayOfflineQueue(): Promise {\r\n const count = await offlineQueueStorage.length();\r\n if (count === 0) return;\r\n _log.debug(() => ({\r\n msg: `Found ${count} pending items in offlineQueue`,\r\n }));\r\n\r\n const api = new ApiManager();\r\n let isError = false;\r\n const allItems = await getAllItems(offlineQueueStorage);\r\n for (const item of allItems) {\r\n const offlineQueueItem = item.value;\r\n _log.debug(() => ({\r\n msg: `Syncing \"${item.key}\" from offlineQueue`,\r\n api: offlineQueueItem,\r\n }));\r\n let success = false;\r\n switch (offlineQueueItem.type) {\r\n case OfflineQueueItemType.ApiCall:\r\n success = await _replayApiCall(api, item.key, offlineQueueItem);\r\n break;\r\n case OfflineQueueItemType.UppyFile:\r\n success = await _replayUppyUpload(item.key, offlineQueueItem);\r\n break;\r\n /* istanbul ignore next */\r\n default:\r\n _log.warn(() => ({\r\n msg: \"Unknown OfflineQueueItemType\",\r\n offlineQueueItem,\r\n }));\r\n break;\r\n }\r\n\r\n if (!success) isError = true;\r\n }\r\n\r\n dismissToast(toastId.NetworkStatus);\r\n toastActionResult(!isError, \"common:offline.synced\");\r\n}\r\n\r\n// returns true for success\r\nasync function _replayApiCall(\r\n api: ApiManager,\r\n key: string,\r\n queueItem: OfflineQueueItem\r\n): Promise {\r\n let qi = produce(queueItem, (draft) => draft);\r\n\r\n // #55386 simple retrial policy\r\n for (let i = 0; i < 5; i++) {\r\n try {\r\n await api.call(qi.name, {\r\n params: qi.params,\r\n });\r\n await offlineQueueStorage.removeItem(key);\r\n return true;\r\n } catch (error) {\r\n // eslint-disable-next-line no-loop-func\r\n _log.error(() => ({\r\n msg: `Error while syncing \"${key}\" offline queue`,\r\n api: qi,\r\n error,\r\n }));\r\n qi = produce(qi, (draft) => {\r\n draft.retries = (draft.retries || 0) + 1;\r\n draft.error = error.data || error.message;\r\n });\r\n await offlineQueueStorage.setItem(key, qi);\r\n\r\n // #55376 conflict management\r\n if (\r\n error.data != null &&\r\n error.data.eventId === UPDATE_CONFLICT_EVENTID &&\r\n error.data.extra &&\r\n error.data.extra.name != null\r\n ) {\r\n qi = await _handleConflict(error, key, qi);\r\n if (qi == null) return true;\r\n }\r\n await sleep(3000);\r\n }\r\n }\r\n\r\n return false;\r\n}\r\n\r\n// returns true to try again\r\nasync function _handleConflict(\r\n error,\r\n key: string,\r\n offlineQueueItem: OfflineQueueItem\r\n): Promise {\r\n const doOverwrite = await openConflictModal(error.data.extra.name);\r\n if (doOverwrite) {\r\n const qi = produce(offlineQueueItem, (draft) => {\r\n // we blindly set the etag, reset counter try again\r\n draft.params[\"etag\"] = error.data.extra.currentEtag;\r\n draft.retries = 0;\r\n draft.error = null;\r\n });\r\n // update and immediately continue and retry (shorten concurrency window)\r\n await offlineQueueStorage.setItem(key, qi);\r\n return qi;\r\n } else {\r\n await offlineQueueStorage.removeItem(key);\r\n return null;\r\n }\r\n}\r\n\r\n// returns true for success\r\nasync function _replayUppyUpload(\r\n key: string,\r\n offlineQueueItem: OfflineQueueItem\r\n): Promise {\r\n try {\r\n const uppy = (await import(\"data/uppy\")).default;\r\n uppy.addFile(offlineQueueItem.params);\r\n const result = await uppy.retryUpload(offlineQueueItem.params.id);\r\n if (result && result.failed && result.failed.length === 0) {\r\n await offlineQueueStorage.removeItem(key);\r\n uppy.reset();\r\n return true;\r\n } else {\r\n throw new Error(\"Uppy upload failed\");\r\n }\r\n } catch (error) {\r\n _log.error(() => ({\r\n msg: \"While replaying uppy file upload\",\r\n error,\r\n offlineQueueItem,\r\n }));\r\n const qi = produce(offlineQueueItem, (draft) => {\r\n draft.retries = (draft.retries || 0) + 1;\r\n draft.error = error.data || error.message;\r\n });\r\n await offlineQueueStorage.setItem(key, qi);\r\n }\r\n return false;\r\n}\r\n","import React from \"react\";\r\nimport FormsyEditorBase from \"./FormsyEditorBase\";\r\nimport MaskedInput from \"@hs/masked-input\";\r\nimport { getClassNames } from \"data/utils\";\r\nimport IMask from \"imask\";\r\nimport loc from \"i18next\";\r\n\r\nconst TextEditorControl = (props) => (\r\n (\r\n \r\n )}\r\n {...props}\r\n validations={{\r\n ...props.validations,\r\n notEmptyMask: /*istanbul ignore next*/ (values, value) => {\r\n if (!props.isRequired || !props.mask) return true;\r\n const rawValue = IMask.pipe(\r\n value,\r\n {\r\n mask: props.mask,\r\n definitions: {\r\n \"#\": /[0-9]/,\r\n \"&\": /./,\r\n A: /[0-9a-zA-Z]/,\r\n a: /[0-9a-zA-Z]/,\r\n 9: /[0-9]/,\r\n C: /./,\r\n \"?\": /./,\r\n n: /[0-9]/,\r\n },\r\n },\r\n IMask.PIPE_TYPE.MASKED,\r\n IMask.PIPE_TYPE.UNMASKED\r\n );\r\n return String(rawValue) !== \"\";\r\n },\r\n }}\r\n validationErrors={{\r\n ...props.validationErrors,\r\n notEmptyMask: loc.t(\"common:validation.required\"),\r\n }}\r\n />\r\n);\r\nTextEditorControl.displayName = \"TextEditorControl\";\r\nexport default TextEditorControl;\r\n","import { isListed } from \"data/utils\";\r\nimport {\r\n type ItemActionConfigBase,\r\n type ItemActionsConfigDTO,\r\n} from \"data/types\";\r\nimport { shouldBeVisible } from \"./ShouldBeVisible\";\r\nimport store from \"data/store\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport { getItemActionsConfig } from \"data/itemActions\";\r\nimport { getDefaultsConfig } from \"data/constants\";\r\nimport unionBy from \"lodash/unionBy\";\r\nimport cloneDeep from \"lodash/cloneDeep\";\r\n\r\nexport /**\r\n * returns true if item (itemAction or category) should be shown to the user\r\n *\r\n * @param {ItemActionConfigBase} item action or category to render\r\n * @param {string} itemUri current item\r\n * @param {number} formatId current formatId\r\n * @param {Object} contextProps current contextProps\r\n * @param {string} [targetView] override view context (from store)\r\n * @returns {boolean} true if should render, false to hide\r\n */\r\nconst shouldRenderItem = async (\r\n item: ItemActionConfigBase,\r\n itemUri: string,\r\n formatId: number,\r\n contextProps: Object,\r\n targetView: ?string\r\n): Promise => {\r\n if (contextProps == null) return false;\r\n if (item.visible === false) return false;\r\n if (\r\n item.views &&\r\n !check_isView({\r\n views: item.views,\r\n targetView,\r\n })\r\n )\r\n return false;\r\n if (\r\n item.itemUriRegex &&\r\n !check_itemUriRegex({\r\n itemUri,\r\n itemUriRegex: item.itemUriRegex,\r\n })\r\n )\r\n return false;\r\n if (\r\n item.formatIds &&\r\n !check_formatId({\r\n formatId,\r\n formatIds: item.formatIds,\r\n })\r\n )\r\n return false;\r\n\r\n // Add backwards compatibility\r\n const backwardsCompatibleShouldBeVisible = (\r\n item.shouldBeVisible ?? [\r\n \"!isRecycleBin\",\r\n \"!isSpecialFolder\",\r\n \"!isMultiSelection\",\r\n \"isOnline\",\r\n ]\r\n ).slice();\r\n\r\n // hide everything from recyclebin\r\n if (\r\n !backwardsCompatibleShouldBeVisible.some((rule) =>\r\n rule.endsWith(\"isRecycleBin\")\r\n )\r\n ) {\r\n backwardsCompatibleShouldBeVisible.push(\"!isRecycleBin\");\r\n }\r\n // hide everything from special folder\r\n if (\r\n !contextProps.multiple &&\r\n !backwardsCompatibleShouldBeVisible.some((rule) =>\r\n rule.endsWith(\"isSpecialFolder\")\r\n )\r\n ) {\r\n backwardsCompatibleShouldBeVisible.push(\"!isSpecialFolder\");\r\n }\r\n // hide everything on multi selection\r\n if (\r\n !backwardsCompatibleShouldBeVisible.some(\r\n (rule) =>\r\n rule.endsWith(\"isMultiSelection\") ||\r\n rule.endsWith(\"isAnySelection\")\r\n )\r\n ) {\r\n backwardsCompatibleShouldBeVisible.push(\"!isMultiSelection\");\r\n }\r\n // hide everything offline...\r\n if (\r\n !backwardsCompatibleShouldBeVisible.some(\r\n (rule) =>\r\n rule.endsWith(\"isOnline\") || rule.endsWith(\"isAnyOnlineStatus\")\r\n )\r\n ) {\r\n backwardsCompatibleShouldBeVisible.push(\"isOnline\");\r\n }\r\n\r\n // apply shouldBeVisible\r\n return (\r\n shouldBeVisible({\r\n item: {\r\n ...item,\r\n shouldBeVisible: backwardsCompatibleShouldBeVisible,\r\n },\r\n itemUri,\r\n contextProps,\r\n }) === true\r\n );\r\n};\r\n\r\nexport /**\r\n * checks if view is (not) included in list (case-insensitive)\r\n * negate with \"!\" as prefix\r\n *\r\n * @param {{Array}} views to search\r\n * @param {{?string}} targetView to (not) search for in views\r\n * @returns {boolean} true if match found\r\n */\r\nconst check_isView = ({\r\n views,\r\n targetView,\r\n}: {\r\n views: Array,\r\n targetView: ?string,\r\n}) => {\r\n if (views.length === 0) return false;\r\n const targetViewOrCurrent = targetView\r\n ? targetView\r\n : s.currentNameSelector(store.getState());\r\n const negatedViews = views\r\n .filter((l) => l.startsWith(\"!\"))\r\n .map((l) => l.substr(1));\r\n const defaultViews = views.filter((l) => !l.startsWith(\"!\"));\r\n return (\r\n (negatedViews.length === 0 ||\r\n !isListed(targetViewOrCurrent, negatedViews)) &&\r\n (defaultViews.length === 0 ||\r\n isListed(targetViewOrCurrent, defaultViews))\r\n );\r\n};\r\n\r\nexport /**\r\n * checks if itemUri matches the itemUriRegex regular expression\r\n * @returns {boolean} true if match found\r\n */\r\nconst check_itemUriRegex = ({\r\n itemUri,\r\n itemUriRegex,\r\n}: {\r\n itemUri: string,\r\n itemUriRegex: string,\r\n}) => new RegExp(itemUriRegex, \"i\").exec(itemUri) !== null;\r\n\r\nexport /**\r\n * checks if formatId is included in the formatIds list\r\n * @returns {boolean} true if included\r\n */\r\nconst check_formatId = ({\r\n formatId,\r\n formatIds,\r\n}: {\r\n formatId: number,\r\n formatIds: Array,\r\n}) => formatIds.includes(formatId);\r\n\r\nexport const mergePartialConfig = (userActions, sysActions) => {\r\n let result = cloneDeep(userActions);\r\n if (result)\r\n result.forEach((userAction) => {\r\n // is the userAction trying to override an existing system action (by id)?\r\n const sysIndex = sysActions.findIndex(\r\n (sa) => sa.id === userAction.id\r\n );\r\n if (sysIndex !== -1) {\r\n const sysAction = sysActions[sysIndex];\r\n // merge properties (in case user missed/does not want to specify any)\r\n Object.keys(sysAction).forEach((key) => {\r\n userAction[key] = userAction[key] || sysAction[key];\r\n });\r\n }\r\n });\r\n return result;\r\n};\r\n\r\n/** merges our data/itemActions.js with customer defined actions from appsettings.json */\r\nexport const mergeItemActionsConfig = (\r\n itemUri: string,\r\n formatId: number\r\n): ItemActionsConfigDTO => {\r\n // get itemActions as defined in appsettings.json (after being checked for security for this user)\r\n const userActions = cloneDeep(s.userItemActionsSelector(store.getState()));\r\n const itemActions = cloneDeep(getItemActionsConfig());\r\n\r\n // get itemUri specific itemActions\r\n const defaults = getDefaultsConfig(itemUri, formatId);\r\n if (defaults && defaults.itemActions) {\r\n if (defaults.itemActions.replace === true) {\r\n return {\r\n actions:\r\n mergePartialConfig(\r\n defaults.itemActions.actions,\r\n itemActions.actions\r\n ) || [],\r\n categories:\r\n defaults.itemActions.categories || itemActions.categories, // use our system categories in case they are not specified\r\n };\r\n } else {\r\n return {\r\n actions: unionBy(\r\n defaults.itemActions.actions,\r\n userActions.actions,\r\n itemActions.actions,\r\n \"id\"\r\n ),\r\n categories: unionBy(\r\n defaults.itemActions.categories,\r\n userActions.categories,\r\n itemActions.categories,\r\n \"id\"\r\n ),\r\n };\r\n }\r\n } else {\r\n return {\r\n actions: unionBy(userActions.actions, itemActions.actions, \"id\"),\r\n categories: unionBy(\r\n userActions.categories,\r\n itemActions.categories,\r\n \"id\"\r\n ),\r\n };\r\n }\r\n};\r\n","// @flow\r\nimport {\r\n type ItemActionsConfigDTO,\r\n ItemLinkType,\r\n SearchItemType,\r\n} from \"data/types\";\r\n\r\n// this file defines all the system pre-defined actionPanel commandActions available\r\n/* istanbul ignore next */\r\nexport const getItemActionsConfig = (): ItemActionsConfigDTO => ({\r\n categories: [\r\n {\r\n id: \"filter\",\r\n name: \"$actionCategory:filter.name\",\r\n icon: \"filter\",\r\n shouldBeVisible: [\r\n \"isAnyOnlineStatus\",\r\n \"isAnySelection\",\r\n \"hasRowAndColId\",\r\n ],\r\n },\r\n {\r\n id: \"general\",\r\n name: \"$actionCategory:general.name\",\r\n icon: \"hand-o-right\",\r\n shouldBeVisible: [\"isAnyOnlineStatus\", \"isAnySelection\"],\r\n },\r\n {\r\n id: \"doc\",\r\n name: \"$actionCategory:doc.name\",\r\n icon: \"file-text-o\",\r\n shouldBeVisible: [\"isAnyOnlineStatus\", \"isAnySelection\"],\r\n },\r\n {\r\n id: \"doclist\",\r\n name: \"$actionCategory:doclist.name\",\r\n icon: \"files-o\",\r\n shouldBeVisible: [\"isAnyOnlineStatus\", \"isAnySelection\"],\r\n },\r\n {\r\n id: \"wf\",\r\n name: \"$actionCategory:wf.name\",\r\n icon: \"check-square-o\",\r\n shouldBeVisible: [\"!hasContext:isFlatAU\", \"isWorkflowEnabled\"],\r\n },\r\n {\r\n id: \"reminder\",\r\n name: \"$actionCategory:reminder.name\",\r\n icon: \"clock-o\",\r\n },\r\n {\r\n id: \"history\",\r\n name: \"Activities\",\r\n expanded: true,\r\n shouldBeVisible: [\"hasContext:workflow\", \"isAnyOnlineStatus\"],\r\n },\r\n {\r\n id: \"sync\",\r\n name: \"$actionCategory:sync.name\",\r\n icon: \"external-link\",\r\n shouldBeVisible: [\"isSyncEnabled\", \"isAnySelection\"],\r\n },\r\n {\r\n id: \"clipboard\",\r\n name: \"$actionCategory:clipboard.name\",\r\n icon: \"clipboard\",\r\n shouldBeVisible: [\"isValidItemUri\", \"isAnyOnlineStatus\"],\r\n },\r\n {\r\n name: \"$actionCategory:others.name\",\r\n shouldBeVisible: [\"isAnyOnlineStatus\"],\r\n },\r\n {\r\n id: \"recyclebin\",\r\n name: \"$actionCategory:recyclebin\",\r\n icon: \"trash\",\r\n shouldBeVisible: [\"isAnySelection\", \"isRecycleBin\"],\r\n },\r\n {\r\n id: \"offline\",\r\n name: \"$actionCategory:offline\",\r\n shouldBeVisible: [\r\n \"hasFeature:offline\",\r\n \"isAnySelection\",\r\n \"isAnyOnlineStatus\",\r\n ],\r\n },\r\n ],\r\n actions: [\r\n {\r\n id: \"folder_activities\",\r\n category: \"history\",\r\n views: [\"home\", \"wf\"],\r\n shouldBeVisible: [\"isFolder\", \"isValidItemUri\"],\r\n commandAction: {\r\n name: \"folder_preview\",\r\n },\r\n view: {\r\n name: \"itemView_activityList\",\r\n isDoc: false,\r\n showAddNote: false,\r\n showHistory: false,\r\n showNotes: true,\r\n showRetentionInfo: false,\r\n },\r\n },\r\n {\r\n id: \"doc_activities\",\r\n category: \"history\",\r\n shouldBeVisible: [\"isDoc\", \"isValidItemUri\"],\r\n views: [\"home\", \"wf\", \"news\"],\r\n commandAction: {\r\n name: \"doc_preview\",\r\n },\r\n view: {\r\n name: \"itemView_activityList\",\r\n isDoc: true,\r\n showAddNote: false,\r\n showHistory: true,\r\n showNotes: true,\r\n },\r\n },\r\n {\r\n id: \"doclist_exportCsv\",\r\n category: \"doclist\",\r\n name: \"$itemActions:doclist_exportCsv.name\",\r\n icon: \"file-excel-o\",\r\n views: [\"flat\", \"folder\", \"miniflat\"],\r\n commandAction: { name: \"doclist_exportCsv\" },\r\n },\r\n {\r\n id: \"doclist_filters\",\r\n category: \"filter\",\r\n views: [\"flat\", \"folder\", \"miniflat\", \"mailbox\"],\r\n view: {\r\n name: \"itemView_filter\",\r\n actions: [\r\n \"filterByValue\",\r\n \"filterAddValue\",\r\n \"filterRemove\",\r\n \"reset\",\r\n ],\r\n },\r\n shouldBeVisible: [\"hasRowAndColId\"],\r\n commandAction: {}, //HACK: persist props to itemView\r\n },\r\n {\r\n id: \"doc_preview\",\r\n category: \"doc\",\r\n name: \"$itemActions:doc_preview.name\",\r\n icon: \"eye\",\r\n views: [\r\n \"flat\",\r\n \"folder\",\r\n \"searchresult\",\r\n \"news\",\r\n \"home\",\r\n \"wf\",\r\n \"offline_item\",\r\n ],\r\n shouldBeVisible: [\"isDoc\", \"isAnyOnlineStatus\"],\r\n commandAction: {\r\n name: \"doc_preview\",\r\n },\r\n },\r\n {\r\n id: \"doc_popout\",\r\n category: \"doc\",\r\n name: \"$itemActions:doc_popout.name\",\r\n icon: \"external-link\",\r\n views: [\r\n \"flat\",\r\n \"folder\",\r\n \"searchresult\",\r\n \"docmodal\",\r\n \"mailbox\",\r\n \"news\",\r\n \"home\",\r\n \"wf\",\r\n \"offline_item\",\r\n ],\r\n shouldBeVisible: [\"isDoc\", \"isAnyOnlineStatus\"],\r\n commandAction: {\r\n name: \"doc_preview\",\r\n props: {\r\n newWindow: true,\r\n },\r\n },\r\n },\r\n {\r\n id: \"doc_previewAndPrint\",\r\n category: \"doc\",\r\n name: \"$itemActions:doc_print.name\",\r\n icon: \"print\",\r\n views: [\r\n \"flat\",\r\n \"folder\",\r\n \"mailbox\",\r\n \"searchresult\",\r\n \"home\",\r\n \"news\",\r\n \"offline_item\",\r\n ],\r\n shouldBeVisible: [\r\n \"isDoc\",\r\n \"isAnyOnlineStatus\",\r\n \"hasItemStatus:PDF\",\r\n ],\r\n commandAction: {\r\n name: \"doc_preview\",\r\n props: {\r\n triggerPrint: true,\r\n },\r\n },\r\n },\r\n {\r\n id: \"doc_print\",\r\n category: \"doc\",\r\n name: \"$itemActions:doc_print.name\",\r\n icon: \"print\",\r\n views: [\"doc\", \"docmodal\"],\r\n shouldBeVisible: [\r\n \"isDoc\",\r\n \"isAnyOnlineStatus\",\r\n \"hasItemStatus:PDF\",\r\n ],\r\n commandAction: {\r\n name: \"doc_print\",\r\n },\r\n },\r\n {\r\n id: \"doc_lock\",\r\n category: \"doc\",\r\n name: \"$itemActions:doc_lock.name\",\r\n icon: \"lock\",\r\n views: [\"flat\", \"folder\", \"searchresult\", \"docmodal\", \"document\"],\r\n shouldBeVisible: [\r\n \"isDoc\",\r\n \"!hasItemStatus:Locked\",\r\n \"hasContext:isDocEditAllowed\",\r\n \"isAnySelection\",\r\n ],\r\n commandAction: {\r\n name: \"lock\",\r\n },\r\n },\r\n {\r\n id: \"doc_unlock\",\r\n category: \"doc\",\r\n name: \"$itemActions:doc_unlock.name\",\r\n icon: \"unlock\",\r\n views: [\"flat\", \"folder\", \"searchresult\", \"docmodal\", \"document\"],\r\n shouldBeVisible: [\r\n \"isDoc\",\r\n \"hasItemStatus:Locked\",\r\n \"hasContext:isDocEditAllowed\",\r\n \"isAnySelection\",\r\n ],\r\n commandAction: {\r\n name: \"unlock\",\r\n },\r\n },\r\n {\r\n id: \"fav_add\",\r\n category: \"general\",\r\n // name: \"Add as Favorite\",\r\n name: \"$itemActions:fav_add.name\",\r\n icon: \"star-o\",\r\n shouldBeVisible: [\r\n \"!isFav\",\r\n \"isValidItemUri\",\r\n \"isAnyOnlineStatus\",\r\n \"isAnySelection\",\r\n ],\r\n commandAction: {\r\n name: \"favorite\",\r\n props: {\r\n isFav: false,\r\n },\r\n },\r\n },\r\n {\r\n id: \"fav_remove\",\r\n category: \"general\",\r\n name: \"$itemActions:fav_remove.name\",\r\n // name: \"Remove from Favorites\",\r\n icon: \"star\",\r\n shouldBeVisible: [\r\n \"isFav\",\r\n \"isValidItemUri\",\r\n \"isAnyOnlineStatus\",\r\n \"isAnySelection\",\r\n ],\r\n commandAction: {\r\n name: \"favorite\",\r\n props: {\r\n isFav: true,\r\n },\r\n },\r\n },\r\n {\r\n id: \"share_web\",\r\n category: \"general\",\r\n name: \"$itemActions:share_web.name\",\r\n icon: \"share-alt\",\r\n shouldBeVisible: [\r\n \"hasBrowser_webShareApi\",\r\n \"isValidItemUri\",\r\n \"!hasSiteType:SharedSites\",\r\n \"isAnyOnlineStatus\",\r\n ],\r\n commandAction: {\r\n name: \"share_web\",\r\n },\r\n },\r\n {\r\n id: \"share\",\r\n category: \"general\",\r\n name: \"$itemActions:share.name\",\r\n icon: \"share-alt\",\r\n shouldBeVisible: [\r\n \"hasContext:canBeShared\",\r\n \"isValidItemUri\",\r\n \"isAnySelection\",\r\n ],\r\n commandAction: {\r\n name: \"share\",\r\n },\r\n },\r\n {\r\n id: \"share_edit\",\r\n category: \"general\",\r\n name: \"$itemActions:share_edit.name\",\r\n icon: \"share-alt-square\",\r\n shouldBeVisible: [\r\n \"hasContext:canBeShared\",\r\n \"isValidItemUri\",\r\n \"hasItemStatus:Share\",\r\n ],\r\n commandAction: {\r\n name: \"share\",\r\n props: {\r\n isEdit: true,\r\n },\r\n },\r\n },\r\n {\r\n id: \"search_favorite_add\",\r\n category: \"general\",\r\n // name: \"Add as Favorite\",\r\n name: \"$itemActions:fav_add.name\",\r\n icon: \"star-o\",\r\n shouldBeVisible: [\r\n \"hasContext:searchRequest\",\r\n `!hasSearchType:${SearchItemType.Favorite}`,\r\n ],\r\n commandAction: {\r\n name: \"search_favorite\",\r\n },\r\n },\r\n {\r\n id: \"search_favorite_remove\",\r\n category: \"general\",\r\n name: \"$itemActions:fav_remove.name\",\r\n // name: \"Remove from Favorites\",\r\n icon: \"star\",\r\n shouldBeVisible: [\r\n \"hasContext:searchRequest\",\r\n `hasSearchType:${SearchItemType.Favorite}`,\r\n ],\r\n commandAction: {\r\n name: \"search_favorite\",\r\n },\r\n },\r\n {\r\n id: \"search_preview\",\r\n category: \"general\",\r\n name: \"$itemActions:search_preview.name\",\r\n icon: \"eye\",\r\n views: [\"home\"],\r\n shouldBeVisible: [\"hasContext:searchRequest\"],\r\n commandAction: {\r\n name: \"search_preview\",\r\n },\r\n },\r\n {\r\n id: \"search_popout\",\r\n category: \"general\",\r\n name: \"$itemActions:search_popout.name\",\r\n icon: \"external-link\",\r\n views: [\"home\"],\r\n shouldBeVisible: [\"hasContext:searchRequest\"],\r\n commandAction: {\r\n name: \"search_preview\",\r\n props: {\r\n newWindow: true,\r\n },\r\n },\r\n },\r\n {\r\n id: \"subscribe\",\r\n category: \"general\",\r\n name: \"$itemActions:subscribe.name\",\r\n icon: \"feed\",\r\n views: [\"flat\", \"folder\", \"searchresult\", \"docmodal\", \"document\"],\r\n shouldBeVisible: [\r\n \"!hasContext:isFlatAU\",\r\n \"!hasItemStatus:Subscribed\",\r\n \"isAnyOnlineStatus\",\r\n \"isAnySelection\",\r\n ],\r\n commandAction: {\r\n name: \"subscribe\",\r\n },\r\n },\r\n {\r\n id: \"unsubscribe\",\r\n category: \"general\",\r\n name: \"$itemActions:unsubscribe.name\",\r\n icon: \"feed\",\r\n views: [\r\n \"flat\",\r\n \"folder\",\r\n \"searchresult\",\r\n \"docmodal\",\r\n \"news\",\r\n \"document\",\r\n ],\r\n shouldBeVisible: [\r\n \"hasItemStatus:Subscribed\",\r\n \"isAnyOnlineStatus\",\r\n \"isAnySelection\",\r\n ],\r\n commandAction: {\r\n name: \"unsubscribe\",\r\n },\r\n },\r\n // {\r\n // id: \"transfer\",\r\n // category: \"general\",\r\n // name: \"$itemActions:transfer.name\",\r\n // icon: \"exchange\",\r\n // views: [\"flat\", \"folder\", \"searchresult\", \"docmodal\", \"document\"],\r\n // shouldBeVisible: [\"isValidItemUri\"],\r\n // commandAction: {\r\n // name: \"transfer\",\r\n // },\r\n // },\r\n {\r\n id: \"move\",\r\n category: \"general\",\r\n name: \"$itemActions:transfer.move\",\r\n icon: \"exchange\",\r\n views: [\"folder\", \"searchresult\", \"docmodal\", \"document\"],\r\n shouldBeVisible: [\r\n \"isValidItemUri\",\r\n \"!hasContext:isFlatAU\",\r\n \"isAnySelection\",\r\n ],\r\n commandAction: {\r\n name: \"transfer\",\r\n props: {\r\n type: \"move\",\r\n },\r\n },\r\n },\r\n {\r\n id: \"copy\",\r\n category: \"general\",\r\n name: \"$itemActions:transfer.copy\",\r\n icon: \"files-o\",\r\n views: [\"folder\", \"searchresult\", \"docmodal\", \"document\"],\r\n shouldBeVisible: [\r\n \"isValidItemUri\",\r\n \"isDoc\",\r\n \"!hasContext:isFlatAU\",\r\n \"isAnySelection\",\r\n ],\r\n commandAction: {\r\n name: \"transfer\",\r\n props: {\r\n type: \"copy\",\r\n },\r\n },\r\n },\r\n {\r\n id: \"link\",\r\n category: \"general\",\r\n name: \"$itemActions:transfer.link\",\r\n icon: \"link\",\r\n views: [\"folder\", \"searchresult\", \"docmodal\", \"document\"],\r\n shouldBeVisible: [\r\n \"isValidItemUri\",\r\n \"!hasContext:isFlatAU\",\r\n \"isAnySelection\",\r\n ],\r\n commandAction: {\r\n name: \"transfer\",\r\n props: {\r\n type: \"link\",\r\n },\r\n },\r\n },\r\n {\r\n id: \"reminder_manage\",\r\n category: \"reminder\",\r\n shouldBeVisible: [\"isValidItemUri\"],\r\n view: {\r\n name: \"itemView_reminder\",\r\n },\r\n commandAction: {\r\n name: \"reminder_manage\",\r\n },\r\n },\r\n {\r\n id: \"reminder_add\",\r\n category: \"reminder\",\r\n name: \"$itemActions:reminder_add.name\",\r\n icon: \"clock-o\",\r\n shouldBeVisible: [\"isValidItemUri\"],\r\n commandAction: {\r\n name: \"reminder_manage\",\r\n },\r\n },\r\n {\r\n id: \"folder_preview\",\r\n category: \"general\",\r\n name: \"$itemActions:folder_preview.name\",\r\n icon: \"eye\",\r\n views: [\r\n \"searchresult\",\r\n \"news\",\r\n \"home\",\r\n \"document\",\r\n \"wf\",\r\n \"offline_item\",\r\n ],\r\n shouldBeVisible: [\r\n \"isValidItemUri\",\r\n \"!isMiniView\",\r\n \"!hasContext:isFlatAU\",\r\n ],\r\n commandAction: {\r\n name: \"folder_preview\",\r\n },\r\n },\r\n {\r\n id: \"folder_popout\",\r\n category: \"general\",\r\n name: \"$itemActions:folder_popout.name\",\r\n icon: \"external-link\",\r\n views: [\r\n \"searchresult\",\r\n \"news\",\r\n \"home\",\r\n \"document\",\r\n \"wf\",\r\n \"offline_item\",\r\n ],\r\n shouldBeVisible: [\r\n \"isValidItemUri\",\r\n \"isAnyOnlineStatus\",\r\n \"!isMiniView\",\r\n \"!hasContext:isFlatAU\",\r\n ],\r\n commandAction: {\r\n name: \"folder_preview\",\r\n props: {\r\n newWindow: true,\r\n },\r\n },\r\n },\r\n {\r\n id: \"doc_download\",\r\n category: \"doc\",\r\n name: \"$itemActions:doc_download.name\",\r\n // name: \"Download\",\r\n icon: \"download\",\r\n shouldBeVisible: [\r\n \"isDoc\",\r\n \"hasContext:isDocDownloadAllowed\",\r\n \"isAnyOnlineStatus\",\r\n \"isAnySelection\",\r\n ],\r\n commandAction: {\r\n name: \"doc_download\",\r\n },\r\n },\r\n {\r\n id: \"doc_downloadZip\",\r\n category: \"doc\",\r\n name: \"$itemActions:doc_downloadZip.name\",\r\n // name: \"Download as ZIP\",\r\n icon: \"file-zip-o\",\r\n shouldBeVisible: [\r\n \"isDoc\",\r\n \"hasContext:isDocDownloadAllowed\",\r\n \"isAnyOnlineStatus\",\r\n \"isMultiSelection\",\r\n ],\r\n commandAction: {\r\n name: \"doc_downloadZip\",\r\n },\r\n },\r\n {\r\n id: \"doc_downloadFilesAPI\",\r\n category: \"doc\",\r\n name: \"$itemActions:doc_downloadFilesAPI.name\",\r\n // name: \"Download as ZIP\",\r\n icon: \"folder-open-o\",\r\n shouldBeVisible: [\r\n \"isDoc\",\r\n \"hasContext:isDocDownloadAllowed\",\r\n \"isAnyOnlineStatus\",\r\n \"isMultiSelection\",\r\n ],\r\n commandAction: {\r\n name: \"doc_downloadFilesAPI\",\r\n },\r\n },\r\n {\r\n id: \"doc_editWebDav\",\r\n category: \"doc\",\r\n name: \"$itemActions:doc_editWebDav.name\",\r\n icon: \"pencil\",\r\n views: [\"folder\", \"document\", \"docmodal\", \"flat\", \"home\"],\r\n shouldBeVisible: [\r\n \"isDoc\",\r\n \"hasContext:isDocEditAllowed\",\r\n \"!hasItemStatus:CloudSync\",\r\n ],\r\n commandAction: {\r\n name: \"doc_editWebDav\",\r\n },\r\n },\r\n {\r\n id: \"doc_editCloud\",\r\n category: \"doc\",\r\n name: \"$itemActions:doc_editCloud.name\",\r\n icon: \"pencil\",\r\n views: [\"folder\", \"document\", \"docmodal\", \"flat\", \"home\"],\r\n shouldBeVisible: [\r\n \"isDoc\",\r\n \"hasContext:isDocEditAllowed\",\r\n \"hasItemStatus:CloudSync\",\r\n ],\r\n commandAction: {\r\n name: \"doc_editCloud\",\r\n props: {\r\n onlineEditor: true,\r\n },\r\n },\r\n },\r\n {\r\n id: \"doc_editCloudLocal\",\r\n category: \"doc\",\r\n name: \"$itemActions:doc_editCloudLocal.name\",\r\n icon: \"pencil\",\r\n views: [\"folder\", \"document\", \"docmodal\", \"flat\", \"home\"],\r\n shouldBeVisible: [\r\n \"isDoc\",\r\n \"hasContext:isDocEditAllowed\",\r\n \"hasItemStatus:CloudSync\",\r\n ],\r\n commandAction: {\r\n name: \"doc_editCloud\",\r\n props: {\r\n onlineEditor: false,\r\n },\r\n },\r\n },\r\n {\r\n id: \"doc_delete\",\r\n category: \"doc\",\r\n name: \"$itemActions:doc_delete.name\",\r\n icon: \"trash\",\r\n views: [\"folder\", \"document\", \"docmodal\", \"flat\"],\r\n shouldBeVisible: [\r\n \"isAnyOnlineStatus\",\r\n \"isAnySelection\",\r\n \"isDoc\",\r\n \"hasContext:isDocEditAllowed\",\r\n ],\r\n commandAction: { name: \"doc_delete\" },\r\n },\r\n {\r\n id: \"folder_delete\",\r\n category: \"general\",\r\n name: \"$itemActions:folder_delete.name\",\r\n icon: \"trash\",\r\n views: [\"folder\"],\r\n shouldBeVisible: [\r\n \"isFolder\",\r\n \"hasContext:isEditAllowed\",\r\n \"licenseAllowEdit\",\r\n \"isAnyOnlineStatus\",\r\n \"isAnySelection\",\r\n ],\r\n commandAction: { name: \"folder_delete\" },\r\n },\r\n {\r\n id: \"folder_editClassification\",\r\n category: \"general\",\r\n name: \"$itemActions:folder_editClassification.name\",\r\n icon: \"edit\",\r\n views: [\"folder\"],\r\n shouldBeVisible: [\r\n \"isFolder\",\r\n \"hasContext:isEditAllowed\",\r\n \"hasContext:isFolderClassificationEditAllowed\",\r\n \"licenseAllowEdit\",\r\n \"isAnyOnlineStatus\",\r\n ],\r\n commandAction: { name: \"folder_editClassification\" },\r\n },\r\n {\r\n id: \"doc_previewAndEditClassification\",\r\n category: \"doc\",\r\n name: \"$itemActions:doc_editClassification.name\",\r\n icon: \"edit\",\r\n views: [\"flat\", \"folder\", \"searchresult\"],\r\n shouldBeVisible: [\r\n \"isDoc\",\r\n \"hasContext:isDocEditAllowed\",\r\n \"hasContext:isDocClassificationEditAllowed\",\r\n \"licenseAllowEdit\",\r\n \"isAnyOnlineStatus\",\r\n ],\r\n commandAction: {\r\n name: \"doc_preview\",\r\n props: {\r\n triggerEditMode: true,\r\n },\r\n },\r\n },\r\n {\r\n id: \"doc_editClassification\",\r\n category: \"doc\",\r\n name: \"$itemActions:doc_editClassification.name\",\r\n icon: \"edit\",\r\n views: [\"document\", \"docmodal\"],\r\n shouldBeVisible: [\r\n \"isDoc\",\r\n \"hasContext:isDocEditAllowed\",\r\n \"hasContext:isDocClassificationEditAllowed\",\r\n \"licenseAllowEdit\",\r\n \"isAnyOnlineStatus\",\r\n ],\r\n commandAction: { name: \"doc_editClassification\" },\r\n },\r\n // {\r\n // category: \"doc\",\r\n // name: \"Add to Basket\",\r\n // icon: \"shopping-basket\",\r\n // shouldBeVisible: [\"isDoc\"]\r\n // },\r\n // {\r\n // category: \"doc\",\r\n // name: \"Remove from Basket\",\r\n // icon: \"shopping-basket\",\r\n // shouldBeVisible: [\"isDoc\"]\r\n // },\r\n {\r\n id: \"doc_uploadVersion\",\r\n category: \"doc\",\r\n name: \"$itemActions:doc_uploadVersion.name\",\r\n icon: \"upload\",\r\n views: [\"document\", \"docmodal\", \"folder\", \"flat\"],\r\n shouldBeVisible: [\r\n \"isDoc\",\r\n \"hasContext:isDocEditAllowed\",\r\n \"licenseAllowEdit\",\r\n \"!isSyncUpload\",\r\n \"isAnyOnlineStatus\",\r\n ],\r\n commandAction: { name: \"doc_uploadVersion\" },\r\n },\r\n {\r\n id: \"doc_upload\",\r\n category: \"doclist\",\r\n name: \"$itemActions:doc_upload.name\",\r\n icon: \"upload\",\r\n views: [\"folder\", \"flat\", \"miniflat\"],\r\n shouldBeVisible: [\r\n \"isFolder\",\r\n \"hasContext:isDocAssignmentAllowed\",\r\n \"licenseAllowEdit\",\r\n \"!isSyncUpload\",\r\n \"isAnyOnlineStatus\",\r\n ],\r\n // commandAction: { name: \"doc_upload\" }\r\n commandAction: {\r\n name: \"itemFlows\",\r\n props: {\r\n direction: \"in\",\r\n flowId: \"doc_upload\",\r\n },\r\n },\r\n },\r\n // {\r\n // category: \"general\",\r\n // name: \"Add to Selection\",\r\n // icon: \"check-circle-o\",\r\n // views: [\"folder\", \"flat\"],\r\n // shouldBeVisible: [\"isValidItemUri\", \"isDoc\"]\r\n // },\r\n // {\r\n // category: \"general\",\r\n // name: \"Remove from Selection\",\r\n // icon: \"circle-o\",\r\n // views: [\"folder\", \"flat\"],\r\n // shouldBeVisible: [\"isValidItemUri\", \"isDoc\"]\r\n // },\r\n // {\r\n // category: \"doc\",\r\n // name: \"Edit\",\r\n // icon: \"edit\",\r\n // shouldBeVisible: [\"isDoc\"]\r\n // },\r\n // {\r\n // category: \"doc\",\r\n // name: \"Lock\",\r\n // icon: \"lock\",\r\n // desc: \"Lock file to block any changes from other users\",\r\n // shouldBeVisible: [\"isDoc\"]\r\n // },\r\n // {\r\n // category: \"doc\",\r\n // name: \"Unlock\",\r\n // icon: \"unlock\",\r\n // shouldBeVisible: [\"isDoc\"]\r\n // },\r\n {\r\n id: \"itemFlows_input\",\r\n category: \"general\",\r\n name: \"$itemActions:itemFlows_input.name\",\r\n icon: \"plus-circle\",\r\n views: [\"folder\"],\r\n shouldBeVisible: [\"isCreateAllowed\", \"isAnyOnlineStatus\"],\r\n commandAction: {\r\n name: \"itemFlows\",\r\n props: {\r\n direction: \"in\",\r\n },\r\n },\r\n },\r\n // {\r\n // id: \"offline_depsMap\",\r\n // category: \"offline\",\r\n // name: \"$itemActions:offline_depsMap.name\",\r\n // views: [\"offline_item\"],\r\n // shouldBeVisible: [\"isAdmin\", \"hasFeature:offline\"],\r\n // commandAction: {\r\n // name: \"offline_depsMap\",\r\n // },\r\n // },\r\n {\r\n id: \"offline_add\",\r\n icon: \"power-off\",\r\n category: \"general\",\r\n name: \"$itemActions:offline_add.name\",\r\n shouldBeVisible: [\r\n \"isValidItemUri\",\r\n \"!hasContext:isOffline\",\r\n \"hasFeature:offline\",\r\n \"isFolder\",\r\n \"isAnySelection\",\r\n ],\r\n commandAction: {\r\n name: \"offline_add\",\r\n },\r\n },\r\n {\r\n id: \"offline_del\",\r\n icon: \"power-off\",\r\n category: \"general\",\r\n name: \"$itemActions:offline_delete.name\",\r\n shouldBeVisible: [\r\n \"hasContext:isOffline\",\r\n \"hasFeature:offline\",\r\n \"isAnyOnlineStatus\",\r\n \"isAnySelection\",\r\n ],\r\n commandAction: {\r\n name: \"offline_delete\",\r\n },\r\n },\r\n {\r\n id: \"offline_syncItem\",\r\n icon: \"cloud-download\",\r\n category: \"general\",\r\n name: \"$itemActions:offline_syncItem.name\",\r\n shouldBeVisible: [\"hasContext:isOffline\", \"hasFeature:offline\"],\r\n views: [\"offline_item\"],\r\n commandAction: {\r\n name: \"offline_syncItem\",\r\n },\r\n },\r\n {\r\n id: \"clipboard_copyItemUri\",\r\n category: \"clipboard\",\r\n name: \"$itemActions:clipboard_copyItemUri.name\",\r\n icon: \"clipboard\",\r\n views: [\"flat\", \"folder\", \"docmodal\", \"mailbox\", \"offline_item\"],\r\n shouldBeVisible: [\"isAdmin\", \"isAnyOnlineStatus\"],\r\n commandAction: {\r\n name: \"clipboard_copyItemUri\",\r\n },\r\n },\r\n {\r\n id: \"clipboard_copyItemLink\",\r\n category: \"clipboard\",\r\n name: \"$itemActions:clipboard_copyItemLink.name\",\r\n icon: \"clipboard\",\r\n views: [\"flat\", \"folder\", \"docmodal\", \"mailbox\", \"offline_item\"],\r\n shouldBeVisible: [\"isAnyOnlineStatus\"],\r\n commandAction: {\r\n name: \"clipboard_copyItemLink\",\r\n },\r\n },\r\n // {\r\n // category: \"general\",\r\n // name: \"Copy\",\r\n // icon: \"clone\",\r\n // shouldBeVisible: [\"isValidItemUri\"]\r\n // },\r\n // {\r\n // category: \"general\",\r\n // name: \"Cut\",\r\n // icon: \"scissors\",\r\n // shouldBeVisible: [\"isValidItemUri\"]\r\n // },\r\n // {\r\n // category: \"general\",\r\n // name: \"Paste\",\r\n // icon: \"clipboard\",\r\n // shouldBeVisible: [\"isValidItemUri\"]\r\n // },\r\n // {\r\n // category: \"general\",\r\n // name: \"Paste as Link\",\r\n // icon: \"link\",\r\n // shouldBeVisible: [\"isValidItemUri\"]\r\n // },\r\n {\r\n id: \"wf_report\",\r\n category: \"wf\",\r\n name: \"$itemActions:wf_report.name\",\r\n //desc: \"Displays workflow report(s)\",\r\n icon: \"book\",\r\n // views: [\"document\", \"docmodal\", \"folder\", \"miniflat\"],\r\n shouldBeVisible: [\"isWorkflowEnabled\", \"hasItemStatus:WFReport\"],\r\n commandAction: {\r\n name: \"doc_related\",\r\n props: {\r\n itemLinkType: ItemLinkType.WorkflowReport,\r\n },\r\n },\r\n },\r\n {\r\n id: \"wf_start\",\r\n category: \"wf\",\r\n name: \"$itemActions:wf_start.name\",\r\n //desc: \"Starts a workflow\",\r\n icon: \"check-square-o\",\r\n views: [\r\n \"home\",\r\n \"news\",\r\n \"document\",\r\n \"docmodal\",\r\n \"folder\",\r\n \"miniflat\",\r\n ],\r\n shouldBeVisible: [\r\n // \"hasContext:isDocEditAllowed\",\r\n \"isWorkflowEnabled\",\r\n ],\r\n commandAction: {\r\n name: \"wf_start\",\r\n },\r\n },\r\n // {\r\n // name: \"Stop Workflow\",\r\n // desc:\r\n // \"Stop a WIP status\",\r\n // icon: \"cancel\",\r\n // shouldBeVisible: [{ loc:\"isField\", name:\"status\", value:\"WIP\"}]\r\n // },\r\n {\r\n id: \"wf_info\",\r\n category: \"wf\",\r\n shouldBeVisible: [\r\n \"isValidItemUri\",\r\n // \"hasContext:isDocEditAllowed\",\r\n \"isWorkflowEnabled\",\r\n ],\r\n views: [\r\n \"home\",\r\n \"folder\",\r\n \"document\",\r\n \"docmodal\",\r\n \"flat\",\r\n \"miniflat\",\r\n \"searchresult\",\r\n \"wf\",\r\n ],\r\n commandAction: {\r\n name: \"link\",\r\n props: {\r\n asModal: true,\r\n docked: true,\r\n },\r\n },\r\n view: {\r\n name: \"itemView_workflow\",\r\n },\r\n },\r\n {\r\n id: \"wf_info_noitemuri\",\r\n category: \"wf\",\r\n shouldBeVisible: [\r\n \"!isValidItemUri\",\r\n // \"hasContext:isDocEditAllowed\",\r\n \"isWorkflowEnabled\",\r\n ],\r\n views: [\"wf\"],\r\n commandAction: {\r\n name: \"link\",\r\n props: {\r\n asModal: true,\r\n docked: true,\r\n },\r\n },\r\n view: {\r\n name: \"itemView_workflow\",\r\n },\r\n },\r\n {\r\n id: \"ip_archive\",\r\n category: \"sync\",\r\n name: \"$itemActions:ip_archive.name\",\r\n // desc: \"Launch inPoint.Sync ArchiveDialog\",\r\n icon: \"upload\",\r\n shouldBeVisible: [\r\n \"isWindows\",\r\n \"isSyncEnabled\",\r\n \"isFolder\",\r\n \"hasContext:isDocAssignmentAllowed\",\r\n ],\r\n commandAction: { name: \"ip_archive\" },\r\n },\r\n {\r\n id: \"ip_browse\",\r\n category: \"sync\",\r\n name: \"$itemActions:ip_browse.name\",\r\n icon: \"eye\",\r\n // desc: \"Browse in inPoint.Client\",\r\n shouldBeVisible: [\"isWindows\", \"isSyncEnabled\", \"isValidItemUri\"],\r\n commandAction: { name: \"ip_browse\" },\r\n },\r\n {\r\n id: \"ip_properties\",\r\n category: \"sync\",\r\n name: \"$itemActions:ip_properties.name\",\r\n // desc: \"Launch inPoint.Sync Properties dialog\",\r\n icon: \"tasks\",\r\n shouldBeVisible: [\r\n \"isWindows\",\r\n \"isSyncEnabled\",\r\n \"hasContext:isDocAssignmentAllowed\",\r\n \"!hasContext:isFlatAU\",\r\n ],\r\n commandAction: { name: \"ip_properties\" },\r\n },\r\n {\r\n id: \"ip_edit\",\r\n category: \"sync\",\r\n name: \"$itemActions:ip_edit.name\",\r\n // desc: \"Edit (in original application) with inPoint.Sync\",\r\n icon: \"edit\",\r\n shouldBeVisible: [\r\n \"isWindows\",\r\n \"isSyncEnabled\",\r\n \"isDoc\",\r\n \"hasContext:isDocAssignmentAllowed\",\r\n \"hasContext:isDocEditAllowed\",\r\n \"!hasContext:isFlatAU\",\r\n ],\r\n commandAction: { name: \"ip_edit\" },\r\n },\r\n {\r\n id: \"ip_commandAction_itemSendAsEmail\",\r\n category: \"sync\",\r\n name: \"$itemActions:ip_commandAction.itemSendAsEmail\",\r\n icon: \"envelope-o\",\r\n shouldBeVisible: [\r\n \"isAnySelection\",\r\n \"isWindows\",\r\n \"isSyncEnabled\",\r\n \"isDoc\",\r\n \"hasContext:isDocSendByEmailAllowed\",\r\n ],\r\n commandAction: {\r\n name: \"ip_commandAction\",\r\n props: {\r\n commandAction: \"ItemSendAsEmailCommandAction\",\r\n },\r\n },\r\n },\r\n {\r\n id: \"ip_commandAction_itemSendAsEmailLink\",\r\n category: \"sync\",\r\n name: \"$itemActions:ip_commandAction.itemSendAsEmailLink\",\r\n icon: \"envelope-o\",\r\n shouldBeVisible: [\r\n \"isAnySelection\",\r\n \"isWindows\",\r\n \"isSyncEnabled\",\r\n \"isValidItemUri\",\r\n ],\r\n commandAction: {\r\n name: \"ip_commandAction\",\r\n props: {\r\n commandAction: \"ItemSendAsEmailLinkCommandAction\",\r\n },\r\n },\r\n },\r\n // {\r\n // category: \"sync\",\r\n // name: \"Make available Offline\",\r\n // desc: \"Sync for offline use with inPoint.Sync\",\r\n // icon: \"power-off\",\r\n // shouldBeVisible: [\"isWindows\", \"isSyncEnabled\"]\r\n // },\r\n\r\n // ---- Recycle Bin\r\n {\r\n id: \"doc_previewRecycleBin\",\r\n category: \"recyclebin\",\r\n name: \"$itemActions:doc_preview.name\",\r\n icon: \"eye\",\r\n views: [\"flat\", \"folder\", \"searchresult\", \"news\", \"home\"],\r\n shouldBeVisible: [\"isDoc\", \"isRecycleBin\"],\r\n commandAction: {\r\n name: \"doc_preview\",\r\n },\r\n },\r\n {\r\n id: \"doc_clear\",\r\n category: \"recyclebin\",\r\n name: \"$itemActions:doc_clear.name\",\r\n icon: \"trash\",\r\n shouldBeVisible: [\r\n \"isDoc\",\r\n \"hasItemStatus:Deleted\",\r\n \"isRecycleBin\",\r\n \"isAnyOnlineStatus\",\r\n \"isAnySelection\",\r\n ],\r\n commandAction: { name: \"recyclebin_docClear\" },\r\n },\r\n {\r\n id: \"doc_restore\",\r\n category: \"recyclebin\",\r\n name: \"$itemActions:doc_restore.name\",\r\n icon: \"repeat\",\r\n shouldBeVisible: [\r\n \"isDoc\",\r\n \"hasItemStatus:Deleted\",\r\n \"!hasItemStatus:ParentDeleted\",\r\n \"isRecycleBin\",\r\n \"isAnySelection\",\r\n ],\r\n commandAction: { name: \"recyclebin_docRestore\" },\r\n },\r\n {\r\n id: \"folder_clear\",\r\n category: \"recyclebin\",\r\n name: \"$itemActions:folder_clear.name\",\r\n icon: \"trash\",\r\n shouldBeVisible: [\r\n \"isFolder\",\r\n \"hasItemStatus:Deleted\",\r\n \"isRecycleBin\",\r\n \"isAnyOnlineStatus\",\r\n \"isAnySelection\",\r\n ],\r\n commandAction: { name: \"recyclebin_folderClear\" },\r\n },\r\n {\r\n id: \"folder_restore\",\r\n category: \"recyclebin\",\r\n name: \"$itemActions:folder_restore.name\",\r\n icon: \"repeat\",\r\n shouldBeVisible: [\r\n \"isFolder\",\r\n \"hasItemStatus:Deleted\",\r\n \"!hasItemStatus:ParentDeleted\",\r\n \"isRecycleBin\",\r\n \"isAnySelection\",\r\n ],\r\n commandAction: { name: \"recyclebin_folderRestore\" },\r\n },\r\n ],\r\n});\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"checkbox\":\"CellContent_checkbox__152-h\",\"desktop\":\"CellContent_desktop__2ulOb\",\"link\":\"CellContent_link__2nsPt\",\"icons\":\"CellContent_icons__1tAYs\",\"boolean\":\"CellContent_boolean__3cO2X\",\"number\":\"CellContent_number__2HsSU\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"UploadImage_container__3rabK\",\"image\":\"UploadImage_image__21AEd\",\"middle\":\"UploadImage_middle__12lER\",\"ro\":\"UploadImage_ro__2CBTQ\",\"button\":\"UploadImage_button__2D9zY\",\"input\":\"UploadImage_input__14FQD\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"mark\":\"CellContent_mark__3pu0O\",\"checkbox\":\"CellContent_checkbox__1XIS9\",\"desktop\":\"CellContent_desktop__2bXxB\",\"link\":\"CellContent_link__VcSKB\"};","import { useRef, useEffect, useCallback } from \"react\";\r\n\r\nconst useAbortController = (\r\n abortControllerInstance = new AbortController()\r\n) => {\r\n const abort = useRef(abortControllerInstance);\r\n\r\n // Get AbortController (optional: abort existing)\r\n const abortController = useCallback((reset = false): AbortController => {\r\n if (reset) {\r\n abort.current.abort();\r\n abort.current = new AbortController();\r\n }\r\n return abort.current;\r\n }, []);\r\n\r\n // Abort on unmount\r\n useEffect(() => {\r\n function handleUnmount() {\r\n abort.current.abort();\r\n }\r\n return handleUnmount;\r\n }, [abort]);\r\n return abortController;\r\n};\r\n\r\nexport { useAbortController };\r\n","import { useState, useRef, useEffect } from \"react\";\r\nimport { BroadcastChannel } from \"broadcast-channel\";\r\n\r\nexport function useBroadcast(\r\n channelName: string = \"BROADCAST\",\r\n initialState: Object | null = { type: \"UNKNOWN\" }\r\n) {\r\n let [state, setState] = useState(initialState);\r\n let channel = useRef(new BroadcastChannel(channelName));\r\n\r\n useEffect(() => {\r\n /* istanbul ignore next */\r\n if (channel.current) {\r\n channel.current.onmessage = (event: MessageEvent) =>\r\n setState(event);\r\n }\r\n return () => channel.current && channel.current.close();\r\n }, [channelName]);\r\n\r\n const postMessage = (value: any) =>\r\n channel.current && channel.current.postMessage(value);\r\n\r\n return [state, postMessage];\r\n}\r\n","import { useUpdateEffect } from \"hooks\";\r\nimport { useSelector } from \"react-redux\";\r\nimport { toastStyled, dismissToast, toastPosition, toastId } from \"data/toast\";\r\nimport { NotificationStyle } from \"data/types\";\r\nimport styles from \"./NetworkStatus.module.css\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport loc from \"i18next\";\r\nimport { offlineQueueStorage } from \"data/storage\";\r\n\r\nconst useNetworkStatus = () => {\r\n const isOnline = useSelector(s.isOnlineSelector);\r\n\r\n useUpdateEffect(() => {\r\n dismissToast(toastId.NetworkStatus);\r\n if (isOnline) {\r\n offlineQueueStorage.length().then((count) =>\r\n toastStyled({\r\n message:\r\n count === 0\r\n ? loc.t(\"common:offline.connected\")\r\n : loc.t(\"common:offline.connectedSyncing\", {\r\n count,\r\n }),\r\n icon: \"check\",\r\n style: NotificationStyle.Success,\r\n toastId: toastId.NetworkStatus,\r\n className: styles.toast,\r\n position: toastPosition.TOP_CENTER,\r\n })\r\n );\r\n } else {\r\n toastStyled({\r\n message: \"$common:offline.lost\",\r\n icon: \"warning\",\r\n style: NotificationStyle.Warning,\r\n toastId: toastId.NetworkStatus,\r\n className: styles.toast,\r\n autoClose: false,\r\n position: toastPosition.TOP_CENTER,\r\n });\r\n }\r\n }, [isOnline]);\r\n\r\n return null;\r\n};\r\n\r\nexport { useNetworkStatus };\r\n","// @flow\r\nimport { useCallback } from \"react\";\r\nimport { useEvent } from \"hooks\";\r\n\r\n// hook to handle message events\r\nexport function usePostMessageHandler(\r\n handlers: Object,\r\n parentWindow = window.parent\r\n) {\r\n // calls the registered handler for a given message type\r\n const handleMessage = useCallback(\r\n (data, source) => {\r\n if (data == null || data.source !== \"inPoint\") return;\r\n var handler = handlers[data.type];\r\n if (handler == null || typeof handler !== \"function\") return;\r\n handler(data.data, source);\r\n },\r\n [handlers]\r\n );\r\n\r\n const onMessage = useCallback(\r\n (e) => {\r\n // some security checks\r\n if (!e.isTrusted || e.data == null) return;\r\n /* istanbul ignore next */ else if (\r\n window !== parentWindow &&\r\n window.location.href !== parentWindow.location.href &&\r\n window.location.origin === parentWindow.location.origin\r\n )\r\n // forward message\r\n parentWindow.postMessage(e.data, \"*\");\r\n else {\r\n // handle\r\n if (Array.isArray(e.data)) {\r\n e.data.forEach((d) => handleMessage(d, e.source));\r\n } else handleMessage(e.data, e.source);\r\n }\r\n },\r\n [handleMessage, parentWindow]\r\n );\r\n\r\n useEvent(\"message\", onMessage);\r\n}\r\n","import { useMemo } from \"react\";\r\nimport { usePostMessageHandler } from \"./Handler\";\r\nimport { ModalAction } from \"./Actions\";\r\n\r\nconst useModalPostMessageHandler = (close) =>\r\n usePostMessageHandler(\r\n useMemo(\r\n () => ({\r\n [ModalAction.Close]: close,\r\n [ModalAction.CloseLegacy]: close,\r\n }),\r\n [close]\r\n )\r\n );\r\n\r\nexport { useModalPostMessageHandler };\r\n","// @flow\r\nimport { useMemo } from \"react\";\r\nimport { openSearchResultActionPanel } from \"components/SearchResultActionPanel\";\r\nimport { openGeoPointActionPanel } from \"components/GeoPointActionPanel\";\r\nimport { openPickerModal } from \"components/PickerModal\";\r\nimport {\r\n searchRouteWithItem,\r\n getRoute,\r\n folderRoute,\r\n docRoute,\r\n flatRoute,\r\n mailRoute,\r\n} from \"components/ItemUriLink\";\r\nimport { check_isView } from \"containers/ActionPanel/Utils\";\r\nimport CommandActionHandler from \"components/CommandActions\";\r\nimport { usePostMessageHandler } from \"./Handler\";\r\nimport { useModalPostMessageHandler } from \"./Modal\";\r\nimport { DefaultAction } from \"./Actions\";\r\nimport { postMessageTo } from \"./Utils\";\r\nimport { toastStyled } from \"data/toast\";\r\n\r\nconst handleGeoInfo = (data) => {\r\n /* istanbul ignore else */\r\n if (data.row) {\r\n openSearchResultActionPanel({\r\n row: {\r\n ...data.row,\r\n targetView: \"searchresult\",\r\n },\r\n });\r\n } else if (check_isView({ views: [\"upload\"] })) {\r\n openGeoPointActionPanel({\r\n location: data,\r\n });\r\n }\r\n};\r\n\r\nconst useDefaultPostMessageHandler = (history) =>\r\n usePostMessageHandler(\r\n useMemo(\r\n () => ({\r\n [DefaultAction.Browse]: ({\r\n itemUri,\r\n mini,\r\n externalLink,\r\n isDoc,\r\n toggles,\r\n view,\r\n mark,\r\n print,\r\n }: {\r\n itemUri: string,\r\n mini?: boolean,\r\n externalLink?: boolean,\r\n isDoc?: boolean,\r\n toggles?: string | Array,\r\n view?: \"doc\" | \"flat\" | \"folder\" | \"mail\",\r\n mark?: string,\r\n print?: boolean,\r\n }) => {\r\n let url;\r\n switch (view) {\r\n case \"doc\":\r\n url = docRoute(\r\n itemUri,\r\n mini,\r\n externalLink,\r\n toggles,\r\n mark,\r\n print\r\n );\r\n break;\r\n case \"flat\":\r\n url = flatRoute(\r\n itemUri,\r\n mini,\r\n externalLink,\r\n toggles\r\n );\r\n break;\r\n case \"folder\":\r\n url = folderRoute(\r\n itemUri,\r\n mini,\r\n externalLink,\r\n toggles\r\n );\r\n break;\r\n case \"mail\":\r\n url = mailRoute(\r\n itemUri,\r\n mini,\r\n externalLink,\r\n toggles\r\n );\r\n break;\r\n default:\r\n url = getRoute(\r\n itemUri,\r\n mini,\r\n externalLink,\r\n isDoc,\r\n toggles\r\n );\r\n break;\r\n }\r\n history.push(url);\r\n },\r\n [DefaultAction.Search]: (data) =>\r\n history.push(searchRouteWithItem(/*searchItem*/ data)),\r\n [DefaultAction.GeoInfo]: handleGeoInfo,\r\n [DefaultAction.GeoInfoLegacy]: handleGeoInfo,\r\n [DefaultAction.Exec]: (data) =>\r\n CommandActionHandler(data.actionId, data.props),\r\n [DefaultAction.Toast]: toastStyled,\r\n [DefaultAction.Picker.Open]: async (\r\n {\r\n itemUri,\r\n helpText,\r\n pickerType,\r\n selectButton,\r\n scopeBreadcrumb = false,\r\n additionalActions = null,\r\n canChangeSite = true,\r\n },\r\n source\r\n ) => {\r\n let action = null;\r\n const onSelect = (eventKey) => (action = eventKey);\r\n const selectedItemUri = await openPickerModal({\r\n itemUri,\r\n pickerType,\r\n helpText,\r\n selectButton,\r\n scopeBreadcrumb,\r\n additionalActions,\r\n canChangeSite,\r\n onSelect,\r\n });\r\n if (selectedItemUri) {\r\n postMessageTo(\r\n DefaultAction.Picker.Select,\r\n { itemUri: selectedItemUri, action },\r\n source\r\n );\r\n } else {\r\n postMessageTo(\r\n DefaultAction.Picker.Cancel,\r\n null,\r\n source\r\n );\r\n }\r\n },\r\n }),\r\n [history]\r\n )\r\n );\r\n\r\nexport {\r\n usePostMessageHandler,\r\n useDefaultPostMessageHandler,\r\n useModalPostMessageHandler,\r\n};\r\n","// @flow\r\nimport React from \"react\";\r\nimport { openItemActionPanel } from \"components/ItemActionPanel\";\r\nimport { type MapLocationInfo } from \"data/types\";\r\nimport { getFileExtension } from \"data/utils\";\r\n\r\nexport const openGeoPointActionPanel = ({\r\n location,\r\n}: {\r\n location: MapLocationInfo,\r\n}) =>\r\n openItemActionPanel({\r\n title: location.label,\r\n ext: location.label.includes(\".\") && getFileExtension(location.label),\r\n contextProps: {\r\n itemUri: location.itemUri || \"GEOUPLOAD\",\r\n ext:\r\n location.label.includes(\".\") &&\r\n getFileExtension(location.label),\r\n },\r\n thumbnail: location.thumbnail && (\r\n \r\n ),\r\n attributes: [\r\n [\"Longitude\", String(location.longitude)],\r\n [\"Latitude\", String(location.latitude)],\r\n ],\r\n });\r\n","import { useCallback } from \"react\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport { setSettingAction } from \"data/actions\";\r\nimport { settingValueSelector } from \"data/reducers/selectors\";\r\n\r\n/** hooks version of containers/SettingValue */\r\nexport function usePersistSetting({ name, defaultValue, asObject = false }) {\r\n const dispatch: Dispatch = useDispatch();\r\n const value: any =\r\n useSelector((state) => settingValueSelector(name, state)) ??\r\n defaultValue;\r\n const setValue = useCallback(\r\n (value: any) => dispatch(setSettingAction(name, value)),\r\n [name, dispatch]\r\n );\r\n\r\n return asObject ? { value, setValue } : [value, setValue];\r\n}\r\n","import { useRef } from \"react\";\r\nimport { compose, createStore, applyMiddleware } from \"redux\";\r\nimport appReducers from \"data/reducers\";\r\n// responsive\r\nimport { responsiveStoreEnhancer } from \"redux-responsive\";\r\n// sagas\r\nimport createSagaMiddleware from \"redux-saga\";\r\nimport { localRootSaga } from \"data/sagas/rootSaga\";\r\n\r\nconst getStore = (storeName: string = \"LocalStore\") => {\r\n // create the saga middleware\r\n const sagaMiddleware = createSagaMiddleware();\r\n\r\n // http://redux.js.org/\r\n const middlewares = [sagaMiddleware];\r\n /*istanbul ignore next*/\r\n const composeEnhancers =\r\n (window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ &&\r\n window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({\r\n name: `inPoint.Web ${storeName}`,\r\n })) ||\r\n compose;\r\n const store = createStore(\r\n appReducers,\r\n composeEnhancers(\r\n responsiveStoreEnhancer,\r\n applyMiddleware(...middlewares)\r\n )\r\n );\r\n\r\n // then run the rootSaga which forks all the others\r\n sagaMiddleware.run(localRootSaga);\r\n\r\n return store;\r\n};\r\n\r\nconst useLocalStore = (storeName: ?string) => {\r\n const store = useRef(null);\r\n /* istanbul ignore else */\r\n if (store.current == null) {\r\n store.current = getStore(storeName);\r\n }\r\n return store.current;\r\n};\r\n\r\nexport { useLocalStore, getStore };\r\n","//@flow\r\nimport { useState, useEffect } from \"react\";\r\nimport moment from \"moment\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\n\r\nconst getMomentLocale = (language: string): string => {\r\n if (language == null) {\r\n return \"de\";\r\n }\r\n switch (language) {\r\n case \"en\":\r\n case \"en-US\":\r\n return null;\r\n case \"de-DE\":\r\n return \"de\";\r\n default:\r\n return language.toLowerCase();\r\n }\r\n};\r\n\r\nconst useMomentLocale = (language: string): ConstantsEnum => {\r\n const locale = getMomentLocale(language);\r\n const [status, setStatus] = useState(Constants.LOADING);\r\n useEffect(() => {\r\n if (locale == null || moment.locales().includes(locale)) {\r\n return setStatus(Constants.OK);\r\n }\r\n import(\r\n `__i18n/moment/${locale}` /* webpackChunkName: \"moment-[request]\" */\r\n )\r\n .then(() => setStatus(Constants.OK))\r\n .catch((e) => {\r\n console.error(\r\n \"[useMomentLocale] Cannot load moment.js locale:\",\r\n e\r\n );\r\n setStatus(Constants.ERROR);\r\n });\r\n }, [locale]);\r\n return status;\r\n};\r\n\r\nexport { useMomentLocale, getMomentLocale };\r\n","import { useState, useRef, useEffect } from \"react\";\r\nimport {\r\n createUppy,\r\n addUppyPlugins,\r\n getUppyLocale,\r\n addUppyEvents,\r\n removeUppyEvents,\r\n type UppyEvent,\r\n uppyPendingFilesMetaSelector,\r\n} from \"data/uppy\";\r\nimport { useDeepCompareEffect } from \"hooks\";\r\nimport { useSelector } from \"react-redux\";\r\n\r\ntype Props = {\r\n /** which uppy ID to use (to separate from other upload queues)\r\n * @default {string} const from data/uppy.js/DEFAULT_UPPY_ID\r\n */\r\n uppyId?: string,\r\n /** optional uppy properties to pass (e.g. maxNumberOfFiles) */\r\n uppyProps?: Object,\r\n /** optional list of uppy events to attach to */\r\n events?: Array,\r\n};\r\n\r\nexport function useUppy({ uppyId, uppyProps, events }: Props) {\r\n const [ready, setReady] = useState(false);\r\n const uppy = useRef();\r\n useEffect(() => {\r\n uppy.current = createUppy({\r\n id: uppyId,\r\n ...uppyProps,\r\n });\r\n uppy.current = addUppyPlugins(uppy.current);\r\n // clear all pending uploads in this queue\r\n uppy.current.reset();\r\n if (events) addUppyEvents(events, uppy.current);\r\n getUppyLocale()\r\n .then((result) => {\r\n uppy.current.locale = { ...result.i18n };\r\n })\r\n .finally(() => setReady(true));\r\n\r\n return () => {\r\n if (events) removeUppyEvents(events, uppy.current);\r\n uppy.current.close();\r\n };\r\n }, [uppyId, uppyProps, events]);\r\n\r\n return ready ? uppy.current : null;\r\n}\r\n\r\n/**\r\n * data/uppy/uppyPendingFilesMetaSelector returns a new object on every call\r\n * this wrapper uses a deep compare to avoid re-renders\r\n * @returns {Array} array of pending file uploads\r\n */\r\nexport function usePendingUploads() {\r\n const [pendingUploads, setPendingUploads] = useState([]);\r\n const uppyPendingUploads = useSelector(uppyPendingFilesMetaSelector);\r\n\r\n useDeepCompareEffect(() => {\r\n setPendingUploads(uppyPendingUploads);\r\n }, [uppyPendingUploads]);\r\n\r\n return pendingUploads;\r\n}\r\n","//@flow\r\nimport { useMemo, useCallback, useState } from \"react\";\r\nimport useUpdateEffect from \"react-use/lib/useUpdateEffect\";\r\nimport { createGlobalState } from \"react-use\";\r\nimport { postMessageTo } from \"hooks/PostMessage/Utils\";\r\nimport {\r\n PdfHighlightAction,\r\n type PdfHighlightActionEnum,\r\n} from \"hooks/PostMessage/Actions\";\r\nimport { usePostMessageHandler } from \"hooks/PostMessage/Handler\";\r\nimport {\r\n ActivityType,\r\n ItemNoteType,\r\n type ActivityDTO,\r\n type IPdfShape,\r\n} from \"data/types\";\r\n\r\ntype PdfHighlight = {\r\n $type: ItemNoteTypeEnum,\r\n shapes: Array,\r\n activityId: number,\r\n isReadonly: boolean,\r\n};\r\n\r\nconst usePdfHighlight = createGlobalState(null);\r\n\r\nconst usePdfHighlightActions = () => {\r\n const [target] = usePdfHighlight();\r\n const createPostMessage = useCallback(\r\n (action: PdfHighlightActionEnum) => (payload: any) => {\r\n if (target == null) {\r\n console.warn(`Target is null, ${action} will not be executed!`);\r\n return;\r\n }\r\n postMessageTo(action, payload, target);\r\n },\r\n [target]\r\n );\r\n return useMemo(\r\n () => ({\r\n handleLoad: createPostMessage(PdfHighlightAction.Load),\r\n handleUpsert: createPostMessage(PdfHighlightAction.Upsert),\r\n handleHighlight: createPostMessage(PdfHighlightAction.Highlight),\r\n handleDelete: createPostMessage(PdfHighlightAction.Delete),\r\n handleSelect: createPostMessage(PdfHighlightAction.Select),\r\n }),\r\n [createPostMessage]\r\n );\r\n};\r\n\r\nconst usePdfHighlightActivityList = (\r\n items: Array,\r\n userId: number,\r\n setEdit: (activityId: number) => void,\r\n onAction: (action: string, itemIndex: number) => void,\r\n isReadOnly: boolean = false\r\n) => {\r\n const [highlight, setHighlight] = useState(null);\r\n const actions = usePdfHighlightActions();\r\n\r\n // Handle UI input from PDF\r\n usePostMessageHandler(\r\n useMemo(() => {\r\n const messageHandler = {\r\n [PdfHighlightAction.Highlight]: (pdfHighlight: PdfHighlight) =>\r\n setHighlight(pdfHighlight.activityId),\r\n };\r\n\r\n if (!isReadOnly) {\r\n messageHandler[PdfHighlightAction.Upsert] = (\r\n pdfHighlight: PdfHighlight\r\n ) => setEdit(pdfHighlight.activityId);\r\n messageHandler[PdfHighlightAction.Delete] = (\r\n pdfHighlight: PdfHighlight\r\n ) =>\r\n onAction(\r\n \"delete_note\",\r\n items.findIndex(\r\n (item) =>\r\n item.what === ActivityType.comment &&\r\n item.id === pdfHighlight.activityId\r\n )\r\n );\r\n }\r\n\r\n return messageHandler;\r\n }, [setEdit, onAction, items, isReadOnly])\r\n );\r\n\r\n // Update PDF when items change\r\n useUpdateEffect(() => {\r\n const pdfHighlights: Array = items\r\n .filter(\r\n (item) =>\r\n item.extras &&\r\n item.extras.$type === ItemNoteType.PdfHighlight\r\n )\r\n .map((item) => ({\r\n activityId: item.id,\r\n ...item.extras,\r\n isReadonly: userId !== item.userId,\r\n }));\r\n actions.handleLoad(pdfHighlights);\r\n return () => actions.handleLoad([]);\r\n }, [items, actions, userId]);\r\n\r\n // Create handleHightlicht Callback Factory for ActivityDTOs\r\n const handleHighlight = useCallback(\r\n (item: ActivityDTO) => {\r\n const targetHighlight =\r\n item &&\r\n item.extras &&\r\n item.extras.$type === ItemNoteType.PdfHighlight\r\n ? item.id\r\n : null;\r\n actions.handleHighlight({ activityId: targetHighlight });\r\n setHighlight(targetHighlight);\r\n },\r\n [actions]\r\n );\r\n\r\n return useMemo(\r\n () => [highlight, handleHighlight],\r\n [highlight, handleHighlight]\r\n );\r\n};\r\n\r\nconst usePdfHighlightInput = (handleNoteExtras, noteRef) => {\r\n usePostMessageHandler(\r\n useMemo(\r\n () => ({\r\n [PdfHighlightAction.Select]: (pdfHighlight: PdfHighlight) => {\r\n /* istanbul ignore else */\r\n if (\r\n pdfHighlight != null &&\r\n noteRef.current &&\r\n noteRef.current.clearableInput\r\n ) {\r\n noteRef.current.clearableInput.scrollIntoView({\r\n block: \"center\",\r\n inline: \"center\",\r\n });\r\n noteRef.current.clearableInput.focus();\r\n }\r\n handleNoteExtras(pdfHighlight);\r\n },\r\n }),\r\n [handleNoteExtras]\r\n )\r\n );\r\n return usePdfHighlightActions();\r\n};\r\n\r\nexport {\r\n usePdfHighlight,\r\n usePdfHighlightActions,\r\n usePdfHighlightActivityList,\r\n usePdfHighlightInput,\r\n};\r\n","import React, { useState, useMemo, useCallback, useEffect } from \"react\";\r\nimport { useSelector } from \"react-redux\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport { createGlobalState } from \"react-use\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport { isFeatureOn, Feature } from \"data/constants\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\nimport CommandActionHandler from \"components/CommandActions\";\r\nimport { toastStyled, dismissToast, toastId } from \"data/toast\";\r\nimport { NotificationStyle } from \"data/types\";\r\n\r\nconst useDismissNetworkToast = createGlobalState(false);\r\n\r\nconst useOfflineHandler = ({ itemUri, name, request = null }) => {\r\n const [error, setError] = useState(null);\r\n const [dismiss, setDismiss] = useDismissNetworkToast();\r\n const isOnline = useSelector(s.isOnlineSelector);\r\n\r\n useEffect(() => {\r\n if (isOnline) {\r\n dismissToast(toastId.NoNetwork);\r\n setDismiss(false);\r\n }\r\n }, [dismiss, setDismiss, isOnline]);\r\n\r\n const handleDismissClick = useCallback(\r\n () => setDismiss(true),\r\n [setDismiss]\r\n );\r\n const handleEnableOffline = useMemo(\r\n () =>\r\n /* istanbul ignore else */\r\n itemUri\r\n ? () =>\r\n CommandActionHandler(\"offline_add\", {\r\n itemUri,\r\n name: name || loc.t(\"offline.pretty.noname\"),\r\n })\r\n : null,\r\n [itemUri, name]\r\n );\r\n\r\n const details = useMemo(\r\n () =>\r\n function OfflineErrorDetails() {\r\n return (\r\n <>\r\n {isFeatureOn(Feature.offline) &&\r\n typeof handleEnableOffline === \"function\" && (\r\n \r\n {\" \"}\r\n {loc.t(\"offline.pretty.enable\")}\r\n \r\n )}\r\n \r\n {loc.t(\"offline.pretty.dismiss\")}\r\n \r\n \r\n );\r\n },\r\n [handleEnableOffline, handleDismissClick]\r\n );\r\n\r\n const factory = useCallback(\r\n (fetchRequest) =>\r\n (...args) =>\r\n fetchRequest(...args)\r\n .then((response) => {\r\n dismissToast(toastId.NoNetwork);\r\n setDismiss(false);\r\n setError(null);\r\n return response;\r\n })\r\n .catch((e) => {\r\n setError(e);\r\n if (\r\n e.constructor.name === \"ApiNetworkOfflineError\" &&\r\n !dismiss\r\n ) {\r\n toastStyled({\r\n icon: \"chain-broken\",\r\n style: NotificationStyle.Warning,\r\n autoClose: false,\r\n details,\r\n toastId: toastId.NoNetwork,\r\n message: \"$offline.pretty.msg\",\r\n });\r\n }\r\n throw e;\r\n }),\r\n [details, dismiss, setDismiss]\r\n );\r\n\r\n return useMemo(\r\n () => ({\r\n error,\r\n factory: request ? undefined : factory,\r\n request: request ? factory(request) : undefined,\r\n }),\r\n [error, factory, request]\r\n );\r\n};\r\n\r\nexport { useOfflineHandler };\r\n","import { useMemo } from \"react\";\r\nimport { usePostMessageHandler } from \"hooks/PostMessage/Handler\";\r\nimport { postMessageTo } from \"hooks/PostMessage/Utils\";\r\nimport { ArrowNavigationAction } from \"hooks/PostMessage/Actions\";\r\nimport { docRoute } from \"components/ItemUriLink\";\r\nimport queryString from \"data/queryString\";\r\nimport { get } from \"data/constants\";\r\n\r\nconst useArrowNavigationTransmitter = (\r\n source,\r\n target,\r\n targetData,\r\n setCurrentIndex,\r\n history\r\n) =>\r\n usePostMessageHandler(\r\n useMemo(\r\n () => ({\r\n [ArrowNavigationAction.Ready]: (data) =>\r\n postMessageTo(\r\n ArrowNavigationAction.Load,\r\n targetData,\r\n target\r\n ),\r\n [ArrowNavigationAction.Paginate]: (data) => {\r\n if (source !== data.source) {\r\n return;\r\n }\r\n const search = queryString.parse(window.location.search);\r\n search[data.qsParam] = data.currentIndex;\r\n setCurrentIndex(data.currentIndex);\r\n const a = document.createElement(\"a\"); // Use a tag for Location conversion\r\n a.href = window.location;\r\n a.pathname = a.pathname.replace(\r\n get(window.CONFIG, [\"host\", \"basename\"], \"\"),\r\n \"\"\r\n );\r\n a.search = queryString.stringify(search);\r\n history.push(a.pathname + a.search);\r\n },\r\n }),\r\n [source, target, targetData, setCurrentIndex, history]\r\n )\r\n );\r\n\r\nconst useArrowNavigationReceiver = (\r\n postMessageProps,\r\n setPostMessageProps,\r\n history,\r\n setMaxCount\r\n) =>\r\n usePostMessageHandler(\r\n useMemo(\r\n () => ({\r\n [ArrowNavigationAction.Load]: (data) => {\r\n /* istanbul ignore if */\r\n if (postMessageProps.source) {\r\n return;\r\n }\r\n setPostMessageProps({\r\n ...data,\r\n rows: data.rows ?? [],\r\n currentIndex: data.currentIndex ?? 0,\r\n });\r\n setMaxCount(data.rows?.length ?? 0);\r\n },\r\n [ArrowNavigationAction.Reload]: (data) => {\r\n /* istanbul ignore if */\r\n if (data.source !== postMessageProps.source) {\r\n return;\r\n }\r\n setPostMessageProps({\r\n ...postMessageProps,\r\n rows: data.rows ?? [],\r\n currentIndex: data.currentIndex ?? 0,\r\n });\r\n setMaxCount(data.rows?.length ?? 0);\r\n },\r\n [ArrowNavigationAction.SetIndex]: (data) => {\r\n if (data.source !== postMessageProps.source) {\r\n return;\r\n }\r\n const url = docRoute(\r\n postMessageProps.rows[data.currentIndex],\r\n true,\r\n false\r\n );\r\n history.push(url);\r\n setPostMessageProps({\r\n ...postMessageProps,\r\n currentIndex: data.currentIndex,\r\n });\r\n },\r\n }),\r\n [postMessageProps, setPostMessageProps, history, setMaxCount]\r\n )\r\n );\r\n\r\nexport { useArrowNavigationTransmitter, useArrowNavigationReceiver };\r\n","//@flow\r\nimport { useCallback, useEffect } from \"react\";\r\nimport {\r\n ItemStatuses,\r\n SpecialFoldersItemURIs,\r\n type ItemStatusesDTO,\r\n} from \"data/types\";\r\nimport { type History } from \"history\";\r\n\r\nconst useRecycleBin = (\r\n itemUriFromProps: string,\r\n itemStatusFromProps: ItemStatusesDTO = ItemStatuses.Nothing,\r\n history: History = null\r\n) => {\r\n const checkIfRecycledDocuments = useCallback(\r\n (itemUri: string = itemUriFromProps) =>\r\n itemUri?.endsWith(SpecialFoldersItemURIs.RecycledDocumentsUri),\r\n [itemUriFromProps]\r\n );\r\n const checkIfDeleted = useCallback(\r\n (\r\n itemStatus: ItemStatusesDTO = itemStatusFromProps,\r\n itemUri: string = itemUriFromProps\r\n ) =>\r\n (itemStatus & ItemStatuses.Deleted) > 0 ||\r\n checkIfRecycledDocuments(itemUri),\r\n [itemStatusFromProps, itemUriFromProps, checkIfRecycledDocuments]\r\n );\r\n const checkIfAnyParentDeleted = useCallback(\r\n (itemStatus: ItemStatusesDTO = itemStatusFromProps) =>\r\n (itemStatus & ItemStatuses.ParentDeleted) > 0,\r\n [itemStatusFromProps]\r\n );\r\n const checkIfInRecycleBin = useCallback(\r\n (itemStatus: ItemStatusesDTO = itemStatusFromProps) =>\r\n checkIfDeleted(itemStatus) || checkIfAnyParentDeleted(itemStatus),\r\n [itemStatusFromProps, checkIfDeleted, checkIfAnyParentDeleted]\r\n );\r\n useEffect(() => {\r\n if (history == null) return;\r\n const { pathname, search, hash } = history.location;\r\n\r\n const isRecycleBin = checkIfInRecycleBin();\r\n if (\r\n (isRecycleBin &&\r\n hash !== `#${SpecialFoldersItemURIs.RecycleBinUri}`) ||\r\n (!isRecycleBin &&\r\n hash === `#${SpecialFoldersItemURIs.RecycleBinUri}`)\r\n ) {\r\n history.replace(\r\n `${pathname}${search}${\r\n isRecycleBin\r\n ? `#${SpecialFoldersItemURIs.RecycleBinUri}`\r\n : \"\"\r\n }`\r\n );\r\n }\r\n }, [checkIfInRecycleBin, history]);\r\n return [\r\n checkIfRecycledDocuments,\r\n checkIfDeleted,\r\n checkIfAnyParentDeleted,\r\n checkIfInRecycleBin,\r\n ];\r\n};\r\n\r\nexport { useRecycleBin };\r\n","import { useCallback } from \"react\";\r\nimport { type History } from \"history\";\r\nimport { ViewNameType, type ViewNameTypeEnum } from \"data/types\";\r\nimport { folderRoute, flatRoute, mailRoute } from \"components/ItemUriLink\";\r\n\r\ntype Props = {\r\n targetViewNameType: ViewNameTypeEnum,\r\n history: History,\r\n isMini?: boolean,\r\n};\r\n\r\nconst useViewNameTypeRouting = ({\r\n targetViewNameType,\r\n history,\r\n isMini = false,\r\n}: Props) => {\r\n const handleViewNameTypeChange = useCallback(\r\n (viewNameType, props) => {\r\n if (props.itemUri == null) return;\r\n if (targetViewNameType === viewNameType || isMini) return;\r\n let url = \"\";\r\n switch (viewNameType) {\r\n case ViewNameType.flat:\r\n url = flatRoute(props.itemUri, isMini, true);\r\n break;\r\n case ViewNameType.mailbox:\r\n url = mailRoute(props.itemUri, isMini, true);\r\n break;\r\n case ViewNameType.folder:\r\n url = folderRoute(props.itemUri, isMini, true);\r\n break;\r\n default:\r\n return;\r\n }\r\n history.push(url);\r\n },\r\n [targetViewNameType, isMini, history]\r\n );\r\n return handleViewNameTypeChange;\r\n};\r\n\r\nexport { useViewNameTypeRouting };\r\n","//@flow\r\nimport { type FormActionsConfigDTO } from \"data/types\";\r\n\r\nexport const getFormActionsConfig = (): FormActionsConfigDTO => [\r\n {\r\n id: \"searchForm_operator\",\r\n icon: \"filter\",\r\n name: \"$formActions:searchForm_operator.name\",\r\n description: \"$formActions:searchForm_operator.description\",\r\n views: [\"search\"],\r\n shouldBeVisible: [\"hasContext:showSearchOperators\"],\r\n commandAction: {\r\n name: \"searchForm_operator\",\r\n },\r\n },\r\n {\r\n id: \"searchForm_scope\",\r\n icon: \"dot-circle-o\",\r\n name: \"$formActions:searchForm_scope.name\",\r\n description: \"$formActions:searchForm_scope.description\",\r\n views: [\"search\"],\r\n shouldBeVisible: [\"hasContext:showSearchScope\"],\r\n commandAction: {\r\n name: \"searchForm_scope\",\r\n },\r\n },\r\n {\r\n id: \"search_scope\",\r\n icon: \"folder-o\",\r\n name: \"$formActions:search_scope.name\",\r\n description: \"$formActions:search_scope.description\",\r\n views: [\"search_scope\"],\r\n commandAction: {\r\n name: \"search_scope\",\r\n },\r\n },\r\n {\r\n id: \"unlock\",\r\n icon: \"unlock\",\r\n name: \"$formActions:unlock.name\",\r\n views: [\"lock_info\"],\r\n shouldBeVisible: [\"hasContext:isDocEditAllowed\"],\r\n commandAction: {\r\n name: \"unlock\",\r\n },\r\n },\r\n {\r\n id: \"doc_editClassification\",\r\n icon: \"pencil\",\r\n name: \"$formActions:doc_editClassification.name\",\r\n views: [\"document\", \"docmodal\"],\r\n shouldBeVisible: [\r\n \"!hasContext:isEdit\",\r\n \"hasContext:isDocEditAllowed\",\r\n \"hasContext:isDocClassificationEditAllowed\",\r\n \"licenseAllowEdit\",\r\n ],\r\n commandAction: {\r\n name: \"doc_editClassification\",\r\n },\r\n },\r\n {\r\n id: \"folder_editClassification\",\r\n icon: \"pencil\",\r\n name: \"$formActions:folder_editClassification.name\",\r\n views: [\"folder\"],\r\n shouldBeVisible: [\r\n \"!hasContext:isEdit\",\r\n \"hasContext:isEditAllowed\",\r\n \"hasContext:isFolderClassificationEditAllowed\",\r\n \"licenseAllowEdit\",\r\n ],\r\n commandAction: {\r\n name: \"folder_editClassification\",\r\n },\r\n },\r\n {\r\n id: \"edit_form_clear\",\r\n name: \"$formActions:form_clear.name\",\r\n views: [\"folder\", \"document\", \"docmodal\", \"upload\", \"itemflows\"],\r\n shouldBeVisible: [\"hasContext:onClear\", \"hasContext:isEdit\"],\r\n commandAction: {\r\n name: \"form_clear\",\r\n },\r\n },\r\n {\r\n id: \"edit_form_cancel\",\r\n name: \"$formActions:form_cancel.name\",\r\n views: [\"folder\", \"document\", \"docmodal\", \"upload\", \"itemflows\"],\r\n shouldBeVisible: [\"hasContext:onCancel\", \"hasContext:isEdit\"],\r\n commandAction: {\r\n name: \"form_cancel\",\r\n },\r\n },\r\n {\r\n id: \"view_form_clear\",\r\n name: \"$formActions:form_clear.name\",\r\n views: [\"archive_target\", \"search\"],\r\n shouldBeVisible: [\"hasContext:onClear\"],\r\n commandAction: {\r\n name: \"form_clear\",\r\n },\r\n },\r\n {\r\n id: \"view_form_cancel\",\r\n name: \"$formActions:form_cancel.name\",\r\n views: [\"archive_target\", \"search\"],\r\n shouldBeVisible: [\"hasContext:onCancel\"],\r\n commandAction: {\r\n name: \"form_cancel\",\r\n },\r\n },\r\n];\r\n","import { useMemo, useContext } from \"react\";\r\nimport unionBy from \"lodash/unionBy\";\r\nimport cloneDeep from \"lodash/cloneDeep\";\r\nimport { useSelector } from \"react-redux\";\r\nimport { useAsyncMemo } from \"hooks\";\r\nimport CommandActionHandler from \"components/CommandActions\";\r\nimport {\r\n shouldRenderItem,\r\n mergePartialConfig,\r\n} from \"containers/ActionPanel/Utils\";\r\nimport { getDefaultsConfig } from \"data/constants\";\r\nimport { ItemContext } from \"data/context\";\r\nimport { getFormActionsConfig } from \"data/formActions\";\r\nimport { userFormActionsSelector } from \"data/reducers/selectors\";\r\nimport { type ItemActionConfig, type FormActionsConfigDTO } from \"data/types\";\r\nimport { getLocalizedText, asyncFilter } from \"data/utils\";\r\n\r\nexport const useFormActionsConfig = (\r\n itemUri: string,\r\n formatId: number\r\n): FormActionsConfigDTO => {\r\n const userFormActions = useSelector(userFormActionsSelector);\r\n return useMemo(() => {\r\n const userActions = cloneDeep(userFormActions.actions);\r\n // get formActions as defined in appsettings.json (after being checked for security for this user)\r\n const formActions = cloneDeep(getFormActionsConfig());\r\n\r\n // get itemUri specific formActions\r\n const defaults = getDefaultsConfig(itemUri, formatId);\r\n if (defaults?.formActions) {\r\n if (defaults.formActions.replace === true) {\r\n return (\r\n mergePartialConfig(\r\n defaults.formActions.actions,\r\n formActions\r\n ) || []\r\n );\r\n } else {\r\n return unionBy(\r\n defaults.formActions.actions,\r\n userActions,\r\n formActions,\r\n \"id\"\r\n );\r\n }\r\n } else {\r\n return unionBy(userActions, formActions, \"id\");\r\n }\r\n }, [itemUri, formatId, userFormActions]);\r\n};\r\n\r\nexport const useFormActions = (targetView, contextProps) => {\r\n const itemContext = useContext(ItemContext);\r\n const { itemUri = \"\", formatId = -1 } = itemContext || {};\r\n const formActions = useFormActionsConfig(itemUri, formatId);\r\n const allContextProps = useMemo(\r\n () => ({ ...contextProps, ...itemContext }),\r\n [contextProps, itemContext]\r\n );\r\n const actions: Array = useAsyncMemo(\r\n async () => {\r\n const result = await asyncFilter(\r\n formActions,\r\n (action: ItemActionConfig) =>\r\n shouldRenderItem(\r\n action,\r\n itemUri,\r\n formatId,\r\n allContextProps,\r\n targetView\r\n )\r\n );\r\n return result.map((action) => ({\r\n id: action.id,\r\n title: getLocalizedText(action.name),\r\n icon: action.icon,\r\n description: getLocalizedText(action.description),\r\n onClick: () => {\r\n if (action.commandAction == null) {\r\n console.error(\r\n `Sorry, no CommandAction defined for action.name='${action.name}'`\r\n );\r\n } else {\r\n CommandActionHandler(\r\n action.commandAction.name,\r\n Object.assign(\r\n {},\r\n allContextProps,\r\n action.commandAction.props\r\n )\r\n );\r\n }\r\n },\r\n }));\r\n },\r\n [formActions, itemUri, formatId, allContextProps, targetView],\r\n null\r\n );\r\n return actions;\r\n};\r\n","// @flow\r\nimport React, { PureComponent } from \"react\";\r\nimport \"./index.css\";\r\n\r\ntype Props = {\r\n /** controlled input text value */\r\n name: string,\r\n /** controller input onChange event */\r\n onChange: Function,\r\n /** optional title (tooltip) */\r\n title?: string,\r\n};\r\n\r\ntype State = {\r\n name: string,\r\n editing: boolean,\r\n};\r\n\r\nclass Rename extends PureComponent {\r\n _txt: HTMLInputElement | null;\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n this.state = { editing: false, name: props.name };\r\n }\r\n\r\n _startEditing = () => {\r\n this.setState({ editing: true }, () => {\r\n /* istanbul ignore else */\r\n if (this._txt != null) {\r\n const txt = this._txt;\r\n txt.focus();\r\n txt.setSelectionRange(0, this.state.name.length);\r\n }\r\n });\r\n };\r\n\r\n _onChange = (e: SyntheticInputEvent<*>) => {\r\n this.setState({ name: e.currentTarget.value });\r\n };\r\n\r\n _onBlur = (e: SyntheticInputEvent<*>) => {\r\n this.setState({ editing: false }, () => {\r\n /* istanbul ignore else */\r\n if (\r\n typeof this.props.onChange === \"function\" &&\r\n this.state.name !== this.props.name\r\n )\r\n this.props.onChange(this.state.name);\r\n });\r\n };\r\n\r\n _onKeyDown = (e: SyntheticInputEvent<*>) => {\r\n /* istanbul ignore else */\r\n if (e.which === 13) {\r\n //ENTER\r\n e.preventDefault();\r\n this._onBlur(e);\r\n }\r\n /* istanbul ignore else */\r\n if (e.which === 27) {\r\n //ESCAPE\r\n e.preventDefault();\r\n this.setState({ name: this.props.name }, () => this._onBlur(e));\r\n }\r\n };\r\n\r\n render() {\r\n if (this.state.editing) {\r\n return (\r\n (this._txt = ref)}\r\n style={{ display: \"inline\" }}\r\n type=\"text\"\r\n className=\"form-control\"\r\n value={this.state.name}\r\n onBlur={this._onBlur}\r\n onChange={this._onChange}\r\n onKeyDown={this._onKeyDown}\r\n />\r\n );\r\n } else {\r\n return (\r\n \r\n {this.props.name}\r\n \r\n );\r\n }\r\n }\r\n}\r\nexport default Rename;\r\n","// @flow\r\nimport React from \"react\";\r\nimport Breadcrumb from \"react-bootstrap/lib/Breadcrumb\";\r\nimport { LinkContainer } from \"react-router-bootstrap\";\r\nimport loc from \"i18next\";\r\nimport Status from \"components/Status\";\r\nimport Rename from \"components/Rename\";\r\n\r\ntype Props = {\r\n /** name of search item */\r\n name: ?string,\r\n /** whether this is a favorite */\r\n isFav: boolean,\r\n /** whether user is allowed to rename searchcrumb (and hide favorite option) */\r\n isReadonly: boolean,\r\n /** favorite add/remove fetch status */\r\n favStatus: string,\r\n /** callback when favorite icon is clicked */\r\n favOnClick?: () => void,\r\n /** callback when user renamed favorite\r\n * @param {string} name new name\r\n */\r\n onRename: ?(name: string) => void,\r\n /** CSS styles to apply */\r\n style?: StyleSheet | Object,\r\n /** className to apply */\r\n className?: string,\r\n};\r\n\r\nconst Searchcrumb = ({\r\n name,\r\n isFav = false,\r\n isReadonly = false,\r\n favStatus,\r\n favOnClick,\r\n onRename,\r\n style,\r\n className,\r\n}: Props) => (\r\n \r\n {typeof favOnClick === \"function\" &&\r\n !isReadonly &&\r\n (isFav ? (\r\n \r\n \r\n \r\n ) : (\r\n \r\n \r\n \r\n ))}{\" \"}\r\n \r\n {isReadonly === true && (\r\n \r\n {loc.t(\"search.searchcrumb\")}\r\n \r\n )}\r\n {isReadonly === false && (\r\n \r\n {loc.t(\"search.searchcrumb\")}\r\n \r\n )}\r\n \r\n {name && String(name).length > 0 && (\r\n \r\n {typeof onRename === \"function\" && !isReadonly ? (\r\n \r\n ) : (\r\n name\r\n )}\r\n \r\n )}\r\n \r\n);\r\nSearchcrumb.displayName = \"Searchcrumb\";\r\nexport default Searchcrumb;\r\n","// @flow\r\nimport React, { PureComponent } from \"react\";\r\nimport { connect, Dispatch } from \"react-redux\";\r\nimport { addSearchFavorite, delFavoriteLink } from \"data/api\";\r\nimport { renameSearchFavoriteAction } from \"data/actions\";\r\nimport {\r\n type SearchRequestDTO,\r\n type SearchItemDTO,\r\n SearchRequestType,\r\n} from \"data/types\";\r\nimport Searchcrumb from \"components/Searchcrumb\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport Status from \"components/Status\";\r\nimport { toastActionResult } from \"data/toast\";\r\nimport * as s from \"data/reducers/selectors\";\r\n\r\ntype Props = {\r\n /** searchItem object (not executed yet) */\r\n searchItem: ?SearchItemDTO,\r\n /** search Request object (executed query) */\r\n searchRequest: SearchRequestDTO,\r\n /** whether user is allowed to rename searchcrumb (and hide favorite option) */\r\n isReadonly: boolean,\r\n /** Redux dispatch */\r\n dispatch: Dispatch,\r\n};\r\n\r\ntype State = {\r\n status: ConstantsEnum,\r\n isFav: boolean,\r\n favStatus: ConstantsEnum,\r\n name: string,\r\n linkId: number,\r\n};\r\n\r\nexport class SearchcrumbContainer extends PureComponent {\r\n favOnClick: Function;\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n this.state = {\r\n status: Constants.LOADING,\r\n isFav: false,\r\n favStatus: Constants.LOADING,\r\n name: \"\",\r\n linkId: -1,\r\n };\r\n this.favOnClick = this.favOnClick.bind(this);\r\n }\r\n\r\n // componentDidMount() {\r\n // this._parse(this.props.searchRequest);\r\n // }\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n /* istanbul ignore else */\r\n if (prevProps.searchRequest !== this.props.searchRequest) {\r\n this._parse(this.props.searchRequest);\r\n }\r\n }\r\n\r\n _parse = (searchRequest: SearchRequestDTO): void => {\r\n if (searchRequest) {\r\n this.setState({\r\n status: Constants.OK,\r\n isFav:\r\n searchRequest.isCustom === false &&\r\n searchRequest.searchType === SearchRequestType.Favorite,\r\n favStatus: Constants.OK,\r\n name: searchRequest.name || \"\",\r\n linkId: searchRequest.id,\r\n });\r\n } else {\r\n this.setState({ status: Constants.OK });\r\n }\r\n };\r\n\r\n async favOnClick(e: SyntheticEvent) {\r\n e.preventDefault();\r\n const { searchRequest } = this.props;\r\n const { name, isFav, linkId } = this.state;\r\n\r\n this.setState({ favStatus: Constants.LOADING });\r\n\r\n try {\r\n const success = isFav\r\n ? await delFavoriteLink(linkId)\r\n : await addSearchFavorite(searchRequest);\r\n\r\n toastActionResult(\r\n success,\r\n isFav ? \"breadcrumb.delfav\" : \"breadcrumb.addfav\",\r\n { name }\r\n );\r\n\r\n if (success) {\r\n this.setState({\r\n isFav: !isFav,\r\n favStatus: Constants.OK,\r\n });\r\n } else {\r\n this.setState({\r\n favStatus: Constants.ERROR,\r\n });\r\n }\r\n } catch (err) {\r\n this.setState({\r\n favStatus: Constants.ERROR,\r\n });\r\n }\r\n }\r\n\r\n favOnRename = (name: string) =>\r\n this.props.dispatch(renameSearchFavoriteAction({ name }));\r\n\r\n render() {\r\n const { searchRequest, searchItem, isReadonly } = this.props;\r\n if (searchRequest != null && searchItem != null) {\r\n const { name, status, isFav, favStatus } = this.state;\r\n if (status === Constants.OK)\r\n return (\r\n \r\n );\r\n\r\n return ;\r\n } else if (searchItem != null) {\r\n return (\r\n \r\n );\r\n } else {\r\n return (\r\n \r\n );\r\n }\r\n }\r\n}\r\n\r\nconst mapStateToProps = /* istanbul ignore next */ (state, ownProps) => ({\r\n searchRequest: s.searchRequestSelector(state),\r\n ...ownProps,\r\n});\r\n\r\nexport default connect(mapStateToProps)(SearchcrumbContainer);\r\n","import React from \"react\";\r\nimport BreadcrumbContainer from \"containers/Breadcrumb\";\r\nimport SearchcrumbContainer from \"containers/Searchcrumb\";\r\nimport { check_isSpecialFolder } from \"containers/ActionPanel/ShouldBeVisible\";\r\nimport Icons from \"@hs/icons\";\r\nimport { type SearchItemDTO } from \"data/types\";\r\nimport loc from \"i18next\";\r\n\r\nexport const CustomBreadcrumb = ({\r\n name,\r\n icon,\r\n}: {\r\n /** text to show */\r\n name: string,\r\n /** icon to show (FontAwesome) */\r\n icon: string,\r\n}) => (\r\n
\r\n \r\n {\" \" + name}\r\n
\r\n);\r\nCustomBreadcrumb.displayName = \"CustomBreadcrumb\";\r\n\r\ntype Props = {\r\n /** itemUri */\r\n itemUri: ?string,\r\n /** current view name */\r\n viewName: string,\r\n /** optional used searchItem */\r\n searchItem?: SearchItemDTO,\r\n /** whether user is allowed to navigate through breadcrumb (and hide favorite option) */\r\n isReadonly: boolean,\r\n /** scope breadcrumb to show parts only starting the specified level number */\r\n scopeFromLevel?: number,\r\n /** optional breadcrumbPart click event instead of history.push */\r\n onBreadcrumbPartClick?: (itemUri: string) => void,\r\n};\r\n\r\nexport const CrumbSelector = ({\r\n itemUri,\r\n viewName,\r\n searchItem,\r\n isReadonly = false,\r\n isRecycleBin = false,\r\n scopeFromLevel = 0,\r\n onBreadcrumbPartClick,\r\n canChangeSite = false,\r\n}: Props) => {\r\n if (searchItem != null)\r\n return (\r\n \r\n );\r\n else if (\r\n itemUri == null //home baby\r\n )\r\n return null;\r\n // ;\r\n else if (itemUri === \"search\")\r\n return (\r\n \r\n );\r\n else if (itemUri === \"news\")\r\n return ;\r\n else if (itemUri === \"upload\")\r\n return (\r\n \r\n );\r\n else if (\r\n String(itemUri).startsWith(\"pam-item://\") ||\r\n check_isSpecialFolder({ itemUri })\r\n ) {\r\n const isFavorable = !(\r\n check_isSpecialFolder({ itemUri }) || isRecycleBin\r\n );\r\n return (\r\n \r\n );\r\n } else {\r\n return null;\r\n }\r\n};\r\nCrumbSelector.displayName = \"CrumbSelector\";\r\nexport default CrumbSelector;\r\n","// @flow\r\nimport React, { useCallback } from \"react\";\r\nimport styles from \"./Button.module.css\";\r\nimport CountBadge from \"components/CountBadge\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport Icons from \"@hs/icons\";\r\nimport { type ToggleItemDTO } from \"data/types\";\r\nimport Constants from \"data/constants\";\r\nimport { getClassNames } from \"data/utils\";\r\n\r\ntype Props = {\r\n name: string,\r\n isMultiple: boolean,\r\n item: ToggleItemDTO,\r\n onClick: Function,\r\n};\r\n\r\nconst ToggleBarButton = ({ item, index, isMultiple, onClick }: Props) => {\r\n const handleClick = useCallback(\r\n () => !item.isDisabled && onClick(item, isMultiple),\r\n [item, isMultiple, onClick]\r\n );\r\n return (\r\n !item.isHidden && (\r\n \r\n {item.icon && (\r\n \r\n )}\r\n \r\n {item.text}\r\n \r\n {item.count > 0 && (\r\n \r\n )}\r\n {item.status != null && (\r\n \r\n )}\r\n \r\n )\r\n );\r\n};\r\nToggleBarButton.displayName = \"ToggleBar.Button\";\r\n\r\nexport default ToggleBarButton;\r\n","// @flow\r\nimport React from \"react\";\r\nimport styles from \"./ToggleBar.module.css\";\r\nimport Button from \"./Button\";\r\nimport ButtonGroup from \"react-bootstrap/lib/ButtonGroup\";\r\nimport { type ToggleItemDTO } from \"data/types\";\r\n\r\ntype Props = {\r\n name: string,\r\n isMultiple: boolean,\r\n toggles: Array,\r\n onClick: Function,\r\n};\r\n\r\nconst ToggleBar = ({ name, toggles, ...props }: Props) => (\r\n \r\n {toggles.map((item: ToggleItemDTO, index: number) => (\r\n \r\n ))}\r\n \r\n);\r\n\r\nexport default ToggleBar;\r\n","import { useCallback } from \"react\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport ToggleBar from \"components/ToggleBar\";\r\nimport { persistTogglesAction } from \"data/actions\";\r\nimport produce from \"immer\";\r\n\r\nconst ToggleBarContainer = ({\r\n isMultiple,\r\n name,\r\n toggles: togglesFromProps,\r\n}) => {\r\n const dispatch = useDispatch();\r\n // enrich toggles with data from store and fix multiple selection issues\r\n const toggles = useSelector((state) =>\r\n produce(togglesFromProps, (draft) => {\r\n const togglesFromStore = state.toggles[name];\r\n draft = draft.map((toggle) => {\r\n toggle.count = togglesFromStore?.counts?.[toggle.value] ?? 0;\r\n toggle.status =\r\n togglesFromStore?.status?.[toggle.value] ?? null;\r\n return toggle;\r\n });\r\n })\r\n );\r\n const handleClick = useCallback(\r\n (item) => {\r\n const newToggles = produce(toggles, (draft) => {\r\n draft = draft.map((toggle) => {\r\n if (!isMultiple) toggle.isSelected = false;\r\n if (toggle.value === item.value) {\r\n toggle.isSelected = !toggle.isSelected;\r\n }\r\n return toggle;\r\n });\r\n // if none selected preselect first one\r\n /* istanbul ignore else */\r\n if (draft.filter((toggle) => toggle.isSelected).length === 0) {\r\n draft[0].isSelected = true;\r\n }\r\n });\r\n dispatch(persistTogglesAction(name, newToggles));\r\n },\r\n [name, toggles, isMultiple, dispatch]\r\n );\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default ToggleBarContainer;\r\n","// @flow\r\nimport React, { type Node } from \"react\";\r\nimport \"./index.css\";\r\n// local components\r\nimport CrumbSelector from \"./CrumbSelector\";\r\nimport ToggleBarContainer from \"containers/ToggleBar\";\r\nimport ActionsMenu from \"components/ActionsMenu\";\r\nimport ActionsButton from \"components/ActionPanel/ActionsButton\";\r\nimport Pane from \"components/SplitPanes/Pane\";\r\nimport { openItemActionPanel } from \"components/ItemActionPanel\";\r\nimport { type ToggleDTO, type SearchItemDTO } from \"data/types\";\r\nimport { usePendingOfflineChanges } from \"./usePendingOfflineChanges\";\r\n\r\ntype Props = {\r\n /** toggles definition */\r\n toggles: ?ToggleDTO,\r\n /** React children */\r\n children?: Node,\r\n /** optional control to show at the beginning of topbar */\r\n topRowBefore?: Node,\r\n /** optional control to show at the end of topbar */\r\n topRowEnd?: Node,\r\n /** optional CSS class to apply */\r\n className?: string,\r\n /** current itemUri */\r\n itemUri?: ?string, //TODO remove MainLayout.ItemUri since it should be included in contextProps\r\n /** any contextProps to pass to actions */\r\n contextProps?: Object,\r\n /** optional used searchItem */\r\n searchItem?: SearchItemDTO,\r\n /** view name */\r\n name: string,\r\n /** callback when user selects action from ActionsMenu\r\n * @param {string} actionId which action has been selected by the user\r\n */\r\n onAction?: (actionId: string) => void,\r\n /** callback to decide whether specified action should be visible\r\n * @param {object} action action object for which to decide visibility\r\n * @returns {boolean} true if should be visible, false to not render\r\n */\r\n onActionShouldBeVisible?: (action: { id: string }) => boolean,\r\n /** scope breadcrumbs to recyclebin; default: false */\r\n breadcrumbIsRecycleBin?: boolean,\r\n /** whether user is allowed to navigate through breadcrumb (and hide favorite option); default: false */\r\n breadcrumbReadonly?: boolean,\r\n /** scope breadcrumb to show parts only starting the specified level number */\r\n breadcrumbScopeFromLevel?: number,\r\n /** optional breadcrumbPart click event instead of history.push */\r\n onBreadcrumbPartClick?: (itemUri: string) => void,\r\n /** whether to disable the whole actionsMenu; default: false */\r\n actionsDisabled?: boolean,\r\n /** whether root of breadcrumb can be changed */\r\n breadcrumbCanChangeSite?: boolean,\r\n};\r\n\r\nconst MainLayout = ({\r\n toggles,\r\n children,\r\n topRowClassName = \"\",\r\n topRowBefore,\r\n topRowEnd,\r\n id,\r\n className,\r\n itemUri,\r\n contextProps,\r\n searchItem,\r\n name,\r\n onAction,\r\n onActionShouldBeVisible,\r\n breadcrumbIsRecycleBin = false,\r\n breadcrumbReadonly = false,\r\n breadcrumbScopeFromLevel,\r\n onBreadcrumbPartClick,\r\n actionsDisabled = false,\r\n breadcrumbCanChangeSite = false,\r\n}: Props) => {\r\n usePendingOfflineChanges(itemUri);\r\n return (\r\n
\r\n \r\n {topRowBefore}\r\n
\r\n \r\n
\r\n\r\n {toggles && }\r\n\r\n {contextProps && (\r\n \r\n openItemActionPanel({ contextProps })\r\n }\r\n className=\"ab\"\r\n dataTest=\"openItemActionPanelButton\"\r\n />\r\n )}\r\n {onAction && name && (\r\n \r\n )}\r\n {topRowEnd}\r\n
\r\n \r\n {children}\r\n \r\n
\r\n );\r\n};\r\nMainLayout.displayName = \"MainLayout\";\r\nexport default MainLayout;\r\n","import { useEffect } from \"react\";\r\nimport { toastTypes, toastStyled } from \"data/toast\";\r\nimport { anyPendingChanges } from \"data/offline/offlineQueue\";\r\n\r\nexport function usePendingOfflineChanges(itemUri: string) {\r\n // const [hasPendingChanges, setHasPendingChanges] = useState(false);\r\n useEffect(() => {\r\n if (itemUri != null) {\r\n anyPendingChanges(itemUri).then((result) => {\r\n if (result === true) {\r\n toastStyled(toastTypes.offlinePendingChanges);\r\n }\r\n // setHasPendingChanges(result);\r\n });\r\n }\r\n }, [itemUri]);\r\n\r\n // useEffect(() => {\r\n // if (hasPendingChanges === true) {\r\n // toastStyled(toastTypes.offlinePendingChanges);\r\n // }\r\n // }, [hasPendingChanges]);\r\n}\r\n","// @flow\r\nimport React from \"react\";\r\nimport ItemActions from \"./ItemActions\";\r\nimport {\r\n type ItemActionConfig,\r\n type ItemActionCategoryConfig,\r\n} from \"data/types\";\r\nimport Icons from \"@hs/icons\";\r\nimport { getLocalizedText } from \"data/utils\";\r\nimport Divider from \"components/Divider\";\r\nimport styles from \"./ActionCategory.module.css\";\r\n\r\ntype Props = {\r\n /** current category to render */\r\n category: ItemActionCategoryConfig,\r\n /** list of all actions (will be filtered by category.category) */\r\n actions?: Array,\r\n /** callback when user clicks an action */\r\n onAction?: (action: ItemActionConfig) => void,\r\n /** optional children (if actions not provided) */\r\n children?: React.Node,\r\n};\r\n\r\n/**\r\n * renders a category and all it's defined actions\r\n */\r\nconst ActionCategory = ({ category, actions, onAction, children }: Props) => {\r\n const catActions =\r\n actions && actions.filter((action) => action.category === category.id);\r\n if (\r\n (catActions == null || catActions.length === 0) &&\r\n typeof onAction === \"function\"\r\n )\r\n return null;\r\n\r\n const content = catActions ? (\r\n \r\n ) : (\r\n children\r\n );\r\n if (category.renderHeader === false) {\r\n return content;\r\n } else {\r\n return (\r\n \r\n {getLocalizedText(category.name)}\r\n {category.icon && (\r\n \r\n )}\r\n \r\n }\r\n >\r\n {content}\r\n \r\n );\r\n }\r\n};\r\n\r\nActionCategory.displayName = \"ActionCategory\";\r\nexport default ActionCategory;\r\n","// @flow\r\nimport React from \"react\";\r\nimport Modal from \"components/Modal\";\r\n// import Tab from \"react-bootstrap/lib/Tab\";\r\n// import Tabs from \"react-bootstrap/lib/Tabs\";\r\n// import loc from \"i18next\";\r\nimport ActionCategory from \"./ActionCategory\";\r\n// import ItemActions from \"./ItemActions\";\r\nimport {\r\n type ItemActionConfig,\r\n type ItemActionCategoryConfig,\r\n} from \"data/types\";\r\nimport NoData from \"components/NoData\";\r\nimport Status from \"components/Status\";\r\nimport Constants from \"data/constants\";\r\nimport { useModalPostMessageHandler } from \"hooks\";\r\n\r\ntype Props = {\r\n /** react-modal-promise: whether to show dialog */\r\n open: boolean,\r\n /** react-modal-promise: callback when user closes Dialog */\r\n close: () => void,\r\n /** React Component to render as Title */\r\n title?: React.Node,\r\n /** React Component to render as body */\r\n body?: React.Node,\r\n /** list of action categories */\r\n categories?: Array,\r\n /** CommandActions to render */\r\n actions?: Array,\r\n /** callback when user selects an Action to execute */\r\n onAction: (action: ItemActionConfig) => void,\r\n /** is loading */\r\n isLoading: boolean,\r\n};\r\n\r\n/**\r\n * renders a docked modal as the actionPanel\r\n */\r\nconst ActionPanel = ({\r\n open,\r\n close,\r\n title,\r\n body,\r\n categories,\r\n actions,\r\n onAction,\r\n isLoading,\r\n}: Props) => {\r\n useModalPostMessageHandler(close);\r\n return (\r\n \r\n {title && (\r\n \r\n {title}\r\n \r\n )}\r\n \r\n {body}\r\n {isLoading && }\r\n {!isLoading &&\r\n (categories == null || categories.length === 0) && (\r\n \r\n )}\r\n {!isLoading &&\r\n categories &&\r\n categories.length > 0 &&\r\n categories.map((category, index) => (\r\n {\r\n if (\r\n action != null &&\r\n typeof onAction === \"function\"\r\n )\r\n onAction(action);\r\n close();\r\n }\r\n }\r\n />\r\n ))}\r\n \r\n \r\n );\r\n};\r\nActionPanel.displayName = \"ActionPanel\";\r\nexport default ActionPanel;\r\n","// @flow\r\nimport React, { useMemo, useCallback } from \"react\";\r\nimport { useAsyncMemo } from \"hooks\";\r\nimport ActionPanel from \"components/ActionPanel\";\r\nimport { createModal } from \"react-modal-promise\";\r\nimport { fetchItemContexts } from \"data/api\";\r\nimport {\r\n type ItemActionConfig,\r\n type ItemActionCategoryConfig,\r\n ItemContextsFlags,\r\n} from \"data/types\";\r\nimport CommandActionHandler from \"components/CommandActions\";\r\nimport { asyncFilter } from \"data/utils\";\r\nimport { mergeItemActionsConfig, shouldRenderItem } from \"./Utils\";\r\nimport produce from \"immer\";\r\n\r\nconst getContextProps = async (\r\n contextProps: any,\r\n itemContexts = ItemContextsFlags.ResultFlags | ItemContextsFlags.Offline\r\n) => {\r\n const {\r\n itemUri,\r\n formatId,\r\n ext,\r\n name,\r\n itemStatus,\r\n multiple,\r\n items,\r\n hasWorkflow,\r\n } = contextProps;\r\n /* istanbul ignore else */\r\n if (itemStatus == null) {\r\n itemContexts |= ItemContextsFlags.ItemStatus;\r\n }\r\n /* istanbul ignore else */\r\n if (name == null) {\r\n itemContexts |= ItemContextsFlags.WebDavName;\r\n }\r\n /* istanbul ignore else */\r\n if (ext == null) {\r\n itemContexts |= ItemContextsFlags.Extension;\r\n }\r\n /* istanbul ignore else */\r\n if (hasWorkflow == null) {\r\n itemContexts |= ItemContextsFlags.Workflow;\r\n }\r\n const itemUris = multiple ? items.map((i) => i.itemUri) : [itemUri];\r\n let formatIds = multiple ? items.map((i) => i.formatId) : [formatId];\r\n if (formatIds.filter((i) => i != null).length === 0) {\r\n formatIds = null;\r\n }\r\n return await fetchItemContexts(itemUris, formatIds, itemContexts);\r\n};\r\n\r\ntype Props = {\r\n /** react-modal-promise: whether to show dialog */\r\n open: boolean,\r\n /** react-modal-promise: callback when user closes Dialog */\r\n close: () => void,\r\n /** React Component to render as Title */\r\n title?: React.Node,\r\n /** React Component to render as body */\r\n body?: React.Node,\r\n /** any context props passed by caller will be assigned to commandAction props */\r\n contextProps: {\r\n itemUri: string,\r\n formatId: number,\r\n multiple: boolean,\r\n items: Array,\r\n } & Object,\r\n /** Override view context for Action Panel items */\r\n targetView?: string,\r\n};\r\n\r\nexport const ActionPanelContainer = (props: Props) => {\r\n const { contextProps, targetView, ...rest } = props;\r\n\r\n // fetch context and extend contextProps\r\n const allContextProps = useAsyncMemo(async () => {\r\n try {\r\n return {\r\n ...contextProps,\r\n ...(await getContextProps(contextProps)),\r\n };\r\n } catch (e) {\r\n console.error(`Cannot calculate contextProps: ${e.message}`);\r\n return contextProps;\r\n }\r\n }, [contextProps]);\r\n\r\n const [itemUri, formatId] = useMemo(() => {\r\n if (allContextProps == null) {\r\n return [null, -1];\r\n }\r\n const { itemUri, folderItemUri, formatId, multiple, items } =\r\n allContextProps;\r\n if (!multiple) {\r\n return [itemUri, formatId];\r\n }\r\n const combinedFormatId = items.every(\r\n (item) => item.formatId === items[0].formatId\r\n )\r\n ? items[0].formatId\r\n : -1;\r\n return [folderItemUri, combinedFormatId];\r\n }, [allContextProps]);\r\n\r\n const { categories: categoriesFromConfig, actions: actionsFromConfig } =\r\n useMemo(\r\n () => mergeItemActionsConfig(itemUri, formatId),\r\n [itemUri, formatId]\r\n );\r\n\r\n const categories: Array = useAsyncMemo(\r\n async () =>\r\n await asyncFilter(\r\n categoriesFromConfig,\r\n (category: ItemActionCategoryConfig) =>\r\n shouldRenderItem(\r\n category,\r\n itemUri,\r\n formatId,\r\n allContextProps,\r\n targetView\r\n )\r\n ),\r\n [categoriesFromConfig, itemUri, formatId, allContextProps, targetView]\r\n );\r\n\r\n const actions: Array = useAsyncMemo(async () => {\r\n const result = produce(\r\n await asyncFilter(actionsFromConfig, (action: ItemActionConfig) =>\r\n shouldRenderItem(\r\n action,\r\n itemUri,\r\n formatId,\r\n allContextProps,\r\n targetView\r\n )\r\n ),\r\n (draft) => {\r\n // HACK itemViews_* use the CommandActionHandler to RENDER before onAction is being called!\r\n draft.forEach(\r\n (action) =>\r\n action.commandAction &&\r\n (action.commandAction.props = Object.assign(\r\n {},\r\n allContextProps,\r\n action.commandAction.props\r\n ))\r\n );\r\n }\r\n );\r\n\r\n return result;\r\n }, [actionsFromConfig, itemUri, formatId, allContextProps, targetView]);\r\n\r\n const onAction = useCallback(\r\n (action: ItemActionConfig) => {\r\n if (action.commandAction == null) {\r\n alert(\r\n `Sorry, no CommandAction defined for action.name='${action.name}'`\r\n );\r\n } else {\r\n CommandActionHandler(\r\n action.commandAction.name,\r\n produce({}, (draft) => {\r\n draft = Object.assign(\r\n draft,\r\n allContextProps,\r\n action.commandAction.props\r\n );\r\n })\r\n );\r\n }\r\n },\r\n [allContextProps]\r\n );\r\n\r\n return (\r\n \r\n );\r\n};\r\n/* istanbul ignore next */\r\nconst MemoActionPanelContainer = React.memo(\r\n ActionPanelContainer,\r\n (prevProps, nextProps) => prevProps.itemUri !== nextProps.itemUri\r\n);\r\nexport const openActionPanel = createModal(MemoActionPanelContainer);\r\n","// @flow\r\nimport React from \"react\";\r\nimport { openActionPanel } from \"containers/ActionPanel\";\r\nimport Icons from \"@hs/icons\";\r\nimport Breadcrumb from \"components/Breadcrumb\";\r\nimport Attributes from \"components/Attributes\";\r\nimport styles from \"./ItemActionPanel.module.css\";\r\nimport { type BreadcrumbResultDTO } from \"data/types\";\r\nimport { getFileExtension, getLocalizedText } from \"data/utils\";\r\nimport ActionCategory from \"components/ActionPanel/ActionCategory\";\r\nimport loc from \"i18next\";\r\n\r\nexport const RowTitle = ({ title, ext }: { title?: string, ext?: string }) => (\r\n <>\r\n {ext && }\r\n {title || \"Actions\"}\r\n \r\n);\r\nRowTitle.displayName = \"RowTitle\";\r\n\r\nexport const RowBody = ({\r\n thumbnail,\r\n breadcrumb,\r\n attributes,\r\n}: {\r\n thumbnail?: React.Element,\r\n breadcrumb?: BreadcrumbResultDTO,\r\n attributes?: Array>,\r\n}) => (\r\n \r\n
\r\n {thumbnail}\r\n {breadcrumb && (\r\n \r\n )}\r\n {attributes && (\r\n \r\n )}\r\n
\r\n \r\n);\r\nRowBody.displayName = \"RowBody\";\r\n\r\ntype Props = {\r\n /** the name of the item */\r\n title?: string,\r\n /** file extension (if document and known) */\r\n ext?: string,\r\n /** contextProps to pass to commandActions */\r\n contextProps: {\r\n itemUri: string,\r\n isDoc: boolean,\r\n formatId: number,\r\n name?: string,\r\n ext?: string,\r\n } & Object,\r\n /** file thumbnail (if document) */\r\n thumbnail?: React.Element,\r\n /** item breadcrumb */\r\n breadcrumb?: BreadcrumbResultDTO,\r\n /** item attribute values */\r\n attributes?: Array>,\r\n /** Target view (override for current)*/\r\n targetView?: string,\r\n};\r\n\r\nconst parseName = (name) =>\r\n typeof name !== \"string\" &&\r\n name &&\r\n Object.prototype.hasOwnProperty.call(name, \"value\")\r\n ? name.value\r\n : name;\r\n\r\nconst parseTitle = (title, parsedName) => {\r\n let parsedTitleOrName = title || parsedName;\r\n return `${parsedTitleOrName}`.startsWith(\"$folder:\")\r\n ? getLocalizedText(parsedTitleOrName)\r\n : parsedTitleOrName;\r\n};\r\n\r\nexport /**\r\n * opens an actionPanel for the given itemUri (can be a Document or Folder)\r\n */\r\nconst openItemActionPanel = ({\r\n title,\r\n ext,\r\n contextProps,\r\n thumbnail,\r\n breadcrumb,\r\n attributes,\r\n targetView,\r\n}: Props) => {\r\n const parsedName = parseName(contextProps && contextProps.name);\r\n const parsedTitle = parseTitle(title, parsedName);\r\n\r\n openActionPanel({\r\n title: (\r\n \r\n ),\r\n body: (thumbnail || breadcrumb || attributes) && (\r\n \r\n ),\r\n contextProps,\r\n targetView,\r\n });\r\n};\r\n","// @flow\r\nimport React, { useMemo } from \"react\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\nimport queryString from \"data/queryString\";\r\nimport { getRoute } from \"components/ItemUriLink\";\r\nimport AttributeLabel from \"components/ExtraAttributes/AttributeLabel\";\r\nimport ViewerControlBase from \"components/ExtraAttributes/ViewerControl/ViewerControlBase\";\r\nimport styles from \"./LinkViewer.module.css\";\r\nimport { getClassNames } from \"data/utils\";\r\n\r\ntype Props = {\r\n /** attribute name */\r\n name: string,\r\n /** current value */\r\n value: string | any,\r\n /** which link type to create (mailto, tel, ...) set as prefix (if not defined will show localized \"open link\" text */\r\n linkType?: string,\r\n /** value width */\r\n width?: number,\r\n /** which FontAwesome icon to render */\r\n icon?: string,\r\n /** whether icon should be place at beginning or end of text */\r\n isIconLast?: boolean,\r\n width?: number,\r\n className?: string,\r\n caption?: string,\r\n /** optional onClick handler */\r\n onClick?: () => void,\r\n};\r\n\r\ntype ControlledProps = Props & {\r\n /** label text */\r\n header?: string,\r\n /** whether rendered inside a Grid */\r\n isGridCell: boolean,\r\n};\r\n\r\nconst renderValue = (\r\n linkType?: string,\r\n value?: string,\r\n caption?: string,\r\n icon?: string,\r\n isIconLast?: boolean\r\n) => (\r\n <>\r\n {icon && isIconLast === false && (\r\n <>\r\n {\" \"}\r\n \r\n )}\r\n {linkType == null && caption == null ? (\r\n {loc.t(\"plugin:extraAttributes.link_open\")}\r\n ) : (\r\n {caption || value}\r\n )}\r\n {icon && isIconLast && (\r\n <>\r\n {\" \"}\r\n \r\n \r\n )}\r\n \r\n);\r\n\r\nconst useAnchorProps = (value, linkType, width) => {\r\n // #35977 convert inpoint:browse links\r\n let href = String(value || \"\");\r\n let target = \"_blank\";\r\n\r\n let comparableValue = String(value || \"\").toLowerCase();\r\n if (comparableValue.startsWith(\"inpoint:browse\")) {\r\n const qs = queryString.parse(value.substr(value.indexOf(\"?\")));\r\n /* istanbul ignore else */\r\n if (qs[\"uri\"] !== undefined) {\r\n target = \"_self\";\r\n href = getRoute(qs.uri, null, true);\r\n }\r\n } else if (comparableValue.startsWith(\"pam-item://\")) {\r\n target = \"_self\";\r\n href = getRoute(comparableValue, null, true);\r\n } else if (linkType != null) {\r\n href = `${linkType}:${href}`;\r\n }\r\n let style: CSSStyleDeclaration = useMemo(\r\n () => ({\r\n color: \"#337ab7\",\r\n width: width && width > 0 ? `${width}px` : \"100px\",\r\n }),\r\n [width]\r\n );\r\n return useMemo(() => ({ href, target, style }), [href, target, style]);\r\n};\r\n\r\nconst LinkViewer = ({\r\n name,\r\n value,\r\n linkType,\r\n width,\r\n icon,\r\n isIconLast,\r\n className,\r\n caption,\r\n onClick,\r\n}: Props) => {\r\n const { style, href, target } = useAnchorProps(value, linkType, width);\r\n return href.length > 0 ? (\r\n \r\n {renderValue(linkType, value, caption, icon, isIconLast)}\r\n \r\n ) : (\r\n \r\n {loc.t(\"plugin:extraAttributes.link_empty\")}\r\n \r\n );\r\n};\r\nLinkViewer.displayName = \"LinkViewer\";\r\n\r\nconst LinkViewerControl = ({\r\n isGridCell,\r\n header,\r\n ...props\r\n}: ControlledProps) => {\r\n if (isGridCell)\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\nLinkViewerControl.displayName = \"LinkViewerControl\";\r\nLinkViewerControl.defaultProps = {\r\n isGridCell: false,\r\n isIconLast: true,\r\n icon: \"external-link\",\r\n};\r\nexport default LinkViewerControl;\r\n\r\nexport { LinkViewer };\r\n","import React, { PureComponent } from \"react\";\r\nimport { connect, Dispatch } from \"react-redux\";\r\nimport { docThumbnailRequestAction } from \"data/actions\";\r\n// import { fetchThumbnail } from \"data/api\";\r\nimport { Img } from \"react-image\";\r\nimport Icons from \"@hs/icons\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport styles from \"./Thumbnail.module.css\";\r\n\r\ntype Props = {\r\n /** document's itemUri */\r\n itemUri: string,\r\n /** callback when rendered (and HTML loaded) */\r\n onLoad?: () => void,\r\n /** callback when user clicks the img element */\r\n onClick?: () => void,\r\n // from Redux\r\n /** thumbnail's data base64 encoded */\r\n result?: string,\r\n /** Redux dispatch */\r\n dispatch: Dispatch,\r\n /** thumbnail fetch status */\r\n status: ConstantsEnum,\r\n /** optional style to apply to image itself\r\n * @default {CSSStyleDeclaration} { maxHeight:128, maxWidth:128 }\r\n */\r\n style?: CSSStyleDeclaration,\r\n};\r\n\r\n/**\r\n * Renders one document's Thumbnail\r\n */\r\nexport class Thumbnail extends PureComponent {\r\n componentDidMount() {\r\n /* istabul ignore else */\r\n if (\r\n this.props.itemUri != null &&\r\n this.props.result === undefined &&\r\n this.props.status === Constants.NONE\r\n ) {\r\n this._fetch();\r\n }\r\n }\r\n\r\n _fetch = () => {\r\n const { itemUri, dispatch } = this.props;\r\n dispatch(docThumbnailRequestAction(itemUri));\r\n };\r\n\r\n _onLoad = () => {\r\n /* istanbul ignore else */\r\n if (typeof this.props.onLoad === \"function\") this.props.onLoad();\r\n };\r\n\r\n render() {\r\n if (\r\n this.props.result == null ||\r\n String(this.props.result).length === 0\r\n ) {\r\n if (\r\n [Constants.NONE, Constants.LOADING].includes(this.props.status)\r\n ) {\r\n return ;\r\n } else {\r\n return (\r\n \r\n \r\n \r\n \r\n );\r\n }\r\n } else {\r\n return (\r\n }\r\n className={styles.thumbnail}\r\n style={\r\n this.props.style || {\r\n maxWidth: 128,\r\n maxHeight: 128,\r\n }\r\n }\r\n />\r\n );\r\n }\r\n }\r\n}\r\n\r\nconst mapStateToProps = /* istanbul ignore next */ (state, ownProps) => ({\r\n status: s.thumbnailStatusSelector(state, ownProps.itemUri),\r\n result:\r\n ownProps.itemUri == null\r\n ? undefined\r\n : s.thumbnailStatusSelector(state, ownProps.itemUri) ===\r\n Constants.OK\r\n ? s.thumbnailResultSelector(state, ownProps.itemUri)\r\n : undefined,\r\n ...ownProps,\r\n});\r\n\r\nexport default connect(mapStateToProps)(Thumbnail);\r\n","// @flow\r\nimport React, { PureComponent, type ElementRef } from \"react\";\r\nimport styles from \"components/NativeSelect/NativeSelect.module.css\";\r\nimport { components } from \"react-select\";\r\nconst { DownChevron } = components;\r\n\r\ntype Props = {\r\n /** control id */\r\n id?: string,\r\n /** current selected value */\r\n value?: ?Object | ?Array,\r\n /** defaultValue for initial rendering */\r\n defaultValue?: Object | ?Array,\r\n /** placeholder text to show when nothing is rendered */\r\n placeholder?: string,\r\n /** callback when user selects a value\r\n * @param {Object} option new option selected\r\n */\r\n onChange?: (option: Object) => void,\r\n /** React.createRef reference */\r\n selectRef?: ElementRef<*>,\r\n /** CSS Classname to apply to wrapper */\r\n wrapperClassName?: string,\r\n /** CSS Classname to apply */\r\n className?: string,\r\n /** @see options property name used to show to the user */\r\n labelKey?: string,\r\n /** @see options property name used to store value reference */\r\n valueKey?: string,\r\n /** list of options to display */\r\n options?: Array,\r\n /** whether the SELECT tag should be disabled */\r\n disabled?: boolean,\r\n /** whether to allow multiple selection */\r\n isMultiple?: boolean,\r\n};\r\n\r\ntype State = {\r\n selected: ?Object | ?Array,\r\n};\r\n\r\n// based on: https://github.com/JaniAnttonen/react-select-native/blob/master/src/index.js\r\nexport default class NativeSelect extends PureComponent {\r\n static defaultProps = {\r\n labelKey: \"label\",\r\n valueKey: \"value\",\r\n };\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n this.state = {\r\n selected: props.value || props.defaultValue,\r\n };\r\n }\r\n\r\n _onChange = (e: SyntheticInputEvent<*>) => {\r\n e.preventDefault();\r\n let selected = null;\r\n if (this.props.isMultiple) {\r\n selected = [...e.currentTarget.options]\r\n .filter((so) => so.selected && so.value.length > 0)\r\n .map(\r\n (so) =>\r\n this.props.options &&\r\n this.props.options.find(\r\n (o) => o[this.props.valueKey] === so.value\r\n )\r\n );\r\n } else {\r\n const value = e.currentTarget.value;\r\n selected =\r\n this.props.options &&\r\n this.props.options.find(\r\n (o) => String(o[this.props.valueKey]) === value\r\n );\r\n }\r\n /* istanbul ignore else */\r\n if (selected != null) {\r\n /* istanbul ignore else */\r\n if (typeof this.props.onChange === \"function\")\r\n this.props.onChange(selected);\r\n this.setState({\r\n selected,\r\n });\r\n }\r\n };\r\n\r\n componentDidUpdate(prevProps: Props, prevState: State) {\r\n /* istanbul ignore else */\r\n if (prevProps.value !== this.props.value) {\r\n this.setState({\r\n selected: this.props.value,\r\n });\r\n }\r\n }\r\n\r\n _getValue = () => {\r\n if (this.state.selected == null) return undefined;\r\n if (this.props.isMultiple) {\r\n return this.state.selected.map((o) => o[this.props.valueKey]);\r\n } else {\r\n return this.state.selected[this.props.valueKey];\r\n }\r\n };\r\n\r\n render = () => (\r\n \r\n \r\n {this.props.placeholder && (\r\n \r\n )}\r\n {this.props.options &&\r\n this.props.options.map((option, index) => (\r\n \r\n {option[this.props.labelKey]}\r\n \r\n ))}\r\n \r\n \r\n \r\n );\r\n}\r\n","export const removeSpaces = (text) => {\r\n return typeof text === \"string\" ? text.replace(/ /g, \"\") : text;\r\n};\r\n","// @flow\r\nimport React from \"react\";\r\nimport Avatar from \"components/User/Avatar\";\r\nimport AttributeLabel from \"components/ExtraAttributes/AttributeLabel\";\r\nimport ViewerControlBase from \"components/ExtraAttributes/ViewerControl/ViewerControlBase\";\r\n\r\ntype Props = {\r\n header?: string,\r\n value: any | string,\r\n userid: number,\r\n width?: number,\r\n};\r\n\r\nconst UserIdViewerControl = ({ header, value, userid, width }: Props) => {\r\n return (\r\n \r\n {\" \"}\r\n \r\n \r\n \r\n {value}\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nUserIdViewerControl.displayName = \"UserIdViewerControl\";\r\nexport default UserIdViewerControl;\r\n","import { type FormFieldDTO } from \"data/types\";\r\nimport {\r\n type FormResultDTO,\r\n type DocFormResultDTO,\r\n type FormFieldInfo,\r\n} from \"data/types\";\r\n\r\nimport StaticViewerControl from \"components/ExtraAttributes/ViewerControl/StaticViewerControl\";\r\nimport UserIdViewerControl from \"components/ExtraAttributes/ViewerControl/UserIdViewerControl\";\r\nimport ImageViewerControl from \"components/ExtraAttributes/ViewerControl/ImageViewerControl\";\r\nimport LocationViewerControl from \"components/ExtraAttributes/ViewerControl/LocationViewerControl\";\r\nimport GeoRasterViewerControl from \"components/ExtraAttributes/ViewerControl/GeoRasterViewerControl\";\r\nimport EmailViewerControl from \"components/ExtraAttributes/ViewerControl/EmailViewerControl\";\r\nimport TelViewerControl from \"components/ExtraAttributes/ViewerControl/TelViewerControl\";\r\nimport LinkViewerControl from \"components/ExtraAttributes/ViewerControl/LinkViewerControl\";\r\n\r\nconst findCustomField = (\r\n fields: Array,\r\n name: string\r\n): ?FormFieldDTO => {\r\n return fields.find((f) => f.format === name && f.name === name);\r\n};\r\n\r\nexport const getFields = (\r\n form: FormResultDTO | DocFormResultDTO,\r\n itemUri: string\r\n): ?Array => {\r\n return form?.fields?.map((field) =>\r\n getFieldType(itemUri, form.formatId, field, form.fields)\r\n );\r\n};\r\n\r\nconst getFieldType = (\r\n itemUri: string,\r\n formatId: number,\r\n field: FormFieldDTO,\r\n fields: Array\r\n): ?FormFieldInfo => {\r\n const header = field.header || field.name;\r\n\r\n switch (field.format) {\r\n case undefined:\r\n return null;\r\n\r\n case \"Image\":\r\n return {\r\n Component: ImageViewerControl,\r\n props: {\r\n name: header,\r\n header,\r\n value: field.value,\r\n },\r\n };\r\n\r\n case \"CreatorName\":\r\n const creatorIdField = findCustomField(fields, \"CreatorId\");\r\n /* istanbul ignore next */\r\n if (creatorIdField === undefined) return null;\r\n return {\r\n Component: UserIdViewerControl,\r\n props: {\r\n header,\r\n value: field.value,\r\n userid: parseInt(creatorIdField.value, 10),\r\n width: field.width,\r\n },\r\n };\r\n\r\n case \"ModifiedName\":\r\n const modifiedIdField = findCustomField(fields, \"ModifiedId\");\r\n /* istanbul ignore next */\r\n if (modifiedIdField === undefined) return null;\r\n return {\r\n Component: UserIdViewerControl,\r\n props: {\r\n header,\r\n value: field.value,\r\n userid: parseInt(modifiedIdField.value, 10),\r\n width: field.width,\r\n },\r\n };\r\n\r\n case \"CreatorId\":\r\n case \"ModifiedId\":\r\n // those will not be rendered since they are internally created\r\n /* istanbul ignore next */\r\n if (field.format === field.name) return null;\r\n else\r\n return {\r\n Component: StaticViewerControl,\r\n props: {\r\n name: field.name,\r\n header,\r\n value: field.value,\r\n width: field.width,\r\n },\r\n };\r\n\r\n case \"Text_GeoPoint\":\r\n case \"Text_GeoArea\":\r\n return {\r\n Component: LocationViewerControl,\r\n props: {\r\n name: field.name,\r\n header,\r\n value: field.value,\r\n width: field.width,\r\n marker: field.extra && field.extra.marker,\r\n },\r\n };\r\n\r\n case \"Text_GeoRaster\":\r\n return {\r\n Component: GeoRasterViewerControl,\r\n props: {\r\n itemUri,\r\n formatId,\r\n name: field.name,\r\n header,\r\n value: field.value,\r\n width: field.width,\r\n marker: field.extra && field.extra.marker,\r\n },\r\n };\r\n\r\n case \"Text_Lookup\":\r\n case \"Text_LookupRep\":\r\n const value =\r\n field.value == null || field.value.T == null\r\n ? null\r\n : field.value.T;\r\n return {\r\n Component: StaticViewerControl,\r\n props: {\r\n name: field.name,\r\n header,\r\n value,\r\n width: field.width,\r\n },\r\n };\r\n\r\n case \"Text_TelNumber\":\r\n return {\r\n Component: TelViewerControl,\r\n props: {\r\n name: field.name,\r\n header,\r\n value: field.value,\r\n isGridCell: false,\r\n },\r\n };\r\n\r\n case \"Text_EMail\":\r\n return {\r\n Component: EmailViewerControl,\r\n props: {\r\n name: field.name,\r\n header,\r\n value: field.value,\r\n isGridCell: false,\r\n },\r\n };\r\n\r\n case \"Text_Link\":\r\n return {\r\n Component: LinkViewerControl,\r\n props: {\r\n name: field.name,\r\n header,\r\n value: field.value,\r\n isGridCell: false,\r\n },\r\n };\r\n case \"WebDavName\":\r\n if (field.extra && field.extra.hidden) {\r\n return null;\r\n }\r\n //fall through\r\n default:\r\n return {\r\n Component: StaticViewerControl,\r\n props: {\r\n name: field.name,\r\n header,\r\n value: field.value,\r\n width: field.width,\r\n },\r\n };\r\n }\r\n};\r\n","// @flow\r\nimport React, { useMemo, memo } from \"react\";\r\nimport Form from \"react-bootstrap/lib/Form\";\r\nimport Row from \"react-bootstrap/lib/Row\";\r\nimport \"./index.css\";\r\nimport EAForm from \"components/ExtraAttributes/EAForm\";\r\nimport NoData from \"components/NoData\";\r\nimport LocalContactInfo from \"components/LocalContactInfo\";\r\nimport { type FormResultDTO, type DocFormResultDTO } from \"data/types\";\r\nimport { LabelSizeContext } from \"data/context\";\r\nimport { getClassNames } from \"data/utils\";\r\nimport { getFields } from \"./utils\";\r\n\r\ntype Props = {\r\n form: FormResultDTO | DocFormResultDTO,\r\n itemUri: string,\r\n isNoDataError: boolean,\r\n};\r\n\r\nconst MyForm = memo(({ form, itemUri, isNoDataError }: Props) => {\r\n const fields = useMemo(() => getFields(form, itemUri), [form, itemUri]);\r\n const fieldsLength = useMemo(\r\n () => fields?.filter((field) => field).length,\r\n [fields]\r\n );\r\n\r\n const hasEA = useMemo(() => form?.attributes != null, [form]);\r\n return (\r\n e.preventDefault()}\r\n data-test=\"form\"\r\n >\r\n \r\n {form?.fields != null &&\r\n fieldsLength > 0 &&\r\n fields.map(\r\n (field, index) =>\r\n field && (\r\n \r\n \r\n \r\n )\r\n )}\r\n {hasEA && (\r\n \r\n )}\r\n {(form?.fields === null || fieldsLength === 0) &&\r\n form?.attributes === null && (\r\n \r\n {isNoDataError && }\r\n \r\n )}\r\n \r\n \r\n );\r\n});\r\n\r\nexport default MyForm;\r\n","import React from \"react\";\r\nimport FormsyEditorBase from \"./FormsyEditorBase\";\r\n\r\nconst HiddenEditorControl = (props) => (\r\n (\r\n \r\n )}\r\n {...props}\r\n />\r\n);\r\nHiddenEditorControl.displayName = \"HiddenEditorControl\";\r\nexport default HiddenEditorControl;\r\n","// @flow\r\nimport React from \"react\";\r\nimport TextEditorControl from \"components/ExtraAttributes/EditorControl/TextEditorControl\";\r\nimport HiddenEditorControl from \"components/ExtraAttributes/EditorControl/HiddenEditorControl\";\r\nimport MemoEditorControl from \"components/ExtraAttributes/EditorControl/MemoEditorControl\";\r\nimport NumberEditorControl from \"components/ExtraAttributes/EditorControl/NumberEditorControl\";\r\nimport LookupEditorControl from \"components/ExtraAttributes/EditorControl/LookupEditorControl\";\r\nimport StaticViewerControl from \"components/ExtraAttributes/ViewerControl/StaticViewerControl\";\r\nimport UserIdViewerControl from \"components/ExtraAttributes/ViewerControl/UserIdViewerControl\";\r\nimport ImageEditorControl from \"components/ExtraAttributes/EditorControl/ImageEditorControl\";\r\nimport DateEditorControl from \"components/ExtraAttributes/EditorControl/DateEditorControl\";\r\nimport GeoPointEditorControl from \"components/ExtraAttributes/EditorControl/LoadableGeoPointEditorControl\";\r\nimport GeoAreaEditorControl from \"components/ExtraAttributes/EditorControl/GeoAreaEditorControl\";\r\nimport GeoRasterEditorControl from \"components/ExtraAttributes/EditorControl/GeoRasterEditorControl\";\r\nimport { type FormFieldDTO, FormLookupType } from \"data/types\";\r\nimport loc from \"i18next\";\r\nimport {\r\n GeoPointValidationRegex,\r\n GeoAreaValidationRegex,\r\n} from \"components/MapViewer/utils\";\r\nimport { DateTimeFormat } from \"data/types\";\r\n\r\nfunction findCustomField(\r\n fields: Array,\r\n name: string\r\n): FormFieldDTO | void {\r\n return fields.find((f) => f.format === name && f.name === name);\r\n /*for (var i = 0; i < fields.length; i++) {\r\n if (fields[i].format === name && fields[i].name === name)\r\n return fields[i];\r\n }\r\n return undefined;*/\r\n}\r\n\r\nfunction getValidationErrors(field: FormFieldDTO, customErrors?: Object) {\r\n let validationErrors = customErrors || {};\r\n if (field.req)\r\n validationErrors.isDefaultRequiredValue = loc.t(\r\n \"common:validation.required\"\r\n );\r\n return validationErrors;\r\n}\r\n\r\nconst FieldEdit = ({\r\n isDoc,\r\n itemUri,\r\n formatId,\r\n field,\r\n fields,\r\n onChange,\r\n}: {\r\n isDoc: boolean,\r\n itemUri: string,\r\n formatId: number,\r\n field: FormFieldDTO,\r\n fields: Array,\r\n onChange: Function,\r\n}) => {\r\n const formPrefix = \"ip.\";\r\n const header = field.header || field.name;\r\n //console.dir(formAttribute);\r\n switch (field.format) {\r\n case \"None\":\r\n case undefined:\r\n return null;\r\n\r\n case \"Image\":\r\n return (\r\n \r\n );\r\n\r\n case \"CreatorName\":\r\n const creatorIdField = findCustomField(fields, \"CreatorId\");\r\n /* istanbul ignore if */\r\n if (creatorIdField === undefined) return null;\r\n return (\r\n \r\n );\r\n\r\n case \"ModifiedName\":\r\n const modifiedIdField = findCustomField(fields, \"ModifiedId\");\r\n /* istanbul ignore if */\r\n if (modifiedIdField === undefined) return null;\r\n return (\r\n \r\n );\r\n\r\n case \"CreatorId\":\r\n case \"ModifiedId\":\r\n // those will not be rendered since they are internally created\r\n if (field.format === field.name) return null;\r\n else\r\n return (\r\n \r\n );\r\n\r\n case \"Date_Time\":\r\n case \"Date_Date\":\r\n if (field.ro) {\r\n return (\r\n \r\n );\r\n } else {\r\n return (\r\n \r\n );\r\n }\r\n\r\n case \"Text_Lookup\":\r\n case \"Text_LookupRep\":\r\n const value =\r\n field.value == null || field.value.T == null\r\n ? null\r\n : field.value;\r\n return (\r\n \r\n );\r\n\r\n case \"Number_IntegerNumber\":\r\n return (\r\n \r\n );\r\n\r\n case \"Number_DecimalNumberOneDecimal\":\r\n return (\r\n \r\n );\r\n\r\n case \"Number_DecimalNumberTwoDecimal\":\r\n return (\r\n \r\n );\r\n\r\n case \"Number_DecimalNumberThreeDecimal\":\r\n return (\r\n \r\n );\r\n\r\n case \"Number_CurrencyEuroTwoDecimal\":\r\n return (\r\n \r\n );\r\n\r\n case \"Number_CurrencyDollarTwoDecimal\":\r\n return (\r\n \r\n );\r\n\r\n case \"Number_CurrencyEuroThreeDecimal\":\r\n return (\r\n \r\n );\r\n\r\n case \"Number_CurrencyDollarThreeDecimal\":\r\n return (\r\n \r\n );\r\n\r\n case \"WebDavName\":\r\n // Render hidden field, in case WebDavName is hidden\r\n if (field.extra && field.extra.hidden === true) {\r\n return (\r\n \r\n );\r\n }\r\n return (\r\n \r\n );\r\n\r\n case \"Text_TelNumber\":\r\n return (\r\n \r\n );\r\n\r\n case \"Text_Text\":\r\n return (\r\n \r\n );\r\n\r\n case \"Text_EMail\":\r\n return (\r\n \r\n );\r\n\r\n case \"Text_GeoPoint\":\r\n return (\r\n \r\n );\r\n\r\n case \"Text_GeoArea\":\r\n return (\r\n \r\n );\r\n\r\n case \"Text_GeoRaster\":\r\n return (\r\n \r\n );\r\n case \"Text_Link\":\r\n return (\r\n \r\n );\r\n\r\n default:\r\n return (\r\n \r\n );\r\n }\r\n};\r\n\r\nexport default FieldEdit;\r\n","// @flow\r\nimport React, { PureComponent } from \"react\";\r\nimport { Prompt } from \"react-router\";\r\n\r\ntype Props = { isDirty: boolean, message: ?string | ?boolean };\r\n\r\nexport default class NavigationBlock extends PureComponent {\r\n componentDidUpdate() {\r\n if (this.props.isDirty === true) {\r\n window.onbeforeunload = /* istanbul ignore next */ () =>\r\n this.props.message;\r\n } else {\r\n window.onbeforeunload = undefined;\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n window.onbeforeunload = undefined;\r\n }\r\n\r\n render() {\r\n const { isDirty, message } = this.props;\r\n if (message == null) return null;\r\n return ;\r\n }\r\n}\r\n","// @flow\r\nimport React, { PureComponent, type Children } from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\nimport { connect, Dispatch } from \"react-redux\";\r\nimport Formsy from \"formsy-react\";\r\nimport Row from \"react-bootstrap/lib/Row\";\r\nimport ButtonToolbar from \"react-bootstrap/lib/ButtonToolbar\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport FieldEdit from \"./FieldEdit\";\r\nimport \"components/Form/index.css\";\r\nimport EAForm from \"components/ExtraAttributes/EAForm\";\r\nimport NoData from \"components/NoData\";\r\nimport LocalContactInfo from \"components/LocalContactInfo\";\r\nimport loc from \"i18next\";\r\nimport produce from \"immer\";\r\nimport immutable from \"object-path-immutable\";\r\nimport { addValidationRule } from \"formsy-react\";\r\nimport { extraAttributesSetField } from \"data/actions\";\r\nimport NavigationBlock from \"components/NavigationBlock\";\r\nimport { type FormResultDTO, type DocFormResultDTO } from \"data/types\";\r\nimport isEmpty from \"lodash/isEmpty\";\r\nimport Icons from \"@hs/icons\";\r\nimport { LabelSizeContext } from \"data/context\";\r\nimport { getClassNames } from \"data/utils\";\r\n\r\ntype Props = {\r\n /** Redux dispatch */\r\n dispatch: Dispatch,\r\n /** the Form itself */\r\n form: FormResultDTO | DocFormResultDTO,\r\n /** itemUri of Folder or Document */\r\n itemUri: string,\r\n /** callback for Cancel button */\r\n onCancel?: () => void,\r\n /** callback for Save button\r\n * @param {Object} model model to save\r\n * @returns {boolean} true is success\r\n */\r\n onSave: (model: Object) => boolean,\r\n /**\r\n * handler to validate model\r\n * @param {Object} model the current form (changed) values\r\n * @returns {Object} validation errors e.g. {field:msg,field:msg,...}\r\n */\r\n onValidate: (model: Object) => Object,\r\n /** save button label\r\n * @default common:save\r\n */\r\n saveLabel?: string,\r\n /** saving button label\r\n * @default common:savingLabel\r\n */\r\n savingLabel?: string,\r\n /** if NOT null will prompt user upon navigating away */\r\n confirmLabel?: boolean,\r\n /** should the save button be enabled */\r\n isFormButtonEnabled?: boolean,\r\n /** whether to include all or only changed fields\r\n * @default false\r\n */\r\n onSaveReturnAllFields?: boolean,\r\n /** defaultValues to set\r\n * Note: $NAME$ is special - see {@link _prepForm}\r\n * @example {\"$NAME$\"\":\"test.docx\"}\r\n */\r\n defaultValues?: Object,\r\n /** optional DOM ref to render ButtonToolbar onto (otherwise will render as child of form) */\r\n buttonToolbarPortal?: React.DOMElement,\r\n};\r\n\r\ntype State = {\r\n canSubmit: boolean,\r\n changed: Object,\r\n form: FormResultDTO | DocFormResultDTO,\r\n validationErrors: Object,\r\n isSubmitting: boolean,\r\n isValidating: boolean,\r\n};\r\n\r\nexport class MyFormEdit extends PureComponent {\r\n constructor(props: Props, children: any) {\r\n super(props);\r\n this._onSubmit = this._onSubmit.bind(this);\r\n this._formsyRef = React.createRef();\r\n this.state = {\r\n canSubmit: false,\r\n isSubmitting: false,\r\n isValidating: false,\r\n validationErrors: {},\r\n ...this._prepForm(props.form),\r\n };\r\n this._setupValidations();\r\n this._onFieldChange = this._onFieldChange.bind(this);\r\n }\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n if (this.props.form !== prevProps.form) {\r\n this.setState((state) => ({\r\n ...this._prepForm(this.props.form, state.changed),\r\n }));\r\n }\r\n }\r\n\r\n /**\r\n * returns immutable form & changeLog with applied props.defaultValues\r\n * Note: $NAME$ is special\r\n * @param {FormResultDTO} form the current form\r\n * @memberof MyFormEdit\r\n */\r\n _prepForm = (form: FormResultDTO | DocFormResultDTO, changed = {}) => {\r\n const { defaultValues } = this.props;\r\n return produce({ form, changed }, (draft) => {\r\n if (defaultValues == null || form == null) {\r\n return;\r\n }\r\n Object.keys(defaultValues).forEach((defaultValueKey) => {\r\n if (defaultValueKey.startsWith(\"ea.\")) {\r\n /* istanbul ignore next */\r\n if (form.attributes == null) {\r\n console.warn(\r\n `Requested setting DefaultValue for ${defaultValueKey} but there are no ExtraAttributes defined here!`\r\n );\r\n return null;\r\n }\r\n const defaultAttributeKey = defaultValueKey.substr(3);\r\n let idx = form.attributes.findIndex(\r\n (attribute) => attribute.name === defaultAttributeKey\r\n );\r\n if (idx === -1) {\r\n console.warn(\r\n `Requested setting DefaultValue for ${defaultValueKey} but it was not found!`\r\n );\r\n return;\r\n }\r\n /* istanbul ignore else */\r\n if (draft.changed.ea == null) draft.changed.ea = {};\r\n // update changeLog (dot notation)\r\n draft.changed.ea[form.attributes[idx].name] =\r\n defaultValues[defaultValueKey];\r\n // update form (to immediately show value)\r\n draft.form.attributes[idx].value =\r\n defaultValues[defaultValueKey];\r\n } else {\r\n const defaultFieldKey = defaultValueKey.startsWith(\"ip.\")\r\n ? defaultValueKey.substr(3)\r\n : defaultValueKey;\r\n // find field by field name (commonName)\r\n let idx = form.fields.findIndex(\r\n (field) => field.name === defaultFieldKey\r\n );\r\n if (idx === -1) {\r\n console.warn(\r\n `Requested setting DefaultValue for ${defaultValueKey} but it was not found!`\r\n );\r\n return;\r\n }\r\n /* istanbul ignore else */\r\n if (draft.changed.ip == null) draft.changed.ip = {};\r\n // update changeLog (dot notation)\r\n draft.changed.ip[form.fields[idx].name] =\r\n defaultValues[defaultValueKey];\r\n // update form (to immediately show value)\r\n draft.form.fields[idx].value =\r\n defaultValues[defaultValueKey];\r\n }\r\n });\r\n });\r\n };\r\n\r\n /* istanbul ignore next */ _setupValidations = () => {\r\n // setup our custom validation rules used by Field/AttributeEdit components\r\n addValidationRule(\"isRange\", (values, value, range) => {\r\n // empty value need no validation - is required needs additional isRequired validation\r\n if (value == null) return true;\r\n return value >= range.min && value <= range.max;\r\n });\r\n\r\n addValidationRule(\"isFilename\", (values, value) => {\r\n // rules: https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file\r\n var rg1 = /^[^\\\\/:*?\"<>|]+$/; // forbidden characters \\ / : * ? \" < > |\r\n var rg2 = /^\\./; // cannot start with dot (.)\r\n var rg3 = /^(aux|nul|prn|con|lpt[1-9]|com[1-9])(\\.|$)/i; // forbidden file names\r\n return rg1.test(value) && !rg2.test(value) && !rg3.test(value);\r\n });\r\n\r\n addValidationRule(\"isPathname\", (values, value) => {\r\n var rg1 = /^[^\\\\/:*?\"<>|]+$/; // forbidden characters \\ / : * ? \" < > |\r\n return rg1.test(value);\r\n });\r\n\r\n addValidationRule(\r\n \"isNotInvalid\",\r\n (values, value) =>\r\n value == null || !String(value).startsWith(\"__INVALID__\")\r\n );\r\n };\r\n\r\n _onInvalid = () => this.setState({ canSubmit: false });\r\n\r\n _onValid = () => this.setState({ canSubmit: true });\r\n\r\n _onSubmit = async (\r\n model: Object,\r\n resetForm?: boolean,\r\n invalidateForm?: boolean\r\n ) => {\r\n try {\r\n this.setState({ isValidating: true });\r\n const validationErrors = await this.props.onValidate(model);\r\n if (!isEmpty(validationErrors)) {\r\n invalidateForm(validationErrors);\r\n this.setState({ isValidating: false });\r\n } else {\r\n this.setState({ isValidating: false, isSubmitting: true });\r\n const result = await this.props.onSave(\r\n this.props.onSaveReturnAllFields === true\r\n ? model\r\n : this.state.changed\r\n );\r\n if (false === result) {\r\n this.setState({ isSubmitting: false });\r\n }\r\n }\r\n } catch (e) {\r\n /* istanbul ignore else */\r\n if (e.code !== 20)\r\n //AbortController aborted\r\n this.setState({ isValidating: false, isSubmitting: false });\r\n }\r\n };\r\n\r\n /**\r\n * On every change will update changeLog and fire a Redux action\r\n * @param {string} name the field's name (dot notation e.g. ip.WebDavName)\r\n * @param {any} value the field's value\r\n * @memberof MyFormEdit\r\n */\r\n _onFieldChange = (name: string, value: any): void => {\r\n const splittedName = name.split(\".\");\r\n\r\n // is it an inPoint field?\r\n const valueType = splittedName[0] === \"ip\" ? \"fields\" : \"attributes\";\r\n const idx = this.state.form[valueType].findIndex(\r\n (a) => a.name === splittedName[1]\r\n );\r\n // Allow fast (= multiple) field changes of state (e.g. Lookup Extras)\r\n this.setState(\r\n (prevState) => ({\r\n form:\r\n idx !== -1\r\n ? immutable.set(\r\n prevState.form,\r\n [valueType, idx, \"value\"],\r\n value\r\n )\r\n : prevState.form,\r\n changed: immutable.set(prevState.changed, name, value),\r\n }),\r\n () =>\r\n this.props.dispatch(\r\n extraAttributesSetField(\r\n splittedName[0],\r\n splittedName[1],\r\n value\r\n )\r\n )\r\n );\r\n };\r\n\r\n _isDirty = (): boolean => {\r\n /* istanbul ignore if */\r\n if (this.state.changed == null) return false;\r\n return Object.keys(this.state.changed).length > 0;\r\n };\r\n\r\n _getSaveButtonLabel = (): React.Element => {\r\n const { isValidating, isSubmitting } = this.state;\r\n\r\n if (isValidating === true) {\r\n return (\r\n <>\r\n {loc.t(\"validating\")}\r\n \r\n \r\n );\r\n }\r\n\r\n if (isSubmitting === true) {\r\n return (\r\n <>\r\n {this.props.savingLabel || loc.t(\"saving\")}\r\n \r\n \r\n );\r\n }\r\n\r\n return this.props.saveLabel || loc.t(\"save\");\r\n };\r\n\r\n _formsySubmit = () => this._formsyRef.current.submit();\r\n\r\n render() {\r\n const { itemUri, saveLabel, confirmLabel } = this.props;\r\n const {\r\n form,\r\n validationErrors,\r\n canSubmit,\r\n isSubmitting,\r\n isValidating,\r\n } = this.state;\r\n const hasEA = form && form.attributes != null;\r\n const toolbar = (\r\n \r\n \r\n {this._getSaveButtonLabel()}\r\n \r\n \r\n );\r\n return (\r\n \r\n \r\n \r\n {form &&\r\n form.fields !== null &&\r\n form.fields.map((field, index) => (\r\n \r\n \r\n \r\n ))}\r\n {form && form.attributes !== null && (\r\n \r\n )}\r\n {form &&\r\n form.fields === null &&\r\n form.attributes === null && (\r\n \r\n \r\n \r\n )}\r\n {this.props.buttonToolbarPortal == null && toolbar}\r\n \r\n {this.props.buttonToolbarPortal &&\r\n ReactDOM.createPortal(\r\n toolbar,\r\n this.props.buttonToolbarPortal\r\n )}\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default connect()(MyFormEdit);\r\n","// @flow\r\nimport React, { PureComponent } from \"react\";\r\nimport { connect, Dispatch } from \"react-redux\";\r\nimport { compose } from \"redux\";\r\nimport { fetchForm, fetchNewForm, saveForm, validateForm } from \"data/api\";\r\nimport { togglesUpdateCounterAction } from \"data/actions\";\r\nimport {\r\n ServerEventActionType,\r\n ServerEventItemType,\r\n type ServerEventMessage,\r\n type NewFormTypeEnum,\r\n NewFormType,\r\n type FormResultDTO,\r\n type DocFormResultDTO,\r\n FormBarView,\r\n type ApiError,\r\n} from \"data/types\";\r\nimport { getLocalizedText } from \"data/utils\";\r\nimport Form from \"components/Form\";\r\nimport FormEdit from \"components/FormEdit\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport Constants, {\r\n type ConstantsEnum,\r\n isFeatureOn,\r\n Feature,\r\n} from \"data/constants\";\r\nimport Status from \"components/Status\";\r\nimport loc from \"i18next\";\r\nimport { toastActionResult } from \"data/toast\";\r\nimport isEmpty from \"lodash/isEmpty\";\r\nimport GlobalEventsHandler from \"containers/GlobalEventsHandler\";\r\nimport { openConflictModal } from \"components/ConflictModal\";\r\nimport produce from \"immer\";\r\nimport withOfflineHandler from \"containers/OfflineHandler\";\r\nimport FormGroup from \"react-bootstrap/lib/FormGroup\";\r\nimport FormControl from \"react-bootstrap/lib/FormControl\";\r\nimport ControlLabel from \"react-bootstrap/lib/ControlLabel\";\r\nimport SettingValue, { type SettingValueProps } from \"containers/SettingValue\";\r\nimport FormBarFactory from \"components/FormBar/Factory\";\r\nimport styles from \"./Form.module.css\";\r\n\r\ntype Props = {\r\n form?: FormResultDTO | DocFormResultDTO,\r\n /** the current itemUri */\r\n itemUri: string,\r\n /** the current viewName */\r\n viewName: string,\r\n /** whether we are now editing */\r\n isEditMode: boolean,\r\n /** callback when cancelling edit mode */\r\n onCancel: () => void,\r\n /** callback when saving a new item\r\n * @async\r\n * @param {object} model the form's values\r\n * @param {boolean?} keepOriginalFilename whether to use the actual filename or the user input\r\n * @returns {boolean} true if success, false otherwise\r\n */\r\n onSaveNew: (\r\n model: Object,\r\n keepOriginalFilename?: boolean,\r\n formatId: number\r\n ) => Promise,\r\n /** callback when the form definition has been loaded from server\r\n * @param {FormResultDTO | DocFormResultDTO} form the form definition\r\n */\r\n onFormLoad: (form: FormResultDTO | DocFormResultDTO) => void,\r\n /** which new item to create (Folder or Document) */\r\n newFormType: NewFormTypeEnum,\r\n /** pass-through save button label */\r\n saveLabel?: string,\r\n /** pass-through saving label */\r\n savingLabel?: string,\r\n /** pass-through to FormBarFactory */\r\n defaultFormTitle?: string,\r\n /** pass-through to FormBarFactory */\r\n defaultFormIcon?: string,\r\n /** whether to enable save form button */\r\n isFormButtonEnabled?: boolean,\r\n /** whether an internet connection is detected */\r\n isOnline?: boolen,\r\n /** whether offline feature is enabled */\r\n isOfflineAllowed?: boolean,\r\n /** whether to return ALL form fields or only changeLog */\r\n onSaveReturnAllFields?: boolean,\r\n /** defaultValues to preset on the form, accepts any {field:value} or {attribute:value} (no prefixes) */\r\n defaultValues?: Object,\r\n /** Redux dispatch */\r\n dispatch: Dispatch,\r\n /** GlobalEventsHandler.refreshId */\r\n refreshId: number,\r\n /** GlobalEventsHandler.refreshEvent */\r\n refreshEvent: ?ServerEventMessage,\r\n /** whether to show FormBarFactory */\r\n showHeader?: boolean,\r\n /** optional DOM ref to render ButtonToolbar onto (otherwise will render as child of form) */\r\n buttonToolbarPortal?: React.DOMElement,\r\n /** whether no data is intentional or an error */\r\n isNoDataError?: boolean,\r\n /** persisted bool if original filename should be kept */\r\n keepFilename: SettingValueProps,\r\n};\r\n\r\ntype State = {\r\n form?: FormResultDTO | DocFormResultDTO,\r\n status: ConstantsEnum,\r\n defaultValues: ?Object,\r\n};\r\n\r\nexport class FormContainer extends PureComponent {\r\n abortController: AbortController | null;\r\n _isMounted: boolean;\r\n _formsyRef: Formsy | null;\r\n\r\n static defaultProps = {\r\n isEditMode: false,\r\n isFormButtonEnabled: true,\r\n isOnline: true,\r\n isOfflineAllowed: false,\r\n showHeader: true,\r\n };\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n this.state = {\r\n form: undefined,\r\n status: Constants.LOADING,\r\n defaultValues: props.defaultValues,\r\n };\r\n }\r\n\r\n componentDidMount = () => {\r\n this._isMounted = true;\r\n this._fetch(this.props.itemUri);\r\n };\r\n\r\n componentWillUnmount() {\r\n this._isMounted = false;\r\n /* istanbul ignore else */\r\n if (this.abortController != null) {\r\n this.abortController.abort();\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: Props, prevState: State) {\r\n /* istanbul ignore else */\r\n if (\r\n prevProps.itemUri !== this.props.itemUri ||\r\n prevProps.refreshId !== this.props.refreshId ||\r\n prevProps.form !== this.props.form\r\n ) {\r\n this.setState({\r\n status: Constants.LOADING,\r\n defaultValues: this.props.defaultValues,\r\n });\r\n this._fetch(this.props.itemUri);\r\n return;\r\n }\r\n\r\n if (prevProps.keepFilename.value !== this.props.keepFilename.value) {\r\n this.setState((state) => ({\r\n form: this._handleKeepFilename(state.form),\r\n }));\r\n }\r\n }\r\n\r\n /**\r\n * @async\r\n * @summary will fetch the appropriate form (new/edit) from the server\r\n * @param {string} paramUri - the itemUri of the item\r\n * @memberof FormContainer\r\n */\r\n _fetch = async (paramUri: string) => {\r\n this._updateToggleLoading(true);\r\n try {\r\n let form = this.props.form;\r\n if (form == null) {\r\n if (this.props.newFormType != null) {\r\n form = await this.props.offlineHandler.factory(\r\n fetchNewForm\r\n )(this.props.newFormType, paramUri);\r\n } else {\r\n form = await this.props.offlineHandler.factory(fetchForm)(\r\n paramUri\r\n );\r\n }\r\n if (typeof this.props.onFormLoad === \"function\")\r\n this.props.onFormLoad(form);\r\n }\r\n /* istanbul ignore else */\r\n if (\r\n form != null &&\r\n this.props.itemUri === paramUri &&\r\n this._isMounted\r\n ) {\r\n form = this._handleKeepFilename(form);\r\n this.setState({\r\n status: Constants.OK,\r\n form,\r\n });\r\n }\r\n } catch (e) {\r\n console.error(e);\r\n try {\r\n this.setState({ status: Constants.ERROR });\r\n } catch (e2) {}\r\n } finally {\r\n this._updateToggleLoading(false);\r\n }\r\n };\r\n\r\n _updateToggleLoading = (loading?: boolean) => {\r\n const { viewName, dispatch } = this.props;\r\n dispatch(\r\n togglesUpdateCounterAction({\r\n name: viewName,\r\n counts: { form: 0 },\r\n status: {\r\n form: loading === true ? Constants.LOADING : null,\r\n },\r\n })\r\n );\r\n };\r\n\r\n _handleKeepFilename = (form: FormResultDTO) => {\r\n if (this.props.newFormType !== NewFormType.Document) {\r\n return form;\r\n }\r\n return produce(form, (draft) => {\r\n const idx = draft.fields.findIndex(\r\n (f) => f.format === \"WebDavName\" && f.name === \"$NAME$\"\r\n );\r\n /* istanbul ignore else */\r\n if (idx > -1) {\r\n draft.fields[idx].ro = this.props.keepFilename.value;\r\n }\r\n });\r\n };\r\n\r\n _isWebDavNameHidden = (): boolean =>\r\n this.state.form.fields.some(\r\n (f) =>\r\n f.format === \"WebDavName\" &&\r\n f.name === \"$NAME$\" &&\r\n f.extra &&\r\n f.extra.hidden\r\n );\r\n\r\n _ignoreWebDavName = (): boolean => {\r\n const {\r\n newFormType,\r\n keepFilename: { value: keepFilename },\r\n } = this.props;\r\n\r\n const hiddenWebDavName = this._isWebDavNameHidden();\r\n return (\r\n (newFormType === NewFormType.Document && keepFilename) ||\r\n (newFormType != null && hiddenWebDavName)\r\n );\r\n };\r\n\r\n _maybeAddDefaultWebDavName = (defaultValues: ?Object): Object => {\r\n const { newFormType } = this.props;\r\n if (!(this._isWebDavNameHidden() && newFormType != null)) {\r\n return defaultValues;\r\n }\r\n return produce(defaultValues, (draft: ?Object) => {\r\n /* istanbul ignore else */\r\n if (draft == null) {\r\n draft = {};\r\n }\r\n /* istanbul ignore else */\r\n if (!draft[\"$NAME$\"]) {\r\n draft[\"$NAME$\"] = loc.t(\"common:new_folder\");\r\n }\r\n return draft;\r\n });\r\n };\r\n\r\n /**\r\n * Will validate the model against the server\r\n * @async\r\n * @param {Object} model contains current changed fields & attributes\r\n * @returns {Object} containing all localized validation errors per field e.g. {fieldName:error, fieldName:error...}\r\n * @memberof FormContainer\r\n */\r\n _onValidate = async (model: Object): Object => {\r\n this.abortController = new AbortController();\r\n const validationErrors = await validateForm(\r\n this.props.newFormType != null, //isNew\r\n this.props.itemUri.includes(\"@eid=\") ||\r\n this.props.newFormType === NewFormType.Document, //isDoc\r\n this.props.itemUri,\r\n !this._ignoreWebDavName(),\r\n model,\r\n this.abortController.signal\r\n );\r\n // localize error messages\r\n const locErrors = {};\r\n if (!isEmpty(validationErrors)) {\r\n Object.keys(validationErrors).forEach(\r\n (k) => (locErrors[k] = getLocalizedText(validationErrors[k]))\r\n );\r\n }\r\n return locErrors;\r\n };\r\n\r\n /**\r\n * Will submit the form to the server\r\n * @returns {boolean} true if success, false otherwise\r\n * @async\r\n * @param {Object} model - contains current changed fields & attributes\r\n * @memberof FormContainer\r\n */\r\n _onSave = async (model: Object): boolean => {\r\n try {\r\n let response: boolean | null | ApiError = null;\r\n if (this.props.newFormType != null) {\r\n return await this.props.onSaveNew(\r\n model,\r\n this._ignoreWebDavName(),\r\n this.state.form.formatId\r\n );\r\n } else {\r\n response = await saveForm(\r\n this.props.itemUri,\r\n this.state.form.formatId,\r\n model,\r\n this.state.form.etag\r\n );\r\n }\r\n /* istanbul ignore else */\r\n if (response != null) {\r\n if (response === false || response.isError) {\r\n toastActionResult(\r\n false,\r\n `${this.props.viewName}:edit_form`\r\n );\r\n } else {\r\n toastActionResult(true, `${this.props.viewName}:edit_form`);\r\n this.props.onCancel();\r\n return true;\r\n }\r\n }\r\n } catch (e) {\r\n if (e.data && e.constructor.name === \"ApiConflictError\") {\r\n const doOverwrite = await openConflictModal(e.data.extra.name);\r\n if (doOverwrite) {\r\n this.setState({\r\n form: produce(\r\n this.state.form,\r\n (draft: FormResultDTO) => {\r\n draft.etag = e.data.extra.currentEtag;\r\n }\r\n ),\r\n });\r\n return await this._onSave(model);\r\n } else {\r\n this.props.onCancel();\r\n }\r\n } else {\r\n //this.setState({ status: Constants.ERROR });\r\n toastActionResult(false, `${this.props.viewName}:edit_form`);\r\n }\r\n }\r\n return false;\r\n };\r\n\r\n renderKeepFilename = () => {\r\n if (this.props.newFormType !== NewFormType.Document) {\r\n return null;\r\n }\r\n return (\r\n \r\n \r\n this.props.keepFilename.setValue(\r\n e.currentTarget.checked\r\n )\r\n }\r\n />{\" \"}\r\n \r\n {loc.t(\"upload:keepFilename\")}\r\n \r\n \r\n );\r\n };\r\n\r\n getFormBarViewNames = () => {\r\n const viewNames = [this.props.viewName];\r\n if (this.state.form.isLocked) {\r\n viewNames.push(FormBarView.LockInfo);\r\n }\r\n return viewNames;\r\n };\r\n\r\n render() {\r\n const {\r\n itemUri,\r\n isEditMode,\r\n onCancel,\r\n newFormType,\r\n isFormButtonEnabled,\r\n saveLabel,\r\n savingLabel,\r\n onSaveReturnAllFields,\r\n isOnline,\r\n isOfflineAllowed,\r\n isNoDataError,\r\n } = this.props;\r\n const { status, form, defaultValues } = this.state;\r\n let adjustedItemUri = itemUri;\r\n if (newFormType === NewFormType.Document) {\r\n adjustedItemUri +=\r\n \"@eid=00000000|000|000|0000000000000000000000000\";\r\n }\r\n if (status === Constants.OK) {\r\n return (\r\n <>\r\n {this.props.showHeader && (\r\n \r\n )}\r\n {window.CONFIG.licenseAllowEdit && isEditMode ? (\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\nconst mapStateToProps = /* istanbul ignore next */ (state, ownProps) => ({\r\n isOnline: s.isOnlineSelector(state),\r\n isOfflineAllowed: isFeatureOn(Feature.offline),\r\n ...ownProps,\r\n});\r\n\r\nexport default compose(\r\n connect(mapStateToProps),\r\n withOfflineHandler,\r\n SettingValue({\r\n name: \"keepFilename\",\r\n namespace: \"keepFilename\",\r\n defaultValue: true,\r\n }),\r\n GlobalEventsHandler({\r\n actions: [\r\n ServerEventActionType.modify,\r\n ServerEventActionType.edit,\r\n ServerEventActionType.refresh,\r\n ],\r\n items: [ServerEventItemType.document, ServerEventItemType.folder],\r\n })\r\n)(FormContainer);\r\n","// @flow\r\nimport React from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\nimport { LinkContainer } from \"react-router-bootstrap\";\r\nimport Breadcrumb from \"react-bootstrap/lib/Breadcrumb\";\r\nimport { getRoute } from \"components/ItemUriLink\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\nimport { getLocalizedText } from \"data/utils\";\r\n\r\nfunction partTitle(\r\n text: string,\r\n itemUri: string,\r\n isLast: boolean,\r\n bctext: string\r\n): string {\r\n const isDoc = itemUri.indexOf(\"@eid=\") > 0;\r\n /* istanbul ignore next */\r\n return isDoc && isLast\r\n ? loc.t(\"breadcrumb.titleDoc\", { text })\r\n : isLast\r\n ? bctext\r\n : loc.t(\"breadcrumb.title\", { text });\r\n}\r\n\r\ntype Props = {\r\n /** Breadcrumb as Text (shown in Tooltip) */\r\n bctext?: string,\r\n /** font-awesome icon to display before text */\r\n symbolName?: string,\r\n /** part name */\r\n text: string,\r\n /** part itemUri */\r\n itemUri: string,\r\n /** whether this is the last part */\r\n isLast: boolean,\r\n /** CSS styles to apply */\r\n style?: StyleSheet,\r\n /** CSS classname to apply */\r\n className?: string,\r\n /** part index */\r\n index: number,\r\n /** calback when width of part has been measured\r\n * @param {number} index index of part\r\n * @param {number} width pixel width of rendered part\r\n */\r\n onMeasured?: (index: number, width: number) => void,\r\n /** whether part should be rendered as readonly (no navigation) */\r\n isReadonly: boolean,\r\n /** optional onClick instead of using history.push */\r\n onClick?: (itemUri: string) => void,\r\n};\r\n\r\nexport const BreadcrumbPart = ({\r\n bctext,\r\n symbolName,\r\n text,\r\n itemUri,\r\n isLast,\r\n style,\r\n className,\r\n index,\r\n onMeasured,\r\n isReadonly,\r\n onClick,\r\n}: Props) => {\r\n function measureWidth(ref: Breadcrumb.Item) {\r\n const bi: Breadcrumb.Item = ReactDOM.findDOMNode(ref);\r\n /* istanbul ignore else */\r\n if (bi !== null && bi !== undefined) {\r\n /* istanbul ignore else */\r\n if (onMeasured) onMeasured(index, bi.clientWidth + 8);\r\n }\r\n }\r\n function onPartClick(e, itemUri: string) {\r\n // no link on last part\r\n if (isLast) {\r\n e.preventDefault();\r\n return;\r\n }\r\n // if onclick defined avoid history.push\r\n /* istanbul ignore else */\r\n if (typeof onClick === \"function\") {\r\n e.preventDefault();\r\n onClick(itemUri);\r\n }\r\n // use history.push to load itemUri\r\n return null;\r\n }\r\n\r\n const localizedText = text.startsWith(\"$folder:\")\r\n ? getLocalizedText(text)\r\n : text;\r\n\r\n return (\r\n ref && measureWidth(ref)}\r\n active={isLast || isReadonly}\r\n style={style}\r\n className={className}\r\n data-test={`breadCrumb${isReadonly ? \"Disabled\" : \"Enabled\"}`}\r\n >\r\n {isReadonly ? (\r\n \r\n {symbolName ? (\r\n \r\n ) : (\r\n localizedText\r\n )}\r\n \r\n ) : (\r\n onPartClick(e, itemUri)}\r\n >\r\n \r\n {symbolName ? (\r\n \r\n ) : (\r\n localizedText\r\n )}\r\n \r\n \r\n )}\r\n \r\n );\r\n};\r\n\r\nBreadcrumbPart.displayName = \"BreadcrumbPart\";\r\nexport default BreadcrumbPart;\r\n","// @flow\r\nimport React from \"react\";\r\nimport Status from \"components/Status\";\r\nimport loc from \"i18next\";\r\n\r\ntype Props = {\r\n /** whether marked as favorite */\r\n isFav?: boolean,\r\n /** fetch processing status */\r\n favStatus?: string,\r\n /** callback when favorite icon clicked */\r\n onClick: () => void,\r\n};\r\n\r\nconst BreadcrumbFavorite = ({ isFav, favStatus, onClick }: Props) => {\r\n if (isFav) {\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\nBreadcrumbFavorite.displayName = \"BreadcrumbFavorite\";\r\n\r\nexport default BreadcrumbFavorite;\r\n","// @flow\r\nimport React, { useState, useCallback } from \"react\";\r\nimport BreadcrumbPart from \"./BreadcrumbPart\";\r\nimport Breadcrumb from \"react-bootstrap/lib/Breadcrumb\";\r\nimport BreadcrumbFavorite from \"./BreadcrumbFavorite\";\r\nimport SiteSelect from \"components/SiteSelect\";\r\nimport { type SiteTypeEnum, type BreadcrumbPartDTO } from \"data/types\";\r\nimport { maybeHandleSiteName, maybeLocalizeBreadcrumb } from \"data/utils\";\r\nimport \"./index.css\";\r\nimport loc from \"i18next\";\r\nimport Icons from \"@hs/icons\";\r\nimport Badge from \"react-bootstrap/lib/Badge\";\r\nimport styles from \"./Breadcrumb.module.css\";\r\n\r\ntype Props = {\r\n /** whole breadcrumb in text */\r\n text?: string,\r\n /** siteType */\r\n siteType?: SiteTypeEnum,\r\n /** all part objects making up breadcrumb */\r\n parts: Array,\r\n /** current version */\r\n version?: number,\r\n /** whether marked as favorite */\r\n isFav?: boolean,\r\n /** whether this item is favorable */\r\n isFavorable?: boolean,\r\n /** fetch processing status */\r\n favStatus?: string,\r\n /** callback when favorite icon clicked */\r\n favOnClick?: () => void,\r\n /** optional additional CSS style */\r\n style?: StyleSheet,\r\n /** optional additional CSS class to apply */\r\n className?: string,\r\n /** whether last breadcrumb part should be active */\r\n leafActive?: boolean,\r\n /** callback when UI measured length of rendered breadcrumb */\r\n onMeasured: Function,\r\n /** which parts in the breadcrumb to show (depending on rendering size and screen width) */\r\n showParts: Array,\r\n /** how many parts of the breadcrumb are actually hidden (depending on rendering size and screen width) */\r\n hiddenCount: number,\r\n /** whether user is allowed to navigate through breadcrumb (and hide favorite option) */\r\n isReadonly: boolean,\r\n /** scope breadcrumb to show parts only starting the specified level number */\r\n scopeFromLevel: number,\r\n /** optional breadcrumbPart click event instead of history.push */\r\n onPartClick?: (itemUri: string) => void,\r\n};\r\n\r\nconst MyBreadcrumb = ({\r\n text,\r\n siteType,\r\n parts,\r\n version,\r\n isFav = false,\r\n favStatus,\r\n favOnClick,\r\n style,\r\n className,\r\n leafActive = false,\r\n onMeasured,\r\n showParts,\r\n hiddenCount,\r\n isReadonly = false,\r\n isFavorable = true,\r\n canChangeSite,\r\n scopeFromLevel = -1,\r\n onPartClick,\r\n}: Props) => {\r\n const [showChangeSiteType, setShowChangeSiteType] = useState(false);\r\n const toggleChangeSiteType = useCallback(\r\n () => canChangeSite && setShowChangeSiteType((show) => !show),\r\n [canChangeSite]\r\n );\r\n const handleSiteChange = useCallback(\r\n (itemUri) => {\r\n /* istanbul ignore else */\r\n if (typeof onPartClick === \"function\") onPartClick(itemUri);\r\n setShowChangeSiteType(false);\r\n },\r\n [onPartClick]\r\n );\r\n return (\r\n \r\n {siteType &&\r\n // !isReadonly &&\r\n isFavorable &&\r\n scopeFromLevel <= 0 &&\r\n typeof favOnClick === \"function\" && (\r\n \r\n )}\r\n {parts &&\r\n ((hiddenCount > 0 &&\r\n parts.length > 1 &&\r\n hiddenCount < showParts.length - 1) ||\r\n parts.length === 1 ||\r\n hiddenCount === 0) &&\r\n siteType &&\r\n \" \"}\r\n {parts &&\r\n ((hiddenCount > 0 &&\r\n parts.length > 1 &&\r\n hiddenCount < showParts.length - 1) ||\r\n parts.length === 1 ||\r\n hiddenCount === 0 ||\r\n isReadonly) &&\r\n siteType &&\r\n !showChangeSiteType && (\r\n \r\n )}{\" \"}\r\n {parts && siteType && parts.length === 1 && !showChangeSiteType && (\r\n \r\n )}\r\n {parts && showChangeSiteType && (\r\n \r\n )}\r\n {parts &&\r\n parts.length > 1 &&\r\n !isReadonly &&\r\n hiddenCount > 0 &&\r\n (hiddenCount === showParts.length - 1 ||\r\n (scopeFromLevel > 0 &&\r\n hiddenCount ===\r\n showParts.length - scopeFromLevel - 1)) && (\r\n \r\n )}\r\n {parts &&\r\n parts.length > 1 &&\r\n hiddenCount > 0 &&\r\n hiddenCount < showParts.length - 1 && (\r\n \r\n ...\r\n \r\n )}\r\n {parts &&\r\n parts.length > 1 &&\r\n parts.map((part, index) => {\r\n if (index === 0 && showChangeSiteType) return null;\r\n if (showParts.length > 0 && !showParts[index]) return null;\r\n if (index < scopeFromLevel) return null;\r\n return (\r\n \r\n );\r\n })}\r\n {parts && parts.length > 1 && version > 0 && (\r\n \r\n {loc.t(\"common:version.text\", { version })}\r\n \r\n )}\r\n \r\n );\r\n};\r\n\r\nMyBreadcrumb.displayName = \"MyBreadcrumb\";\r\nexport default MyBreadcrumb;\r\n","// @flow\r\nimport React from \"react\";\r\nimport Breadcrumb from \"./Breadcrumb\";\r\nimport { type BreadcrumbPartDTO, type SiteTypeEnum } from \"data/types\";\r\nimport noop from \"lodash/noop\";\r\nimport Measure from \"react-measure\";\r\nimport throttle from \"lodash/debounce\";\r\n\r\ntype Props = {\r\n /** width in pixel */\r\n knownWidth?: number,\r\n /** breadcrumb leaf name */\r\n text?: string,\r\n /** siteType */\r\n siteType?: SiteTypeEnum,\r\n /** all parts making up the breadcrumb */\r\n parts: Array,\r\n /** whether user is allowed to navigate the breadcrumb parts */\r\n isReadonly?: boolean,\r\n /** current version */\r\n version?: number,\r\n /** optional breadcrumbPart click event instead of history.push */\r\n onPartClick?: (itemUri: string) => void,\r\n};\r\n\r\ntype State = {\r\n width: number,\r\n parts: Array,\r\n showParts: Array,\r\n hiddenCount: number,\r\n calculated: boolean,\r\n};\r\n\r\nclass ResponsiveBreadcrumb extends React.PureComponent {\r\n _isMounted: boolean;\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n this._isMounted = false;\r\n this.state = {\r\n width: props.knownWidth || 0,\r\n parts: [],\r\n showParts: [],\r\n hiddenCount: 0,\r\n calculated: false,\r\n };\r\n }\r\n\r\n _onMeasured = (index: number, width: number) => {\r\n const { parts, showParts } = this.state;\r\n parts[index] = width;\r\n showParts[index] = true;\r\n this.setState({ parts, showParts });\r\n };\r\n\r\n __calcVisible = (knownState: State) => {\r\n if (knownState.width === 0) return;\r\n const { parts, width } = knownState;\r\n if (parts.length === 0) return;\r\n\r\n let showParts = [],\r\n hiddenCount = 0;\r\n parts.reduceRight((previousValue, currentValue, index) => {\r\n const result = previousValue + currentValue;\r\n showParts[index] = index === parts.length - 1 || result <= width;\r\n if (!showParts[index]) hiddenCount++;\r\n return result;\r\n }, 0);\r\n\r\n /* first calculate the parts that must be shown\r\n let sum = parts[parts.length - 1];\r\n let anyHidden = false;\r\n const newShowParts = showParts.map((part, index) => {\r\n if (index === parts.length - 1) return true;\r\n sum += parts[index];\r\n const isVisible = sum <= width;\r\n if (!isVisible) anyHidden = true;\r\n return isVisible;\r\n });*/\r\n /* istanbul ignore else */\r\n if (this._isMounted)\r\n this.setState({ showParts, hiddenCount, calculated: true });\r\n };\r\n\r\n _calcVisible = throttle(this.__calcVisible, 200, {\r\n leading: false,\r\n trailing: true,\r\n });\r\n\r\n componentDidMount() {\r\n this._isMounted = true;\r\n this._calcVisible(this.state);\r\n }\r\n\r\n componentWillUnmount = () => (this._isMounted = false);\r\n\r\n componentDidUpdate(prevProps: Props, prevState: State) {\r\n if (prevProps.parts !== this.props.parts) {\r\n this.setState(\r\n {\r\n parts: [],\r\n showParts: [],\r\n hiddenCount: 0,\r\n calculated: false,\r\n },\r\n () => this._calcVisible(this.state)\r\n );\r\n }\r\n\r\n if (prevState.width === this.state.width && this.state.calculated)\r\n return;\r\n this._calcVisible(this.state);\r\n }\r\n\r\n render() {\r\n const mybc = (\r\n \r\n );\r\n if (this.props.knownWidth !== undefined) return mybc;\r\n\r\n return (\r\n this.setState({ width: bounds.width })}\r\n >\r\n {mybc}\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default ResponsiveBreadcrumb;\r\n","// @flow\r\nimport React, { useCallback, useContext, useState, useEffect } from \"react\";\r\nimport { MultiSelectionContext } from \"data/context\";\r\nimport noop from \"lodash/noop\";\r\nimport { isHandheld } from \"data/bowser\";\r\n\r\ntype Props = {\r\n /** which HTML element to use to wrap the children */\r\n componentClass: string,\r\n /** callback when user wants to see the ContextMenu */\r\n onContextMenu: () => void,\r\n /** React children to render */\r\n children?: Node,\r\n};\r\n\r\n/**\r\n * wrapper to add context menu event handling\r\n */\r\nconst EventHandler = ({\r\n componentClass = \"div\",\r\n onContextMenu = noop,\r\n children,\r\n onTouchEnd,\r\n onTouchStart,\r\n onTouchMove,\r\n onMouseDown,\r\n onMouseLeave,\r\n onMouseUp,\r\n rowIndex,\r\n columnIndex,\r\n ...rest\r\n}: Props) => {\r\n /* istanbul ignore next */\r\n const {\r\n handler,\r\n multiple,\r\n actions: { handleAdd },\r\n } = useContext(MultiSelectionContext) || {\r\n handler: {},\r\n multiple: false,\r\n actions: { handleAdd: (index: number) => null },\r\n };\r\n\r\n // Auto toggle row on initial MultiSelection\r\n const [autoToggleRow, setAutoToggleRow] = useState(false);\r\n\r\n useEffect(() => {\r\n setAutoToggleRow(multiple);\r\n }, [multiple]);\r\n\r\n const handleTouchStart = useCallback(\r\n (e) => {\r\n /* istanbul ignore else */\r\n if (handler.onTouchStart) handler.onTouchStart(e);\r\n /* istanbul ignore else */\r\n if (onTouchStart) onTouchStart(e);\r\n if (multiple) setAutoToggleRow(false);\r\n },\r\n [handler, onTouchStart, multiple]\r\n );\r\n\r\n const handleTouchMove = useCallback(\r\n (e) => {\r\n /* istanbul ignore else */\r\n if (handler.onTouchMove) handler.onTouchMove(e);\r\n /* istanbul ignore else */\r\n if (onTouchMove) onTouchMove(e);\r\n },\r\n [handler, onTouchMove]\r\n );\r\n\r\n const handleTouchEnd = useCallback(\r\n (e) => {\r\n /* istanbul ignore else */\r\n if (handler.onTouchEnd) handler.onTouchEnd(e);\r\n /* istanbul ignore else */\r\n if (onTouchEnd) onTouchEnd(e);\r\n /* istanbul ignore else */\r\n if (autoToggleRow) {\r\n setAutoToggleRow(false);\r\n handleAdd(rowIndex);\r\n }\r\n },\r\n [handler, onTouchEnd, autoToggleRow, handleAdd, rowIndex]\r\n );\r\n\r\n const handleMouseDown = useCallback(\r\n (e) => {\r\n /* istanbul ignore else */\r\n if (handler.onMouseDown) handler.onMouseDown(e);\r\n /* istanbul ignore else */\r\n if (onMouseDown) onMouseDown(e);\r\n },\r\n [handler, onMouseDown]\r\n );\r\n\r\n const handleMouseLeave = useCallback(\r\n (e) => {\r\n /* istanbul ignore else */\r\n if (handler.onMouseLeave) handler.onMouseLeave(e);\r\n /* istanbul ignore else */\r\n if (onMouseLeave) onMouseLeave(e);\r\n },\r\n [handler, onMouseLeave]\r\n );\r\n\r\n const handleMouseUp = useCallback(\r\n (e) => {\r\n /* istanbul ignore else */\r\n if (handler.onMouseUp) handler.onMouseUp(e);\r\n /* istanbul ignore else */\r\n if (onMouseUp) onMouseUp(e);\r\n },\r\n [handler, onMouseUp]\r\n );\r\n\r\n return React.createElement(\r\n componentClass,\r\n {\r\n ...rest,\r\n onTouchStart: handleTouchStart,\r\n onTouchMove: handleTouchMove,\r\n onTouchEnd: handleTouchEnd,\r\n onMouseDown: handleMouseDown,\r\n onMouseLeave: handleMouseLeave,\r\n onMouseUp: handleMouseUp,\r\n onContextMenu: isHandheld() ? null : onContextMenu,\r\n },\r\n children\r\n );\r\n};\r\n\r\nexport default EventHandler;\r\n","// @flow\r\n//#region imports\r\nimport React, { PureComponent } from \"react\";\r\nimport { connect, Dispatch } from \"react-redux\";\r\nimport { compose } from \"redux\";\r\nimport { fetchBreadcrumb, addFavorite, delFavorite } from \"data/api\";\r\nimport {\r\n ServerEventActionType,\r\n ServerEventItemType,\r\n type BreadcrumbResultDTO,\r\n type BreadcrumbPartDTO,\r\n type SiteTypeEnum,\r\n} from \"data/types\";\r\nimport { setCurrentBreadcrumb } from \"data/actions\";\r\nimport Breadcrumb from \"components/Breadcrumb\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport Status from \"components/Status\";\r\nimport GlobalEventsHandler from \"containers/GlobalEventsHandler\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport { toastActionResult } from \"data/toast\";\r\nimport withOfflineHandler from \"containers/OfflineHandler\";\r\n//#endregion\r\n\r\n//#region flow types\r\ntype Props = {\r\n /** itemUri */\r\n itemUri?: string,\r\n /** whether marked as favorite */\r\n isFav: boolean,\r\n /** whether this item is favorable */\r\n isFavorable: boolean,\r\n /** Redux dispatch */\r\n dispatch: Dispatch,\r\n /** all part objects making up breadcrumb */\r\n parts?: Array,\r\n /** current version */\r\n version?: number,\r\n /** siteType */\r\n siteType?: SiteTypeEnum,\r\n /** whole breadcrumb in text */\r\n text?: string,\r\n /** breadcrumb item name */\r\n name: string,\r\n /** current view name */\r\n viewName: string,\r\n /** whether user is allowed to navigate through breadcrumb (and hide favorite option) */\r\n isReadonly: boolean,\r\n /** whether this updates when globalEvents are received */\r\n isRefreshing: boolean,\r\n /** scope breadcrumb to show parts only starting the specified level number */\r\n scopeFromLevel?: number,\r\n /** GlobalEventsHandler.refreshId */\r\n refreshId: number,\r\n /** optional breadcrumbPart click event instead of history.push */\r\n onBreadcrumbPartClick?: (itemUri: string) => void,\r\n};\r\n\r\ntype State = {\r\n status: ConstantsEnum,\r\n favStatus: ConstantsEnum,\r\n initialLoading: boolean,\r\n};\r\n//#endregion\r\n\r\nexport async function toggleFavorite({\r\n isFav,\r\n itemUri,\r\n name,\r\n logger = toastActionResult,\r\n}: {\r\n isFav: boolean,\r\n itemUri: string,\r\n name: string,\r\n logger: () => void,\r\n}): Promise {\r\n const success: boolean = isFav\r\n ? await delFavorite(itemUri)\r\n : await addFavorite(itemUri, name);\r\n logger(success, isFav ? \"breadcrumb.delfav\" : \"breadcrumb.addfav\", {\r\n name,\r\n });\r\n return success;\r\n}\r\n\r\nexport class BreadcrumbContainer extends PureComponent {\r\n _isMounted: boolean;\r\n abortController: AbortController | null;\r\n\r\n state = {\r\n status: Constants.LOADING,\r\n favStatus: Constants.LOADING,\r\n initialLoading: true,\r\n };\r\n\r\n static defaultProps = {\r\n isFav: false,\r\n isReadonly: false,\r\n isRefreshing: true,\r\n };\r\n\r\n componentDidMount = () => {\r\n this._isMounted = true;\r\n this._fetch(this.props.itemUri);\r\n };\r\n\r\n componentWillUnmount = () => {\r\n const { dispatch, viewName } = this.props;\r\n /* istanbul ignore else */\r\n if (this.abortController != null) {\r\n this.abortController.abort();\r\n }\r\n dispatch(\r\n setCurrentBreadcrumb({\r\n breadcrumb: {},\r\n viewName,\r\n })\r\n );\r\n this._isMounted = false;\r\n };\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n /* istanbul ignore else */\r\n if (\r\n prevProps.itemUri !== this.props.itemUri ||\r\n (this.props.isRefreshing === true &&\r\n prevProps.refreshId !== this.props.refreshId)\r\n ) {\r\n this._fetch(this.props.itemUri);\r\n }\r\n /*if (nextProps.isFav !== this.props.isFav) {\r\n this._isFavToast(nextProps.isFav);\r\n }*/\r\n }\r\n\r\n _maybeGetNewAbortController = () => {\r\n if (this.abortController != null) {\r\n this.abortController.abort();\r\n return new AbortController();\r\n }\r\n return this.abortController || new AbortController();\r\n };\r\n\r\n _fetch = (itemUri: ?string): void => {\r\n this.abortController = this._maybeGetNewAbortController();\r\n const { dispatch, viewName } = this.props;\r\n if (itemUri != null) {\r\n this.setState({ status: Constants.LOADING });\r\n this.props.offlineHandler\r\n .factory(fetchBreadcrumb)(itemUri, this.abortController.signal)\r\n .then((breadcrumb: BreadcrumbResultDTO) => {\r\n this._isMounted &&\r\n this.setState(\r\n {\r\n status: Constants.OK,\r\n initialLoading: false,\r\n favStatus: Constants.OK,\r\n },\r\n () =>\r\n dispatch(\r\n setCurrentBreadcrumb({\r\n breadcrumb,\r\n viewName,\r\n })\r\n )\r\n );\r\n })\r\n .catch((err) => {\r\n /* istanbul ignore if */\r\n if (this._isMounted && err.name === \"AbortError\") {\r\n this.setState({\r\n status: Constants.LOADING,\r\n initialLoading: true,\r\n });\r\n } else if (this._isMounted) {\r\n this.setState({\r\n status: Constants.ERROR,\r\n favStatus: Constants.ERROR,\r\n });\r\n }\r\n });\r\n } else {\r\n this._isMounted && this.setState({ status: Constants.OK });\r\n }\r\n };\r\n\r\n favOnClick = (e: SyntheticMouseEvent<*>) => {\r\n e.preventDefault();\r\n const { itemUri, name, isFav } = this.props;\r\n\r\n /* istanbul ignore next */\r\n if (itemUri == null) return;\r\n\r\n this.setState({ favStatus: Constants.LOADING });\r\n\r\n toggleFavorite({ isFav, itemUri, name }).then((success) => {\r\n this.setState({\r\n favStatus: success ? Constants.OK : Constants.ERROR,\r\n });\r\n });\r\n };\r\n\r\n render() {\r\n /* istanbul ignore else */\r\n if (this.props.itemUri) {\r\n const { initialLoading, status, favStatus } = this.state;\r\n const {\r\n text,\r\n parts,\r\n version,\r\n siteType,\r\n isFav,\r\n isReadonly,\r\n isFavorable,\r\n scopeFromLevel,\r\n onBreadcrumbPartClick,\r\n canChangeSite,\r\n } = this.props;\r\n\r\n /* istanbul ignore else */\r\n if (initialLoading === true || status === Constants.ERROR)\r\n return (\r\n \r\n );\r\n\r\n /* istanbul ignore else */\r\n if (status !== Constants.ERROR)\r\n return (\r\n \r\n );\r\n\r\n /* istanbul ignore next */\r\n return null;\r\n }\r\n\r\n return null;\r\n }\r\n}\r\n\r\n// apply Redux Store state to Component Properties\r\nconst mapStateToProps = /*istanbul ignore next*/ (state, ownProps) => {\r\n let result = {\r\n name: s.breadcrumbNameSelector(state, ownProps.viewName),\r\n ...ownProps,\r\n };\r\n if (state.breadcrumb[ownProps.viewName]) {\r\n const { itemUri, ...rest } = state.breadcrumb[ownProps.viewName];\r\n result = Object.assign({}, result, rest);\r\n }\r\n return result;\r\n};\r\n\r\nexport default compose(\r\n connect(mapStateToProps),\r\n GlobalEventsHandler({\r\n items: [\r\n ServerEventItemType.document,\r\n ServerEventItemType.folder,\r\n ServerEventItemType.favorite,\r\n ],\r\n actions: [\r\n ServerEventActionType.modify,\r\n ServerEventActionType.edit,\r\n ServerEventActionType.add,\r\n ServerEventActionType.delete,\r\n ServerEventActionType.refresh,\r\n ],\r\n }),\r\n withOfflineHandler\r\n)(BreadcrumbContainer);\r\n","// @flow\r\nimport React from \"react\";\r\nimport Modal, { ModalSize } from \"components/Modal\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport ProgressBar from \"react-bootstrap/lib/ProgressBar\";\r\nimport { createModal } from \"react-modal-promise\";\r\nimport styles from \"./ProgressModal.module.css\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\n\r\ntype Props = {\r\n /** react-modal-promise: whether to show dialog */\r\n open: boolean,\r\n /** react-modal-promise: callback when user closes Dialog */\r\n close: () => void,\r\n /** text to show in Cancel button */\r\n cancelButton?: string,\r\n /** Modal Dialog title */\r\n title?: string,\r\n /** FontAwesome icon to show above title\r\n * @default {string} \"spinner\"\r\n */\r\n icon?: string,\r\n /** called once dialog mounted to actually perform work\r\n * @param {Function} close call to close dialog passing whichever return value you need\r\n * @param {Function} setError call to set error message to display on dialog\r\n * @param {Function} setProgress call to set progress bar on dialog\r\n */\r\n doWork: (\r\n close: () => void,\r\n setError: (error: string) => void,\r\n setProgress: (progress: number) => void\r\n ) => void,\r\n /** initial progress (defaults to 100) */\r\n initialProgress: number,\r\n};\r\n\r\ntype State = {\r\n error: ?string,\r\n progress: number,\r\n};\r\n\r\n/** presents a Progress dialog to the user\r\n * @returns {boolean} true if user confirmed, null/undefined otherwise\r\n */\r\nexport class ProgressModal extends React.PureComponent {\r\n state = { error: null, progress: 100 };\r\n\r\n componentDidMount() {\r\n /* istanbul ignore else */\r\n if (typeof this.props.doWork === \"function\") {\r\n this.props.doWork(\r\n this.props.close,\r\n (error: string) => this.setState({ error }),\r\n (progress: number) => this.setState({ progress })\r\n );\r\n }\r\n if (this.state.progress !== this.props.initialProgress) {\r\n this.setState({\r\n progress: this.props.initialProgress,\r\n });\r\n }\r\n }\r\n\r\n render() {\r\n const {\r\n open,\r\n close,\r\n cancelButton = loc.t(\"common:cancel\"),\r\n title,\r\n icon,\r\n } = this.props;\r\n\r\n return (\r\n close()}\r\n dialogClassName={styles.modal}\r\n >\r\n {title && (\r\n \r\n \r\n {title}\r\n \r\n )}\r\n \r\n {this.state.error == null && (\r\n \r\n )}\r\n {this.state.error != null &&
{this.state.error}
}\r\n
\r\n {this.state.error != null && (\r\n \r\n close()}\r\n >\r\n {cancelButton}\r\n \r\n \r\n )}\r\n \r\n );\r\n }\r\n}\r\nProgressModal.displayName = \"ProgressModal\";\r\nProgressModal.defaultProps = {\r\n icon: \"spinner\",\r\n initialProgress: 100,\r\n};\r\n\r\nexport const openProgressModal = createModal(ProgressModal);\r\n","// @flow\r\nimport React, { useMemo } from \"react\";\r\nimport AttributeLabel from \"components/ExtraAttributes/AttributeLabel\";\r\nimport ViewerControlBase from \"components/ExtraAttributes/ViewerControl/ViewerControlBase\";\r\nimport { getValue } from \"data/utils\";\r\n\r\ntype Props = {\r\n name: string,\r\n header?: string,\r\n value: any | string,\r\n width?: number,\r\n};\r\n\r\nconst StaticViewerControl = ({ name, header, value, width }: Props) => {\r\n // $FlowFixMe\r\n let style: CSSStyleDeclaration = {};\r\n if (width && width > 0) style.width = width * 1.3 + \"px\";\r\n else style.minWidth = \"100px\";\r\n\r\n // replace carriage returns and some basic html safety\r\n const htmlValue = useMemo(() => {\r\n const v = getValue(value);\r\n return (\r\n (v\r\n ? String(v)\r\n .replace(//g, \">\")\r\n .replace(/\\n/g, \"
\")\r\n : \"\") + \" \"\r\n );\r\n }, [value]);\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nStaticViewerControl.displayName = \"StaticViewerControl\";\r\nexport default StaticViewerControl;\r\n","import React, { useMemo } from \"react\";\r\nimport FormBar from \"@hs/form-bar\";\r\nimport SearchInput from \"@hs/search-input\";\r\nimport { useFormActions } from \"hooks\";\r\nimport { FormBarView } from \"data/types\";\r\nimport { getClassNames } from \"data/utils\";\r\nimport styles from \"./ArchiveTarget.module.css\";\r\n\r\ntype Props = {\r\n /** CSS Classname */\r\n className?: string,\r\n /** current ArchiveTarget */\r\n archiveTarget: CardItemResultDTO,\r\n /** callback when user clicks Cancel */\r\n onCancel: () => void,\r\n /** callback when user types anything into filter text\r\n * @param {string} filterText filterText to apply\r\n */\r\n onFilterTextChange?: (filterText: string) => void,\r\n /** current filterText value */\r\n filterText?: string,\r\n};\r\n\r\n/**\r\n * renders an ArchiveTarget image (instead of icon)\r\n */\r\nconst ArchiveTargetImageWithTitle = (title) => {\r\n const Component = ({ name: src }) => (\r\n {title}\r\n );\r\n Component.displayName = \"ArchiveTargetImage\";\r\n return Component;\r\n};\r\n\r\n/**\r\n * renders an ArchiveTarget panel header\r\n */\r\nexport const ArchiveTarget = ({\r\n className,\r\n archiveTarget,\r\n onCancel,\r\n onFilterTextChange,\r\n filterText,\r\n}: Props) => {\r\n const [components, icon] = useMemo(() => {\r\n const components = archiveTarget.image\r\n ? {\r\n Icon: ArchiveTargetImageWithTitle(archiveTarget.name),\r\n }\r\n : null;\r\n switch (archiveTarget.uri) {\r\n case \"at-fav\":\r\n return [components, \"star-o\"];\r\n case \"at-rec\":\r\n return [components, \"history\"];\r\n case \"at-search\":\r\n return [components, \"search\"];\r\n default:\r\n return [components, archiveTarget.image];\r\n }\r\n }, [archiveTarget]);\r\n const contextProps = useMemo(() => ({ onCancel }), [onCancel]);\r\n const actions = useFormActions(FormBarView.ArchiveTarget, contextProps);\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\nArchiveTarget.displayName = \"FormBar.ArchiveTarget\";\r\nexport default ArchiveTarget;\r\n","import React, { useMemo } from \"react\";\r\nimport FormBar from \"@hs/form-bar\";\r\nimport { getLocalizedText } from \"data/utils\";\r\nimport { type FormBarViewEnum } from \"data/types\";\r\nimport { useFormActions } from \"hooks\";\r\nimport { getClassNames } from \"data/utils\";\r\nimport styles from \"./Edit.module.css\";\r\n\r\ntype Props = {\r\n /** CSS Classname */\r\n className?: string,\r\n /** current Form being edited */\r\n form?: FormResultDTO | DocFormResultDTO,\r\n /** callback when user clicks Cancel */\r\n onCancel: () => void,\r\n /** default form title to use when formTitle/name not supplied\r\n * @default {string} null so use i18next localization upload:edit_form.title\r\n */\r\n title?: string,\r\n /** optional icon to display\r\n * @default {string} edit\r\n */\r\n /** optional center component */\r\n children?: React.ElementType,\r\n /** targetView */\r\n targetView: FormBarViewEnum,\r\n};\r\n\r\n/**\r\n * renders the FormEdit's panel header\r\n *\r\n * @param {Props} { form, title, onCancel, children, icon }\r\n */\r\nexport const Edit = ({\r\n className,\r\n title,\r\n onCancel,\r\n targetView,\r\n children,\r\n icon = \"edit\",\r\n}: Props) => {\r\n const contextProps = useMemo(\r\n () => ({ onCancel, isEdit: true }),\r\n [onCancel]\r\n );\r\n const actions = useFormActions(targetView, contextProps);\r\n return (\r\n \r\n );\r\n};\r\nEdit.displayName = \"FormBar.Edit\";\r\nexport default Edit;\r\n","import React from \"react\";\r\nimport { useToggle } from \"hooks\";\r\nimport FormBar from \"@hs/form-bar\";\r\nimport Avatar from \"components/User/Avatar\";\r\nimport { LockInfoOn } from \"components/LockInfo\";\r\nimport { type LockResultDTO } from \"data/types\";\r\nimport { useFormActions } from \"hooks\";\r\nimport { FormBarView } from \"data/types\";\r\nimport { getClassNames } from \"data/utils\";\r\nimport styles from \"./LockInfo.module.css\";\r\n\r\ntype Props = {\r\n lockInfo: LockResultDTO,\r\n className?: string,\r\n};\r\n\r\nconst components = {\r\n Container: \"aside\",\r\n};\r\n\r\n/**\r\n * renders dismissable lock info\r\n *\r\n * @param {Props} { lockInfo, className }\r\n */\r\nexport const LockInfo = ({ lockInfo, className }: Props) => {\r\n const [show, toggleShow] = useToggle(true);\r\n const actions = useFormActions(FormBarView.LockInfo);\r\n return (\r\n \r\n
\r\n \r\n {lockInfo.lockedByName}\r\n \r\n
\r\n \r\n );\r\n};\r\nLockInfo.displayName = \"FormBar.LockInfo\";\r\nexport default LockInfo;\r\n","import React, { useMemo } from \"react\";\r\nimport FormBar from \"@hs/form-bar\";\r\nimport { getLocalizedText } from \"data/utils\";\r\nimport { useFormActions, usePersistSetting } from \"hooks\";\r\nimport { FormBarView } from \"data/types\";\r\nimport { getClassNames } from \"data/utils\";\r\nimport styles from \"./Search.module.css\";\r\n\r\ntype Props = {\r\n /** CSS Classname */\r\n className?: string,\r\n /** current SearchForm */\r\n searchForm?: SearchFormResultDTO,\r\n /** callback when user clicks Cancel */\r\n onCancel: () => void,\r\n /** callback when user clicks Clear */\r\n onClear: () => void,\r\n /** used for evaluating if the clear button should be visible */\r\n clearEnabled: () => boolean,\r\n};\r\n\r\n/**\r\n * renders the SearchForm's panel header\r\n *\r\n * @param {Props} { searchForm, onCancel, onClear }\r\n */\r\nexport const Search = ({ className, searchForm, onCancel, onClear }: Props) => {\r\n const [operator, setOperator] = usePersistSetting({\r\n name: \"showSearchOperators\",\r\n defaultValue: false,\r\n });\r\n const [scope, setScope] = usePersistSetting({\r\n name: \"showSearchScope\",\r\n defaultValue: false,\r\n });\r\n const contextProps = useMemo(\r\n () => ({\r\n searchForm,\r\n onClear,\r\n onCancel,\r\n showSearchOperators: { value: operator, setValue: setOperator },\r\n showSearchScope: { value: scope, setValue: setScope },\r\n }),\r\n [searchForm, onClear, onCancel, operator, setOperator, scope, setScope]\r\n );\r\n const actions = useFormActions(FormBarView.Search, contextProps);\r\n return (\r\n \r\n );\r\n};\r\nSearch.displayName = \"FormBar.Search\";\r\nexport default Search;\r\n","import React, { useCallback, useMemo } from \"react\";\r\nimport FormBar from \"@hs/form-bar\";\r\nimport { useFormActions, usePersistSetting } from \"hooks\";\r\nimport { SearchScope as Scope, FormBarView } from \"data/types\";\r\nimport SearchScopeSelect from \"components/MainSearchScope/SearchScopeSelect\";\r\nimport styles from \"./SearchScope.module.css\";\r\n\r\ntype Props = {\r\n /** optional string of css classes */\r\n className?: string,\r\n /** initial search scope */\r\n searchScope: SearchScopeEnum,\r\n /** initial search scope itemUri */\r\n itemUri: string,\r\n /** callback when user changes scope\r\n * @param {SearchScopeEnum} searchScope new search scope\r\n * @param {string} itemUri new scoped itemUri\r\n */\r\n onSearchScopeChange: (\r\n searchScope: SearchScopeEnum,\r\n itemUri: ?string\r\n ) => void,\r\n};\r\n\r\nconst components = {\r\n Container: \"aside\",\r\n};\r\n\r\n/**\r\n * renders dismissable search scope\r\n *\r\n * @param {Props} { scope, className }\r\n */\r\nexport const SearchScope = ({\r\n searchScope,\r\n onSearchScopeChange,\r\n className,\r\n scopeItemUri: itemUri,\r\n}: Props) => {\r\n const [value, setValue] = usePersistSetting({\r\n name: \"showSearchScope\",\r\n defaultValue: false,\r\n });\r\n const handleClose = useCallback(() => setValue(false), [setValue]);\r\n const contextProps = useMemo(\r\n () => ({\r\n itemUri,\r\n onSearchScopeChange,\r\n showSearchScope: { value, setValue },\r\n }),\r\n [itemUri, onSearchScopeChange, value, setValue]\r\n );\r\n const actions = useFormActions(FormBarView.SearchScope, contextProps);\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\nSearchScope.displayName = \"FormBar.SearchScope\";\r\nexport default SearchScope;\r\n","import React, { useMemo } from \"react\";\r\nimport FormBar from \"@hs/form-bar\";\r\nimport { useFormActions } from \"hooks\";\r\nimport { type FormBarViewEnum } from \"data/types\";\r\n\r\ntype Props = {\r\n className?: string,\r\n title?: string,\r\n onCancel?: () => void,\r\n children?: React.ElementType,\r\n icon?: string,\r\n targetView: FormBarViewEnum,\r\n};\r\n\r\n/**\r\n * renders the Form's panel header\r\n *\r\n * @param {Props} { form, title, onCancel, children, icon }\r\n */\r\nexport const View = ({\r\n className,\r\n title,\r\n onCancel,\r\n children,\r\n icon,\r\n targetView,\r\n}: Props) => {\r\n const contextProps = useMemo(() => ({ onCancel }), [onCancel]);\r\n const actions = useFormActions(targetView, contextProps);\r\n return (\r\n \r\n );\r\n};\r\nView.displayName = \"FormBar.View\";\r\nexport default View;\r\n","import ArchiveTarget from \"./ArchiveTarget\";\r\nimport Edit from \"./Edit\";\r\nimport LockInfo from \"./LockInfo\";\r\nimport Search from \"./Search\";\r\nimport SearchScope from \"./SearchScope\";\r\nimport View from \"./View\";\r\n\r\nconst FormBarItem = {\r\n ArchiveTarget,\r\n Edit,\r\n LockInfo,\r\n Search,\r\n SearchScope,\r\n View,\r\n};\r\n\r\nexport default FormBarItem;\r\n","import React from \"react\";\r\nimport FormBarItem from \"./Item\";\r\nimport { FormBarView } from \"data/types\";\r\n\r\nconst Factory = ({ views, ...props }) =>\r\n views.map((targetView, i) => {\r\n switch (targetView) {\r\n case FormBarView.Document:\r\n case FormBarView.Upload:\r\n case FormBarView.ItemFlows:\r\n case FormBarView.DocModal:\r\n case FormBarView.Folder:\r\n return props.isEdit ? (\r\n \r\n ) : (\r\n \r\n );\r\n case FormBarView.Search:\r\n return (\r\n \r\n );\r\n case FormBarView.SearchScope:\r\n return (\r\n \r\n );\r\n case FormBarView.LockInfo:\r\n return (\r\n \r\n );\r\n case FormBarView.ArchiveTarget:\r\n return (\r\n \r\n );\r\n default:\r\n console.error(`Unknown FormBarView ${targetView}`);\r\n return null;\r\n }\r\n });\r\nFactory.displayName = \"FormBarFactory\";\r\nexport default Factory;\r\n","import {\r\n HttpMethod,\r\n ContentType,\r\n CacheStrategy,\r\n SearchRequestType,\r\n SearchScope,\r\n NewFormType,\r\n ItemFlowTemplateType,\r\n ItemContextsFlags,\r\n} from \"data/types\";\r\nimport type {\r\n Dictionary,\r\n ApiMethod,\r\n UserInfoResultDTO,\r\n CardItemResultDTO,\r\n TreeDTO,\r\n BreadcrumbResultDTO,\r\n FormResultDTO,\r\n SearchFormResultDTO,\r\n DocListFilterRequestDTO,\r\n DocListSortRequestDTO,\r\n DocsResultDTO,\r\n WorkflowDTO,\r\n WorkflowInfoDTO,\r\n WorkflowProviderDTO,\r\n SAYTOptionDTO,\r\n SearchResultDTO,\r\n SearchCountResultDTO,\r\n SearchRequestDTO,\r\n SearchFilterDTO,\r\n UserPrincipalDTO,\r\n GroupPrincipalDTO,\r\n ExtraAttributesEmbeddedGridDTO,\r\n SortDirectionEnum,\r\n ItemLinkTypeEnum,\r\n ActivitiesDTO,\r\n NewFormTypeEnum,\r\n LookupValuesResultDTO,\r\n FormLookupTypeEnum,\r\n NewsFeedDTO,\r\n SubscribeResponseDTO,\r\n UserSettingsResultDTO,\r\n SearchFormInfoDTO,\r\n UserSettingsDTO,\r\n ItemFlowsConfigDTO,\r\n ItemFlowDirectionEnum,\r\n SendNotificationRequestDTO,\r\n SendDocumentsRequestDTO,\r\n NewItemResultDTO,\r\n RasterMapResultDTO,\r\n ReminderDTO,\r\n ShareDTO,\r\n TransferItemRequestDTO,\r\n // SearchValueTypeEnum\r\n} from \"data/types\";\r\n\r\nimport { getGeoRasterProvider } from \"components/MapViewer/providerSupport\";\r\n\r\n/**\r\n * ApiCatalog defines ALL WebApi methods provided by inPoint.Web.Server.\r\n *\r\n * Each method is identified by name (the \"key\"), and the value is the metadata:\r\n * - url (without the __api/ prefix); e.g. \"/user/cards\"\r\n * - HTTP method (per default GET)\r\n *\r\n * Cache: caching settings for:\r\n * 1. resilience - unstable network connection\r\n * Cached by service-worker.custom.js; do not define to use default caching strategy,\r\n * set to false to always avoid caching (equals to CacheStrategy.NetworkOnly) or define\r\n * extra properties as such:\r\n * - strategy: defaults to CacheStrategy.StaleWhileRevalidate\r\n * Available: None, StaleWhileRevalidate, CacheFirst, NetworkFirst, NetworkOnly, CacheOnly\r\n *\r\n * 2. offline items - fully synchronized for full offline work.\r\n * Handled by ApiManagerMakeAvailableOffline.js, uses following cache settings:\r\n * - keyParams: per default the URL is used as the CacheKey - here you can\r\n * optionally choose to omit/add other params\r\n * - transformer: transform the original body (only JSON) before caching\r\n * - depsAnalyzer: define which other dependencies exist for the current method\r\n * (note: you can view the latest dependency tree with CommandAction offline_depsMap)\r\n *\r\n * Notes:\r\n * - resilience is currently only for GET methods\r\n * - while online the caching is handled by service-worker.js; when offline it's\r\n * done directly by ApiManager (since Workbox can only check ONE specific Cache\r\n * and we might have items across multiple ones)\r\n * - caching of offline items (\"synchronization\") is handled only by ApiManagerMakeAvailableOffline;\r\n * this includes GET/PUT/POST methods\r\n * -\r\n */\r\n\r\nexport /* istanbul ignore next*/ const ApiCatalog: Dictionary<\r\n string,\r\n ApiMethod\r\n> = {\r\n //#region User\r\n\r\n /**\r\n * @returns {UserInfoResultDTO}\r\n */\r\n fetchUser: {\r\n url: \"/user\",\r\n cache: {\r\n strategy: CacheStrategy.NetworkFirst,\r\n },\r\n },\r\n\r\n /**\r\n * @returns {Array}\r\n */\r\n fetchSites: {\r\n url: \"/user/sites\",\r\n cache: {\r\n strategy: CacheStrategy.NetworkFirst,\r\n },\r\n },\r\n\r\n /**\r\n * @returns {Array}\r\n */\r\n fetchCards: {\r\n url: \"/user/cards\",\r\n cache: {\r\n strategy: CacheStrategy.NetworkFirst,\r\n },\r\n },\r\n /**\r\n * @returns {Array}\r\n */\r\n fetchCardsByEntity: {\r\n url: \"/user/cards\",\r\n method: HttpMethod.POST,\r\n cache: {\r\n strategy: CacheStrategy.NetworkFirst,\r\n },\r\n },\r\n\r\n /**\r\n * @returns {UserSettingsResultDTO}\r\n */\r\n fetchUserSettings: {\r\n url: \"/user/settings\",\r\n },\r\n\r\n /**\r\n * @param {UserSettingsDTO} settings\r\n * @returns {boolean}\r\n */\r\n saveUserSettings: {\r\n method: HttpMethod.POST,\r\n url: \"/user/settings\",\r\n },\r\n\r\n /**\r\n * @returns {NewsFeedDTO}\r\n */\r\n fetchNews: {\r\n url: \"/user/feed\",\r\n cache: {\r\n strategy: CacheStrategy.NetworkFirst,\r\n },\r\n },\r\n\r\n // ----- favorites\r\n\r\n /**\r\n * @returns {Array}\r\n */\r\n fetchFavorites: {\r\n url: \"/user/fav\",\r\n cache: {\r\n strategy: CacheStrategy.NetworkFirst,\r\n },\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @param {string} name\r\n * @returns {boolean}\r\n */\r\n addFavorite: {\r\n method: HttpMethod.PUT,\r\n url: \"/user/fav\",\r\n offline: {\r\n allowEdit: true,\r\n transformer: () => true,\r\n },\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @returns {boolean}\r\n */\r\n delFavorite: {\r\n method: HttpMethod.DELETE,\r\n url: \"/user/fav\",\r\n offline: {\r\n allowEdit: true,\r\n transformer: () => true,\r\n },\r\n },\r\n\r\n /**\r\n * @param {SearchRequestDTO} searchRequest\r\n * @returns {boolean}\r\n */\r\n addSearchFavorite: {\r\n method: HttpMethod.PUT,\r\n url: \"/search/fav\",\r\n },\r\n\r\n /**\r\n * @param {number} linkId\r\n * @returns {boolean}\r\n */\r\n delFavoriteLink: {\r\n method: HttpMethod.DELETE,\r\n url: \"/user/fav\",\r\n offline: {\r\n allowEdit: true,\r\n transformer: () => true,\r\n },\r\n },\r\n\r\n // ----- mails\r\n\r\n // TODO move to /item/mail\r\n /**\r\n * @param {SendNotificationRequestDTO} request\r\n * @returns {boolean}\r\n */\r\n sendMail: {\r\n method: HttpMethod.POST,\r\n url: \"/user/mail\",\r\n },\r\n\r\n // TODO move to /item/mail/doc\r\n /**\r\n * @param {SendDocumentsRequestDTO} request\r\n * @returns {boolean}\r\n */\r\n sendMailAttachments: {\r\n method: HttpMethod.POST,\r\n url: \"/user/maildoc\",\r\n },\r\n //#endregion\r\n\r\n //#region Items\r\n /**\r\n * @param {string} itemUri\r\n * @returns {BreadcrumbResultDTO}\r\n */\r\n fetchBreadcrumb: {\r\n url: \"/folder/breadcrumb\",\r\n },\r\n\r\n // ----- Reminders\r\n /**\r\n * @param {string} itemUri\r\n * @returns {Array}\r\n */\r\n fetchReminders: {\r\n url: \"/item/reminders\",\r\n },\r\n\r\n /**\r\n * @param {ReminderDTO} reminderRequest\r\n * @returns {number}\r\n */\r\n upsertReminder: {\r\n method: HttpMethod.POST,\r\n url: \"/item/reminder\",\r\n },\r\n\r\n /**\r\n * @param {number} reminderId\r\n * @param {string} itemUri\r\n * @returns {number}\r\n */\r\n deleteReminder: {\r\n method: HttpMethod.DELETE,\r\n url: \"/item/reminder\",\r\n },\r\n\r\n // ----- shares\r\n /**\r\n * @param {string} itemUri\r\n * @returns {ShareDTO}\r\n */\r\n fetchShare: {\r\n url: \"/item/share\",\r\n },\r\n\r\n /**\r\n * @param {ShareDTO} shareRequest\r\n * @returns {boolean}\r\n */\r\n createShare: {\r\n method: HttpMethod.POST,\r\n url: \"/item/share\",\r\n },\r\n\r\n /**\r\n * @param {ShareDTO} shareRequest\r\n * @returns {boolean}\r\n */\r\n updateShare: {\r\n method: HttpMethod.PUT,\r\n url: \"/item/share\",\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @returns {boolean}\r\n */\r\n deleteShare: {\r\n method: HttpMethod.DELETE,\r\n url: \"/item/share\",\r\n },\r\n\r\n /**\r\n * @param {Array} itemUris\r\n * @param {Array} webDavName\r\n * @returns {Array}\r\n */\r\n checkShareName: {\r\n method: HttpMethod.POST,\r\n url: \"/item/share/unique\",\r\n },\r\n\r\n /**\r\n * @param {Array} itemUris\r\n * @param {Array} formatIds\r\n * @returns {ShareContextDTO}\r\n */\r\n fetchShareContext: {\r\n method: HttpMethod.POST,\r\n url: \"/item/share/context\",\r\n },\r\n // ----- items\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @returns {Array}\r\n */\r\n fetchActivities: {\r\n url: \"/item/activity\",\r\n },\r\n\r\n /**\r\n * @returns {Array}\r\n */\r\n fetchOfflineItems: {\r\n url: \"/offline/all\",\r\n cache: {\r\n strategy: CacheStrategy.NetworkFirst,\r\n },\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @returns {string} guid or null\r\n */\r\n addOfflineItem: {\r\n method: HttpMethod.POST,\r\n url: \"/offline\",\r\n offline: {\r\n allowEdit: true,\r\n transformer: () => crypto.randomUUID(), //TODO: Fix for WebKit < 92,\r\n },\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @returns {boolean} success\r\n */\r\n delOfflineItem: {\r\n method: HttpMethod.DELETE,\r\n url: \"/offline\",\r\n offline: {\r\n allowEdit: true,\r\n transformer: () => true,\r\n },\r\n },\r\n\r\n // called directly by service-worker.custom.js\r\n // /**\r\n // * @returns {Array}\r\n // */\r\n // fetchOfflinePrecache: {\r\n // // TODO move fetchOfflinePrecache to /user (or /offline?)\r\n // url: \"offline/precache\",\r\n // cache: {\r\n // strategy: CacheStrategy.NetworkOnly,\r\n // },\r\n // },\r\n\r\n context: {\r\n method: HttpMethod.POST,\r\n url: \"/item/context\",\r\n cache: {\r\n strategy: CacheStrategy.NetworkFirst,\r\n keyParams: (params) => ({\r\n itemUri: params.itemUris.length === 1 && params.itemUris[0],\r\n }),\r\n depsAnalyzer: (data: ItemContextDTO, params: Object) => {\r\n const itemUri = params.itemUris?.[0];\r\n const formatId = params.formatIds?.[0];\r\n const {\r\n isDoc,\r\n isPdf,\r\n canPdf,\r\n hasPdf,\r\n isReadonly,\r\n ext,\r\n isEditAllowed,\r\n } = data || {};\r\n const depsApis = [];\r\n if (isDoc) {\r\n depsApis.push({\r\n name: \"fetchDownloadToken\",\r\n params: {\r\n itemUri,\r\n pdf: window.CONFIG.general.imageViewerExtensions.includes(\r\n String(ext).toLowerCase()\r\n )\r\n ? undefined\r\n : hasPdf || isPdf || canPdf || undefined,\r\n stream:\r\n window.CONFIG.general.mediaViewerExtensions.includes(\r\n String(ext).toLowerCase()\r\n ) || undefined,\r\n },\r\n transformer: (token) => itemUri,\r\n });\r\n depsApis.push({\r\n name: \"fetchThumbnail\",\r\n params: { itemUri },\r\n });\r\n } else if (!isReadonly) {\r\n depsApis.push({\r\n name: \"fetchItemFlows\",\r\n params: {\r\n dir: \"in\",\r\n itemUri,\r\n },\r\n });\r\n }\r\n // TODO #54607 appSettings offline specs - allow editing\r\n if (isEditAllowed) {\r\n depsApis.push(\r\n {\r\n name: \"fetchNewForm\",\r\n params: { itemUri },\r\n },\r\n {\r\n name: \"validateForm\",\r\n params: {\r\n itemUri,\r\n isDoc,\r\n values: {},\r\n },\r\n }\r\n );\r\n // parse inPoint.Fields\r\n if (params.fields?.length > 0) {\r\n for (const field of params.fields) {\r\n switch (field.format) {\r\n case \"Text_LookupRep\":\r\n //lint -fallthrough\r\n case \"Text_Lookup\":\r\n depsApis.push({\r\n name: \"fetchFormLookup\",\r\n params: {\r\n filters: [],\r\n formatId,\r\n id: field.id,\r\n name: field.name,\r\n pageNum: 0,\r\n isDoc,\r\n lookupType: 0,\r\n keyword: \"\",\r\n itemUri,\r\n },\r\n });\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // parse ExtraAttributes\r\n if (params.attributes?.length > 0) {\r\n for (const ea of params.attributes) {\r\n switch (ea.format) {\r\n case \"Lookup_Combo\":\r\n depsApis.push({\r\n name: \"fetchFormLookup\",\r\n params: {\r\n filters: [],\r\n formatId,\r\n id: ea.id,\r\n name: ea.name,\r\n pageNum: 0,\r\n isDoc,\r\n lookupType: 1,\r\n keyword: \"\",\r\n itemUri,\r\n },\r\n });\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n return depsApis;\r\n },\r\n },\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @param {string} name\r\n * @returns {boolean}\r\n */\r\n subscribe: {\r\n method: HttpMethod.PUT,\r\n url: \"/item/subscribe\",\r\n offline: {\r\n allowEdit: true,\r\n },\r\n },\r\n\r\n // TODO should be /item/subscribe\r\n /**\r\n * @param {string} itemUri\r\n * @returns {SubscribeResponseDTO}\r\n */\r\n isSubscribed: {\r\n url: \"/item/subscribed\",\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @returns {boolean}\r\n */\r\n unsubscribeByItemUri: {\r\n method: HttpMethod.DELETE,\r\n url: \"/item/subscribe\",\r\n offline: {\r\n allowEdit: true,\r\n transformer: () => true,\r\n },\r\n },\r\n\r\n // TODO should be /item/subscribe/{id}\r\n /**\r\n * @param {string} itemUri\r\n * @param {number} linkID\r\n * @returns {boolean}\r\n */\r\n unsubscribeById: {\r\n method: HttpMethod.DELETE,\r\n url: \"/item/subscribeById\",\r\n offline: {\r\n allowEdit: true,\r\n transformer: () => true,\r\n },\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @returns {boolean}\r\n */\r\n delDefiniteItemUri: {\r\n method: HttpMethod.DELETE,\r\n url: \"/item/deleteDefinite\",\r\n offline: {\r\n allowEdit: true,\r\n transformer: () => true,\r\n },\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @returns {boolean}\r\n */\r\n restoreItemUri: {\r\n method: HttpMethod.PUT,\r\n url: \"/item/restore\",\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @returns {FormResultDTO}\r\n */\r\n fetchForm: {\r\n url: \"/item/form\",\r\n cache: {\r\n strategy: CacheStrategy.NetworkFirst,\r\n depsAnalyzer: (data: FormResultDTO, params: Object) => {\r\n const depsApis = [\r\n {\r\n name: \"fetchBreadcrumb\",\r\n params: { itemUri: params.itemUri },\r\n },\r\n {\r\n name: \"context\",\r\n params: {\r\n itemUris: [params.itemUri],\r\n formatIds: [data.formatId],\r\n itemContexts: ItemContextsFlags.All,\r\n fields: data.fields,\r\n attributes: data.attributes,\r\n },\r\n },\r\n {\r\n name: \"fetchActivities\",\r\n params: { itemUri: params.itemUri },\r\n },\r\n ];\r\n\r\n // parse inPoint.Fields\r\n if (data.fields && data.fields.length > 0) {\r\n for (const field of data.fields) {\r\n switch (field.format) {\r\n case \"Text_GeoRaster\":\r\n const mapProvider = getGeoRasterProvider(\r\n params.itemUri,\r\n data.formatId\r\n );\r\n if (mapProvider == null) {\r\n console.warn(\r\n `Text_GeoRaster field ${field.name} - could not find mapProvider for ${params.itemUri}`\r\n );\r\n } else {\r\n depsApis.push({\r\n name: \"fetchRasterMapLayers\",\r\n params: {\r\n itemUri: params.itemUri,\r\n rasterMapIdSelector:\r\n mapProvider.rasterMapIdSelector,\r\n },\r\n });\r\n }\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // parse ExtraAttributes\r\n if (data.attributes && data.attributes.length > 0) {\r\n for (const ea of data.attributes) {\r\n switch (ea.format) {\r\n case \"SearchResult\":\r\n // HACK not sure how to discover those dynamically?\r\n const mapProvider = getGeoRasterProvider(\r\n params.itemUri,\r\n data.formatId\r\n );\r\n if (mapProvider == null) {\r\n console.warn(\r\n `EA.SearchResult attribute ${ea.name} - could not find mapProvider for ${params.itemUri}`\r\n );\r\n } else {\r\n depsApis.push({\r\n name: \"fetchRasterMapLayers\",\r\n params: {\r\n itemUri: params.itemUri,\r\n rasterMapIdSelector:\r\n mapProvider.rasterMapIdSelector,\r\n },\r\n });\r\n }\r\n depsApis.push({\r\n name: \"fetchSearchResult\",\r\n params: {\r\n itemUri: params.itemUri,\r\n name: ea.name,\r\n pageNum: 0,\r\n filters: ea.extra.filters,\r\n searchType: SearchRequestType.Url,\r\n scope: SearchScope.CurrentFolder,\r\n },\r\n });\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n }\r\n return depsApis;\r\n },\r\n },\r\n },\r\n\r\n /**\r\n * @param {boolean} isNew\r\n * @param {boolean} isDoc\r\n * @param {string} itemUri\r\n * @param {Object} values\r\n * @returns {Object}\r\n */\r\n validateForm: {\r\n method: HttpMethod.POST,\r\n url: \"/item/form/validate\",\r\n cache: {\r\n strategy: CacheStrategy.NetworkOnly,\r\n keyParams: (params) => ({\r\n itemUri: params.itemUri,\r\n isDoc: params.isDoc,\r\n }),\r\n },\r\n offline: {\r\n allowEdit: true,\r\n showToast: false,\r\n transformer: () => ({}), // return no errors on offline so we can continue\r\n },\r\n },\r\n\r\n /**\r\n * @param {NewFormTypeEnum} formType\r\n * @param {string} itemUri\r\n * @returns {FormResultDTO}\r\n */\r\n fetchNewForm: {\r\n url: \"/doc/newform\",\r\n params: ({ itemUri }) => ({ itemUri }),\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @returns {boolean}\r\n */\r\n delItemUri: {\r\n method: HttpMethod.DELETE,\r\n url: \"/item\",\r\n offline: {\r\n allowEdit: true,\r\n transformer: () => true,\r\n },\r\n },\r\n\r\n /**\r\n * @param {string} keyword\r\n * @param {number} pageNum\r\n * @param {boolean} isDoc\r\n * @param {number} formatId\r\n * @param {string} name\r\n * @param {FormLookupTypeEnum} lookupType\r\n * @param {number} id\r\n * @param {Array} filters\r\n * @param {string} itemUri\r\n * @returns {LookupValuesResultDTO}\r\n */\r\n fetchFormLookup: {\r\n method: HttpMethod.POST,\r\n url: \"/item/form/lookup\",\r\n cache: {\r\n strategy: CacheStrategy.CacheFirst,\r\n keyParams: (params) => ({\r\n formatId: params.formatId,\r\n name: params.name,\r\n pageNum: params.pageNum,\r\n }),\r\n depsAnalyzer: (data: LookupValuesResultDTO, params: Object) => {\r\n // TODO #54607 appSettings offline specs\r\n const allowEdit = true;\r\n const depsApis = [];\r\n // recursively load all pages\r\n // TODO #54607 appSettings offline specs - limit number of lookup pages to cache\r\n if (allowEdit && data.hasMore) {\r\n depsApis.push({\r\n name: \"fetchFormLookup\",\r\n params: Object.assign({}, params, {\r\n pageNum: params.pageNum + 1,\r\n }),\r\n });\r\n }\r\n return depsApis;\r\n },\r\n },\r\n },\r\n\r\n /**\r\n * @param {boolean} isDoc\r\n * @param {number} formatId\r\n * @param {string} name\r\n * @param {FormLookupTypeEnum} lookupType\r\n * @param {Array} currentLookupValues\r\n * @param {string} itemUri\r\n * @returns {Array}\r\n */\r\n fetchFormLookupDependencies: {\r\n method: HttpMethod.POST,\r\n url: \"/item/form/lookup/dependencies\",\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @param {string} name\r\n * @param {string} filter\r\n * @param {number} pageNum\r\n * @param {string} sortColumn\r\n * @param {SortDirectionEnum} sortDirection\r\n * @returns {ExtraAttributesEmbeddedGridDTO}\r\n */\r\n fetchExtraAttributesEmbeddedGrid: {\r\n url: \"/folder/form/grid\",\r\n cache: {\r\n strategy: CacheStrategy.CacheFirst,\r\n },\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @param {number} formatId\r\n * @param {Object} values\r\n * @returns {boolean}\r\n */\r\n saveForm: {\r\n method: HttpMethod.POST,\r\n url: \"/item/form\",\r\n offline: {\r\n allowEdit: true,\r\n },\r\n },\r\n\r\n /**\r\n * @param {string} templateId\r\n * @param {string} itemUri\r\n * @param {Object} values\r\n * @returns {bool}\r\n */\r\n saveNewDocFromTemplate: {\r\n method: HttpMethod.PUT,\r\n url: \"/doc/doctemplate\",\r\n offline: {\r\n allowEdit: true,\r\n transformer: () => true,\r\n },\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @param {number} pageNum\r\n * @param {DocListSortRequestDTO | Array} sorts\r\n * @param {Array} filters\r\n * @param {Array} cols\r\n * @returns {DocsResultDTO}\r\n */\r\n fetchDocs: {\r\n method: HttpMethod.POST,\r\n url: \"/folder/docs\",\r\n params: ({\r\n itemUri,\r\n pageNum = 0,\r\n sorts = [],\r\n filters = [],\r\n cols,\r\n }: {\r\n itemUri: string,\r\n pageNum?: number,\r\n sorts?: DocListSortRequestDTO | Array,\r\n filters?: Array,\r\n cols?: Array,\r\n }) => ({\r\n itemUri,\r\n pageNum: pageNum || 0,\r\n sorts: sorts != null && !Array.isArray(sorts) ? [sorts] : sorts,\r\n filters,\r\n cols,\r\n }),\r\n cache: {\r\n keyParams: (params) => ({\r\n itemUri: params.itemUri,\r\n pageNum: params.pageNum,\r\n }),\r\n depsAnalyzer: (data: DocsResultDTO, params: Object) => {\r\n let depsApis = [];\r\n if (data.rowCount > 0 && data.rows) {\r\n for (let rowKey of Object.keys(data.rows)) {\r\n const row = data.rows[rowKey];\r\n const itemUri = row[row.length - 1];\r\n depsApis.push({\r\n name: \"fetchForm\",\r\n params: { itemUri },\r\n });\r\n }\r\n }\r\n return depsApis;\r\n },\r\n },\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @param {DocListSortRequestDTO | Array} sorts\r\n * @param {Array} filters\r\n * @returns {any}\r\n */\r\n fetchDocsCsv: {\r\n method: HttpMethod.POST,\r\n contentType: ContentType.BLOB,\r\n url: \"/folder/docs_csv\",\r\n params: ({\r\n itemUri,\r\n sorts = [],\r\n filters = [],\r\n }: {\r\n itemUri: string,\r\n sorts?: DocListSortRequestDTO | Array,\r\n filters?: Array,\r\n }) => ({\r\n itemUri,\r\n sorts: sorts != null && !Array.isArray(sorts) ? [sorts] : sorts,\r\n filters,\r\n }),\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @param {Array} filters\r\n * @returns {number}\r\n */\r\n fetchDocCount: {\r\n method: HttpMethod.POST,\r\n url: \"/folder/doccount\",\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @param {number} version\r\n * @returns {boolean}\r\n */\r\n delDocVersion: {\r\n method: HttpMethod.DELETE,\r\n url: \"/doc/version\",\r\n offline: {\r\n allowEdit: true,\r\n transformer: () => true,\r\n },\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @param {number} version\r\n * @returns {boolean}\r\n */\r\n restoreDocVersion: {\r\n method: HttpMethod.PUT,\r\n url: \"/doc/version\",\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @returns {string}\r\n */\r\n fetchDownloadToken: {\r\n url: \"/doc/token\",\r\n cache: {\r\n strategy: CacheStrategy.None,\r\n keyParams: ({ itemUri }) => ({\r\n itemUri,\r\n }),\r\n depsAnalyzer: (token: GUID, params: Object) => {\r\n const { pdf = undefined, stream = undefined, itemUri } = params;\r\n const depsApis = [];\r\n depsApis.push({\r\n name: \"fetchDocument\",\r\n params: {\r\n token,\r\n pdf,\r\n stream,\r\n // fake for offline cache to be used only by fetchDocument/cache/keyParams\r\n itemUri,\r\n },\r\n });\r\n return depsApis;\r\n },\r\n },\r\n },\r\n\r\n /**\r\n * @param {string} token\r\n * @param {string} uri\r\n * @param {boolean} inline\r\n * @param {boolean} pdf\r\n * @param {boolean} stream\r\n * NOTE: api.js only returns URL, we return Content for offline caching\r\n */\r\n fetchDocument: {\r\n url: \"/doc/download\",\r\n cache: {\r\n strategy: CacheStrategy.None,\r\n // fake \"itemUri\" as token for offline cache\r\n keyParams: ({ pdf, stream, itemUri: token }) => {\r\n const params = { token };\r\n if (pdf) params.pdf = pdf;\r\n if (stream) params.stream = stream;\r\n return params;\r\n },\r\n },\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @returns {string}\r\n */\r\n fetchThumbnail: {\r\n url: \"/doc/thumbnail\",\r\n cache: {\r\n strategy: CacheStrategy.CacheFirst,\r\n },\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @param {ItemLinkTypeEnum} itemLinkType\r\n * @param {boolean} getSource\r\n * @returns {Array}\r\n */\r\n fetchRelatedDocs: {\r\n url: \"/doc/related\",\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @param {string} webDavName\r\n * @returns {string}\r\n */\r\n getWebDavHttpLink: {\r\n url: \"/doc/webdav\",\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @param {string} webDavName\r\n * @returns {Array}\r\n */\r\n getCloudInfo: {\r\n url: \"/doc/cloudinfo\",\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @returns {boolean}\r\n */\r\n lock: {\r\n method: HttpMethod.PUT,\r\n url: \"/doc/lock\",\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @returns {boolean}\r\n */\r\n unlock: {\r\n method: HttpMethod.DELETE,\r\n url: \"/doc/lock\",\r\n },\r\n\r\n // ----- folders\r\n\r\n //TODO shouldn't this be in /item or /user?\r\n /**\r\n * @param {boolean} offline\r\n * @returns {Array}\r\n */\r\n getArchiveTargets: {\r\n url: \"/folder/archivetargets\",\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @param {string} filter\r\n * @param {boolean} deep\r\n * @param {boolean} all\r\n * @returns {TreeDTO}\r\n */\r\n fetchTree: {\r\n url: \"/folder/tree\",\r\n params: ({ itemUri, filter = \"\", deep = false, all = false }) => ({\r\n itemUri,\r\n filter,\r\n deep,\r\n all,\r\n }),\r\n cache: {\r\n keyParams: (params) => ({\r\n itemUri: params.itemUri,\r\n }),\r\n depsAnalyzer: (data: TreeDTO, params) => {\r\n const { itemUri } = params;\r\n const depsApis = [\r\n // current details\r\n {\r\n name: \"fetchForm\",\r\n params: { itemUri },\r\n },\r\n {\r\n name: \"fetchDocs\",\r\n params: { itemUri },\r\n },\r\n ];\r\n\r\n if (data.totalCount > 0 && data.items) {\r\n for (const treeNode of data.items) {\r\n depsApis.push(\r\n // recursive children\r\n {\r\n name: \"fetchTree\",\r\n params: {\r\n itemUri: treeNode.itemUri,\r\n deep: false,\r\n all: true, // no paging\r\n },\r\n }\r\n );\r\n }\r\n }\r\n return depsApis;\r\n },\r\n },\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @param {number} formatId\r\n * @param {number} elementType\r\n * @param {Object} values\r\n * @returns {NewItemResultDTO}\r\n */\r\n createFolder: {\r\n method: HttpMethod.PUT,\r\n url: \"/folder/form\",\r\n offline: {\r\n allowEdit: true,\r\n transformer: () => ({ success: true }), // return no errors on offline so we can continue\r\n // transformer: (params) => ({\r\n // success: true,\r\n // itemUri: \"pam-item://FAKEID1\",\r\n // name: params.values.ip[\"$NAME$\"],\r\n // formatId: params.formatId,\r\n // elementType: params.elementType,\r\n // }),\r\n },\r\n },\r\n\r\n /**\r\n * @param {string} template\r\n * @param {string} itemUri\r\n * @param {string} targetFolderName\r\n * @returns {number}\r\n */\r\n createFolderFromTemplate: {\r\n method: HttpMethod.PUT,\r\n url: \"/folder/template\",\r\n offline: {\r\n allowEdit: true,\r\n transformer: () => ({ success: true }), // return no errors on offline so we can continue\r\n },\r\n },\r\n\r\n /**\r\n * @param {number} jobId\r\n * @returns {string}\r\n */\r\n createFolderTemplateGetItemUri: {\r\n url: \"/folder/templatejob\",\r\n },\r\n\r\n // ----- itemNotes\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @param {number} noteId\r\n * @returns {any}\r\n */\r\n fetchItemNote: {\r\n method: HttpMethod.GET,\r\n url: \"/item/note\",\r\n },\r\n\r\n /**\r\n * @param {ActivityDTO} activity\r\n * @returns {any}\r\n */\r\n addItemNote: {\r\n method: HttpMethod.POST,\r\n url: \"/item/note\",\r\n offline: {\r\n allowEdit: true,\r\n },\r\n },\r\n\r\n /**\r\n * @param {ActivityDTO} activity\r\n * @returns {any}\r\n */\r\n updateItemNote: {\r\n method: HttpMethod.PUT,\r\n url: \"/item/note\",\r\n offline: {\r\n allowEdit: true,\r\n },\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @param {number} noteId\r\n * @returns {any}\r\n */\r\n deleteItemNote: {\r\n method: HttpMethod.DELETE,\r\n url: \"/item/note\",\r\n offline: {\r\n allowEdit: true,\r\n },\r\n },\r\n\r\n // ----- itemFlows\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @param {ItemFlowDirectionEnum} dir\r\n * @returns {ItemFlowsConfigDTO}\r\n */\r\n fetchItemFlows: {\r\n url: \"/item/flows\",\r\n cache: {\r\n // transformer to remove custom flows using iframes!\r\n transformer: (data: ItemFlowsConfigDTO) =>\r\n data.flows &&\r\n data.flows.length > 0 &&\r\n data.flows.filter(\r\n (flow) => flow.commandAction.name !== \"itemFlow_custom\"\r\n ),\r\n depsAnalyzer: (data: ItemFlowsConfigDTO, params: Object) => {\r\n const depsApi = [];\r\n if (data.flows && data.flows.length > 0) {\r\n for (const flow of data.flows) {\r\n // TODO #54607 appSettings flow specs - which itemFlows to allow/pre-cache offline\r\n // components/CommandActions/itemFlows/Factory.js\r\n switch (flow.commandAction.name) {\r\n case \"itemFlow_custom\":\r\n break;\r\n case \"itemFlow_folder\":\r\n depsApi.push({\r\n name: \"fetchItemFlowForm\",\r\n params: {\r\n formType: NewFormType.Folder,\r\n itemUri: params.itemUri,\r\n templateType:\r\n ItemFlowTemplateType.Folder,\r\n templateId:\r\n flow.commandAction.props.templateId,\r\n },\r\n });\r\n break;\r\n case \"itemFlow_folderTemplate\":\r\n depsApi.push({\r\n name: \"fetchItemFlowForm\",\r\n params: {\r\n formType: NewFormType.Folder,\r\n itemUri: params.itemUri,\r\n templateType:\r\n ItemFlowTemplateType.FolderTemplate,\r\n templateId:\r\n flow.commandAction.props.templateId,\r\n },\r\n });\r\n break;\r\n case \"itemFlow_document\":\r\n depsApi.push({\r\n name: \"fetchItemFlowForm\",\r\n params: {\r\n formType: NewFormType.Document,\r\n itemUri: params.itemUri,\r\n templateType:\r\n ItemFlowTemplateType.Document,\r\n templateId:\r\n flow.commandAction.props.templateId,\r\n },\r\n });\r\n break;\r\n case \"itemFlow_docTemplate\":\r\n depsApi.push({\r\n name: \"fetchItemFlowForm\",\r\n params: {\r\n formType: NewFormType.Document,\r\n itemUri: params.itemUri,\r\n templateType:\r\n ItemFlowTemplateType.DocTemplate,\r\n templateId:\r\n flow.commandAction.props.templateId,\r\n },\r\n });\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n }\r\n return depsApi;\r\n },\r\n },\r\n },\r\n\r\n /**\r\n * @param {NewFormTypeEnum} formType\r\n * @param {string} itemUri\r\n * @param {string} templateId\r\n * @param {string} templateType\r\n * @returns {FormResultDTO}\r\n */\r\n fetchItemFlowForm: {\r\n url: \"/item/flows/form\",\r\n },\r\n\r\n // ----- search\r\n /**\r\n * @returns {Array}\r\n */\r\n fetchSearchFormList: {\r\n url: \"/search/list\",\r\n },\r\n\r\n /**\r\n * @param {number} id\r\n * @param {Object} values\r\n * @returns {SearchFormResultDTO}\r\n */\r\n fetchSearchForm: {\r\n method: HttpMethod.POST,\r\n url: \"/search/form\",\r\n },\r\n\r\n //#endregion\r\n\r\n //#region Workflows\r\n /**\r\n * @returns {Array}\r\n */\r\n fetchWorkflowProviders: {\r\n url: \"/workflow/providers\",\r\n },\r\n\r\n /**\r\n * @returns {Array}\r\n */\r\n fetchWorkflowCards: {\r\n url: \"/workflow/cards\",\r\n },\r\n\r\n /**\r\n * @param {string} itemUri\r\n * @returns {Array}\r\n */\r\n fetchNewWorkflows: {\r\n url: \"/workflow/new\",\r\n },\r\n\r\n /**\r\n * @param {string} provider\r\n * @param {string} wfID\r\n * @param {string} itemUri\r\n * @returns {Array}\r\n */\r\n fetchWorkflowInfo: {\r\n url: \"/workflow/info\",\r\n },\r\n //#endregion\r\n\r\n //#region Raster maps\r\n /**\r\n * @param {string} itemUri\r\n * @param {string} rasterMapIdSelector\r\n * @param {boolean} create\r\n * @returns {RasterMapResultDTO}\r\n */\r\n fetchRasterMapLayers: {\r\n url: \"/map/raster/layers\",\r\n },\r\n\r\n /**\r\n * @param {RasterMapSaveRequestDTO} map\r\n * @returns {RasterMapResultDTO}\r\n */\r\n saveRasterMapLayers: {\r\n method: HttpMethod.POST,\r\n url: \"/map/raster/layers\",\r\n },\r\n //#endregion\r\n\r\n //#region Search\r\n /**\r\n * @param {string} keyword\r\n * @param {string} itemUri\r\n * @returns {Array}\r\n */\r\n fetchSAYT: {\r\n url: \"/search/sayt\",\r\n cache: {\r\n strategy: CacheStrategy.CacheFirst,\r\n },\r\n },\r\n\r\n /**\r\n * @param {SearchRequestDTO} searchRequest\r\n * @returns {SearchCountResultDTO}\r\n */\r\n fetchSearchCount: {\r\n method: HttpMethod.PUT,\r\n url: \"/search/count\",\r\n cache: {\r\n strategy: CacheStrategy.CacheFirst,\r\n },\r\n },\r\n\r\n /**\r\n * @param {SearchRequestDTO} searchRequest\r\n * @returns {SearchResultDTO}\r\n */\r\n fetchSearchResult: {\r\n method: HttpMethod.PUT,\r\n url: \"/search\",\r\n cache: {\r\n keyParams: (params) => ({\r\n name: params.name,\r\n pageNum: params.pageNum,\r\n itemUri: params.itemUri,\r\n scope: params.scope,\r\n searchType: params.searchType,\r\n filters: JSON.stringify(params.filters),\r\n sorts: JSON.stringify(params.sorts),\r\n }),\r\n },\r\n },\r\n\r\n /**\r\n * @param {string} provider\r\n * @param {Array} filters\r\n * @returns {string}\r\n */\r\n fetchSearchSuggestion: {\r\n method: HttpMethod.PUT,\r\n url: \"/search/suggestion\",\r\n },\r\n\r\n /**\r\n * @param {string} keyword\r\n * @param {boolean} includeUsers\r\n * @param {boolean} includeGroups\r\n * @returns {Array}\r\n */\r\n fetchSearchPrincipal: {\r\n url: \"/search/principal\",\r\n cache: {\r\n strategy: CacheStrategy.CacheFirst,\r\n },\r\n },\r\n //#endregion\r\n\r\n //#region transfer\r\n /**\r\n * @param {string} provider\r\n * @param {TransferItemRequestDTO} transferRequest\r\n * @returns {bool}\r\n */\r\n transfer: {\r\n method: HttpMethod.POST,\r\n url: \"/item/transfer\",\r\n },\r\n //#endregion\r\n};\r\n","import \"whatwg-fetch\";\r\nimport { ApiCatalog } from \"data/ApiCatalog\";\r\nimport {\r\n HttpMethod,\r\n type HttpMethodEnum,\r\n ContentType,\r\n type ContentTypeEnum,\r\n CacheStrategy,\r\n type CacheSettings,\r\n CustomHttpHeader,\r\n} from \"data/types\";\r\nimport { isMiniView } from \"data/constants\";\r\nimport {\r\n HTTP_ERROR_CONFLICT,\r\n notifyOnError,\r\n ApiError,\r\n ApiErrorContainer,\r\n ApiNetworkError,\r\n ApiNetworkOfflineError,\r\n ApiConflictError,\r\n} from \"data/apiError\";\r\nimport { accessToken, correlationId, isOnline } from \"data/storeHelper\";\r\nimport { signinRedirect } from \"data/loginFlow\";\r\nimport qs from \"data/queryString\";\r\nimport { performanceTester } from \"data/utils\";\r\nimport { JL } from \"jsnlog\";\r\nimport { isLegacyResponseClone } from \"data/bowser\";\r\nimport cloneDeep from \"lodash/cloneDeep\";\r\n\r\n//#region AbortSignal\r\n// https://github.com/flow-typed/flow-typed/issues/1652\r\n// translation of https://dom.spec.whatwg.org/#abortcontroller\r\ndeclare interface AbortSignal extends EventTarget {\r\n +aborted: boolean;\r\n onabort: EventHandler;\r\n}\r\ndeclare class AbortController {\r\n +signal: AbortSignal;\r\n abort: () => void;\r\n}\r\n//#endregion\r\n\r\nexport type ContextRequest = {\r\n name: string,\r\n method: HttpMethodEnum,\r\n contentType: ContentTypeEnum,\r\n urlEnd: string,\r\n params: Object,\r\n cache: CacheSettings,\r\n};\r\n\r\nexport type Context = {\r\n request: ContextRequest,\r\n response?: Response,\r\n url: string,\r\n options: RequestInit,\r\n body?: any,\r\n};\r\n\r\n/**\r\n * Base implementation for API calls\r\n * TODO this is not meant to be used directly - a cache read-through (including offline) descendent WIP\r\n * @export\r\n * @class ApiManager\r\n * @abstract\r\n */\r\nexport default class ApiManagerBase {\r\n constructor() {\r\n this._log = JL(\"ApiManager\");\r\n this.call = this.call.bind(this);\r\n this.BeforeFetch = this.BeforeFetch.bind(this);\r\n this.OnFetch = this.OnFetch.bind(this);\r\n this.AfterFetch = this.AfterFetch.bind(this);\r\n this.CheckLicense = this.CheckLicense.bind(this);\r\n this.DecodeBody = this.DecodeBody.bind(this);\r\n this.CheckCustomError = this.CheckCustomError.bind(this);\r\n this.EOL = this.EOL.bind(this);\r\n }\r\n\r\n /**\r\n * Call an API method\r\n * @param {string} name API method name (from ApiCatalog)\r\n * @param {Object} params optional parameters\r\n * @param {AbortSignal} signal optional AbortSignal\r\n * @returns {Context} decoded response body\r\n * @memberof ApiManager\r\n * @protected\r\n */\r\n _callReturnContext = async (\r\n name: string,\r\n {\r\n params,\r\n signal,\r\n transformer,\r\n }?: {\r\n params?: Object,\r\n signal?: AbortSignal,\r\n transformer?: (data: Object) => Object,\r\n } = {}\r\n ): Promise => {\r\n if (name == null)\r\n throw new ApiError(\"You must provide the API method name!\");\r\n const meta = ApiCatalog[name];\r\n if (meta == null)\r\n throw new ApiError(`Could not find ${name} in ApiCatalog!`);\r\n let context: Context = {\r\n request: {\r\n name,\r\n method: meta.method ?? HttpMethod.GET,\r\n urlEnd: meta.url,\r\n params:\r\n typeof meta.params === \"function\"\r\n ? meta.params(params)\r\n : params,\r\n contentType: meta.contentType ?? ContentType.AUTO,\r\n cache: meta.cache,\r\n offline: meta.offline,\r\n transformer,\r\n signal,\r\n },\r\n };\r\n context = await this._pipeline(context);\r\n return context;\r\n };\r\n\r\n /**\r\n * Call an API method\r\n * @param {string} name API method name (from ApiCatalog)\r\n * @param {Object} params optional parameters\r\n * @param {AbortSignal} signal optional AbortSignal\r\n * @returns {any} decoded response body\r\n * @memberof ApiManager\r\n * @public\r\n */\r\n call = async (name: string, args?: Object = {}): Promise => {\r\n return (await this._callReturnContext(name, args)).body;\r\n };\r\n\r\n /**\r\n * encode request query parameters\r\n * @param {Object} data\r\n * @returns {string} encoded ready to add to URL (without ?)\r\n * @memberof ApiManager\r\n * @private\r\n */\r\n _encodeData = (data: Object): string => {\r\n // prefix ItemUris\r\n if (Object.prototype.hasOwnProperty.call(data, \"itemUri\")) {\r\n let itemUri = data.itemUri;\r\n if (itemUri && !itemUri.startsWith(\"pam-item://\")) {\r\n data.itemUri = \"pam-item://\" + itemUri;\r\n }\r\n }\r\n // stringify skipping empty values\r\n return qs.stringify(data, {\r\n filter: /* istanbul ignore next */ (prefix, value) =>\r\n value == null ? undefined : value,\r\n });\r\n };\r\n\r\n _getFullCacheKey = (context: Context): string => {\r\n if (context.request.cacheKey) {\r\n return `${window.CONFIG.host.basename}${window.CONFIG.general.api}${context.request.urlEnd}${context.request.cacheKey}`;\r\n }\r\n if (context.request.method === HttpMethod.GET) {\r\n return context.url;\r\n } else {\r\n // store api method name in cache URL to cover apis using same URL but different HTTP methods\r\n // e.g. fetchFavorites, addFavorite and delFavorite\r\n return `${context.url}?${this._encodeData({\r\n api: context.request.name,\r\n })}`;\r\n }\r\n };\r\n\r\n /**\r\n * Creates appropriate request HTTP headers\r\n * @param {Context} context query context\r\n * @returns {Headers} Headers collection\r\n * @memberof ApiManager\r\n * @private\r\n */\r\n _getHeaders = (context: Context): Headers => {\r\n const token: string = accessToken();\r\n /* istanbul ignore else */\r\n if (token == null) {\r\n this._log.error(\"No user token available!\");\r\n throw new ApiError(\"No user token available!\");\r\n }\r\n\r\n const headers = new Headers();\r\n headers.append(\"Accept\", \"application/json\"); //application/json -> to avoid OPTIONS pre-flight requests\r\n\r\n // Bearer Authorization header\r\n if (window.CONFIG.auth.useCustomAuthHeader) {\r\n headers.append(CustomHttpHeader.CustomAuthorization, token);\r\n } else {\r\n headers.append(CustomHttpHeader.Authorization, `Bearer ${token}`);\r\n }\r\n headers.append(CustomHttpHeader.CorrelationId, correlationId());\r\n\r\n // add cacheStrategy for our ServiceWorker to process (avoid a back-lookup)\r\n const { cache } = context.request;\r\n if (cache !== false) {\r\n headers.append(\r\n CustomHttpHeader.CacheStrategy,\r\n cache == null || cache === true\r\n ? CacheStrategy.NetworkFirst\r\n : cache.strategy || CacheStrategy.NetworkFirst\r\n );\r\n }\r\n\r\n // encode custom cacheKey for serviceWorker to use when storing in cache\r\n if (\r\n cache != null &&\r\n Object.prototype.hasOwnProperty.call(cache, \"keyParams\")\r\n ) {\r\n context.request.cacheKey = `?${this._encodeData(\r\n cache.keyParams(context.request.params)\r\n )}`;\r\n headers.append(CustomHttpHeader.CacheKey, context.request.cacheKey);\r\n }\r\n\r\n // passthrough original secureParams token\r\n if (window.CONFIG.general.secure_params) {\r\n headers.append(\r\n CustomHttpHeader.SecureParams,\r\n window.CONFIG.general.secure_params\r\n );\r\n }\r\n\r\n // passthrough original /mini view mode\r\n if (isMiniView(window.location)) {\r\n headers.append(CustomHttpHeader.MiniView, \"1\");\r\n }\r\n return headers;\r\n };\r\n\r\n /**\r\n * Handles failed Network requests\r\n * @param {Context} context query context\r\n * @memberof ApiManager\r\n * @private\r\n */\r\n _networkError = (context: Context): void => {\r\n this._log.error(() => ({\r\n msg: `${context.request.name}: OnFetch - Network request failed`,\r\n apiContext: context,\r\n }));\r\n throw new ApiNetworkOfflineError(\"Network request failed\", context);\r\n };\r\n\r\n /**\r\n * First chain method to prepare Request\r\n * @memberof ApiManager\r\n * @param {Context} context query context\r\n * @returns {Promise} current context\r\n * @virtual\r\n */\r\n async BeforeFetch(context: Context): Promise {\r\n this._log.debug(() => ({\r\n msg: `${context.request.name}: BeforeFetch`,\r\n apiContext: context,\r\n }));\r\n const { method, urlEnd, params, signal } = context.request;\r\n\r\n context.url = `${window.CONFIG.host.basename}${window.CONFIG.general.api}${urlEnd}`;\r\n if (\r\n params &&\r\n (method === HttpMethod.GET ||\r\n method === HttpMethod.DELETE ||\r\n method === HttpMethod.HEAD)\r\n ) {\r\n const urlParams = this._encodeData(params);\r\n if (urlParams && urlParams.length > 0) {\r\n context.url += `?${urlParams}`;\r\n }\r\n }\r\n\r\n context.options = {\r\n method,\r\n headers: this._getHeaders(context),\r\n credentials: \"include\",\r\n mode: \"cors\",\r\n body: undefined,\r\n signal,\r\n };\r\n\r\n /* istanbul ignore else */\r\n if (method === HttpMethod.PUT || method === HttpMethod.POST) {\r\n context.options.headers.append(\"Content-Type\", \"application/json\");\r\n context.options.body = JSON.stringify(params);\r\n }\r\n return context;\r\n }\r\n\r\n /**\r\n * Runs actual data fetch\r\n * @param {Context} context query context\r\n * @returns {Promise} current context with fetch .response\r\n * @memberof ApiManager\r\n * @virtual\r\n */\r\n async OnFetch(context: Context): Promise {\r\n this._log.debug(() => ({\r\n msg: `${context.request.name}: OnFetch`,\r\n apiContext: context,\r\n }));\r\n if (false === isOnline()) this._networkError(context);\r\n context.response = await fetch(context.url, context.options).catch(\r\n (e) => {\r\n // Handle Signal AbortErrors\r\n if (e.name === \"AbortError\") {\r\n throw e;\r\n }\r\n this._networkError(context);\r\n }\r\n );\r\n\r\n return context;\r\n }\r\n\r\n /**\r\n * First response in fetch response chain\r\n * @param {Context} context query context\r\n * @returns {Promise} current context\r\n * @memberof ApiManager\r\n * @virtual\r\n */\r\n async AfterFetch(context: Context): Promise {\r\n this._log.debug(() => ({\r\n msg: `${context.request.name}: AfterFetch`,\r\n apiContext: context,\r\n }));\r\n const { response } = context;\r\n /* istanbul ignore else */\r\n if (!response.ok) {\r\n // NotAuthorized? redirect\r\n if (response.status === 401) {\r\n signinRedirect();\r\n return context;\r\n }\r\n if (response.status === HTTP_ERROR_CONFLICT) {\r\n throw new ApiConflictError(\r\n response,\r\n await this._getErrorData(response)\r\n );\r\n }\r\n if (response.status !== 500 && response.status !== 408) {\r\n throw new ApiNetworkError(\r\n response,\r\n await this._getErrorData(response)\r\n );\r\n } else {\r\n // API errors also have HTTP 500 but include json for isError description\r\n const contentHeader = response.headers.get(\"content-type\");\r\n if (\r\n contentHeader == null ||\r\n contentHeader.indexOf(\"application/json\") === -1\r\n ) {\r\n // this is a different HTTP 500 not coming from API!\r\n throw new ApiNetworkError(\r\n response,\r\n await this._getErrorData(response)\r\n );\r\n }\r\n }\r\n }\r\n return context;\r\n }\r\n\r\n async _getErrorData(response: Response): Promise {\r\n let result = {};\r\n try {\r\n result = await response.clone().json();\r\n } catch (error) {\r\n /* istanbul ignore next */\r\n this._log.warn(() => ({\r\n msg: \"Could parse response body for additional error data\",\r\n error,\r\n response,\r\n }));\r\n }\r\n return result;\r\n }\r\n\r\n /**\r\n * Validates HTTP header for a valid inPoint license\r\n * @param {Context} context query context\r\n * @returns {Promise} current context\r\n * @memberof ApiManager\r\n * @virtual\r\n */\r\n async CheckLicense(context: Context): Promise {\r\n this._log.debug(() => ({\r\n msg: `${context.request.name}: CheckLicense`,\r\n apiContext: context,\r\n }));\r\n // check license\r\n const lic = context.response.headers.get(\"x-inpoint-license\");\r\n /* istanbul ignore else */\r\n if (lic === null || lic === \"Invalid\") {\r\n // TODO invalid license user notification instead of console error\r\n this._log.warn(\"Invalid inPoint.Web Server License!\");\r\n }\r\n return context;\r\n }\r\n\r\n /**\r\n * Decodes response body based on content-type\r\n * @param {Context} context query context\r\n * @returns {Promise} current context with decoded .body\r\n * @memberof ApiManager\r\n * @virtual\r\n */\r\n async DecodeBody(context: Context): Promise {\r\n this._log.debug(() => ({\r\n msg: `${context.request.name}: DecodeBody`,\r\n apiContext: context,\r\n }));\r\n const { request } = context;\r\n // avoid bodyUsed in case of cache.transformer!\r\n /* istanbul ignore next */\r\n const response = isLegacyResponseClone()\r\n ? cloneDeep(context.response) // Legacy browsers\r\n : context.response.clone(); // Modern browsers\r\n switch (request.contentType) {\r\n case ContentType.NONE:\r\n context.body = null;\r\n break;\r\n case ContentType.TEXT:\r\n context.body = await response.text();\r\n break;\r\n case ContentType.AUTO:\r\n // fall through\r\n case ContentType.JSON:\r\n const contentHeader = response.headers.get(\"content-type\");\r\n if (\r\n contentHeader &&\r\n contentHeader.indexOf(\"application/json\") !== -1\r\n ) {\r\n // checking response header\r\n context.body = await response.json();\r\n } else {\r\n context.body = await response.text();\r\n }\r\n break;\r\n case ContentType.BLOB:\r\n // TODO #40646 only newest fetch-mock supports blobs\r\n context.body =\r\n typeof response.blob === \"function\"\r\n ? await response.blob()\r\n : /* istanbul ignore next */ null;\r\n break;\r\n default:\r\n this._log.error(() => ({\r\n msg: `${context.request.name} ApiCatalog has invalid ContentType: ${context.request.contentType}`,\r\n apiContext: context,\r\n }));\r\n break;\r\n }\r\n return context;\r\n }\r\n\r\n /**\r\n * Check for any custom server errors\r\n * @param {Context} context query context\r\n * @returns {Promise} current context\r\n * @memberof ApiManager\r\n * @virtual\r\n */\r\n async CheckCustomError(context: Context): Promise {\r\n this._log.debug(() => ({\r\n msg: `${context.request.name}: CheckCustomError`,\r\n apiContext: context,\r\n }));\r\n const { request, body } = context;\r\n if (request.contentType !== ContentType.BLOB && body != null) {\r\n /* istanbul ignore else */\r\n if (body.isError === true) {\r\n notifyOnError(body);\r\n throw new ApiErrorContainer(body);\r\n }\r\n }\r\n return context;\r\n }\r\n\r\n /**\r\n * Placeholder event at the End Of line\r\n * @param {Context} context\r\n * @returns {Promise}\r\n * @memberof ApiManager\r\n * @virtual\r\n */\r\n async EOL(context: Context): Promise {\r\n return context;\r\n }\r\n\r\n /**\r\n * Main Worker kicking off pipeline chain\r\n * @memberof ApiManager\r\n * @private\r\n */\r\n _pipeline = async (\r\n context: Context\r\n ): Promise /* istanbul ignore next */ =>\r\n performanceTester(\r\n async () =>\r\n await this.BeforeFetch(context)\r\n .then(this.OnFetch)\r\n .then(this.AfterFetch)\r\n .then(this.CheckLicense)\r\n .then(this.DecodeBody)\r\n .then(this.CheckCustomError)\r\n .then(this.EOL),\r\n (ms) =>\r\n this._log.info(() => ({\r\n msg: `${context.request.name} Done in ${ms}ms`,\r\n apiContext: context,\r\n apiTook: ms,\r\n }))\r\n );\r\n}\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"tree\":\"minipicker_tree__193WF\",\"loading\":\"minipicker_loading__1IMuc\",\"doclist\":\"minipicker_doclist__2Qc_1\",\"filter\":\"minipicker_filter__3oriO\",\"split\":\"minipicker_split__17Dwo\",\"noTree\":\"minipicker_noTree__3yj7_\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"viewer\":\"document_viewer__3juQu\",\"right\":\"document_right__3Hbgn\",\"form\":\"document_form__1kLIs\",\"activity\":\"document_activity__XCGi6\",\"filedrop\":\"document_filedrop__2HjZI\",\"split\":\"document_split__2zOZa\"};","// @flow\r\nimport React from \"react\";\r\nimport ModalBootstrap from \"react-bootstrap/lib/Modal\";\r\nimport Form from \"react-bootstrap/lib/Form\";\r\nimport { isHandheld, isIOS } from \"data/bowser\";\r\nimport debounce from \"lodash/debounce\";\r\nimport styles from \"./Modal.module.css\";\r\nimport { History } from \"history\";\r\nimport { withRouter } from \"react-router\";\r\nimport queryString from \"data/queryString\";\r\nimport { getClassNames } from \"data/utils\";\r\n\r\nconst ModalHeader = (props) => ;\r\nconst ModalTitle = (props) => ;\r\nconst ModalBody = (props) => ;\r\nconst ModalFooter = (props) => ;\r\n\r\nexport const ModalSize = {\r\n Large: \"large\",\r\n Medium: undefined,\r\n Small: \"small\",\r\n};\r\n\r\ntype ModalSizeEnum = $Values;\r\n\r\ntype Props = {\r\n history: History,\r\n show: boolean,\r\n onHide: () => void,\r\n onKeyPress: () => void,\r\n style?: CSSStyleDeclaration,\r\n /** width of Dialog box to render */\r\n size?: ModalSizeEnum,\r\n /** height in pixels of header\r\n * @default 42 */\r\n headerSize?: number,\r\n /** height in pixels of footer\r\n * @default 0\r\n */\r\n footerSize?: number,\r\n /** whether to scroll modal contents\r\n * @default false\r\n */\r\n scroll?: boolean,\r\n /** whether modal should take fullscreen height (true) or max-height (false)\r\n * @default false\r\n */\r\n fullscreen?: boolean,\r\n /** whether modal should open docked to the right (true) or centered (false)\r\n * @default false\r\n */\r\n docked?: boolean,\r\n /** whether modal should enforce focus state (set to false if portal is used within modal)\r\n * @default true\r\n */\r\n enforceFocus?: boolean,\r\n /** optional CSS class to apply to Modal dialog */\r\n dialogClassName?: string,\r\n /** optional string to help test engines target this component */\r\n dataTest?: string,\r\n};\r\n\r\ntype State = {\r\n vh: number,\r\n fs: boolean,\r\n closeRequested: boolean,\r\n};\r\n\r\n/**\r\n * wrapper around Modal which will dynamically calculate viewport height\r\n */\r\nexport class Modal extends React.PureComponent {\r\n Header: ModalHeader;\r\n Title: ModalTitle;\r\n Body: ModalBody;\r\n Footer: ModalFooter;\r\n\r\n static defaultProps = {\r\n size: ModalSize.Large,\r\n headerSize: 42,\r\n footerSize: 0,\r\n scroll: false,\r\n fullscreen: false,\r\n enforceFocus: true,\r\n };\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n const fs = this._shouldFullscreen();\r\n this.state = {\r\n vh: this._getHeight(fs),\r\n fs,\r\n closeRequested: false,\r\n location: props.history.location,\r\n };\r\n }\r\n\r\n componentDidMount = () => {\r\n this.historyUnlisten = this.props.history.listen((location, action) => {\r\n // Compare search parameter to distinguish if modal should be closed: Do not close Modal on e.g. pagination\r\n const _search = queryString.parse(this.state.location.search);\r\n const search = queryString.parse(location.search);\r\n const closeRequested = search.uri !== _search.uri;\r\n this.setState({\r\n location,\r\n closeRequested,\r\n });\r\n });\r\n window.addEventListener(\"resize\", this._onResizeDebounced, {\r\n capture: false,\r\n passive: true,\r\n });\r\n };\r\n\r\n componentWillUnmount = () => {\r\n if (this.historyUnlisten) this.historyUnlisten();\r\n window.removeEventListener(\"resize\", this._onResizeDebounced);\r\n };\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n /* istanbul ignore else */\r\n if (this.props.show !== prevProps.show && this.props.show === true)\r\n this._onResize();\r\n }\r\n\r\n _onResize = () => {\r\n const fs = this._shouldFullscreen();\r\n this.setState({\r\n vh: this._getHeight(\r\n /*istanbul ignore next*/ fs || this.props.docked\r\n ),\r\n fs,\r\n });\r\n };\r\n\r\n _onResizeDebounced = debounce(this._onResize, 400);\r\n\r\n _shouldFullscreen = () => isHandheld() || this._getWidth() <= 768;\r\n\r\n _getWidth = () =>\r\n isIOS() ? document.documentElement.clientWidth : window.innerWidth;\r\n\r\n _getHeight = (fs: boolean) => {\r\n const height = isIOS()\r\n ? document.documentElement.clientHeight\r\n : window.innerHeight;\r\n const margin = fs ? 0 : 31;\r\n return (\r\n height - this.props.headerSize - this.props.footerSize - margin * 2\r\n );\r\n };\r\n\r\n _renderChildren = (children) =>\r\n React.Children.map(children, (child, index) =>\r\n this._renderChild(child)\r\n );\r\n\r\n _renderChild = (child) => {\r\n /* istanbul ignore else */\r\n if (child != null) {\r\n if (child.type === ModalBody) {\r\n return React.cloneElement(child, {\r\n style: {\r\n height: this.props.fullscreen\r\n ? this.state.vh\r\n : undefined,\r\n maxHeight: this.props.fullscreen\r\n ? undefined\r\n : this.state.vh,\r\n overflowY:\r\n this.props.scroll === true ? \"auto\" : \"hidden\",\r\n },\r\n });\r\n } else if (child.type === ModalHeader) {\r\n return React.cloneElement(child, {\r\n style: {\r\n height: this.props.headerSize,\r\n },\r\n });\r\n } else if (\r\n child.type === Form &&\r\n React.Children.count(child.props.children) > 0\r\n ) {\r\n return React.cloneElement(\r\n child,\r\n {},\r\n this._renderChildren(child.props.children)\r\n );\r\n } else {\r\n return React.cloneElement(child, {});\r\n }\r\n }\r\n };\r\n render() {\r\n const { show, onHide, onKeyPress, dialogClassName, style } = this.props;\r\n return (\r\n \r\n {this._renderChildren(this.props.children)}\r\n \r\n );\r\n }\r\n}\r\n\r\nModal.Header = ModalHeader;\r\nModal.Title = ModalTitle;\r\nModal.Body = ModalBody;\r\nModal.Footer = ModalFooter;\r\nexport default withRouter(Modal);\r\n","//@flow\r\nimport React from \"react\";\r\nimport Status from \"./index\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport styles from \"./Overlay.module.css\";\r\n\r\ntype Props = { status: ConstantsEnum, message: string };\r\nconst Overlay = ({ status, message }: Props) =>\r\n status !== Constants.OK ? (\r\n
\r\n \r\n
\r\n ) : null;\r\nOverlay.displayName = \"Status.Overlay\";\r\n\r\nexport default Overlay;\r\n","// @flow\r\nimport React from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport Icons from \"@hs/icons\";\r\nimport Constants from \"data/constants\";\r\nimport styles from \"./Status.module.css\";\r\nimport Overlay from \"./Overlay\";\r\nimport loc from \"i18next\";\r\n\r\n// central UI for status icon\r\nconst Status = ({\r\n status,\r\n ok,\r\n okStyle,\r\n inline = false,\r\n message = \"\",\r\n error = null,\r\n}: {\r\n status: string,\r\n ok?: string,\r\n okStyle?: StyleSheet,\r\n inline?: boolean,\r\n message: ?string,\r\n error?: Error,\r\n}) => {\r\n switch (status) {\r\n case Constants.REFRESH:\r\n case Constants.LOADING:\r\n return inline ? (\r\n \r\n ) : (\r\n
\r\n \r\n
\r\n );\r\n case Constants.OK:\r\n return ok ? (\r\n \r\n ) : null;\r\n case Constants.ERROR:\r\n if (\r\n error != null &&\r\n error.constructor.name === \"ApiNetworkOfflineError\"\r\n ) {\r\n return inline ? (\r\n \r\n ) : (\r\n
\r\n {loc.t(\"offline.pretty.msg\")}\r\n
\r\n );\r\n }\r\n //fallthrough\r\n default:\r\n return inline ? (\r\n \r\n ) : (\r\n
\r\n \r\n {message && (\r\n <>\r\n
\r\n {message}\r\n \r\n )}\r\n
\r\n );\r\n }\r\n};\r\n\r\nStatus.Overlay = Overlay;\r\n\r\nStatus.propTypes = {\r\n status: PropTypes.oneOf([\r\n Constants.NONE,\r\n Constants.LOADING,\r\n Constants.ERROR,\r\n Constants.OK,\r\n Constants.REFRESH,\r\n ]).isRequired,\r\n ok: PropTypes.string,\r\n okStyle: PropTypes.object,\r\n inline: PropTypes.bool,\r\n message: PropTypes.string,\r\n};\r\n\r\nexport default Status;\r\n","import actionTypes from \"data/actions/actionTypes\";\r\nimport Constants from \"data/constants\";\r\nimport produce from \"immer\";\r\n\r\nconst initialState = {\r\n cards: [],\r\n providers: null,\r\n status: Constants.NONE,\r\n};\r\n\r\nconst workflowReducer = (state = initialState, action) =>\r\n produce(state, (draft) => {\r\n switch (action.type) {\r\n case actionTypes.WF_PROVIDERS_FETCH_REQUESTED:\r\n case actionTypes.WF_PROVIDERS_FETCH_RESULT:\r\n case actionTypes.WF_FETCH_REQUESTED:\r\n case actionTypes.WF_FETCH_RESULT:\r\n return { ...draft, ...action.payload };\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return initialState;\r\n default:\r\n return draft;\r\n }\r\n });\r\n\r\nexport default workflowReducer;\r\n\r\nexport const workflowStatusSelector = (state: Object) => state.workflow.status;\r\nexport const workflowCardsSelector = (state: Object) => state.workflow.cards;\r\nexport const workflowProvidersSelector = (state: Object) =>\r\n state.workflow.providers;\r\nexport const workflowPendingCountSelector = (state: Object) =>\r\n (state.workflow.status === Constants.OK ||\r\n state.workflow.status === Constants.REFRESH) &&\r\n state.workflow.cards\r\n ? state.workflow.cards.filter(\r\n (card) => card.extras.toggle === \"pending\"\r\n ).length\r\n : -1;\r\n","import actionTypes from \"../actions/actionTypes\";\r\n\r\nexport const initialState = {\r\n initialized: false,\r\n updated: false,\r\n failed: false,\r\n registration: null,\r\n};\r\n\r\nconst serviceWorkerReducer = (state = initialState, action) => {\r\n switch (action.type) {\r\n case actionTypes.SW_INIT:\r\n return {\r\n ...state,\r\n initialized:\r\n action.payload.registration != null &&\r\n action.payload.error == null,\r\n failed:\r\n action.payload.registration == null &&\r\n action.payload.error != null,\r\n ...action.payload,\r\n };\r\n case actionTypes.SW_UPDATE:\r\n return {\r\n ...state,\r\n updated: !state.updated,\r\n ...action.payload,\r\n };\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return initialState;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default serviceWorkerReducer;\r\n\r\nexport const isSwInitializedSelector = (state: Object): boolean =>\r\n state.sw.initialized === true;\r\nexport const isSwFailedSelector = (state: Object): boolean =>\r\n state.sw.failed === true;\r\nexport const isSwUpdatedSelector = (state: Object): boolean =>\r\n state.sw.updated === true;\r\nexport const swRegistrationSelector = (\r\n state: Object\r\n): ServiceWorkerRegistration | null => state.sw.registration;\r\n","// @flow\r\nimport React from \"react\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\n\r\ntype Props = {\r\n /** callback when user clicks on More... Button */\r\n onClick?: () => void,\r\n /** optional CSS Class to apply */\r\n className?: string,\r\n /** whether to render the button in a disabled state */\r\n disabled?: boolean,\r\n /** additional css styling */\r\n style?: CSStyleDefinition,\r\n /** Integration Test identifier */\r\n dataTest?: string,\r\n};\r\n\r\nconst ActionsButton = ({\r\n onClick,\r\n className,\r\n disabled,\r\n style = { color: \"black\" },\r\n dataTest = \"actionsButton\",\r\n ...props\r\n}: Props) => (\r\n \r\n \r\n \r\n);\r\nActionsButton.displayName = \"ActionsButton\";\r\nexport default ActionsButton;\r\n","import React, {\r\n useMemo,\r\n useContext,\r\n useState,\r\n useCallback,\r\n useEffect,\r\n} from \"react\";\r\nimport { useAsyncMemo, usePrevious } from \"hooks\";\r\nimport { fetchItemContext } from \"data/api\";\r\nimport { ItemContextKeyEnum } from \"data/types\";\r\nimport { getDisplayName } from \"data/constants\";\r\nimport { ItemContext } from \"data/context\";\r\n\r\ntype Config = {\r\n asProps?: boolean | Array,\r\n};\r\n\r\ntype Props = {\r\n itemUri: string,\r\n refreshId: ?number,\r\n};\r\n\r\nconst withItemContext =\r\n ({ asProps }: ?Config = {}) =>\r\n (WrappedComponent: ComponentType) => {\r\n const HOC = (props: Props) => {\r\n const parentContext = useContext(ItemContext);\r\n const itemUri = props.itemUri;\r\n const [refreshId, setRefreshId] = useState(props.refreshId || 0);\r\n const prevRefreshId = usePrevious(refreshId) ?? refreshId;\r\n\r\n // #region Nested context update by refreshId\r\n // Update refreshId if the nested child's itemContext refreshId prop changes\r\n\r\n const baseRefreshContext = useCallback(\r\n (newRefreshId) => {\r\n /* istanbul ignore if*/\r\n if (refreshId === newRefreshId) {\r\n return;\r\n }\r\n setRefreshId(newRefreshId);\r\n },\r\n [refreshId]\r\n );\r\n\r\n // get the parentContext's refreshContext,\r\n // if parentContext is available and itemUris match,\r\n // otherwise set it\r\n const refreshContext =\r\n parentContext?.itemUri === itemUri\r\n ? parentContext?.refreshContext ?? baseRefreshContext\r\n : baseRefreshContext;\r\n\r\n useEffect(() => {\r\n setRefreshId(props.refreshId);\r\n }, [props.refreshId]);\r\n\r\n // if the refreshId changed, update the parent itemContext's refreshId as well\r\n useEffect(() => {\r\n if (prevRefreshId === refreshId) {\r\n return;\r\n }\r\n refreshContext(refreshId);\r\n }, [refreshId, prevRefreshId, refreshContext]);\r\n // #endregion\r\n\r\n const itemContext: ItemContextProps = useAsyncMemo(\r\n async () => {\r\n if (!itemUri) return;\r\n if (parentContext?.itemUri === itemUri)\r\n return parentContext;\r\n let c = {};\r\n try {\r\n c = await fetchItemContext(itemUri);\r\n c.itemUri = itemUri;\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n return c;\r\n },\r\n [parentContext, itemUri, refreshId],\r\n {}\r\n );\r\n\r\n const itemContextWithExtras = useMemo(\r\n () => ({\r\n ...itemContext,\r\n itemUri,\r\n refreshContext,\r\n }),\r\n [itemContext, itemUri, refreshContext]\r\n );\r\n\r\n const itemContextAsProps = useMemo(() => {\r\n if (asProps === true) {\r\n return itemContextWithExtras;\r\n }\r\n const props = {};\r\n if (!asProps) return props;\r\n asProps.forEach((key: ItemContextKeyEnum) => {\r\n props[key] = itemContextWithExtras?.[key];\r\n });\r\n return props;\r\n }, [itemContextWithExtras]);\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n };\r\n HOC.displayName = `withItemContext(${getDisplayName(\r\n WrappedComponent\r\n )})`;\r\n return HOC;\r\n };\r\n\r\nexport default withItemContext;\r\n","// @flow\r\nimport React, { useEffect, useMemo } from \"react\";\r\nimport { isFeatureOn, Feature } from \"data/constants\";\r\nimport { Dashboard } from \"@uppy/react\";\r\nimport \"@uppy/dashboard/dist/style.css\";\r\nimport \"./index.css\";\r\n\r\ntype Props = {\r\n /** uppy instance reference */\r\n uppy: Object,\r\n /** whether to immediately open File Browse dialog */\r\n openBrowseDialog?: boolean,\r\n /** whether to immediately open Camera dialog */\r\n openCamera?: boolean,\r\n /** callback when user wants to add a file\r\n * set to replace uppy's dashboard addFilePanel\r\n */\r\n onAddFile?: () => void,\r\n};\r\n\r\nconst UploadSelection = ({\r\n uppy,\r\n openBrowseDialog,\r\n openCamera,\r\n onAddFile,\r\n}: Props) => {\r\n useEffect(() => {\r\n const plugin = uppy.getPlugin(\"react:Dashboard\");\r\n /* istanbul ignore else */\r\n if (plugin) plugin.hideAllPanels();\r\n if (openBrowseDialog === true) {\r\n // browse\r\n var e = document.getElementsByClassName(\"uppy-Dashboard-input\");\r\n /* istanbul ignore else */\r\n if (e.length === 1) e[0].click();\r\n } else if (openCamera === true) {\r\n /* istanbul ignore else */\r\n if (plugin) plugin.showPanel(\"Webcam\");\r\n }\r\n if (plugin && onAddFile)\r\n plugin.toggleAddFilesPanel = onAddFile.bind(this);\r\n }, [uppy, openBrowseDialog, openCamera, onAddFile]);\r\n\r\n const plugins = useMemo(() => {\r\n const plugins = [\"Webcam\"];\r\n /* istanbul ignore next */\r\n if (isFeatureOn(Feature.uppyLexmark)) {\r\n plugins.push(\"Lexmark\");\r\n }\r\n return plugins;\r\n }, []);\r\n\r\n return (\r\n \r\n );\r\n};\r\nexport default UploadSelection;\r\n","import store from \"data/store\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport { persistor } from \"data/store\";\r\nimport { SiteType } from \"data/types\";\r\n\r\nexport const isOnline = () => s.isOnlineSelector(store.getState());\r\n\r\nexport const docsItemUri = () => s.docsItemUriSelector(store.getState());\r\n\r\nexport const currentItemUri = () => s.currentItemUriSelector(store.getState());\r\n\r\nexport const accessToken = () => s.loginAccessTokenSelector(store.getState());\r\n\r\nexport const correlationId = () =>\r\n s.userCorrelationIdSelector(store.getState());\r\n\r\nexport const sitesSelector = () => s.userSitesSelector(store.getState());\r\n\r\nexport const globalSitesAreaSelector = () =>\r\n sitesSelector().find(\r\n (s) =>\r\n s.siteType === SiteType.GlobalSites && s.webDavName === \"GLOBALSITE\"\r\n );\r\n\r\nexport const userLanguage = () => s.userLanguageSelector(store.getState());\r\n\r\nexport const settingValue = (name) =>\r\n s.settingValueSelector(name, store.getState());\r\n\r\nexport const swRegistrationSelector = () =>\r\n s.swRegistrationSelector(store.getState());\r\n\r\nexport const dispatch = (action) => store.dispatch(action);\r\n\r\nexport const getNotification = (notificationId) =>\r\n s.notificationSelector(store.getState(), notificationId)?.[0] || {};\r\n\r\nexport { persistor };\r\n","// this file defines default split panes proportions\r\n\r\nconst panesDefaultState = {\r\n minipicker: [/*leftSplit:*/ [25, 75]],\r\n folder: [\r\n /*leftSplit:*/ [25, 75],\r\n /*rightSplit:*/ [50, 50],\r\n ],\r\n mailbox: [\r\n /*leftSplit:*/ [25, 75],\r\n /*rightSplit:*/ [60, 40],\r\n ],\r\n document: [\r\n /*leftSplit:*/ [70, 30],\r\n [60, 40],\r\n ],\r\n docmodal: [\r\n /*leftSplit:*/ [70, 30],\r\n [60, 40],\r\n ],\r\n miniflat: [/*topSplit:*/ [60, 40]],\r\n upload: [/*leftSplit*/ [30, 70]],\r\n search: [\r\n /*leftSplit*/ [20, 70],\r\n /*rightSplit:*/ [40, 60],\r\n ],\r\n itemflows: [/*leftSplit*/ [35, 65]],\r\n};\r\n\r\nexport default panesDefaultState;\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"siteSelect\":\"SiteSelect_siteSelect__1fzyF\",\"siteSelectNative\":\"SiteSelect_siteSelectNative__1JZRU\",\"name\":\"SiteSelect_name__3XQ2t\",\"menuitem\":\"SiteSelect_menuitem__ZWTic\",\"button\":\"SiteSelect_button__2tcgk\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"recentFolder\":\"RecentFolderSelect_recentFolder__2IOx7\",\"recentFolderNative\":\"RecentFolderSelect_recentFolderNative__rAnQe\",\"text\":\"RecentFolderSelect_text__3Dw2m\",\"menuitem\":\"RecentFolderSelect_menuitem__3CD2N\",\"button\":\"RecentFolderSelect_button__2_Nbo\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"inputGroup\":\"GeoPointInput_inputGroup__26O1P\",\"buttonsWrapper\":\"GeoPointInput_buttonsWrapper__GebQy\",\"iconWrapper\":\"GeoPointInput_iconWrapper__4x_ll\",\"button\":\"GeoPointInput_button__LLpOp\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"searchTextEditor\":\"AttributeSearch_searchTextEditor__1dsuo\",\"searchRelativeDataEditor\":\"AttributeSearch_searchRelativeDataEditor__1yLoD\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"searchPanel\":\"ArchiveTargetSearchForm_searchPanel__QuqOn\",\"searchResult\":\"ArchiveTargetSearchForm_searchResult__1GcS2\",\"wrapper\":\"ArchiveTargetSearchForm_wrapper__1jneC\",\"fSplit\":\"ArchiveTargetSearchForm_fSplit__TsByH\"};","// @flow\r\nimport React from \"react\";\r\nimport AttributeLabel from \"components/ExtraAttributes/AttributeLabel\";\r\nimport ViewerControlBase from \"components/ExtraAttributes/ViewerControl/ViewerControlBase\";\r\n\r\ntype Props = {\r\n name: string,\r\n header?: string,\r\n value?: any | string,\r\n width?: number,\r\n height?: number,\r\n className?: string,\r\n};\r\n\r\nexport const defaultFallbackImage =\r\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=\";\r\n\r\nconst ImageViewerControl = ({\r\n name,\r\n header,\r\n value,\r\n width,\r\n height,\r\n className,\r\n}: Props) => {\r\n const heightStyle = height == null || height === 0 ? \"auto\" : `${height}px`;\r\n const widthStyle = width == null || width === 0 ? \"auto\" : `${width}px`;\r\n const parsedValue = value\r\n ? Object.prototype.hasOwnProperty.call(value, \"src\")\r\n ? value.src\r\n : value\r\n : defaultFallbackImage;\r\n return (\r\n \r\n {\" \"}\r\n \r\n \r\n );\r\n};\r\nImageViewerControl.displayName = \"ImageViewerControl\";\r\nexport default ImageViewerControl;\r\n","import actionTypes from \"data/actions/actionTypes\";\r\nimport Constants from \"data/constants\";\r\nimport { type docsLayoutState } from \"./types\";\r\n\r\nexport const initialState: docsLayoutState = {\r\n status: Constants.NONE,\r\n};\r\n\r\nconst docsReducer = (state: docsLayoutState = initialState, action) => {\r\n switch (action.type) {\r\n case actionTypes.CURRENTITEM_SET:\r\n if (\r\n action.payload.name !== \"docmodal\" &&\r\n action.payload.name !== \"itemflows\" &&\r\n action.payload.itemUri !== state.itemUri\r\n )\r\n return { ...initialState };\r\n else return state;\r\n\r\n case actionTypes.DOCS_LAYOUT_REQUEST:\r\n case actionTypes.DOCS_LAYOUT_SET:\r\n return {\r\n ...state,\r\n ...action.payload,\r\n };\r\n\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return initialState;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default docsReducer;\r\n\r\nexport const docsLayoutStatusSelector = (state: Object) =>\r\n state.docsLayout.status;\r\nexport const docsLayoutFiltersSelector = (state: Object) =>\r\n state.docsLayout.filters;\r\nexport const docsLayoutSortsSelector = (state: Object) =>\r\n state.docsLayout.sorts;\r\n","import actionTypes from \"../actions/actionTypes\";\r\nimport { ListViewMode } from \"data/types\";\r\nimport bowser from \"data/bowser\";\r\n\r\nexport const initialState = {\r\n mini: false,\r\n // set default based on target device\r\n docListViewMode: null,\r\n};\r\n\r\nconst settingsReducer = (state = initialState, action) => {\r\n switch (action.type) {\r\n case actionTypes.SETTINGS_SIDEBAR_MINI:\r\n return { ...state, ...action.payload };\r\n case actionTypes.SETTINGS_DOCLIST_VIEWMODE:\r\n return { ...state, docListViewMode: action.payload.viewMode };\r\n case actionTypes.SETTINGS_SET:\r\n return { ...state, [action.payload.name]: action.payload.value };\r\n\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return initialState;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default settingsReducer;\r\n\r\nexport const sidebarMiniSelector = (state: Object) => state.settings.mini;\r\nexport const docListViewModeSelector = (state: Object) =>\r\n state.settings.docListViewMode == null\r\n ? bowser.is(\"mobile\") || bowser.is(\"tablet\")\r\n ? ListViewMode.List\r\n : ListViewMode.Grid\r\n : state.settings.docListViewMode;\r\nexport const settingValueSelector = (name: string, state: Object) =>\r\n state.settings[name];\r\n","import actionTypes from \"data/actions/actionTypes\";\r\nimport Constants from \"data/constants\";\r\n\r\nconst initialState = {\r\n name: \"\",\r\n itemUri: \"\",\r\n status: Constants.LOADING,\r\n};\r\n\r\nconst currentItemReducer = (state = initialState, action) => {\r\n switch (action.type) {\r\n case actionTypes.CURRENTITEM_BAK:\r\n return {\r\n ...state,\r\n saved: state,\r\n };\r\n case actionTypes.CURRENTITEM_RESTORE:\r\n return {\r\n ...state,\r\n ...state.saved,\r\n saved: undefined,\r\n };\r\n case actionTypes.CURRENTITEM_SET:\r\n const { name, itemUri } = state;\r\n // we reset the state.current to remove any extra values\r\n return {\r\n name,\r\n itemUri,\r\n status: Constants.LOADING,\r\n saved: state.saved,\r\n ...action.payload,\r\n };\r\n case actionTypes.CURRENTITEM_LOADED:\r\n return { ...state, ...action.payload };\r\n\r\n /*case actionTypes.SPLITPANES_SET:\r\n return {\r\n ...state,\r\n [action.payload.name]: action.payload.dimensions\r\n };*/\r\n\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return initialState;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default currentItemReducer;\r\n\r\nexport const currentItemUriSelector = (state: Object) => state.current.itemUri;\r\nexport const currentNameSelector = (state: Object) => state.current.name;\r\nexport const currentStatusSelector = (state: Object) => state.current.status;\r\n","import actionTypes from \"data/actions/actionTypes\";\r\nimport Constants from \"data/constants\";\r\nimport { type searchFormListResultState } from \"./types\";\r\n\r\nexport const initialState: searchFormListResultState = {\r\n status: Constants.NONE,\r\n result: [],\r\n};\r\n\r\nconst searchFormsReducer = (\r\n state: searchResultState = initialState,\r\n action\r\n) => {\r\n switch (action.type) {\r\n case actionTypes.SEARCH_FORM_LIST_FETCH_REQUEST:\r\n case actionTypes.SEARCH_FORM_LIST_FETCH_RESULT:\r\n return {\r\n ...state,\r\n ...action.payload,\r\n };\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return initialState;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default searchFormsReducer;\r\n\r\nexport const searchFormListStatusSelector = (state: Object) =>\r\n state.searchForms.status;\r\nexport const searchFormListResultSelector = (state: Object) =>\r\n state.searchForms.result;\r\nexport const searchFormListCountSelector = (state: Object) =>\r\n state.searchForms.status === Constants.OK\r\n ? state.searchForms.result.length\r\n : -1;\r\n","import actionTypes from \"../actions/actionTypes\";\r\nimport {\r\n OfflineSyncStatus,\r\n type OfflineSyncStatusEnum,\r\n type OfflineItemStatus,\r\n} from \"data/types\";\r\nimport produce from \"immer\";\r\n\r\nexport const initialState = {\r\n status: OfflineSyncStatus.Unknown,\r\n message: null,\r\n items: {},\r\n};\r\n\r\nconst offlineReducer = (state = initialState, action) => {\r\n const { payload } = action;\r\n const { item } = payload || {};\r\n\r\n switch (action.type) {\r\n case actionTypes.OFFLINE_SYNC_STARTED:\r\n //lint -fallthrough\r\n case actionTypes.OFFLINE_SYNC_DONE:\r\n return {\r\n ...state,\r\n ...payload,\r\n };\r\n\r\n case actionTypes.OFFLINEITEM_SYNC_STATUS:\r\n return {\r\n ...state,\r\n message: payload.message,\r\n items: produce(state.items, (draft) => {\r\n draft[item.id] = Object.assign({}, item, {\r\n message: payload.message,\r\n status: payload.status,\r\n at: action.receivedAt,\r\n took: payload.took,\r\n });\r\n }),\r\n };\r\n\r\n case actionTypes.OFFLINEITEM_REMOVE:\r\n return {\r\n ...state,\r\n items: produce(state.items, (draft) => {\r\n delete draft[item.id];\r\n }),\r\n };\r\n\r\n case actionTypes.OFFLINEITEM_DEPSMAP_RESULT:\r\n return {\r\n ...state,\r\n items: produce(state.items, (draft) => {\r\n draft[item.id] = Object.assign({}, item, {\r\n depsMap: payload.depsMap,\r\n });\r\n }),\r\n };\r\n\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return initialState;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default offlineReducer;\r\n\r\nexport const offlineSyncStatusSelector = (\r\n state: Object\r\n): OfflineSyncStatusEnum => state.offline.status;\r\nexport const offlineItemsSelector = (state: Object) =>\r\n state.offline.items /* istanbul ignore next */ || {};\r\nexport const offlineItemDepsMapSelector = (\r\n state: Object,\r\n item: OfflineItemStatus\r\n) => state.offline.items[item.id].depsMap;\r\n","//@flow\r\nimport React from \"react\";\r\nimport { useMomentLocale } from \"hooks\";\r\nimport { userLanguage } from \"data/storeHelper\";\r\nimport { getDisplayName } from \"data/constants\";\r\nimport Status from \"components/Status\";\r\nimport Constants from \"data/constants\";\r\n\r\nconst Moment = (WrappedComponent: ComponentType) => {\r\n function MomentLocale(props: any) {\r\n const status = useMomentLocale(userLanguage());\r\n return status === Constants.OK ? (\r\n \r\n ) : (\r\n \r\n );\r\n }\r\n MomentLocale.displayName = `MomentLocale(${getDisplayName(\r\n WrappedComponent\r\n )})`;\r\n return MomentLocale;\r\n};\r\n\r\nexport default Moment;\r\n","import React, { useMemo } from \"react\";\r\nimport ClearableInput from \"@hs/clearable-input\";\r\nimport FormsyEditorBase from \"./FormsyEditorBase\";\r\n\r\nconst MemoEditorControl = (props) => {\r\n const style = useMemo(\r\n () => ({\r\n width: \"100%\",\r\n borderRadius: 0,\r\n resize: \"vertical\",\r\n overflow: \"auto\",\r\n paddingTop: 6,\r\n paddingLeft: 9,\r\n paddingBottom: 6,\r\n border: \"1px solid #cccccc\",\r\n boxShadow: \"inset 0 1px 1px rgb(0 0 0 / 8%)\",\r\n minHeight: props.height || 32,\r\n }),\r\n [props.height]\r\n );\r\n return (\r\n (\r\n \r\n )}\r\n {...props}\r\n />\r\n );\r\n};\r\nMemoEditorControl.displayName = \"MemoEditorControl\";\r\nexport default MemoEditorControl;\r\n","// @flow\r\nimport React from \"react\";\r\nimport { getLocalizedText } from \"data/utils\";\r\nimport SearchBucket, { getSelected } from \"./\";\r\nimport {\r\n SORT_BUCKET_NAME,\r\n type SearchBucketDTO,\r\n type SearchBucketValueDTO,\r\n} from \"data/types\";\r\nimport styles from \"./SearchBucket.module.css\";\r\n\r\ntype Props = {\r\n item: SearchBucketDTO,\r\n};\r\n\r\nconst findBucketValue = (\r\n item: SearchBucketDTO,\r\n value: number | string | null\r\n): ?SearchBucketValueDTO => {\r\n const idx = item.buckets.findIndex((b) => b.value === value);\r\n if (idx === -1) {\r\n return null;\r\n } else {\r\n return item.buckets[idx];\r\n }\r\n};\r\n\r\nconst parseSelectedValue = (selected: Array): string => {\r\n const selectedValue = getSelected(selected);\r\n return Array.isArray(selectedValue)\r\n ? selectedValue.filter((v) => !!v).join(\"-\")\r\n : selectedValue;\r\n};\r\n\r\nconst Name = ({ item }: Props) => {\r\n const selectedValue = parseSelectedValue(item.selected);\r\n const caption = getLocalizedText(item.caption || item.name);\r\n\r\n // nothing yet selected, show the searchBucketName (localized)\r\n if (selectedValue == null) {\r\n return {caption};\r\n } else {\r\n // we have a value\r\n\r\n // find localized caption of selected value\r\n const bucket = findBucketValue(item, selectedValue);\r\n if (bucket == null) {\r\n // we could not find it (should not really happen)\r\n return (\r\n \r\n {selectedValue\r\n ? `${getLocalizedText(item.caption)}: ${selectedValue}`\r\n : getLocalizedText(item.caption)}\r\n \r\n );\r\n } else {\r\n // should we show the searchBucketName (or save screenspace)?\r\n // note: custom handling of known searchBuckets\r\n if (\r\n item.name === \"Dateityp\" ||\r\n item.name === \"ItemType\" ||\r\n item.hideName === true\r\n ) {\r\n // no, just the selected value\r\n return (\r\n \r\n \r\n {getLocalizedText(\r\n String(bucket.caption || bucket.value)\r\n )}\r\n \r\n );\r\n } else {\r\n // yes show it all (otherwise wont be clear)\r\n return (\r\n \r\n {item.name === SORT_BUCKET_NAME ? (\r\n <>\r\n {/**/}\r\n {getLocalizedText(item.caption)}:{\" \"}\r\n \r\n ) : (\r\n getLocalizedText(caption) + \": \"\r\n )}\r\n \r\n {getLocalizedText(\r\n String(bucket.caption || bucket.value)\r\n )}\r\n \r\n );\r\n }\r\n }\r\n }\r\n};\r\nName.displayName = \"FilterBar.SearchBucket.Name\";\r\n\r\nexport default Name;\r\n","// @flow\r\nimport React from \"react\";\r\nimport MenuItem from \"react-bootstrap/lib/MenuItem\";\r\nimport { type SearchBucketDTO } from \"data/types\";\r\n\r\ntype Props = { item: SearchBucketDTO };\r\n\r\nconst Header = ({ item }: Props) => (\r\n {item.caption || item.name}\r\n);\r\n\r\nHeader.displayName = \"FilterBar.SearchBucket.Header\";\r\n\r\nexport default Header;\r\n","// @flow\r\nimport React from \"react\";\r\nimport MenuItem from \"react-bootstrap/lib/MenuItem\";\r\nimport loc from \"i18next\";\r\nimport { type SearchBucketDTO } from \"data/types\";\r\n\r\ntype Props = {\r\n item: SearchBucketDTO,\r\n onSelect: (name: string, value: Object) => void,\r\n};\r\n\r\nconst AllItem = ({ item, onSelect }: Props) => (\r\n \r\n onSelect({\r\n name: item.name,\r\n value: \"__ALL__\",\r\n })\r\n }\r\n >\r\n {loc.t(\"common:filter.AllCaption\")}\r\n \r\n);\r\n\r\nAllItem.displayName = \"FilterBar.SearchBucket.AllItem\";\r\n\r\nexport default AllItem;\r\n","// @flow\r\nimport React, { useCallback } from \"react\";\r\nimport MenuItemUI from \"react-bootstrap/lib/MenuItem\";\r\nimport SearchBucket from \"./\";\r\nimport CountBadge from \"components/CountBadge\";\r\nimport { getLocalizedText } from \"data/utils\";\r\nimport { type SearchBucketValueDTO } from \"data/types\";\r\nimport styles from \"./SearchBucket.module.css\";\r\n\r\ntype Props = {\r\n name: string,\r\n selected: Array,\r\n item: SearchBucketValueDTO,\r\n onSelect: (name: string, value: Object) => void,\r\n};\r\n\r\nconst MenuItem = ({ name, selected, item, onSelect }: Props) => {\r\n const handleSelect = useCallback(\r\n () => onSelect({ name, value: item.value, valueType: item.valueType }),\r\n [onSelect, name, item]\r\n );\r\n return (\r\n \r\n {item.count > 0 && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n {getLocalizedText(item.caption || item.value)}\r\n \r\n \r\n );\r\n};\r\n\r\nMenuItem.displayName = \"FilterBar.SearchBucket.MenuItem\";\r\n\r\nexport default MenuItem;\r\n","// @flow\r\nimport React from \"react\";\r\nimport ButtonUI from \"react-bootstrap/lib/Button\";\r\nimport SearchBucket from \"./\";\r\nimport { type SearchBucketDTO } from \"data/types\";\r\n\r\ntype Props = {\r\n item: SearchBucketDTO,\r\n selected: Array,\r\n onSelect: (name: string, value: Object) => void,\r\n};\r\n\r\nconst Button = ({ item, selected, onSelect }: Props) => (\r\n \r\n onSelect({\r\n name: item.name,\r\n value: null,\r\n })\r\n }\r\n bsSize=\"small\"\r\n style={{\r\n fontWeight: selected.length > 0 ? \"bold\" : \"normal\",\r\n fontStyle: selected.length > 0 ? \"normal\" : \"italic\",\r\n }}\r\n >\r\n \r\n \r\n);\r\n\r\nButton.displayName = \"FilterBar.SearchBucket.Button\";\r\n\r\nexport default Button;\r\n","// @flow\r\nimport React from \"react\";\r\nimport Icons from \"@hs/icons\";\r\n\r\ntype Props = {\r\n /** commonName */\r\n name: string,\r\n /** field's value */\r\n value: number | string | null,\r\n /** CSS class to apply to icon */\r\n className?: string,\r\n};\r\n\r\n// gets a bucket's value's icon\r\nconst Icon = ({ name, value, className }: Props) => {\r\n /* istanbul ignore next */\r\n if (value === null) return null;\r\n // note: custom handling of known searchBuckets\r\n if (name === \"Dateityp\") {\r\n return ;\r\n } /* istanbul ignore else */ else if (name === \"ItemType\") {\r\n if (value === \"Document\")\r\n return ;\r\n /* istanbul ignore else */ else if (value === \"Folder\")\r\n return ;\r\n }\r\n return null;\r\n};\r\nIcon.displayName = \"FilterBar.SearchBucket.Icon\";\r\nexport default Icon;\r\n","// @flow\r\nimport React from \"react\";\r\nimport Dropdown from \"@hs/dropdown\";\r\nimport bowser from \"data/bowser\";\r\nimport Name from \"./Name\";\r\nimport Header from \"./Header\";\r\nimport AllItem from \"./AllItem\";\r\nimport MenuItem from \"./MenuItem\";\r\nimport Button from \"./Button\";\r\nimport Icon from \"./Icon\";\r\nimport { SORT_BUCKET_NAME, type SearchBucketDTO } from \"data/types\";\r\n\r\nexport const getSelected = (\r\n selected: Array\r\n): string | number | null =>\r\n selected != null &&\r\n Array.isArray(selected) &&\r\n selected.length > 0 &&\r\n selected[0] != null &&\r\n String(selected[0]).length > 0\r\n ? selected[0]\r\n : null;\r\n\r\ntype Props = {\r\n item: SearchBucketDTO,\r\n i: number,\r\n onSelect: (name: string, value: Object) => void,\r\n isDisabled: boolean,\r\n};\r\n\r\nconst SearchBucket = ({ item, i, onSelect, isDisabled }: Props) => {\r\n const selected: Array = item.selected || [];\r\n\r\n // custom button without menu\r\n /* istanbul ignore else */\r\n if (item.buckets.length === 0) {\r\n if (item.hideMenu === true) {\r\n return (\r\n \r\n );\r\n } else return null;\r\n }\r\n\r\n return (\r\n \r\n 0 ? \"bold\" : \"normal\",\r\n fontStyle: selected.length > 0 ? \"normal\" : \"italic\",\r\n }}\r\n >\r\n \r\n \r\n \r\n {bowser.is(\"mobile\") && }\r\n {getSelected(selected) != null &&\r\n item.name !== SORT_BUCKET_NAME &&\r\n item.hideAllReset !== true && (\r\n \r\n )}\r\n {item.buckets.map((bucket, i) => (\r\n \r\n ))}\r\n \r\n \r\n );\r\n};\r\nSearchBucket.displayName = \"FilterBar.SearchBucket\";\r\nSearchBucket.Name = Name;\r\nSearchBucket.Header = Header;\r\nSearchBucket.AllItem = AllItem;\r\nSearchBucket.MenuItem = MenuItem;\r\nSearchBucket.Button = Button;\r\nSearchBucket.Icon = Icon;\r\n\r\nexport default SearchBucket;\r\n","import Bowser from \"bowser\";\r\n\r\nconst bowser = Bowser.getParser(window.navigator.userAgent);\r\nexport default bowser;\r\n\r\nexport /**\r\n * @returns {boolean} true if browser cannot clone fetch responses\r\n * @url https://developer.mozilla.org/en-US/docs/Web/API/Response/clone#browser_compatibility\r\n */\r\n/* istanbul ignore next */\r\nconst isLegacyResponseClone = () =>\r\n bowser.satisfies({\r\n chrome: \"<42\",\r\n });\r\n\r\nexport /**\r\n * @returns {boolean} true if mobile or tablet device\r\n *\r\n */\r\nconst isHandheld = () => bowser.is(\"mobile\") || bowser.is(\"tablet\");\r\n\r\nexport /**\r\n * @returns {boolean} true if iOS\r\n *\r\n */\r\nconst isIOS = () => bowser.is(\"iOS\");\r\n\r\nexport /**\r\n * @returns {boolean} true if Windows\r\n *\r\n */\r\nconst isWindows = () => bowser.is(\"Windows\");\r\n\r\nexport /**\r\n * @returns {boolean} true if Safari\r\n *\r\n */\r\nconst isSafari = () => bowser.is(\"Safari\");\r\n\r\nexport /* istanbul ignore next */ const hasConsole = () =>\r\n bowser.is(Bowser.BROWSER_MAP.edge) ||\r\n bowser.is(Bowser.BROWSER_MAP.chrome) ||\r\n bowser.is(Bowser.BROWSER_MAP.firefox) ||\r\n bowser.is(Bowser.BROWSER_MAP.opera) ||\r\n bowser.is(Bowser.BROWSER_MAP.electron) ||\r\n bowser.is(Bowser.BROWSER_MAP.safari);\r\n","/* istanbul ignore file */\r\n\r\nimport Loader from \"components/Loader\";\r\nimport { LoadingType } from \"data/types\";\r\n\r\nexport default Loader(\r\n {\r\n loader: () =>\r\n import(\"./index\" /* webpackChunkName: \"component-EAForm\" */),\r\n },\r\n LoadingType.Status\r\n);\r\n","// @flow\r\nimport React from \"react\";\r\nimport { get } from \"data/constants\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport loc from \"i18next\";\r\nimport styles from \"./LocalContactInfo.module.css\";\r\nimport globalloc from \"data/i18n.global\";\r\n\r\nconst LocalContactInfo = () => {\r\n const localContactInfo = get(\r\n window.CONFIG,\r\n [\"general\", \"localContactInfo\"],\r\n null\r\n );\r\n if (localContactInfo == null) {\r\n return null;\r\n }\r\n const { email, text = \"\", url } = localContactInfo;\r\n return (\r\n
\r\n {text}\r\n {(email || url) && (\r\n
\r\n {email && (\r\n
\r\n {loc.t(\"localContactInfo:email\") ||\r\n /* istanbul ignore next */ globalloc\r\n .localContactInfo.email}\r\n \r\n {email}\r\n \r\n
\r\n )}\r\n {url && (\r\n
\r\n {loc.t(\"localContactInfo:url\") ||\r\n /* istanbul ignore next */ globalloc\r\n .localContactInfo.url}\r\n \r\n {url}\r\n \r\n
\r\n )}\r\n
\r\n )}\r\n
\r\n );\r\n};\r\n\r\nLocalContactInfo.displayName = \"LocalContactInfo\";\r\nexport default LocalContactInfo;\r\n","import { fetchForm } from \"data/api\";\r\n\r\nconst uriForFormTokens = (uri: string): string =>\r\n uri.replaceAll(\"{ea.\", \"{ea_\").replaceAll(\"{ip.\", \"{ip_\"); // hack since tokenize does not support sub-objects\r\n\r\nconst withFormTokens = async (context: any, encodedContext: any = {}) => {\r\n try {\r\n if (context.itemUri) {\r\n const form = await fetchForm(context.itemUri);\r\n let rawValues = {};\r\n if (form.fields && form.fields.length > 0) {\r\n form.fields.forEach(\r\n (field) =>\r\n (rawValues[\"ip_\" + field.name] = Array.isArray(\r\n field.value\r\n )\r\n ? field.value.map((value) =>\r\n encodeURIComponent(\r\n value?.K ?? value?.V ?? value\r\n )\r\n )\r\n : encodeURIComponent(\r\n field.value?.K ??\r\n field.value?.V ??\r\n field.value\r\n ))\r\n );\r\n }\r\n\r\n if (form.attributes && form.attributes.length > 0) {\r\n form.attributes.forEach(\r\n (attribute) =>\r\n (rawValues[\"ea_\" + attribute.name] = Array.isArray(\r\n attribute.value\r\n )\r\n ? attribute.value.map((value) =>\r\n encodeURIComponent(\r\n value?.K ?? value?.V ?? value\r\n )\r\n )\r\n : encodeURIComponent(\r\n attribute.value?.K ??\r\n attribute.value?.V ??\r\n attribute.value\r\n ))\r\n );\r\n }\r\n return Object.assign(encodedContext, rawValues);\r\n }\r\n } catch (e) {\r\n console.error(\"Error while useFormTokens\", e);\r\n }\r\n return encodedContext;\r\n};\r\n\r\nexport { uriForFormTokens, withFormTokens };\r\n","import React from \"react\";\r\nimport Icons from \"@hs/icons\";\r\nimport styles from \"./UserGroup.module.css\";\r\nimport { getClassNames } from \"data/utils\";\r\n\r\nconst UserGroup = ({\r\n className,\r\n title,\r\n}: {\r\n className?: string,\r\n title?: string,\r\n}) => (\r\n \r\n \r\n \r\n);\r\n\r\nUserGroup.displayName = \"UserGroup\";\r\nexport default UserGroup;\r\n","import React from \"react\";\r\nimport Avatar from \"./Avatar\";\r\nimport UserGroup from \"./UserGroup\";\r\nimport { PrincipalType, type PrincipalTypeEnum } from \"data/types\";\r\n\r\nconst PrincipalAvatar = ({\r\n id,\r\n className,\r\n title,\r\n type = PrincipalType.User,\r\n}: {\r\n id?: int,\r\n className?: string,\r\n title?: string,\r\n type: PrincipalTypeEnum,\r\n}) =>\r\n type === PrincipalType.User ? (\r\n \r\n ) : (\r\n \r\n );\r\n\r\nPrincipalAvatar.displayName = \"Principal\";\r\nexport default PrincipalAvatar;\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrapper\":\"NativeSelect_wrapper__3wn7x\",\"icon\":\"NativeSelect_icon__3lgDG\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"table\":\"RowResultByLayout_table__1dG2X\",\"row\":\"RowResultByLayout_row__2_oTT\",\"cell\":\"RowResultByLayout_cell__28nnu\",\"lastcell\":\"RowResultByLayout_lastcell__u2vNi\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"main\":\"Divider_main__bPfiD\",\"textNoHR\":\"Divider_textNoHR__2Zgbo\",\"text\":\"Divider_text__20CvV\",\"fa\":\"Divider_fa__23KPV\",\"hr\":\"Divider_hr__98RAJ\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"strip\":\"itemView_docListGallery_strip__2gPpM\",\"stripInner\":\"itemView_docListGallery_stripInner__1sQTy\",\"thumb\":\"itemView_docListGallery_thumb__2vB-w\",\"nav\":\"itemView_docListGallery_nav__20h1C\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"top\":\"itemView_workflow_top___CY33\",\"progressBadge\":\"itemView_workflow_progressBadge__2Atpi\",\"wrapper\":\"itemView_workflow_wrapper__nfgH4\",\"actions\":\"itemView_workflow_actions__3_5me\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrapper\":\"SharePrincipal_wrapper__2xzQt\",\"empty\":\"SharePrincipal_empty__2y9BE\",\"row\":\"SharePrincipal_row__36t1C\",\"toolbar\":\"SharePrincipal_toolbar__2JiHI\",\"noBorder\":\"SharePrincipal_noBorder__3hPh5\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"GeoRasterInput_container__1a5g4\",\"inputGroup\":\"GeoRasterInput_inputGroup__3yxK5\",\"buttonsWrapper\":\"GeoRasterInput_buttonsWrapper__1duSy\",\"iconWrapper\":\"GeoRasterInput_iconWrapper__1hLr4\",\"button\":\"GeoRasterInput_button__3NHjt\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrapper\":\"LockInfo_wrapper__2VzoT\",\"aside\":\"LockInfo_aside__TrmP1\",\"avatar\":\"LockInfo_avatar__1uP5x\",\"show\":\"LockInfo_show__1en7j\",\"fadeIn\":\"LockInfo_fadeIn__1KvRB\",\"hide\":\"LockInfo_hide__3Lpts\",\"fadeOut\":\"LockInfo_fadeOut__8JonZ\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrapper\":\"SearchScope_wrapper__2lxW5\",\"radio\":\"SearchScope_radio__1NHqF\",\"radio-inline\":\"SearchScope_radio-inline__AAIo7\",\"checkbox\":\"SearchScope_checkbox__1ftQm\",\"checkbox-inline\":\"SearchScope_checkbox-inline__ar-d0\",\"aside\":\"SearchScope_aside__3_fVU\",\"show\":\"SearchScope_show__BOD9T\",\"fadeIn\":\"SearchScope_fadeIn__3jhbw\",\"hide\":\"SearchScope_hide__MP2aV\",\"fadeOut\":\"SearchScope_fadeOut__3gi8N\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"layerContainer\":\"RasterLayer_layerContainer__2ilJQ\",\"arrows\":\"RasterLayer_arrows__jvd97\",\"thumb\":\"RasterLayer_thumb__jbtQN\",\"name\":\"RasterLayer_name__1GZh5\",\"btnDelete\":\"RasterLayer_btnDelete__267PZ\"};","// @flow\r\n\r\nimport {\r\n type ExtraAttributesEmbeddedGridDTO,\r\n type ExtraAttributeEmbeddedGridColumnDTO,\r\n type ExtraAttributeDataAuditLogDTO,\r\n} from \"data/types\";\r\n\r\n/**\r\n * returns the default values for a given grid\r\n *\r\n * @param {string} gridName grid name (identifier)\r\n * @param {any} attributes form attributes\r\n * @param {string} seqId seqId\r\n * @returns {Array} default value of related grid row\r\n */\r\nexport const getGridRowDefaultValues = (\r\n gridName: string,\r\n attributes: any,\r\n seqId: string | number\r\n): Array => {\r\n const grid = getGrid(attributes, gridName);\r\n const [isNew] = parseSeqId(seqId);\r\n if (isNew) {\r\n return grid.columns.map((col, index) =>\r\n grid.seqIdColumn === index\r\n ? `${seqId}`\r\n : attributes.find((attribute) => attribute.name === col.name)\r\n .value\r\n );\r\n }\r\n return grid.rows.find((row) => row[grid.seqIdColumn] === `${seqId}`);\r\n};\r\n\r\n/**\r\n * returns isNew and corresponding row index/seqId\r\n *\r\n * @param {string | number} seqId seqId to parse\r\n * @returns {Array} array containing a bool flag \"isNew\" and the designated seqId (isNew = false) or new row index (isNew = true)\r\n */\r\nexport const parseSeqId = (seqId: string | number): Array => {\r\n seqId = parseInt(seqId, 10);\r\n return [seqId < 0, seqId < 0 ? convertSeqIdToIndex(seqId) : seqId];\r\n};\r\n\r\n/**\r\n * converts a row index into a seqId\r\n *\r\n * @param {number} index row index to convert to seqId\r\n * @returns {number} seqId\r\n */\r\nexport const convertIndexToSeqId = (index: number) => (index + 1) * -1;\r\n\r\n/**\r\n * converts a seqId into a row index\r\n *\r\n * @param {number} seqId seqId to convert to row index\r\n * @returns {number} row index\r\n */\r\nexport const convertSeqIdToIndex = (seqId: number) => seqId * -1 - 1;\r\n\r\n/**\r\n * returns Embedded Grid DTO from form attributes by given gridName\r\n *\r\n * @param {Array} attributes form attributes\r\n * @param {string} gridName grid name with form type prefix\r\n * @returns {ExtraAttributesEmbeddedGridDTO} Embedded Grid DTO\r\n */\r\nexport const getGrid = (\r\n attributes: Array,\r\n gridName: string\r\n): ExtraAttributesEmbeddedGridDTO => {\r\n return attributes.find(\r\n (attribute) => attribute.name === gridName.split(\".\")[1]\r\n ).value;\r\n};\r\n\r\n/**\r\n * maps a grid row to given ExtraAttributeEmbeddedGridColumnDTO names\r\n *\r\n * @param {Array} row given row\r\n * @param {Array} columns grid columns\r\n * @returns {Object} row values by column name\r\n */\r\nexport const mapGridRowToColumns = (\r\n row: Array,\r\n columns: Array\r\n): Object => {\r\n const result = {};\r\n columns.forEach(\r\n (col: ExtraAttributeEmbeddedGridColumnDTO, index: number) => {\r\n result[col.name] = row[index];\r\n }\r\n );\r\n return result;\r\n};\r\n\r\n/**\r\n * checks if row is deleted in given auditLog\r\n *\r\n * @param {?ExtraAttributeDataAuditLogDTO} auditLog auditLog to check\r\n * @param {string} seqId row identifier\r\n * @returns {bool} flag if row by seqId has changed or is new\r\n */\r\nexport const isGridRowDeleted = (\r\n auditLog: ?ExtraAttributeDataAuditLogDTO,\r\n seqId: string\r\n): boolean =>\r\n auditLog &&\r\n auditLog.deletedIds &&\r\n auditLog.deletedIds.includes(parseInt(seqId, 10));\r\n\r\n/**\r\n * checks if row is updated changed in given auditLog\r\n *\r\n * @param {?ExtraAttributeDataAuditLogDTO} auditLog auditLog to check\r\n * @param {string} seqId row identifier\r\n * @returns {bool} flag if row by seqId has changed or is new\r\n */\r\nexport const isGridRowUpdated = (\r\n auditLog: ?ExtraAttributeDataAuditLogDTO,\r\n seqId: string\r\n): boolean =>\r\n auditLog &&\r\n ((auditLog.updatedRows &&\r\n Object.prototype.hasOwnProperty.call(auditLog.updatedRows, seqId)) ||\r\n parseInt(seqId, 10) < 0);\r\n","// @flow\r\nimport React from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport ReactDOMServer from \"react-dom/server\";\r\nimport {\r\n ViewNameType,\r\n type SidebarItemDTO,\r\n type SearchItemDTO,\r\n type SearchScopeEnum,\r\n type SearchFilterDTO,\r\n type SearchNodeTypeEnum,\r\n} from \"data/types\";\r\nimport queryString from \"data/queryString\";\r\nimport * as cfg from \"data/storeHelper\";\r\nimport { isMiniView, isSecureParams, get } from \"data/constants\";\r\n\r\nexport const inPointAction = {\r\n browse: \"browse\",\r\n preview: \"preview\",\r\n properties: \"properties\",\r\n edit: \"edit\",\r\n archive: \"archive\",\r\n commandAction: \"commandaction\",\r\n};\r\nexport type inPointActionsEnum = $Keys;\r\n\r\nexport /**\r\n * creates an inPoint:uri link (for use with inPoint.Sync)\r\n *\r\n * @param {inPointActionsEnum} action type of action\r\n * @param {string?} itemUri itemUri\r\n * @returns {string} link\r\n */\r\nconst inPointActionLink = (\r\n action: inPointActionsEnum,\r\n itemUri?: string,\r\n itemUris?: Array,\r\n additionalProps?: any = {}\r\n): string =>\r\n `inpoint:${action}?${queryString.stringify({\r\n ...additionalProps,\r\n uri: itemUri,\r\n uris: itemUris,\r\n sp: get(window.CONFIG, [\"general\", \"secure_params\"], undefined),\r\n })}`;\r\n\r\nconst ClientLink = ({\r\n action,\r\n name,\r\n itemUri,\r\n}: {\r\n action: inPointActionsEnum,\r\n name: string,\r\n itemUri: string,\r\n}) => (\r\n \r\n {name}\r\n \r\n);\r\nClientLink.displayName = \"ClientLink\";\r\n\r\nexport /**\r\n * returns an HTML rendered link to open an inPoint:uri (for use with inPoint.Sync)\r\n *\r\n * @param {string} name text to display as link name\r\n * @param {string} itemUri itemUri\r\n * @param {inPointActionsEnum} action inPoint.Client action\r\n * @returns {string} HTML rendering of link\r\n */\r\nconst getClientLinkHtml = (\r\n name: string,\r\n itemUri: string,\r\n action: inPointActionsEnum\r\n): string => {\r\n const link = ;\r\n return ReactDOMServer.renderToStaticMarkup(link);\r\n};\r\n\r\nexport /**\r\n * converts an itemUri to a Web short itemUri (no protocol prefix)\r\n *\r\n * @param {string} itemUri\r\n * @returns {string}\r\n */\r\nconst shortItemUri = (itemUri: string): string =>\r\n itemUri.substring(\r\n itemUri.indexOf(\"pam-item://\") === -1 ? 0 : \"pam-item://\".length\r\n );\r\n\r\n// export /** returns an itemUri with a specific document's version */\r\n// const docItemUriWithVersion = (itemUri: string, version?: number) =>\r\n// version && version > 0 ? `${itemUri}@version=${version}` : itemUri;\r\n\r\nexport /**\r\n * returns route to open a document\r\n *\r\n * @param {string} itemUri itemUri\r\n * @param {boolean} [mini] whether docRoute should be opened in mini mode\r\n * @param {boolean} [externalLink] whether link will be used for external new browser\r\n * @param {string | Array} [toggles] toggles to select\r\n * @param {?string} [mark] terms to highlight (if PDF)\r\n * @param {boolean} [print] toggle print dialog (if PDF)\r\n * @returns {string} doc route link\r\n */\r\nconst docRoute = (\r\n itemUri: string,\r\n mini?: boolean,\r\n externalLink?: boolean,\r\n toggles?: string | Array,\r\n mark?: string,\r\n print?: boolean\r\n): string =>\r\n (externalLink === true\r\n ? get(window.CONFIG, [\"host\", \"basename\"], \"\")\r\n : \"\") +\r\n (mini === true ? \"/mini\" : \"\") +\r\n \"/doc?\" +\r\n queryString.stringify({\r\n uri: shortItemUri(itemUri),\r\n sp: get(window.CONFIG, [\"general\", \"secure_params\"], undefined),\r\n toggles:\r\n toggles != null && Array.isArray(toggles)\r\n ? toggles.join(\",\")\r\n : toggles,\r\n mark,\r\n print,\r\n });\r\n\r\nexport /**\r\n * converts a searchItem object into a searchRoute\r\n *\r\n * @param {SearchItemDTO} searchItem searchItem object to convert\r\n * @returns {string} search route link\r\n */\r\nconst searchRouteWithItem = (searchItem: SearchItemDTO): string => {\r\n let qs = {};\r\n Object.keys(searchItem).forEach((k) => {\r\n if ((searchItem[k] && searchItem[k] !== null) || searchItem[k] === 0)\r\n switch (k) {\r\n case \"sorts\":\r\n //TODO: Allow multiple sorts\r\n const sort = searchItem[k][0];\r\n Object.keys(sort).forEach(\r\n (sortKey) => (qs[`sorts.${sortKey}`] = sort[sortKey])\r\n );\r\n break;\r\n default:\r\n qs[k] = searchItem[k];\r\n break;\r\n }\r\n });\r\n return \"/searchResult?\" + queryString.stringify(qs);\r\n};\r\n\r\nexport /**\r\n * returns route to start a fulltext search with keyword\r\n *\r\n * @param {string} keyword keyword to use for search\r\n * @returns {string} search route link\r\n */\r\nconst searchRouteWithKeyword = (keyword: string): string =>\r\n \"/searchResult?\" +\r\n queryString.stringify({\r\n searchText: keyword,\r\n });\r\n\r\nexport /**\r\n * returns route to start a fulltext search with keyword scoped to itemUri\r\n *\r\n * @param {string} keyword keyword to use for search\r\n * @param {string} itemUri itemUri to limit scope (CurrentFolder)\r\n * @param {SearchScopeEnum} [scope] optional search scope (AllSites, AllFolders, CurrentFolder)\r\n * @param {Array} [filters] optional search filters\r\n * @param {Array} [sorts] optional search sorts\r\n * @param {SearchNodeTypeEnum} [nodeType] optional search NodeType\r\n * @returns {string} search route link\r\n */\r\nconst searchRouteWithKeywordAndMore = (\r\n keyword: string,\r\n itemUri: string,\r\n scope?: SearchScopeEnum,\r\n filters?: Array,\r\n sorts?: Array,\r\n nodeType?: SearchNodeTypeEnum\r\n): string =>\r\n \"/searchResult?\" +\r\n queryString.stringify({\r\n searchText: keyword,\r\n itemUri,\r\n scope,\r\n filters:\r\n filters && filters.length > 0 ? JSON.stringify(filters) : undefined,\r\n sorts: sorts && sorts.length > 0 ? JSON.stringify(sorts) : undefined,\r\n nodeType,\r\n });\r\n\r\nexport /**\r\n * returns a folder route\r\n *\r\n * @param {string} itemUri folder's itemUri\r\n * @param {boolean} [mini] whether route should be opened in mini mode\r\n * @param {boolean} [externalLink] whether link will be used for external new browser\r\n * @param {string | Array} [toggles] toggles to select\r\n * @returns {string} folder route link\r\n */\r\nconst folderRoute = (\r\n itemUri: string,\r\n mini?: boolean,\r\n externalLink?: boolean,\r\n toggles?: string | Array\r\n): string =>\r\n (externalLink === true\r\n ? get(window.CONFIG, [\"host\", \"basename\"], \"\")\r\n : \"\") +\r\n (mini === true ? \"/mini\" : \"\") +\r\n \"/folder?\" +\r\n queryString.stringify({\r\n uri: shortItemUri(itemUri),\r\n sp: get(window.CONFIG, [\"general\", \"secure_params\"], undefined),\r\n toggles:\r\n toggles != null && Array.isArray(toggles)\r\n ? toggles.join(\",\")\r\n : toggles,\r\n });\r\n\r\nexport /**\r\n * returns a route for flat view\r\n *\r\n * @param {string} itemUri folder's itemUri\r\n * @param {boolean} [mini] whether route should be opened in mini mode\r\n * @param {boolean} [externalLink] whether link will be used for external new browser\r\n * @param {string | Array} [toggles] toggles to select\r\n * @returns {string} flat route link\r\n */\r\nconst flatRoute = (\r\n itemUri: string,\r\n mini?: boolean,\r\n externalLink?: boolean,\r\n toggles?: string | Array\r\n): string =>\r\n (externalLink === true\r\n ? get(window.CONFIG, [\"host\", \"basename\"], \"\")\r\n : \"\") +\r\n (mini === true ? \"/mini\" : \"\") +\r\n \"/flat?\" +\r\n queryString.stringify({\r\n uri: shortItemUri(itemUri),\r\n sp: get(window.CONFIG, [\"general\", \"secure_params\"], undefined),\r\n toggles:\r\n toggles != null && Array.isArray(toggles)\r\n ? toggles.join(\",\")\r\n : toggles,\r\n });\r\n\r\nexport /**\r\n * returns a route for mail view\r\n *\r\n * @param {string} itemUri folder's itemUri\r\n * @param {boolean} [mini] whether route should be opened in mini mode\r\n * @param {boolean} [externalLink] whether link will be used for external new browser\r\n * @param {string | Array} [toggles] toggles to select\r\n * @returns {string} mail route link\r\n */\r\nconst mailRoute = (\r\n itemUri: string,\r\n mini?: boolean,\r\n externalLink?: boolean,\r\n toggles?: string | Array\r\n): string =>\r\n (externalLink === true\r\n ? get(window.CONFIG, [\"host\", \"basename\"], \"\")\r\n : \"\") +\r\n (mini === true ? \"/mini\" : \"\") +\r\n (mini === true ? \"/flat?\" : \"/mail?\") + // There is currently NO mini view for mail so we use flat\r\n queryString.stringify({\r\n uri: shortItemUri(itemUri),\r\n sp: get(window.CONFIG, [\"general\", \"secure_params\"], undefined),\r\n toggles:\r\n toggles != null && Array.isArray(toggles)\r\n ? toggles.join(\",\")\r\n : toggles,\r\n });\r\n\r\nconst viewNameTypeRouteMapping = {\r\n [ViewNameType.folder]: folderRoute,\r\n [ViewNameType.mailbox]: mailRoute,\r\n [ViewNameType.flat]: flatRoute,\r\n};\r\n\r\nexport /**\r\n * dynamically figures out which route (and view) to use.\r\n * if no sites configuration available, will always return a folder route link\r\n * @param {string} itemUri item's itemURi\r\n * @param {boolean} [mini] whether route should be opened in mini mode (if not passed will try to parse from window.location)\r\n * @param {boolean} [externalLink] whether link will be used for external new browser\r\n * @returns {string} route link\r\n */\r\nconst getRoute = (\r\n itemUri: string,\r\n mini?: boolean,\r\n externalLink?: boolean,\r\n isDoc?: boolean,\r\n toggles?: string | Array\r\n): string => {\r\n // no isDoc parameter passed on? figure it out if not in secureParams\r\n if (isDoc == null) isDoc = itemUri.indexOf(\"@eid\") > 0;\r\n\r\n // no mini parameter passed on? figure it out\r\n /* istanbul ignore else */\r\n if (mini == null) {\r\n mini = isMiniView(window.location);\r\n }\r\n\r\n const props = [itemUri, mini, externalLink, toggles];\r\n\r\n if (isDoc === true) return docRoute(...props);\r\n\r\n const sites = cfg.sitesSelector();\r\n if (sites != null) {\r\n // sites sorted by itemUri.length descending\r\n const sitesOrdered = sites\r\n .slice(0)\r\n .sort(\r\n (a: SidebarItemDTO, b: SidebarItemDTO) =>\r\n b.itemUri.length - a.itemUri.length\r\n );\r\n // do we have an exact match?\r\n const orderedIndex = sitesOrdered.findIndex(\r\n (orderedSite) => orderedSite.itemUri === itemUri\r\n );\r\n // ...then take it\r\n if (orderedIndex !== -1) {\r\n return viewNameTypeRouteMapping[\r\n sitesOrdered[orderedIndex].viewName\r\n ](...props);\r\n } else {\r\n // find closest neighbour\r\n const orderedIndex2 = sitesOrdered.findIndex(\r\n (orderedSite) => itemUri.indexOf(orderedSite.itemUri) === 0\r\n );\r\n if (orderedIndex2 !== -1) {\r\n return viewNameTypeRouteMapping[\r\n sitesOrdered[orderedIndex2].viewName\r\n ](...props);\r\n }\r\n }\r\n }\r\n //if uri does not exist at all in our sidebar\r\n return folderRoute(...props);\r\n};\r\n\r\n/**\r\n * React component to render an HTML tag with a link\r\n *\r\n * @param {{ name: string, itemUri: string }} { name, itemUri }\r\n * @returns HTML component\r\n */\r\nconst BrowserLink = ({\r\n name,\r\n itemUri,\r\n isDoc,\r\n}: {\r\n name: string,\r\n itemUri: string,\r\n isDoc?: boolean,\r\n}) => (\r\n \r\n {name}\r\n \r\n);\r\nBrowserLink.displayName = \"BrowserLink\";\r\n\r\nexport /**\r\n * returns an HTML rendered link to open an inPoint.Web route link\r\n *\r\n * @param {string} name text to display as link name\r\n * @param {string} itemUri itemUri\r\n * @param {?boolean} itemUri itemUri\r\n * @returns {string} HTML rendering of link\r\n */\r\nconst getBrowserLinkHtml = (\r\n name: string,\r\n itemUri: string,\r\n isDoc: ?boolean\r\n): string => {\r\n const link = ;\r\n return ReactDOMServer.renderToStaticMarkup(link);\r\n};\r\n\r\nexport const BrowserDragLink = ({\r\n className,\r\n itemUri,\r\n children,\r\n}: {\r\n className: ?string,\r\n itemUri: string,\r\n children: any,\r\n}) =>\r\n isSecureParams(window.location) ? (\r\n {children}\r\n ) : (\r\n e.preventDefault()}\r\n >\r\n {children}\r\n \r\n );\r\nBrowserDragLink.displayName = \"BrowserDragLink\";\r\nBrowserDragLink.propTypes = {\r\n itemUri: PropTypes.string.isRequired,\r\n};\r\n","import actionTypes from \"data/actions/actionTypes\";\r\nimport produce from \"immer\";\r\n\r\n// state.toggles {}\r\n// ._selected[] of string toggle.value\r\n// .counts {} of string toggle.value=toggle.count\r\n\r\nexport function getSelected(toggles) {\r\n let result = [];\r\n toggles\r\n .filter((toggle) => toggle.isSelected)\r\n .forEach((toggle) => result.push(toggle.value));\r\n return result;\r\n}\r\n\r\nconst togglesReducer = (state = {}, action) =>\r\n produce(state, (draft) => {\r\n const { name, toggles, counts, status } = action?.payload || {};\r\n switch (action.type) {\r\n case actionTypes.TOGGLES_PERSIST: {\r\n /* istanbul ignore else */\r\n if (draft[name] == null) {\r\n draft[name] = {};\r\n }\r\n draft[name].persisted = true;\r\n }\r\n // eslint-disable-next-line no-fallthrough\r\n case actionTypes.TOGGLES_CHANGE: {\r\n if (draft[name] == null) {\r\n draft[name] = {};\r\n }\r\n draft[name]._selected = getSelected(toggles);\r\n break;\r\n }\r\n case actionTypes.TOGGLES_UPDATECOUNTER: {\r\n if (draft[name] == null) {\r\n draft[name] = {};\r\n }\r\n if (draft[name].counts == null) {\r\n draft[name].counts = {};\r\n }\r\n if (status != null && draft[name].status == null) {\r\n draft[name].status = {};\r\n }\r\n Object.keys(action.payload.counts).forEach((key) => {\r\n draft[name].counts[key] = counts[key];\r\n if (status != null) {\r\n draft[name].status[key] = status[key];\r\n }\r\n });\r\n break;\r\n }\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return {};\r\n default:\r\n return draft;\r\n }\r\n });\r\n\r\nexport default togglesReducer;\r\n\r\nexport const selectedTogglesSelector = (state: Object, viewName: string) =>\r\n state.toggles?.[viewName]?.[\"_selected\"] ?? undefined; // used by TogglesHandler to load initialState\r\nexport const togglesPersistedSelector = (state: Object, viewName: string) =>\r\n state.toggles?.[viewName]?.[\"persisted\"] ?? false; // used by currentItemSaga to load initialState\r\n","import actionTypes from \"data/actions/actionTypes\";\r\nimport Constants from \"data/constants\";\r\nimport produce from \"immer\";\r\n\r\nconst initialState = {\r\n cards: [],\r\n status: Constants.NONE,\r\n};\r\n\r\nconst cardsReducer = (state = initialState, action) =>\r\n produce(state, (draft) => {\r\n const { payload, type } = action;\r\n switch (type) {\r\n case actionTypes.CARDS_FETCH_ENTITY_REQUESTED:\r\n draft.status = payload.status;\r\n break;\r\n case actionTypes.CARDS_FETCH_REQUESTED:\r\n case actionTypes.CARDS_FETCH_RESULT:\r\n return { ...state, ...payload };\r\n case actionTypes.CARDS_FETCH_ENTITY_RESULT:\r\n const { status, cards, cardTypes, cardItemTypes } = payload;\r\n const cardsToAdd = cards.filter(\r\n (card) =>\r\n !(draft.cards || []).find(\r\n (oldCard) => oldCard.id === card.id\r\n )\r\n );\r\n const cardsToUpdate = (draft.cards || [])\r\n .map(\r\n (oldCard) =>\r\n cards.find((card) => oldCard.id === card.id) ??\r\n ((cardTypes?.includes(oldCard.type) ?? true) &&\r\n (cardItemTypes?.includes(oldCard.itemtype) ?? true)\r\n ? null\r\n : oldCard)\r\n )\r\n .filter((card) => !!card);\r\n draft.status = status;\r\n draft.cards = [...cardsToAdd, ...cardsToUpdate];\r\n break;\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return initialState;\r\n default:\r\n return state;\r\n }\r\n });\r\n\r\nexport default cardsReducer;\r\n\r\nexport const cardsStatusSelector = (state: Object) => state.cards.status;\r\nexport const cardsCardsSelector = (state: Object) => state.cards.cards;\r\n","import actionTypes from \"data/actions/actionTypes\";\r\nimport Constants from \"data/constants\";\r\nimport immutable from \"object-path-immutable\";\r\n\r\nconst initialState = {};\r\n\r\nconst thumbnailsReducer = (state = initialState, action) => {\r\n switch (action.type) {\r\n case actionTypes.CURRENTITEM_SET:\r\n /* istanbul ignore next */\r\n if (\r\n action.payload.name !== \"docmodal\" &&\r\n action.payload.name !== \"itemflows\" &&\r\n action.payload.itemUri !== state.itemUri\r\n )\r\n return { ...initialState };\r\n else return state;\r\n\r\n case actionTypes.DOCS_THUMBNAIL_REQUEST:\r\n return immutable.set(state, [action.payload.itemUri], {\r\n status: Constants.LOADING,\r\n });\r\n\r\n case actionTypes.DOCS_THUMBNAIL_RESULT:\r\n return immutable.set(state, [action.payload.itemUri], {\r\n status: action.payload.status,\r\n result: action.payload.result,\r\n });\r\n\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return initialState;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default thumbnailsReducer;\r\n\r\nexport const thumbnailStatusSelector = (state: Object, itemUri: string) =>\r\n state.thumbnails[itemUri] != null\r\n ? state.thumbnails[itemUri].status\r\n : Constants.NONE;\r\nexport const thumbnailResultSelector = (state: Object, itemUri: string) =>\r\n state.thumbnails[itemUri] != null\r\n ? state.thumbnails[itemUri].result\r\n : undefined;\r\n","import actionTypes from \"data/actions/actionTypes\";\r\nimport Constants from \"data/constants\";\r\n\r\nconst initialState = {\r\n favorites: [],\r\n status: Constants.NONE,\r\n};\r\n\r\nconst favoritesReducer = (state = initialState, action) => {\r\n switch (action.type) {\r\n case actionTypes.FAVORITES_FETCH_REQUEST:\r\n return { ...state, ...action.payload };\r\n case actionTypes.FAVORITES_FETCH_RESULT:\r\n return { ...state, ...action.payload };\r\n\r\n // first time loaded as part of the User object\r\n case actionTypes.USER_FETCH_RESULT:\r\n return {\r\n ...state,\r\n status: Constants.OK,\r\n favorites: action.payload.favorites,\r\n };\r\n\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return initialState;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default favoritesReducer;\r\n\r\nexport const favoritesStatusSelector = (state: Object) =>\r\n state.favorites.status;\r\nexport const favoritesFavoritesSelector = (state: Object) =>\r\n state.favorites.favorites;\r\n","import actionTypes from \"../actions/actionTypes\";\r\nimport { type CommandActionRequestDTO } from \"data/types\";\r\nimport produce from \"immer\";\r\n\r\nexport const initialState: Array = [];\r\n\r\nconst commandActionReducer = (state = initialState, action) =>\r\n produce(state, (draft) => {\r\n const { payload, type } = action;\r\n const i = state.findIndex((i) => i.guid === payload?.guid);\r\n\r\n switch (type) {\r\n case actionTypes.COMMANDACTION_REQUEST:\r\n draft.push(payload);\r\n break;\r\n case actionTypes.COMMANDACTION_REMOVE:\r\n if (i > -1) draft.splice(i, 1);\r\n else\r\n console.warn(\r\n `Not found. Cannot delete CommandAction ${payload.guid}`\r\n );\r\n break;\r\n case actionTypes.COMMANDACTION_LOG:\r\n if (i > -1) {\r\n if (!Array.isArray(draft[i].log)) draft[i].log = [];\r\n draft[i].log.unshift(payload.log);\r\n } else\r\n console.warn(\r\n `Not found. Cannot log to CommandAction ${payload.guid}`\r\n );\r\n break;\r\n case actionTypes.COMMANDACTION_STATUS:\r\n if (i > -1)\r\n draft[i].status = payload.replace\r\n ? payload.status\r\n : draft[i].status | payload.status;\r\n else\r\n console.warn(\r\n `Not found. Cannot update status on CommandAction ${payload.guid}`\r\n );\r\n break;\r\n case actionTypes.COMMANDACTION_ITEM_STATUS:\r\n if (i === -1) {\r\n console.warn(\r\n `GUID not found. Cannot update item status on CommandAction ${payload.guid}`\r\n );\r\n return;\r\n }\r\n const j = draft[i].items.findIndex(\r\n (i) =>\r\n i.itemUri === payload?.itemUri ||\r\n (i.itemUri == null && payload?.itemUri == null)\r\n );\r\n if (j > -1) {\r\n draft[i].items[j].status = payload.status;\r\n } else\r\n console.warn(\r\n `Item not found. Cannot update item status on CommandAction ${payload.guid}`\r\n );\r\n break;\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return initialState;\r\n default:\r\n break;\r\n }\r\n });\r\n\r\nexport default commandActionReducer;\r\n\r\nexport const commandActionRequestSelector = (\r\n state: Any,\r\n guid: GUID = null\r\n): Array =>\r\n state.commandAction?.filter((i) => guid == null || i.guid === guid) ?? [];\r\n\r\nexport const commandActionRequestItemSelector = (\r\n state: Any,\r\n guid: GUID,\r\n itemUri: string = null\r\n): Array =>\r\n commandActionRequestSelector(state, guid)?.[0]?.items?.filter(\r\n (i) => itemUri == null || i.itemUri === itemUri\r\n ) ?? [];\r\n","import React from \"react\";\r\n\r\nexport const PaneSizeContext = React.createContext();\r\nPaneSizeContext.displayName = \"PaneSize\";\r\n\r\nexport const LabelSizeContext = React.createContext();\r\nLabelSizeContext.displayName = \"LabelSize\";\r\n\r\nexport const CurrentItemContext = React.createContext();\r\nCurrentItemContext.displayName = \"CurrentItem\";\r\n\r\nexport const MultiSelectionContext = React.createContext();\r\nMultiSelectionContext.displayName = \"MultiSelection\";\r\n\r\nexport const ItemContext = React.createContext();\r\nItemContext.displayName = \"ItemContext\";\r\n","import { openProgressModal } from \"components/ProgressModal\";\r\nimport { LocationToString } from \"components/MapViewer/utils\";\r\nimport loc from \"i18next\";\r\nimport geoLocatorOptions from \"components/LocatorButton/geoLocatorOptions\";\r\n\r\ntype Props = {\r\n /** callback when user's geolocation successfully retrieved\r\n * @param {string} strLocation string coordinates\r\n */\r\n onLocation: (strLocation: string) => void,\r\n};\r\n\r\nconst getGeoLocation = async ({ onLocation }: Props) => {\r\n const geolocator = await import(\"geolocator\");\r\n return openProgressModal({\r\n icon: \"globe\",\r\n title: loc.t(\"common:location.loading\"),\r\n doWork: (close, setError) =>\r\n geolocator.default.locate(geoLocatorOptions(), (err, location) => {\r\n if (err) {\r\n /* istanbul ignore next */\r\n if (err.message != null) setError(err.message);\r\n else setError(\"Unknown Error Occured.\");\r\n console.warn(err);\r\n } else {\r\n onLocation(LocationToString(location.coords));\r\n close();\r\n }\r\n }),\r\n });\r\n};\r\n\r\nexport default getGeoLocation;\r\n","// @flow\r\n// import { SearchItemDTO } from \"data/types\";\r\n\r\n// type BarcodeConfig = {\r\n// description: string,\r\n// matchRegexp: RegExp,\r\n// searchItem: SearchItemDTO\r\n// };\r\n\r\n// const barcodes: Array = [\r\n// {\r\n// description:\r\n// \"by Freetext: will retrieve k code from a SolothurnURL e.g. https://geo.so.ch/map/?k=cde94a977\",\r\n// matchRegexp: /k=(.*)/gm,\r\n// searchItem: {\r\n// name: \"QR location search\",\r\n// searchType: 2, //SearchItemType.Freetext\r\n// itemUri: \"pam-item://hierarchy=51@path=78$-7\\\\,82$-8812\\\\,83$-8813\",\r\n// scope: 2, //SearchScope.CurrentFolder\r\n// filters: [\r\n// // {\r\n// // name: \"sys.itemtype\",\r\n// // value: \"Folder\"\r\n// // },\r\n// {\r\n// name: \"KCode\",\r\n// valueMatchGroup: 1,\r\n// op: 8, //SearchOperator.Equals,\r\n// valueType: \"String\", //SearchValueType.String\r\n// nodeType: 0 //SearchNodeType.AllNodes\r\n// }\r\n// ]\r\n// }\r\n// }\r\n// // {\r\n// // description:\r\n// // \"by SearchForm: will retrieve k code from a SolothurnURL e.g. https://geo.so.ch/map/?k=cde94a977\",\r\n// // matchRegexp: /k=(.*)/gm,\r\n// // searchItem: {\r\n// // pageNum: 0,\r\n// // id: 9410, //\"Barcode - Solothurn\"\r\n// // // name: \"QR location search\",\r\n// // searchType: 3, //SearchItemType.Form\r\n// // filters: [\r\n// // // {\r\n// // // name: \"sys.itemtype\",\r\n// // // value: \"Folder\"\r\n// // // },\r\n// // {\r\n// // name: \"KCode\",\r\n// // op: 8,//SearchOperator.Equals,\r\n// // valueType: \"String\", //SearchValueType.String\r\n// // nodeType: 0, //SearchNodeType.AllNodes\r\n// // matchGroup: 1\r\n// // }\r\n// // ]\r\n// // }\r\n// // }\r\n// ];\r\n\r\n// export /**\r\n// * tries to match a barcode configuration and returns filters to set\r\n// *\r\n// * @param {{ code: string }} { code } barcode scanned\r\n// * @returns {{ barcode: BarcodeConfig, filters: Object }}\r\n// */\r\n// const findBarcodeConfig = ({ code }: { code: string }) => {\r\n// let i = 0;\r\n// // loop through all barcode configs\r\n// while (i < barcodes.length) {\r\n// let barcode = barcodes[i++];\r\n// let m;\r\n// // find all matches\r\n// while ((m = barcode.matchRegexp.exec(code)) !== null) {\r\n// // This is necessary to avoid infinite loops with zero-width matches\r\n// if (m.index === barcode.matchRegexp.lastIndex) {\r\n// barcode.matchRegexp.lastIndex++;\r\n// }\r\n// // anything found?\r\n// if (m.length > 0) {\r\n// const filters = [];\r\n// // let's build a filter list searchItemType.FreeText\r\n// // eslint-disable-next-line\r\n// barcode.searchItem.filters.forEach(filter => {\r\n// if (filter.value) filters.push(filter);\r\n// else if (filter.valueMatchGroup)\r\n// filters.push(\r\n// Object.assign(\r\n// {},\r\n// filter,\r\n// { valueMatchGroup: null },\r\n// { value: m[filter.valueMatchGroup] }\r\n// )\r\n// );\r\n// });\r\n// return {\r\n// barcode,\r\n// filters\r\n// };\r\n// }\r\n// }\r\n// }\r\n// return null;\r\n// };\r\n\r\nexport const getBarcodeMatch = ({\r\n code,\r\n matchRegexp,\r\n}: {\r\n code: string,\r\n matchRegexp: string,\r\n}): ?string => {\r\n let m;\r\n const re = new RegExp(matchRegexp, \"gmi\");\r\n // find all matches\r\n while ((m = re.exec(code)) !== null) {\r\n // This is necessary to avoid infinite loops with zero-width matches\r\n /* istanbul ignore if */\r\n if (m.index === re.lastIndex) {\r\n re.lastIndex++;\r\n }\r\n // anything found?\r\n /* istanbul ignore else */\r\n if (m.length > 1) {\r\n return m[1];\r\n }\r\n }\r\n return null;\r\n};\r\n","// import { openBarcodeModal } from \"components/BarcodeModal\";\r\nimport { getBarcodeMatch } from \"data/barcode\";\r\n\r\ntype Props = {\r\n /** Barcode modal title */\r\n title: string,\r\n /** callback once barcode was read (or user clicked cancel)\r\n * @note will NOT be called if user clicked Cancel\r\n * @param {?string} barcode null if no match or barcode itself\r\n */\r\n onBarcode: (barcode: ?string) => void,\r\n /** optional RegExp to retrieve code from QR Barcode */\r\n matchRegexp?: string,\r\n};\r\n\r\n/**\r\n * shows a Barcode Model to scan/upload a barcode,\r\n * matches it and returns the matched code\r\n// TODO currently only QR codes supported, normal Barcode do not need any regexp!\r\n */\r\nconst getBarcode = async ({ title, onBarcode, matchRegexp }: Props) => {\r\n const { openBarcodeModal } = await import(\r\n \"components/BarcodeModal\" /* webpackChunkName: \"barcode\" */\r\n );\r\n openBarcodeModal({\r\n title,\r\n }).then((code) => {\r\n // user clicked cancel/closed modal?\r\n if (code === false) {\r\n return;\r\n }\r\n const result = matchRegexp\r\n ? getBarcodeMatch({ code, matchRegexp })\r\n : code;\r\n onBarcode(result);\r\n });\r\n};\r\n\r\nexport default getBarcode;\r\n","import { searchRouteWithItem } from \"components/ItemUriLink\";\r\nimport history from \"data/history\";\r\nimport {\r\n type SearchItemDTO,\r\n SearchItemType,\r\n type SearchFilterDTO,\r\n type SearchSortDTO,\r\n NotificationStyle,\r\n} from \"data/types\";\r\nimport getGeoLocation from \"./searchResult_form.geoLocation\";\r\nimport getBarcode from \"./searchResult_form.barcode\";\r\nimport loc from \"i18next\";\r\nimport { toastStyled } from \"data/toast\";\r\nimport { tokenize } from \"data/utils\";\r\n\r\nexport /**\r\n * will prefix the filter's name with \".\" (unless $SEARCHTEXT$) to signalize the server-side processing to replace only the value\r\n * and take all filter properties as configured in the search form\r\n * @param {*} name\r\n */\r\nconst fixSearchFilterName = (name) =>\r\n name.toLowerCase() === \"$searchtext$\" ? \"$SEARCHTEXT$\" : \".\" + name; //only overwrite value (see SearchQueryConversion.cs)\r\n\r\n/**\r\n * create a searchItem object and navigate to the /searchresult view\r\n */\r\nconst runSearchItem = ({\r\n id,\r\n name,\r\n showFilterbar,\r\n searchType,\r\n viewMode,\r\n filters,\r\n sorts,\r\n}) =>\r\n history.push(\r\n searchRouteWithItem({\r\n id,\r\n name,\r\n searchType,\r\n fb: showFilterbar ? 1 : 0,\r\n vm: viewMode,\r\n filters: JSON.stringify(filters),\r\n sorts: JSON.stringify(sorts),\r\n })\r\n );\r\n\r\nexport const createSearchItem = ({\r\n id,\r\n name,\r\n showFilterbar,\r\n searchType,\r\n viewMode,\r\n filters,\r\n sorts,\r\n onSearchItemCreated,\r\n}) => {\r\n const searchItem: SearchItemDTO = {\r\n id,\r\n name,\r\n searchType: searchType || SearchItemType.Form,\r\n showFilterbar:\r\n showFilterbar !== \"false\" && showFilterbar !== false ? true : false,\r\n viewMode,\r\n filters: filters && JSON.parse(JSON.stringify(filters)), //HACK: We need a mutable object for this function\r\n sorts,\r\n };\r\n // analyse required filters (any tokens?)\r\n if (filters && filters.length > 0) {\r\n // any geolocation token?\r\n const geoFilter = searchItem.filters.find(\r\n (f) =>\r\n f.value &&\r\n String(f.value).toLowerCase().indexOf(\"{geolocation}\") !== -1\r\n );\r\n if (geoFilter) {\r\n getGeoLocation({\r\n onLocation: (strLoc) => {\r\n geoFilter.name = fixSearchFilterName(geoFilter.name); //only overwrite value (see SearchQueryConversion.cs)\r\n // geolocation string format with radius (as required by inPoint.Web.Server for geoField radius search)\r\n const geolocation = `${strLoc},${geoFilter.radius || 1000}`;\r\n geoFilter.value = tokenize(geoFilter.value, {\r\n geolocation,\r\n });\r\n onSearchItemCreated(searchItem);\r\n },\r\n });\r\n return null;\r\n }\r\n\r\n // or barcode token?\r\n const barcodeFilter = searchItem.filters.find(\r\n (f) =>\r\n f.value &&\r\n String(f.value).toLowerCase().indexOf(\"{barcode}\") !== -1\r\n );\r\n if (barcodeFilter) {\r\n getBarcode({\r\n title: name,\r\n matchRegexp: barcodeFilter.matchRegexp,\r\n onBarcode: (barcode) => {\r\n if (barcode == null) {\r\n toastStyled({\r\n icon: \"warning\",\r\n style: NotificationStyle.Error,\r\n toastId: \"barcode-failure\",\r\n message: loc.t(\"barcode:noMatch\"),\r\n });\r\n return;\r\n }\r\n barcodeFilter.name = fixSearchFilterName(\r\n barcodeFilter.name\r\n ); //only overwrite value (see SearchQueryConversion.cs)\r\n barcodeFilter.value = tokenize(barcodeFilter.value, {\r\n barcode,\r\n });\r\n onSearchItemCreated(searchItem);\r\n },\r\n });\r\n return null;\r\n }\r\n }\r\n return searchItem;\r\n};\r\n\r\nexport /**\r\n * a Promise version of the createSearchItem() function (in case of placeholders it uses callbacks)\r\n */\r\nconst createSearchItemAsync = (\r\n searchItem: SearchItemDTO\r\n): Promise =>\r\n new Promise((resolve, reject) => {\r\n const newSearchItem = createSearchItem({\r\n ...searchItem,\r\n onSearchItemCreated: resolve,\r\n });\r\n /* istanbul ignore else */\r\n if (newSearchItem != null) resolve(newSearchItem);\r\n });\r\n\r\ntype Context = {\r\n title: string,\r\n searchForm: number,\r\n showFilterbar?: boolean | string,\r\n viewMode?: string,\r\n filters?: Array,\r\n sorts?: Array,\r\n};\r\n\r\nclass searchResult_form {\r\n /**\r\n * shows searchResults for a pre-defined searchForm\r\n * @param {{ title: string }} { title } the modal title\r\n * @param {{ searchForm: number }} { searchForm } searchForm.id to run\r\n * @param {{ showFilterbar: boolean }} { showFilterbar } whether to include Filterbar (default: true)\r\n * @param {{ viewMode: string }} { viewMode } change default viewMode (List/Map) (default: List)\r\n * @param {{ filters: Array }} { filters } set additional filters\r\n * @param {{ sorts: Array }} { sorts } set sorting\r\n */\r\n execute = ({\r\n title,\r\n searchForm,\r\n showFilterbar,\r\n viewMode,\r\n filters,\r\n sorts,\r\n }: Context) => {\r\n const searchItem = createSearchItem({\r\n id: searchForm,\r\n name: title,\r\n showFilterbar,\r\n viewMode,\r\n filters,\r\n sorts,\r\n onSearchItemCreated: runSearchItem,\r\n });\r\n if (searchItem != null) {\r\n // no filters / nor geolocation / nor barcode\r\n runSearchItem(searchItem);\r\n }\r\n return true;\r\n };\r\n}\r\n\r\nexport default searchResult_form;\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"filter\":\"TreeFilter_filter__nmE69\",\"toggleGroup\":\"TreeFilter_toggleGroup__3y1jK\",\"si\":\"TreeFilter_si__HWo-O\",\"buttonDeep\":\"TreeFilter_buttonDeep__EqZpA\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"list\":\"ExternalUser_list__3MyIf\",\"label\":\"ExternalUser_label__1SAIl\",\"name\":\"ExternalUser_name__3MJqW\",\"action\":\"ExternalUser_action__ULTs0\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrapper\":\"LocalContactInfo_wrapper__2fqCp\",\"actions\":\"LocalContactInfo_actions__3qo-A\",\"btn\":\"LocalContactInfo_btn__3RVwf\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"inputGroup\":\"GeoAreaInput_inputGroup__3SKXn\",\"buttonsWrapper\":\"GeoAreaInput_buttonsWrapper__3_XFG\",\"iconWrapper\":\"GeoAreaInput_iconWrapper__2_968\",\"button\":\"GeoAreaInput_button__PfwfE\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"toolbar\":\"Toolbar_toolbar__36k4K\",\"title\":\"Toolbar_title__1NWsg\",\"projColor\":\"Toolbar_projColor__3ldkV\",\"projName\":\"Toolbar_projName__PXVEJ\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"close\":\"FormModal_close__2qKWP\",\"formmodal\":\"FormModal_formmodal__nKPGO\",\"notAuthorizedWrapper\":\"FormModal_notAuthorizedWrapper__22m8U\",\"notAuthorizedIcon\":\"FormModal_notAuthorizedIcon__2Lb9B\"};","// @flow\r\nimport React, { PureComponent, type Node } from \"react\";\r\nimport uppy from \"data/uppy\";\r\nimport { toastActionResult } from \"data/toast\";\r\nimport { getClassNames } from \"data/utils\";\r\nimport \"./index.css\";\r\n\r\nconst isDragDropSupported = require(\"@uppy/utils/lib/isDragDropSupported\");\r\nconst getDroppedFiles = require(\"@uppy/utils/lib/getDroppedFiles\");\r\n\r\nexport type DroppedFile = {\r\n source: string,\r\n name: string,\r\n type: string,\r\n data: Object,\r\n};\r\n\r\ntype Props = {\r\n /** whether to allow dropping file on these children */\r\n allowDrop: boolean,\r\n /** called after files have been dropped\r\n * @param {Array} files dropped files ready for uppy - only if @see {addFilesToUppy} is false!\r\n */\r\n onDrop: (files: Array) => void,\r\n /** React node(s) to render */\r\n children: ?Node,\r\n /** HTML id attribute */\r\n id: ?string,\r\n /** HTML style attribute */\r\n style: ?string,\r\n /** HTML class attribute */\r\n className: ?string,\r\n /** Component to apply the FileDropHandler (must be HTML Tag string or Component that forwards the filedrop ref ) */\r\n component: ?string | PureComponent,\r\n /** whether to automatically add files to global uppy instance */\r\n addFilesToUppy?: boolean,\r\n /** message to show while user is dragging over the targetEl dropzone */\r\n dragOverText?: string,\r\n /** relative path */\r\n relativePath?: string,\r\n};\r\n\r\ntype State = {\r\n isDragover: boolean,\r\n isDrop: boolean,\r\n};\r\n\r\n/**\r\n * This will watch @see {targetEl} as a dropzone and process the files (by adding them to uppy)\r\n * and finally calling the onDrop callback\r\n * @export\r\n */\r\nexport default class FileDropHandler extends PureComponent {\r\n _dropzone: ?React$ElementRef;\r\n _timeout: ?TimeoutID;\r\n _isMounted: boolean;\r\n\r\n static defaultProps = {\r\n addFilesToUppy: true,\r\n relativePath: null,\r\n };\r\n\r\n constructor(props) {\r\n super(props);\r\n this._dropzone = React.createRef();\r\n this.state = {\r\n isDragover: false,\r\n };\r\n }\r\n\r\n componentDidMount = () => {\r\n this._isMounted = true;\r\n this._registerHandler();\r\n };\r\n\r\n componentWillUnmount = () => {\r\n this._isMounted = false;\r\n this._unregisterHandler();\r\n };\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n // allowDrop changed\r\n /* istanbul ignore else */\r\n if (prevProps.allowDrop !== this.props.allowDrop) {\r\n if (this.props.allowDrop === false) {\r\n this._unregisterHandler();\r\n } else {\r\n this._registerHandler();\r\n }\r\n }\r\n }\r\n\r\n _registerHandler = () => {\r\n if (this.props.allowDrop !== true || !isDragDropSupported()) {\r\n return;\r\n }\r\n this._dropzone.current.addEventListener(\"drop\", this.onDrop);\r\n this._dropzone.current.addEventListener(\"dragover\", this.onDragOver);\r\n this._dropzone.current.addEventListener(\"dragleave\", this.onDragLeave);\r\n };\r\n\r\n _unregisterHandler = () => {\r\n this._dropzone.current.removeEventListener(\"drop\", this.onDrop);\r\n this._dropzone.current.removeEventListener(\"dragover\", this.onDragOver);\r\n this._dropzone.current.removeEventListener(\r\n \"dragleave\",\r\n this.onDragLeave\r\n );\r\n clearTimeout(this._timeout);\r\n };\r\n\r\n onDrop = (event) => {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n event.dataTransfer.dropEffect = \"copy\";\r\n\r\n if (!this.isFileDrag(event)) {\r\n toastActionResult(false, \"action_drop\");\r\n return;\r\n }\r\n\r\n getDroppedFiles(event.dataTransfer).then((files) => {\r\n let addedCount = 0;\r\n const filesDTO = files.map((file) => {\r\n const fileDTO = {\r\n source: \"FileDropHandler\",\r\n name: file.name,\r\n type: file.type,\r\n data: file,\r\n meta: {\r\n name: file.name,\r\n relativePath: this.props.relativePath,\r\n },\r\n };\r\n\r\n /* istanbul ignore else */\r\n if (this.props.addFilesToUppy)\r\n try {\r\n uppy.addFile(fileDTO);\r\n addedCount++;\r\n } catch (err) {\r\n /* istanbul ignore next */\r\n if (!err.isRestriction) {\r\n uppy.log(err);\r\n }\r\n }\r\n else addedCount++;\r\n return fileDTO;\r\n });\r\n // only continue if any pending uploads remain\r\n /* istanbul ignore else */\r\n if (addedCount > 0) {\r\n /* istanbul ignore else */\r\n if (typeof this.props.onDrop === \"function\") {\r\n this.props.onDrop(filesDTO);\r\n }\r\n }\r\n this.onDragLeave(event);\r\n });\r\n };\r\n\r\n isFileDrag = (event) =>\r\n event &&\r\n event.dataTransfer &&\r\n event.dataTransfer.types &&\r\n [...event.dataTransfer.types].includes(\"Files\");\r\n\r\n onDragOver = (event) => {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n /* istanbul ignore else */\r\n if (this._isMounted && this.isFileDrag(event))\r\n this.setState({\r\n isDragover: true,\r\n });\r\n clearTimeout(this._timeout);\r\n };\r\n\r\n onDragLeave = (event) => {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n this._timeout = setTimeout(this._timedDragLeave, 100);\r\n };\r\n\r\n /** Delays firing of dragleave on child dragenter */\r\n _timedDragLeave = () =>\r\n this._isMounted && this.setState({ isDragover: false });\r\n\r\n render = () => {\r\n const {\r\n style,\r\n id,\r\n component: DropHandler = \"div\",\r\n dragOverText,\r\n children = null,\r\n relativePath,\r\n ...props\r\n } = this.props;\r\n let {\r\n className = \"\",\r\n allowDrop,\r\n onDrop,\r\n addFilesToUppy,\r\n ...componentProps\r\n } = props;\r\n className = getClassNames(\r\n className,\r\n this.state.isDragover ? \"drag\" : \"\"\r\n );\r\n return (\r\n \r\n {this.state.isDragover && (\r\n {this.props.dragOverText}\r\n )}\r\n {children}\r\n \r\n );\r\n };\r\n}\r\n","export const PickerAction = {\r\n Open: \"picker.open\",\r\n Select: \"picker.select\",\r\n Cancel: \"picker.cancel\",\r\n};\r\n\r\nexport const DefaultAction = {\r\n Browse: \"browse\",\r\n Search: \"search\",\r\n GeoInfo: \"geo.info\",\r\n GeoInfoLegacy: \"geo-info\",\r\n Exec: \"exec\",\r\n Picker: PickerAction,\r\n};\r\n","export const CustomUploadAction = {\r\n Ready: \"custom.upload.ready\",\r\n Language: \"custom.upload.language\",\r\n File: \"custom.upload.file\",\r\n};\r\n","export const ArrowNavigationAction = {\r\n Ready: \"mini.doc.ready\",\r\n Load: \"mini.doc.load\",\r\n Reload: \"mini.doc.reload\",\r\n Paginate: \"mini.doc.paginate\",\r\n SetIndex: \"mini.doc.setIndex\",\r\n};\r\n","export const PdfHighlightAction = {\r\n Load: \"pdf.highlight.load\",\r\n Upsert: \"pdf.highlight.upsert\",\r\n Highlight: \"pdf.highlight.highlight\",\r\n Delete: \"pdf.highlight.delete\",\r\n Select: \"pdf.highlight.select\",\r\n};\r\n","export const PdfSignatureAction = \"pdf.signature\";\r\n","export const PdfPrintAction = \"pdf.print\";\r\n","export const ModalAction = {\r\n Close: \"modal.close\",\r\n CloseLegacy: \"close-modal\", //Legacy notation, keep for\r\n};\r\n","export const NotificationAction = {\r\n Show: \"notification.center.show\",\r\n Hide: \"notification.center.hide\",\r\n Clear: \"notification.clear\",\r\n Status: \"notification.status\",\r\n Upsert: \"notification.upsert\",\r\n Delete: \"notification.delete\",\r\n Toast: \"notification.toast\",\r\n};\r\n","import { DefaultAction, PickerAction } from \"./Default\";\r\nimport { CustomUploadAction } from \"./CustomUpload\";\r\nimport { ArrowNavigationAction } from \"./ArrowNavigation\";\r\nimport { PdfHighlightAction } from \"./PdfHighlight\";\r\nimport { PdfSignatureAction } from \"./PdfSignature\";\r\nimport { PdfPrintAction } from \"./PdfPrint\";\r\nimport { ModalAction } from \"./Modal\";\r\nimport { NotificationAction } from \"./Notification\";\r\nimport { HtmlViewerAction } from \"@hs/html-viewer\";\r\n\r\nDefaultAction.Toast = NotificationAction.Toast;\r\n\r\nexport {\r\n DefaultAction,\r\n PickerAction,\r\n CustomUploadAction,\r\n ArrowNavigationAction,\r\n PdfHighlightAction,\r\n PdfSignatureAction,\r\n PdfPrintAction,\r\n ModalAction,\r\n NotificationAction,\r\n HtmlViewerAction,\r\n};\r\n\r\nexport type DefaultActionEnum = $Values;\r\nexport type PickerActionEnum = $Values;\r\nexport type CustomUploadActionEnum = $Values;\r\nexport type PdfHighlightActionEnum = $Values;\r\nexport type ArrowNavigationActionEnum = $Values;\r\nexport type ModalActionEnum = $Values;\r\nexport type NotificationActionEnum = $Values;\r\nexport type HtmlViewerActionEnum = $Values;\r\n","import React, { useEffect } from \"react\";\r\nimport { usePrevious } from \"hooks\";\r\nimport withItemContext from \"containers/ItemContext\";\r\n\r\ntype Props = {\r\n itemUri: string,\r\n // provide effects\r\n effects: any,\r\n children: any,\r\n};\r\n\r\nexport const ItemContextProvider = ({ children, effects, ...props }: Props) => {\r\n const prevProps = usePrevious(props);\r\n useEffect(() => {\r\n if (!prevProps || !effects) return;\r\n Object.keys(effects).forEach((key) => {\r\n const prevProp = prevProps[key];\r\n const prop = props[key];\r\n if (prevProp === prop) return;\r\n effects[key](prop, props);\r\n });\r\n }, [prevProps, props, effects]);\r\n return typeof children === \"function\" ? (\r\n <>{children(props)}\r\n ) : children ? (\r\n <>{children}\r\n ) : null;\r\n};\r\n\r\nexport default withItemContext({ asProps: true })(ItemContextProvider);\r\n","// @flow\r\nimport React, { useContext } from \"react\";\r\nimport { MultiSelectionContext } from \"data/context\";\r\nimport PropTypes from \"prop-types\";\r\nimport Icons from \"@hs/icons\";\r\nimport Breadcrumb from \"components/Breadcrumb\";\r\nimport Attributes from \"components/Attributes\";\r\nimport { type SearchResultRowDTO } from \"data/types\";\r\nimport { removeSpaces } from \"data/integrationTestUtils\";\r\nimport withStickyToggle from \"containers/StickyToggle\";\r\nimport StickyToggleStyle from \"containers/StickyToggle/style\";\r\nimport { isHandheld } from \"data/bowser\";\r\nimport styles from \"./RowResult.module.css\";\r\n\r\ntype Props = {\r\n /** row number */\r\n index: number,\r\n /* CSS classname to apply */\r\n className: string,\r\n /* CSS styles to apply */\r\n style?: StyleSheet | Object,\r\n /* search result row object */\r\n row: SearchResultRowDTO,\r\n /** callback when user clicks whole row */\r\n onClick: () => void,\r\n /** whether breadcrumb should be readonly */\r\n isBreadcrumbReadonly: boolean,\r\n /** whether more button is rendered */\r\n actionsDisabled: boolean,\r\n /** StickyToggleHOC div ref */\r\n divRef: { current: null | React.ElementRef },\r\n /** ContextMenuHandler onTouchStart callback */\r\n onTouchStart: () => void,\r\n /** ContextMenuHandler onTouchMove callback */\r\n onTouchMove: () => void,\r\n /** ContextMenuHandler onTouchEnd callback */\r\n onTouchEnd: () => void,\r\n /** ContextMenuHandler onMouseDown callback */\r\n onMouseDown: () => void,\r\n /** ContextMenuHandler onMouseUp callback */\r\n onMouseUp: () => void,\r\n /** ContextMenuHandler onContextMenu callback */\r\n onContextMenu: () => void,\r\n};\r\n\r\n/**\r\n * will render one folder search result\r\n */\r\nexport const FolderResult = ({\r\n index,\r\n className,\r\n style,\r\n row,\r\n onClick,\r\n isBreadcrumbReadonly,\r\n actionsDisabled,\r\n isHovered,\r\n divRef,\r\n onMouseEnter,\r\n onMouseLeave,\r\n onTouchStart,\r\n onTouchMove,\r\n onTouchEnd,\r\n onMouseDown,\r\n onMouseUp,\r\n onContextMenu,\r\n}: Props) => {\r\n /* istanbul ignore next */\r\n const { multiple, renderCheckbox } = useContext(MultiSelectionContext) || {\r\n multiple: false,\r\n renderCheckbox: () => null,\r\n };\r\n\r\n return (\r\n \r\n {(multiple || (isHovered && !isHandheld())) &&\r\n renderCheckbox(index, styles.checkbox)}\r\n
\r\n {row.elementType && (\r\n \r\n )}\r\n {row.title}\r\n \r\n
\r\n \r\n \r\n );\r\n};\r\nFolderResult.displayName = \"FolderResult\";\r\nFolderResult.propTypes = {\r\n index: PropTypes.number.isRequired,\r\n className: PropTypes.string,\r\n style: PropTypes.object,\r\n row: PropTypes.object.isRequired,\r\n onClick: PropTypes.func.isRequired,\r\n isBreadcrumbReadonly: PropTypes.bool,\r\n};\r\n\r\nconst FolderResultWithStickyToggle = withStickyToggle({\r\n renderDiv: false,\r\n usePortal: false,\r\n getStyle: StickyToggleStyle.List,\r\n})(FolderResult);\r\n\r\nexport default FolderResultWithStickyToggle;\r\n","// @flow\r\nimport React, { useContext } from \"react\";\r\nimport { MultiSelectionContext } from \"data/context\";\r\nimport PropTypes from \"prop-types\";\r\nimport Icons from \"@hs/icons\";\r\nimport Breadcrumb from \"components/Breadcrumb\";\r\nimport Attributes from \"components/Attributes\";\r\nimport { type SearchResultRowDTO } from \"data/types\";\r\nimport { removeSpaces } from \"data/integrationTestUtils\";\r\nimport withStickyToggle from \"containers/StickyToggle\";\r\nimport StickyToggleStyle from \"containers/StickyToggle/style\";\r\nimport { isHandheld } from \"data/bowser\";\r\nimport styles from \"./RowResult.module.css\";\r\n\r\ntype Props = {\r\n /** row number */\r\n index: number,\r\n /* CSS classname to apply */\r\n className: string,\r\n /* CSS styles to apply */\r\n style?: StyleSheet | Object,\r\n /* search result row object */\r\n row: SearchResultRowDTO,\r\n /** callback when user clicks whole row */\r\n onClick: () => void,\r\n /** whether breadcrumb should be readonly */\r\n isBreadcrumbReadonly: boolean,\r\n /** whether more button is rendered */\r\n actionsDisabled: boolean,\r\n /** StickyToggleHOC div ref */\r\n divRef: { current: null | React.ElementRef },\r\n /** ContextMenuHandler onTouchStart callback */\r\n onTouchStart: () => void,\r\n /** ContextMenuHandler onTouchMove callback */\r\n onTouchMove: () => void,\r\n /** ContextMenuHandler onTouchEnd callback */\r\n onTouchEnd: () => void,\r\n /** ContextMenuHandler onMouseDown callback */\r\n onMouseDown: () => void,\r\n /** ContextMenuHandler onMouseUp callback */\r\n onMouseUp: () => void,\r\n /** ContextMenuHandler onContextMenu callback */\r\n onContextMenu: () => void,\r\n};\r\n\r\n/**\r\n * will render one document search result\r\n */\r\nexport const DocumentResult = ({\r\n index,\r\n className,\r\n style,\r\n row,\r\n onClick,\r\n isBreadcrumbReadonly,\r\n actionsDisabled,\r\n isHovered,\r\n divRef,\r\n onMouseEnter,\r\n onMouseLeave,\r\n onTouchStart,\r\n onTouchMove,\r\n onTouchEnd,\r\n onMouseDown,\r\n onMouseUp,\r\n onContextMenu,\r\n}: Props) => {\r\n /* istanbul ignore next */\r\n const { multiple, renderCheckbox } = useContext(MultiSelectionContext) || {\r\n multiple: false,\r\n renderCheckbox: () => null,\r\n };\r\n return (\r\n \r\n {(multiple || (isHovered && !isHandheld())) &&\r\n renderCheckbox(index, styles.checkbox)}\r\n
\r\n \r\n {row.title}\r\n \r\n
\r\n
{row.summary}
\r\n \r\n \r\n );\r\n};\r\nDocumentResult.displayName = \"DocumentResult\";\r\nDocumentResult.propTypes = {\r\n index: PropTypes.number.isRequired,\r\n className: PropTypes.string,\r\n style: PropTypes.object,\r\n row: PropTypes.object.isRequired,\r\n onClick: PropTypes.func.isRequired,\r\n isBreadcrumbReadonly: PropTypes.bool,\r\n};\r\n\r\nconst DocumentResultWithStickyToggle = withStickyToggle({\r\n renderDiv: false,\r\n usePortal: false,\r\n getStyle: StickyToggleStyle.List,\r\n})(DocumentResult);\r\n\r\nexport default DocumentResultWithStickyToggle;\r\n","// @flow\r\nimport React, { useMemo, useCallback, useContext } from \"react\";\r\nimport { MultiSelectionContext } from \"data/context\";\r\nimport { useEffectOnce } from \"hooks\";\r\nimport FolderResult from \"./FolderResult\";\r\nimport DocumentResult from \"./DocumentResult\";\r\nimport Mark from \"@hs/mark\";\r\nimport { type SearchResultRowDTO } from \"data/types\";\r\nimport { hasSomeParentTheClass, getClassNames } from \"data/utils\";\r\nimport { isHandheld } from \"data/bowser\";\r\nimport styles from \"./RowResult.module.css\";\r\n\r\ntype Props = {\r\n /** row index number */\r\n index: number,\r\n /** optional CSS style to apply */\r\n style?: Object,\r\n /** search item row to render */\r\n row: SearchResultRowDTO,\r\n /** callback when search row has been rendered (CellMeasurer) */\r\n onLoad: () => void,\r\n /** words to highlight */\r\n terms: Array,\r\n /** whether current should be marked as active */\r\n isActive: boolean,\r\n /** callback when user clicks on a row\r\n * @param {number} index the row index clicked\r\n * @param {SearchResultRowDTO} row the row object itself\r\n * @param {boolean} ctrlKey whether control-key was pressed\r\n */\r\n onClick: (index: number, row: SearchResultRowDTO, ctrlKey: boolean) => void,\r\n /** callback when user clicks on a row More... button\r\n * @param {number} index the row index clicked\r\n * @param {SearchResultRowDTO} row the row object itself\r\n */\r\n onMoreClick: (index: number, row: SearchResultRowDTO) => void,\r\n /** callback when user hovers row\r\n * @param {number} index the row hovered\r\n */\r\n onMouseEnter: (index: number, row: SearchResultRowDTO) => void,\r\n /** whether breadcrumb should allow navigation */\r\n isBreadcrumbReadonly?: boolean,\r\n};\r\n\r\nconst RowResult = ({\r\n index,\r\n style,\r\n row,\r\n onLoad,\r\n terms,\r\n isBreadcrumbReadonly,\r\n isActive,\r\n isHovered,\r\n onClick,\r\n onContextMenu,\r\n onTouchStart,\r\n onTouchMove,\r\n onTouchEnd,\r\n onMoreClick,\r\n onMouseDown,\r\n onMouseEnter,\r\n onMouseLeave,\r\n onMouseUp,\r\n}: Props) => {\r\n useEffectOnce(() => {\r\n onLoad();\r\n }, []);\r\n\r\n /* istanbul ignore next */\r\n const { multiple, isSelected } = useContext(MultiSelectionContext) || {\r\n multiple: false,\r\n isSelected: (index: number) => false,\r\n };\r\n\r\n const handleClick = useCallback(\r\n (e: SyntheticMouseEvent<*>) => {\r\n e.preventDefault();\r\n // not clicking on a breadcrumb?\r\n /* istanbul ignore else */\r\n if (!hasSomeParentTheClass(e.target, styles.bc)) {\r\n /* istanbul ignore else */\r\n if (typeof onClick === \"function\") onClick(e, index, row);\r\n }\r\n },\r\n [onClick, row, index]\r\n );\r\n\r\n const combinedClassNames = getClassNames(\r\n styles.row,\r\n isHovered ? styles.hovered : null,\r\n multiple\r\n ? isSelected(index)\r\n ? styles.active\r\n : null\r\n : isActive\r\n ? styles.active\r\n : null,\r\n isHandheld() ? (multiple ? styles.multi : null) : styles.multi\r\n );\r\n\r\n const Component = useMemo(\r\n () => (row.isDoc === true ? DocumentResult : FolderResult),\r\n [row]\r\n );\r\n\r\n return (\r\n \r\n term.replace(\"*\", \"\")\r\n )}\r\n exclude={[\".a-name\"]}\r\n // Mark search term but ignore attribute captions!\r\n style={style}\r\n >\r\n \r\n \r\n );\r\n};\r\n\r\nexport default RowResult;\r\n","// @flow\r\nimport React, { PureComponent, type Node } from \"react\";\r\nimport InfiniteLoader from \"react-virtualized/dist/commonjs/InfiniteLoader\";\r\nimport List from \"react-virtualized/dist/commonjs/List\";\r\nimport CellMeasurer from \"react-virtualized/dist/commonjs/CellMeasurer\";\r\nimport CellMeasurerCache from \"react-virtualized/dist/commonjs/CellMeasurer/CellMeasurerCache\";\r\nimport Measure from \"react-measure\";\r\nimport ReactResizeDetector from \"react-resize-detector\";\r\nimport immutable from \"object-path-immutable\";\r\nimport Icons from \"@hs/icons\";\r\nimport RowResult from \"./RowResult\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport { type SearchResultDTO, type SearchResultRowDTO } from \"data/types\";\r\nimport NoData from \"components/NoData\";\r\nimport ContextMenuHandler from \"components/ContextMenu/Handler\";\r\nimport styles from \"./SearchResult.module.css\";\r\n\r\n// #39038 ES limits paged results to 10000 rows\r\nconst FT_ROWSLIMIT = 10000;\r\n\r\ntype Props = {\r\n /** words to highlight in results */\r\n terms: Array,\r\n /** search results */\r\n result: SearchResultDTO,\r\n /** callback to load next page\r\n * @param {number} pageNum which page number to load\r\n */\r\n loadMoreRows: (pageNum: number) => Promise,\r\n /** callback when user clicks on a row\r\n * @param {number} index the row index clicked\r\n * @param {SearchResultRowDTO} row the row object itself\r\n * @param {boolean} newWindow whether requesting new window (ctrlKey or altKey)\r\n */\r\n onClick: (\r\n index: number,\r\n row: SearchResultRowDTO,\r\n newWindow: boolean\r\n ) => void,\r\n /** callback when user clicks on a row More... button\r\n * @param {number} index the row index clicked\r\n * @param {SearchResultRowDTO} row the row object itself\r\n */\r\n onMoreClick: (index: number, row: SearchResultRowDTO) => void,\r\n /** search result row currently active (-1 for none) */\r\n activeRowIndex: number,\r\n /** whether breadcrumbs should allow navigation */\r\n isBreadcrumbReadonly?: boolean,\r\n /** to which row to scroll to */\r\n scrollToRow?: ?number,\r\n /** Callback after rows have been loaded */\r\n handleMoreRowsLoaded: (\r\n rows: Array,\r\n totalCount: number,\r\n updateTotalCount: boolean\r\n ) => void,\r\n};\r\n\r\ntype State = {\r\n rows: any,\r\n pageSize: number,\r\n maxTotal: number,\r\n pagesStatus: Array,\r\n scrollToRow: number,\r\n hoveredRowIndex: number,\r\n};\r\n\r\n/**\r\n * renders flat list of search results\r\n */\r\nexport default class SearchResult extends PureComponent {\r\n _cache: Object;\r\n _list: List;\r\n _isMounted: boolean;\r\n\r\n constructor(props: Props, children?: Node) {\r\n super(props);\r\n this._isMounted = false;\r\n this._cache = new CellMeasurerCache({\r\n fixedWidth: true,\r\n minHeight: 40,\r\n });\r\n\r\n this.state = {\r\n //first page results loaded by SearchResultContainer\r\n rows: props.result.rows,\r\n pageSize: props.result.pageSize,\r\n maxTotal: FT_ROWSLIMIT - props.result.pageSize,\r\n //first page already pre-loaded otherwise we wouldn't be here\r\n pagesStatus: [Constants.OK],\r\n scrollToRow: props.scrollToRow || -1,\r\n hoveredRowIndex: -1,\r\n };\r\n }\r\n componentDidMount = () => (this._isMounted = true);\r\n componentWillUnmount = () => (this._isMounted = false);\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n /* istanbul ignore else */\r\n if (prevProps.result !== this.props.result) {\r\n /* istanbul ignore next */\r\n this._cache.clearAll();\r\n this.setState(\r\n {\r\n rows: this.props.result.rows,\r\n pagesStatus: [Constants.OK],\r\n scrollToRow: -1,\r\n },\r\n () => this._list.scrollToPosition(0)\r\n );\r\n }\r\n /* istanbul ignore else */\r\n if (prevProps.scrollToRow !== this.props.scrollToRow) {\r\n this.setState({\r\n scrollToRow: this.props.scrollToRow,\r\n });\r\n }\r\n }\r\n\r\n /* istanbul ignore next */ _onResize = (width: number, height: number) =>\r\n /* istanbul ignore next */\r\n this._cache.clearAll();\r\n\r\n _isRowLoaded = ({ index }: { index: number }) =>\r\n Object.prototype.hasOwnProperty.call(this.state.rows, index);\r\n\r\n _loadMoreRows = ({\r\n startIndex,\r\n stopIndex,\r\n }: {\r\n startIndex: number,\r\n stopIndex: number,\r\n }) => {\r\n const { rows, pageSize, pagesStatus } = this.state;\r\n //console.log(\"loadMoreRows\", startIndex, stopIndex);\r\n\r\n // result already has data?\r\n /* istanbul ignore next */\r\n if (\r\n Object.prototype.hasOwnProperty.call(rows, startIndex) &&\r\n Object.prototype.hasOwnProperty.call(rows, stopIndex)\r\n ) {\r\n return;\r\n }\r\n\r\n // calc pagenumber\r\n let pageNum = 0;\r\n /* istanbul ignore else */\r\n if (startIndex > 0) {\r\n // specific row index requested? calc page number\r\n pageNum = Math.floor(startIndex / pageSize);\r\n }\r\n // check that stopIndex is indeed included\r\n /* istanbul ignore next */\r\n if ((pageNum + 1) * pageSize < stopIndex) {\r\n pageNum++;\r\n }\r\n // page already loaded/requested?\r\n /* istanbul ignore next */\r\n if (\r\n pagesStatus[pageNum] === Constants.OK ||\r\n pagesStatus[pageNum] === Constants.LOADING\r\n )\r\n return;\r\n\r\n // fetch\r\n this.setState({\r\n pagesStatus: immutable.set(\r\n this.state.pagesStatus,\r\n pageNum,\r\n Constants.LOADING\r\n ),\r\n });\r\n\r\n return this.props.loadMoreRows(pageNum).then(\r\n (result) =>\r\n this._isMounted &&\r\n this.setState((state) => {\r\n const nextRows = immutable.assign(\r\n state,\r\n \"rows\",\r\n result.rows\r\n ).rows;\r\n this.props.handleMoreRowsLoaded(\r\n nextRows,\r\n result.totalCount\r\n );\r\n return {\r\n rows: nextRows,\r\n pagesStatus: immutable.set(\r\n state.pagesStatus,\r\n pageNum,\r\n Constants.OK\r\n ),\r\n };\r\n })\r\n );\r\n };\r\n\r\n _rowRenderer = ({\r\n index,\r\n isScrolling,\r\n key,\r\n parent,\r\n style,\r\n }: {\r\n index: number,\r\n isScrolling: boolean,\r\n key: number,\r\n parent: Object,\r\n style: StyleSheet,\r\n }) => {\r\n const { rows } = this.state;\r\n const onMouseEnter = (e) => this.setState({ hoveredRowIndex: index });\r\n const onMoreClick =\r\n typeof this.props.onMoreClick === \"function\"\r\n ? (e) => this.props.onMoreClick(e, index, rows[index])\r\n : null;\r\n\r\n // result already has data?\r\n if (this._isRowLoaded({ index })) {\r\n return (\r\n \r\n {({ measure }) => (\r\n \r\n )}\r\n \r\n );\r\n } else {\r\n return (\r\n \r\n {({ measure }) => (\r\n \r\n \r\n \r\n )}\r\n \r\n );\r\n }\r\n };\r\n\r\n render() {\r\n const { result } = this.props;\r\n const { rows, maxTotal } = this.state;\r\n return (\r\n \r\n {(dimensions) => (\r\n // $FlowFixMe\r\n \r\n \r\n {({ onRowsRendered, registerChild }) => (\r\n {\r\n this._list = ref;\r\n registerChild(ref);\r\n }}\r\n deferredMeasurementCache={this._cache}\r\n className={styles.list}\r\n height={dimensions.height}\r\n onRowsRendered={onRowsRendered}\r\n overscanRowCount={0}\r\n rowCount={Math.min(\r\n result.totalCount,\r\n maxTotal\r\n )}\r\n rowHeight={this._cache.rowHeight}\r\n rowRenderer={this._rowRenderer}\r\n noRowsRenderer={() => (\r\n \r\n )}\r\n rows={rows}\r\n width={dimensions.width}\r\n scrollToIndex={this.state.scrollToRow}\r\n scrollToAlignment=\"center\"\r\n />\r\n )}\r\n \r\n \r\n \r\n )}\r\n \r\n );\r\n }\r\n}\r\n","// @flow\r\nimport React, { PureComponent } from \"react\";\r\nimport { connect, Dispatch } from \"react-redux\";\r\nimport MapViewer from \"components/MapViewer\";\r\nimport {\r\n type MapLocationInfo,\r\n type SearchResultDTO,\r\n type MapProviderConfig,\r\n type RasterLocation,\r\n} from \"data/types\";\r\nimport {\r\n ParseLocation,\r\n ParseArea,\r\n ParseRaster,\r\n} from \"components/MapViewer/utils\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport Status from \"components/Status\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport NoData from \"components/NoData\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport loc from \"i18next\";\r\n\r\ntype Props = {\r\n /** Redux dispatch */\r\n dispatch: Dispatch,\r\n /** fetch status */\r\n status: ConstantsEnum,\r\n /** search results */\r\n result: ?SearchResultDTO,\r\n /** callback when we know number of geo locations */\r\n onCountOfGeoResults: (count: number) => void,\r\n /** callback to load next page\r\n * @param {number} pageNum which page number to load\r\n */\r\n loadMoreRows: (pageNum: number) => Promise,\r\n /** custom mapProvider to use */\r\n mapProvider?: MapProviderConfig,\r\n /** callback when user clicks an empty space on the map (only when useMarker=false & mapProvider.onClick exists) */\r\n onClick?: (location: RasterLocation) => void,\r\n};\r\n\r\ntype State = {\r\n locations: ?Array,\r\n pageNum: number,\r\n totalLoaded: number,\r\n isLoadingNextPage: boolean,\r\n hasMorePages: boolean,\r\n};\r\n\r\nexport class SearchResultMap extends PureComponent {\r\n state = {\r\n locations: null,\r\n pageNum: 0,\r\n totalLoaded: 0,\r\n isLoadingNextPage: false,\r\n hasMorePages: false,\r\n };\r\n\r\n componentDidMount() {\r\n const { status, result } = this.props;\r\n if (status !== Constants.OK) return;\r\n else this._firstPage(result);\r\n }\r\n\r\n componentDidUpdate(prevProps: Props, prevState: State) {\r\n /* istanbul ignore else */\r\n if (\r\n this.props.status !== prevProps.status &&\r\n this.props.status === Constants.OK\r\n ) {\r\n this._firstPage(this.props.result);\r\n }\r\n /* istanbul ignore else */\r\n if (\r\n this.state.locations !== prevState.locations &&\r\n typeof this.props.onCountOfGeoResults === \"function\"\r\n ) {\r\n this.props.onCountOfGeoResults(this.state.locations.length);\r\n }\r\n }\r\n\r\n _firstPage = (result: SearchResultDTO) => {\r\n const locations = this._getLocationsFromResult(result);\r\n this.setState({\r\n locations,\r\n hasMorePages: result.totalCount > result.pageSize,\r\n });\r\n };\r\n\r\n _getLocationsFromResult = (result: SearchResultDTO) => {\r\n let locations: Array = [];\r\n let totalLoaded = this.state.totalLoaded;\r\n const onlyRaster =\r\n this.props.mapProvider && this.props.mapProvider.isRaster === true;\r\n Object.keys(result.rows).forEach((rowKey) => {\r\n totalLoaded++;\r\n const row = result.rows[rowKey];\r\n this._getLocations(row).forEach((attr) => {\r\n let location: MapLocationInfo = {\r\n latitude: null,\r\n longitude: null,\r\n label: row.title,\r\n attribute: attr.caption,\r\n row,\r\n itemUri: row.itemUri,\r\n thumbnail: null,\r\n icon: (attr.value && attr.value.marker) || null,\r\n };\r\n switch (attr.format) {\r\n case \"Text_GeoPoint\":\r\n if (onlyRaster) location = null;\r\n else {\r\n const point = ParseLocation(\r\n attr.value.value || attr.value\r\n );\r\n location.latitude = point.latitude;\r\n location.longitude = point.longitude;\r\n }\r\n break;\r\n case \"Text_GeoArea\":\r\n if (onlyRaster) location = null;\r\n else\r\n location.area = ParseArea(\r\n attr.value.value || attr.value\r\n );\r\n break;\r\n case \"Text_GeoRaster\":\r\n if (onlyRaster)\r\n location = Object.assign(\r\n {},\r\n location,\r\n ParseRaster(attr.value.value || attr.value)\r\n );\r\n else location = null;\r\n break;\r\n default:\r\n location = null;\r\n console.warn(\r\n \"Unsupported row attribute format \" + attr.format\r\n );\r\n }\r\n if (location != null) locations.push(location);\r\n });\r\n });\r\n this.setState({ totalLoaded });\r\n return locations;\r\n };\r\n\r\n /** find all attributes with type Text_GeoPoint or Text_GeoArea */\r\n _getLocations = (row: Object) =>\r\n row.attributes.filter(\r\n (a) => a.format && a.format.startsWith(\"Text_Geo\")\r\n );\r\n\r\n // TODO should really be loaded by Redux dispatch\r\n _loadNextPage = () => {\r\n this.setState({ isLoadingNextPage: true });\r\n this.props.loadMoreRows(this.state.pageNum + 1).then((result) => {\r\n const nextLocations = this._getLocationsFromResult(result);\r\n this.setState({\r\n locations: this.state.locations.concat(nextLocations),\r\n pageNum: this.state.pageNum + 1,\r\n hasMorePages:\r\n this.state.totalLoaded < this.props.result.totalCount,\r\n isLoadingNextPage: false,\r\n });\r\n });\r\n };\r\n\r\n render() {\r\n const { status } = this.props;\r\n if (status !== Constants.OK) return ;\r\n\r\n // #51511 Raster Map should always show even if no geo results were found\r\n const isRaster =\r\n this.props.mapProvider &&\r\n this.props.mapProvider.isRaster != null &&\r\n this.props.mapProvider.isRaster !== false;\r\n if (\r\n this.state.locations == null ||\r\n (this.state.locations.length === 0 && !isRaster)\r\n ) {\r\n return ;\r\n }\r\n\r\n return (\r\n <>\r\n {this.state.hasMorePages && (\r\n \r\n {loc.t(\"location.loadNextPage\") + \" \"}\r\n {this.state.isLoadingNextPage && (\r\n \r\n )}\r\n \r\n )}\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\n// TODO move to a container\r\nconst mapStateToProps = /* istanbul ignore next */ (state, ownProps) => ({\r\n status: s.searchStatusSelector(state),\r\n result:\r\n s.searchStatusSelector(state) === Constants.OK\r\n ? s.searchResultSelector(state)\r\n : undefined,\r\n ...ownProps,\r\n});\r\n\r\nexport default connect(mapStateToProps)(SearchResultMap);\r\n","import React from \"react\";\r\nimport ToggleButtonGroup from \"react-bootstrap/lib/ToggleButtonGroup\";\r\nimport ToggleButton from \"react-bootstrap/lib/ToggleButton\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport ButtonToolbar from \"react-bootstrap/lib/ButtonToolbar\";\r\nimport Dropdown from \"@hs/dropdown\";\r\nimport MenuItem from \"react-bootstrap/lib/MenuItem\";\r\nimport CountBadge from \"components/CountBadge\";\r\nimport Icons from \"@hs/icons\";\r\nimport styles from \"./Toolbar.module.css\";\r\nimport loc from \"i18next\";\r\n\r\nconst Views = {\r\n month: \"dayGridMonth\",\r\n week: \"timeGridWeek\",\r\n day: \"timeGridDay\",\r\n agenda: \"listWeek\",\r\n};\r\n\r\ntype Props = {\r\n /** current calendar range title */\r\n title: string,\r\n /** ReactRef to FullCalendar instance */\r\n calendarRef: React.Ref,\r\n /** current FullCalendar view name */\r\n currentView: string,\r\n /** info on all projections */\r\n projections: Object,\r\n /** current selected projection\r\n * @default {string} \"\" to show ALL\r\n */\r\n currentProjection: string,\r\n /** callback when user selects a projection\r\n * @param {string} newProjection projection name from projections\r\n */\r\n onProjectionChange: (newProjection: string) => void,\r\n /** button rendering for loading next result set */\r\n nextPageButton: React.ReactElement,\r\n /** Browser info */\r\n browser: Object,\r\n};\r\n\r\nconst Toolbar = ({\r\n title,\r\n browser,\r\n calendarRef,\r\n currentView,\r\n projections,\r\n currentProjection,\r\n onProjectionChange,\r\n nextPageButton,\r\n}: Props) => (\r\n
\r\n \r\n \r\n {nextPageButton}\r\n \r\n \r\n {loc.t(\"common:search.calendar.projections\")}\r\n \r\n \r\n {currentProjection !== \"\" && (\r\n \r\n onProjectionChange(\"\")\r\n }\r\n >\r\n {loc.t(\"common:filter.AllCaption\")}\r\n \r\n )}\r\n {Object.keys(projections).map((name) => (\r\n \r\n onProjectionChange(name)\r\n }\r\n active={currentProjection === name}\r\n >\r\n \r\n \r\n \r\n {name}\r\n \r\n \r\n \r\n \r\n ))}\r\n \r\n \r\n \r\n \r\n calendarRef.getApi().prev()}\r\n title={loc.t(\"common:search.calendar.prev\")}\r\n >\r\n \r\n \r\n calendarRef.getApi().today()}\r\n title={loc.t(\"common:search.calendar.today\")}\r\n >\r\n {title}\r\n \r\n calendarRef.getApi().next()}\r\n title={loc.t(\"common:search.calendar.next\")}\r\n >\r\n \r\n \r\n \r\n \r\n calendarRef.getApi().changeView(name)\r\n }\r\n >\r\n {Object.keys(Views).map((name) => (\r\n \r\n {loc\r\n .t(`common:search.calendar.${name}`)\r\n .substr(0, browser.lessThan.medium ? 1 : undefined)}\r\n \r\n ))}\r\n \r\n \r\n
\r\n);\r\nToolbar.displayName = \"Calendar.Toolbar\";\r\nexport default Toolbar;\r\n","// @flow\r\nimport React, { PureComponent } from \"react\";\r\nimport { compose } from \"redux\";\r\nimport { connect, Dispatch } from \"react-redux\";\r\nimport { type SearchResultDTO, type SearchResultRowDTO } from \"data/types\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport Status from \"components/Status\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport NoData from \"components/NoData\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport loc from \"i18next\";\r\nimport { userLanguage } from \"data/storeHelper\";\r\nimport Toolbar from \"./Toolbar\";\r\nimport SettingValue, { type SettingValueProps } from \"containers/SettingValue\";\r\nimport Measure from \"react-measure\";\r\n\r\nimport FullCalendar from \"@fullcalendar/react\";\r\nimport \"./index.css\";\r\nimport \"@fullcalendar/core\";\r\nimport dayGridPlugin from \"@fullcalendar/daygrid\";\r\nimport timeGridPlugin from \"@fullcalendar/timegrid\";\r\nimport listPlugin from \"@fullcalendar/list\";\r\nimport bootstrapPlugin from \"@fullcalendar/bootstrap\";\r\n\r\nvar colorArray = [\r\n \"#FF6633\",\r\n \"#FFB399\",\r\n \"#FF33FF\",\r\n \"#FFFF99\",\r\n \"#00B3E6\",\r\n \"#E6B333\",\r\n \"#3366E6\",\r\n \"#999966\",\r\n \"#99FF99\",\r\n \"#B34D4D\",\r\n \"#80B300\",\r\n \"#809900\",\r\n \"#E6B3B3\",\r\n \"#6680B3\",\r\n \"#66991A\",\r\n \"#FF99E6\",\r\n \"#CCFF1A\",\r\n \"#FF1A66\",\r\n \"#E6331A\",\r\n \"#33FFCC\",\r\n \"#66994D\",\r\n \"#B366CC\",\r\n \"#4D8000\",\r\n \"#B33300\",\r\n \"#CC80CC\",\r\n \"#66664D\",\r\n \"#991AFF\",\r\n \"#E666FF\",\r\n \"#4DB3FF\",\r\n \"#1AB399\",\r\n \"#E666B3\",\r\n \"#33991A\",\r\n \"#CC9999\",\r\n \"#B3B31A\",\r\n \"#00E680\",\r\n \"#4D8066\",\r\n \"#809980\",\r\n \"#E6FF80\",\r\n \"#1AFF33\",\r\n \"#999933\",\r\n \"#FF3380\",\r\n \"#CCCC00\",\r\n \"#66E64D\",\r\n \"#4D80CC\",\r\n \"#9900B3\",\r\n \"#E64D66\",\r\n \"#4DB380\",\r\n \"#FF4D4D\",\r\n \"#99E6E6\",\r\n \"#6666FF\",\r\n];\r\n\r\n// https://fullcalendar.io/docs/event-object\r\ntype EventInfo = {\r\n title: string,\r\n start: Date,\r\n allDay?: boolean,\r\n backgroundColor?: string,\r\n borderColor?: string,\r\n textColor?: string,\r\n extendedProps: { bc: string, row: Object, projection: string },\r\n};\r\n\r\ntype Props = {\r\n /** Redux dispatch */\r\n dispatch: Dispatch,\r\n /** fetch status */\r\n status: ConstantsEnum,\r\n /** search results */\r\n result: ?SearchResultDTO,\r\n /** callback to load next page\r\n * @param {number} pageNum which page number to load\r\n */\r\n loadMoreRows: (pageNum: number) => Promise,\r\n /** callback when user clicks on a row\r\n * @param {number} index the row index clicked\r\n * @param {SearchResultRowDTO} row the row object itself\r\n */\r\n onMoreClick: (e, index: number, row: SearchResultRowDTO) => void,\r\n /** persisted calendar view */\r\n calendarView: SettingValueProps,\r\n /** Browser info */\r\n browser: Object,\r\n};\r\n\r\ntype State = {\r\n events: ?Array,\r\n projections: Object,\r\n pageNum: number,\r\n totalLoaded: number,\r\n isLoadingNextPage: boolean,\r\n hasMorePages: boolean,\r\n currentProjection: string,\r\n title: string,\r\n};\r\n\r\nconst WrapperStyle = {\r\n flex: \"1 1 100%\",\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n minHeight: \"0\",\r\n minWidth: \"0\",\r\n};\r\n\r\nexport class SearchResultCalendar extends PureComponent {\r\n _calendar: null | Calendar;\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n this._calendar = React.createRef();\r\n\r\n this.state = {\r\n events: null,\r\n projections: {},\r\n pageNum: 0,\r\n totalLoaded: 0,\r\n isLoadingNextPage: false,\r\n hasMorePages: false,\r\n currentProjection: \"\",\r\n title: \"loading\",\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n const { status, result } = this.props;\r\n if (status !== Constants.OK) return;\r\n else this._firstPage(result);\r\n }\r\n\r\n componentDidUpdate(prevProps: Props, prevState: State) {\r\n /* istanbul ignore else */\r\n if (\r\n this.props.status !== prevProps.status &&\r\n this.props.status === Constants.OK\r\n ) {\r\n this._firstPage(this.props.result);\r\n }\r\n }\r\n\r\n _firstPage = (result: SearchResultDTO) =>\r\n this.setState({\r\n events: this._getEventsFromResult(result),\r\n hasMorePages: result.totalCount > result.pageSize,\r\n });\r\n\r\n _getEventsFromResult = (result: SearchResultDTO) => {\r\n let events: Array = [];\r\n let totalLoaded = this.state.totalLoaded;\r\n let projections = this.state.projections;\r\n Object.keys(result.rows).forEach((rowKey) => {\r\n totalLoaded++;\r\n const row = result.rows[rowKey];\r\n this._getEvents(row).forEach((attr) => {\r\n // collect legend and assign color\r\n if (projections[attr.name] == null) {\r\n projections[attr.name] = {\r\n color: colorArray[Object.keys(projections).length],\r\n total: 1,\r\n };\r\n } else {\r\n projections[attr.name].total++;\r\n }\r\n // render event\r\n\r\n events.push({\r\n id: rowKey,\r\n title: row.title,\r\n start: attr.date,\r\n allDay: attr.allDay,\r\n backgroundColor: projections[attr.name].color,\r\n extendedProps: {\r\n row,\r\n projection: attr.name,\r\n bc: row.breadcrumb.text,\r\n // icon: (attr.value && attr.value.marker) || null\r\n },\r\n });\r\n });\r\n });\r\n this.setState({ totalLoaded, projections });\r\n return events;\r\n };\r\n\r\n /** find all attributes with type Date_* */\r\n _getEvents = (row: Object) =>\r\n row.attributes\r\n .filter((a) => a.format && a.format.startsWith(\"Date_\"))\r\n .map((a) => {\r\n const date = Date.parse(a.value.rawValue);\r\n\r\n if (isNaN(date)) {\r\n console.warn(\"Could not parse Date\", a.value.rawValue);\r\n return null;\r\n }\r\n\r\n return {\r\n date: date,\r\n name: a.caption,\r\n allDay: a.format === \"Date_Date\",\r\n };\r\n })\r\n .filter((a) => a);\r\n\r\n // TODO should really be loaded by Redux dispatch\r\n _loadNextPage = () => {\r\n this.setState({ isLoadingNextPage: true });\r\n this.props.loadMoreRows(this.state.pageNum + 1).then((result) => {\r\n const nextEvents = this._getEventsFromResult(result);\r\n this.setState({\r\n events: this.state.events.concat(nextEvents),\r\n pageNum: this.state.pageNum + 1,\r\n hasMorePages:\r\n this.state.totalLoaded < this.props.result.totalCount,\r\n isLoadingNextPage: false,\r\n });\r\n });\r\n };\r\n\r\n _onEventDidMount = ({ event, el, view }) => {\r\n el.title = event.extendedProps.bc;\r\n\r\n // fullCalendar doesn't support the right click event out of the box so we have to add the event listener manually\r\n el.addEventListener(\r\n \"contextmenu\",\r\n (this.rightClickHandlers[event.id] =\r\n this._rightClickListener(event))\r\n );\r\n };\r\n\r\n rightClickHandlers = {};\r\n\r\n _rightClickListener(event) {\r\n const onMoreClick = this.props.onMoreClick;\r\n return function rightClickListener(jsEvent: Event) {\r\n jsEvent.preventDefault();\r\n onMoreClick(jsEvent, event.id, event.extendedProps.row);\r\n };\r\n }\r\n\r\n _onEventWillUnmount = ({ event, el, view }) => {\r\n el.removeEventListener(\r\n \"contextmenu\",\r\n this.rightClickHandlers[event.id]\r\n );\r\n delete this.rightClickHandlers[event.id];\r\n };\r\n\r\n _onEventClick = ({ event, el, jsEvent, view }) =>\r\n this.props.onClick(jsEvent, event.id, event.extendedProps.row);\r\n\r\n _onViewChange = ({ view, el }) =>\r\n this.props.calendarView.setValue(view.type);\r\n\r\n _onProjectionChange = (currentProjection) =>\r\n this.setState({ currentProjection });\r\n\r\n _getProjectedEvents = () =>\r\n this.state.currentProjection === \"\"\r\n ? this.state.events\r\n : this.state.events.filter(\r\n (e) =>\r\n e.extendedProps.projection ===\r\n this.state.currentProjection\r\n );\r\n\r\n _onDatesRender = ({ view, el }) =>\r\n this.setState({\r\n title: view.title,\r\n });\r\n\r\n render() {\r\n const { status } = this.props;\r\n if (status !== Constants.OK) return ;\r\n\r\n // TODO allow adding new items directly on calendar\r\n if (this.state.events == null || this.state.events.length === 0) {\r\n return ;\r\n }\r\n\r\n return (\r\n <>\r\n {this._calendar.current && (\r\n \r\n {loc\r\n .t(\"location.loadNextPage\")\r\n .substr(\r\n 0,\r\n this.props.browser.lessThan.medium\r\n ? 1\r\n : undefined\r\n ) + \" \"}\r\n {this.state.isLoadingNextPage && (\r\n \r\n )}\r\n \r\n )\r\n }\r\n />\r\n )}\r\n \r\n {(dimensions) => (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = /* istanbul ignore next */ (state, ownProps) => ({\r\n browser: state.browser,\r\n status: s.searchStatusSelector(state),\r\n result:\r\n s.searchStatusSelector(state) === Constants.OK\r\n ? s.searchResultSelector(state)\r\n : undefined,\r\n ...ownProps,\r\n});\r\n\r\nexport default compose(\r\n connect(mapStateToProps),\r\n SettingValue({\r\n name: \"searchResultCalendarView\",\r\n namespace: \"calendarView\",\r\n defaultValue: \"dayGridMonth\",\r\n })\r\n)(SearchResultCalendar);\r\n","// @flow\r\nimport React, { useContext } from \"react\";\r\nimport { MultiSelectionContext } from \"data/context\";\r\nimport Icons from \"@hs/icons\";\r\nimport { BrowserDragLink } from \"components/ItemUriLink\";\r\nimport ValueFactory from \"components/Attributes/SummaryAttribute/ValueFactory\";\r\nimport Mark from \"@hs/mark\";\r\nimport {\r\n GridListConstant,\r\n SearchValueType,\r\n SummaryAttributeValueType,\r\n} from \"data/types\";\r\nimport withStickyToggle from \"containers/StickyToggle\";\r\nimport StickyToggleStyle from \"containers/StickyToggle/style\";\r\nimport { isHandheld } from \"data/bowser\";\r\nimport styles from \"./CellContent.module.css\";\r\n\r\nconst style = {\r\n marginLeft: \".5em\",\r\n verticalAlign: \"middle\",\r\n};\r\n\r\ntype Props = {\r\n col: DocColumnResultDTO,\r\n cell: any,\r\n filterText: any,\r\n onMoreClick: (\r\n e: SyntheticMouseEvent,\r\n itemUri: string,\r\n index: number\r\n ) => void,\r\n actionsDisabled: boolean,\r\n itemUri: string,\r\n};\r\n\r\nexport const CellContent = ({ index, cell, col, isHovered }: Props) => {\r\n /* istanbul ignore next */\r\n const { multiple, renderCheckbox } = useContext(MultiSelectionContext) || {\r\n multiple: false,\r\n renderCheckbox: () => null,\r\n };\r\n let content = cell && cell.value;\r\n if (col.name === GridListConstant.ExtensionIcon) {\r\n if (multiple && isHandheld()) {\r\n content = renderCheckbox(index, styles.checkbox);\r\n } else {\r\n content = (\r\n <>\r\n {(isHovered || multiple) &&\r\n !isHandheld() &&\r\n renderCheckbox(\r\n index,\r\n `${styles.checkbox} ${styles.desktop}`\r\n )}\r\n {cell.isDoc ? (\r\n \r\n \r\n \r\n ) : (\r\n \r\n )}\r\n \r\n );\r\n }\r\n } else if (SearchValueType[col.type] === SearchValueType.Link) {\r\n return (\r\n \r\n );\r\n } else if (content == null) {\r\n return null;\r\n } else if (Object.prototype.hasOwnProperty.call(content, \"$type\")) {\r\n return (\r\n \r\n );\r\n }\r\n return (\r\n term.replace(\"*\", \"\"))}\r\n >\r\n {content}\r\n \r\n );\r\n};\r\n\r\nconst CellContentWithStickyToggle = withStickyToggle({\r\n getStyle: StickyToggleStyle.GridList,\r\n renderDiv: true,\r\n portalTargetSelector:\r\n \"#searchResult .ReactVirtualized__Grid__innerScrollContainer\",\r\n})(CellContent);\r\n\r\nexport default CellContentWithStickyToggle;\r\n","// @flow\r\nimport React, { useCallback, useState, useEffect } from \"react\";\r\nimport Constants from \"data/constants\";\r\nimport { getLocalizedText } from \"data/utils\";\r\nimport GridList from \"@hs/grid-list\";\r\nimport noop from \"lodash/noop\";\r\nimport ContextMenuHandler from \"components/ContextMenu/Handler\";\r\nimport CellContent from \"./CellContent\";\r\nimport { isHandheld } from \"data/bowser\";\r\nimport {\r\n GridListConstant,\r\n SortDirectionOptions,\r\n SORT_BUCKET_NAME,\r\n} from \"data/types\";\r\n\r\nconst SearchResultGrid = ({\r\n result,\r\n rowCount,\r\n onClick,\r\n onMoreClick,\r\n onContextClick,\r\n onFilterBarSelect,\r\n activeRowIndex,\r\n scrollToRow,\r\n loadMoreRows,\r\n children,\r\n searchRequest,\r\n onSetActiveRowIndex,\r\n terms,\r\n isMoreHidden,\r\n handleMoreRowsLoaded,\r\n isRowActive,\r\n refresh,\r\n}) => {\r\n const { aggregations, cols, rows: rowsFromResult, totalCount } = result;\r\n const [rows, setRows] = useState(rowsFromResult);\r\n useEffect(() => {\r\n setRows(rowsFromResult);\r\n }, [rowsFromResult]);\r\n const [pagesStatus, setPagesStatus] = useState([Constants.OK]);\r\n const { pageSize } = result;\r\n /* istanbul ignore next */\r\n const count = totalCount === 0 ? Object.keys(rows).length : totalCount;\r\n const parseCellColumnTitle = useCallback((header, content) => {\r\n const value = content && content.value;\r\n return value ? value.value || value : value;\r\n }, []);\r\n const isRowLoaded = useCallback(\r\n ({ rowIndex }) => Object.prototype.hasOwnProperty.call(rows, rowIndex),\r\n [rows]\r\n );\r\n const isColumnFiltered = useCallback(\r\n (name) =>\r\n aggregations.find((f) => f.name === name && f.selected != null),\r\n [aggregations]\r\n );\r\n const isColumnSorted = useCallback(\r\n (name) => {\r\n const sort = aggregations.find((f) => f.name === SORT_BUCKET_NAME);\r\n return sort && sort.selected.includes(name);\r\n },\r\n [aggregations]\r\n );\r\n const getColumnSortDirection = useCallback(\r\n () =>\r\n (searchRequest.sorts &&\r\n searchRequest.sorts[0] &&\r\n searchRequest.sorts[0].direction) ||\r\n SortDirectionOptions.Ascending,\r\n [searchRequest.sorts]\r\n );\r\n const handleLoadMoreRows = useCallback(\r\n ({ rowIndex }) => {\r\n let pageNum = 0;\r\n /* istanbul ignore else */\r\n if (rowIndex > 0) {\r\n pageNum = Math.floor(rowIndex / pageSize);\r\n }\r\n\r\n // page already loaded/requested?\r\n /* istanbul ignore else */\r\n if (\r\n pagesStatus[pageNum] === Constants.OK ||\r\n pagesStatus[pageNum] === Constants.LOADING\r\n )\r\n return null;\r\n setPagesStatus((pagesStatus) => {\r\n pagesStatus[pageNum] = Constants.LOADING;\r\n return pagesStatus;\r\n });\r\n loadMoreRows(pageNum)\r\n .then((result) => {\r\n setPagesStatus((pagesStatus) => {\r\n pagesStatus[pageNum] = Constants.OK;\r\n return pagesStatus;\r\n });\r\n setRows((rows) => {\r\n const nextRows = { ...rows, ...result.rows };\r\n handleMoreRowsLoaded(nextRows, result.totalCount);\r\n return nextRows;\r\n });\r\n })\r\n .catch((e) => {\r\n setPagesStatus((pagesStatus) => {\r\n pagesStatus[pageNum] = Constants.ERROR;\r\n return pagesStatus;\r\n });\r\n });\r\n },\r\n [handleMoreRowsLoaded, pagesStatus, pageSize, loadMoreRows]\r\n );\r\n const handleCellClick = useCallback(\r\n (e, rowIndex: number, columnIndex: number, itemUri: string) => {\r\n onClick(e, rowIndex, rows[rowIndex]);\r\n },\r\n [onClick, rows]\r\n );\r\n const handleCellMoreClick = useCallback(\r\n (e, itemUri, rowIndex) => {\r\n const row = rows[rowIndex];\r\n onMoreClick(e, rowIndex, row);\r\n },\r\n [onMoreClick, rows]\r\n );\r\n const handleCellContextClick = useCallback(\r\n (e, rowIndex: number, columnIndex: number, itemUri: string) => {\r\n const row = rows[rowIndex];\r\n onContextClick(e, rowIndex, row);\r\n },\r\n [onContextClick, rows]\r\n );\r\n const handleHeaderFilterClick = useCallback(\r\n (e, name) => {\r\n e.stopPropagation();\r\n const filter = aggregations.find((f) => f.name === name);\r\n onFilterBarSelect(name, filter.valueType, \"__ALL__\");\r\n },\r\n [aggregations, onFilterBarSelect]\r\n );\r\n const handleHeaderClick = useCallback(\r\n (columnIndex: number, header: string) => {\r\n const col = cols[columnIndex];\r\n // const sort = aggregations.find((f) => f.name === SORT_BUCKET_NAME);\r\n // const bucket = sort.buckets.find((b) => b.value === col.name);\r\n // if (bucket == null) return;\r\n if (!col.canSort || col.type == null) return;\r\n onFilterBarSelect(SORT_BUCKET_NAME, col.type, col.name);\r\n },\r\n [/*aggregations,*/ onFilterBarSelect, cols]\r\n );\r\n const getColumnWidth = useCallback(\r\n ({ index, col }: { index: number, col: DocColumnResultDTO }) => {\r\n const width =\r\n index === 0 ? (isHandheld() ? 35 : 42) : col.width * 1.2 + 15;\r\n return width + (index === cols.length - 1 ? 20 : 0);\r\n },\r\n [cols.length]\r\n );\r\n const getCell = useCallback(\r\n ({ row, columnIndex }) => {\r\n const col = cols[columnIndex];\r\n const foundTerms = row.foundTerms || terms;\r\n switch (col.name) {\r\n case GridListConstant.ExtensionIcon:\r\n case GridListConstant.ItemUri:\r\n return { ...row, foundTerms };\r\n case \"Dateityp\":\r\n return { name: col.name, value: row.ext, foundTerms };\r\n default:\r\n const cell = row.attributes.find(\r\n (a) => a.name === col.name\r\n );\r\n // show title instead of name, if empty\r\n if (col.name === \"Name\" && cell == null) {\r\n return { name: col.name, value: row.title, foundTerms };\r\n }\r\n // if (cell == null) console.log(col, cell, row);\r\n return cell ? { ...cell, foundTerms } : null;\r\n }\r\n },\r\n [cols, terms]\r\n );\r\n return (\r\n \r\n );\r\n};\r\nSearchResultGrid.displayName = \"SearchResult.Grid\";\r\n\r\nexport default SearchResultGrid;\r\n","// @flow\r\nimport { type SearchBucketDTO, SearchValueType } from \"data/types\";\r\nimport loc from \"i18next\";\r\n\r\n// inPoint.Forms/Controls/Search/Search/SearchViewModel.cs\r\nconst GetDefaultSearchBuckets = (): Array => [\r\n {\r\n visible: true,\r\n icon: \"clock\",\r\n name: \"Geaendert_am\",\r\n caption: loc.t(\"common:filter.ModifyTimeCaption\"),\r\n valueType: SearchValueType.RelativeDate,\r\n selected: [],\r\n buckets: [\r\n {\r\n value: \"Today\",\r\n caption: loc.t(\"common:filter.RelativeDate.Today\"),\r\n },\r\n {\r\n value: \"Yesterday\",\r\n caption: loc.t(\"common:filter.RelativeDate.Yesterday\"),\r\n },\r\n {\r\n value: \"ThisWeek\",\r\n caption: loc.t(\"common:filter.RelativeDate.ThisWeek\"),\r\n },\r\n {\r\n value: \"ThisMonth\",\r\n caption: loc.t(\"common:filter.RelativeDate.ThisMonth\"),\r\n },\r\n {\r\n value: \"LastMonth\",\r\n caption: loc.t(\"common:filter.RelativeDate.LastMonth\"),\r\n },\r\n {\r\n value: \"ThisYear\",\r\n caption: loc.t(\"common:filter.RelativeDate.ThisYear\"),\r\n },\r\n {\r\n value: \"LastYear\",\r\n caption: loc.t(\"common:filter.RelativeDate.LastYear\"),\r\n },\r\n ],\r\n },\r\n {\r\n visible: true,\r\n icon: \"child\",\r\n name: \"Erstellt_am\",\r\n caption: loc.t(\"common:filter.CreationTimeCaption\"),\r\n valueType: SearchValueType.RelativeDate,\r\n selected: [],\r\n buckets: [\r\n {\r\n value: \"Today\",\r\n caption: loc.t(\"common:filter.RelativeDate.Today\"),\r\n },\r\n {\r\n value: \"Yesterday\",\r\n caption: loc.t(\"common:filter.RelativeDate.Yesterday\"),\r\n },\r\n {\r\n value: \"ThisWeek\",\r\n caption: loc.t(\"common:filter.RelativeDate.ThisWeek\"),\r\n },\r\n {\r\n value: \"ThisMonth\",\r\n caption: loc.t(\"common:filter.RelativeDate.ThisMonth\"),\r\n },\r\n {\r\n value: \"LastMonth\",\r\n caption: loc.t(\"common:filter.RelativeDate.LastMonth\"),\r\n },\r\n {\r\n value: \"ThisYear\",\r\n caption: loc.t(\"common:filter.RelativeDate.ThisYear\"),\r\n },\r\n {\r\n value: \"LastYear\",\r\n caption: loc.t(\"common:filter.RelativeDate.LastYear\"),\r\n },\r\n ],\r\n },\r\n {\r\n visible: true,\r\n icon: \"save\",\r\n name: \"Groesse\",\r\n caption: loc.t(\"common:filter.FileSizeCaption\"),\r\n valueType: SearchValueType.FileSize,\r\n hideName: true,\r\n selected: [],\r\n buckets: [\r\n { value: \"Empty\", caption: loc.t(\"common:filter.FileSize.Empty\") },\r\n { value: \"Tiny\", caption: loc.t(\"common:filter.FileSize.Tiny\") },\r\n { value: \"Small\", caption: loc.t(\"common:filter.FileSize.Small\") },\r\n {\r\n value: \"Medium\",\r\n caption: loc.t(\"common:filter.FileSize.Medium\"),\r\n },\r\n { value: \"Large\", caption: loc.t(\"common:filter.FileSize.Large\") },\r\n { value: \"Huge\", caption: loc.t(\"common:filter.FileSize.Huge\") },\r\n {\r\n value: \"VeryHuge\",\r\n caption: loc.t(\"common:filter.FileSize.VeryHuge\"),\r\n },\r\n ],\r\n },\r\n // {\r\n // icon: \"file\",\r\n // name: \"ItemType\",\r\n // caption: \"Typ\",\r\n // valueType: SearchValueType.ItemType,\r\n // hideName: true,\r\n // selected: [],\r\n // buckets: [\r\n // { value: \"Document\", caption: \"Dokumente\" },\r\n // { value: \"Folder\", caption: \"Ordner\" }\r\n // ]\r\n // },\r\n // {\r\n // visible: true,\r\n // icon: \"sort\",\r\n // name: SORT_BUCKET_NAME,\r\n // caption: loc.t(\"common:filter.SortCaption\"),\r\n // valueType: SearchValueType.NotSet,\r\n // selected: [\"\"],\r\n // buckets: [\r\n // {\r\n // value: \"\",\r\n // caption: loc.t(\"common:filter.RelevanceCaption\"),\r\n // },\r\n // { value: \"Name\", caption: loc.t(\"common:filter.NameCaption\") },\r\n // {\r\n // value: \"Erstellt_am\",\r\n // caption: loc.t(\"common:filter.CreationTimeCaption\"),\r\n // },\r\n // {\r\n // value: \"Geaendert_am\",\r\n // caption: loc.t(\"common:filter.ModifyTimeCaption\"),\r\n // },\r\n // // ,\r\n // // {\r\n // // value: \"__SORT:DESC_\",\r\n // // caption: loc.t(\"common:filter.SortDescending\")\r\n // // }\r\n // ],\r\n // },\r\n];\r\n\r\nexport default GetDefaultSearchBuckets;\r\n","// @flow\r\nimport React, { PureComponent } from \"react\";\r\nimport { connect, Dispatch } from \"react-redux\";\r\nimport { compose } from \"redux\";\r\nimport { withRouter } from \"react-router\";\r\nimport { History } from \"history\";\r\nimport { fetchSearchResult } from \"data/api\";\r\nimport {\r\n type SearchResultDTO,\r\n type SearchItemDTO,\r\n type SearchRequestDTO,\r\n type SearchBucketDTO,\r\n type SearchValueTypeEnum,\r\n type SearchFilterDTO,\r\n type SearchSortDTO,\r\n type SearchResultRowDTO,\r\n SortDirectionOptions,\r\n SearchValueType,\r\n ListViewMode,\r\n type ListViewModeEnum,\r\n type ApiErrorResult,\r\n type MapProviderConfig,\r\n type RasterLocation,\r\n type ArrowNavigationSetter,\r\n SORT_BUCKET_NAME,\r\n} from \"data/types\";\r\nimport { togglesUpdateCounterAction, getSearchAction } from \"data/actions\";\r\nimport { getRoute } from \"components/ItemUriLink\";\r\nimport CommandActionHandler from \"components/CommandActions\";\r\nimport SettingValue, { type SettingValueProps } from \"containers/SettingValue\";\r\nimport SearchResult from \"components/SearchResult\";\r\nimport SearchResultMap from \"components/SearchResultMap\";\r\nimport SearchResultCalendar from \"components/SearchResultCalendar\";\r\nimport SearchResultGrid from \"components/SearchResultGrid\";\r\nimport FilterBarContainer from \"containers/FilterBar\";\r\nimport type DocModalProps from \"components/DocModal\";\r\nimport Constants, {\r\n type ConstantsEnum,\r\n Feature,\r\n isFeatureOn,\r\n} from \"data/constants\";\r\nimport Status from \"components/Status\";\r\nimport immutable from \"object-path-immutable\";\r\nimport GetDefaultSearchBuckets from \"data/FilterBar\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport NoData from \"components/NoData\";\r\nimport { SupportGeoMapViewer } from \"components/MapViewer/providerSupport\";\r\nimport { openSearchResultActionPanel } from \"components/SearchResultActionPanel\";\r\nimport { openMultiSelectionActionPanel } from \"components/MultiSelectionActionPanel\";\r\nimport withMultiSelection, {\r\n type MultiSelectionProps,\r\n} from \"containers/MultiSelection\";\r\nimport styles from \"./SearchResult.module.css\";\r\n\r\ntype Props = {\r\n /** react-router History */\r\n history: History,\r\n /** the search requested by the user */\r\n searchItem?: SearchItemDTO,\r\n /** optional extra filters to set on searchRequest */\r\n extraFilters?: Array,\r\n /** fetch status */\r\n status: ConstantsEnum,\r\n /** fetch error details */\r\n error?: ApiErrorResult,\r\n /** search results */\r\n result: ?SearchResultDTO,\r\n /** the words to highlight */\r\n terms: Array,\r\n /** last searchRequest sent to server (from Redux store) */\r\n searchRequest: SearchRequestDTO,\r\n /** callback when setting activeRowIndex\r\n * @param {number} activeRowIndex new row index\r\n * @param {SearchResultRowDTO} row row object that was clicked\r\n * @returns {bool} return FALSE to avoid opening DocViewer for Doc itemUris\r\n */\r\n onSetActiveRowIndex?: (\r\n activeRowIndex: number,\r\n row?: SearchResultRowDTO\r\n ) => boolean,\r\n /** callback when searchForm.autoBrowseToItem is true and one result found\r\n * @default undefined will navigate to the folder view\r\n * @param {number} activeRowIndex new row index (0)\r\n * @param {SearchResultRowDTO} row row object that was clicked\r\n * */\r\n onAutoBrowseToItem?: (\r\n activeRowIndex: number,\r\n row?: SearchResultRowDTO\r\n ) => void,\r\n /** search result row to mark as active */\r\n activeRowIndex: number,\r\n /** whether the breadcrumbs should allow navigation */\r\n isBreadcrumbReadonly?: boolean,\r\n /** current view mode */\r\n viewModeSetting: SettingValueProps,\r\n /** current result sorting */\r\n sortSetting: SettingValueProps,\r\n /** Redux Dispatch */\r\n dispatch: Dispatch,\r\n /** optional specific ViewMode */\r\n viewMode: ?ListViewMode,\r\n /** optional whether to show filterbar */\r\n showFilterBar: ?boolean,\r\n /** custom mapProvider to use for Map viewMode */\r\n mapProvider?: MapProviderConfig,\r\n /** callback when user clicks an empty space on the map (only when useMarker=false & mapProvider.onClick exists) */\r\n onMapClick?: (location: RasterLocation) => void,\r\n /** whether to hide More Action or not */\r\n isMoreHidden: ?boolean,\r\n /** ArrowNavigation Setter Functions */\r\n postMessage: ?ArrowNavigationSetter,\r\n /** withMultipleSelection additional props */\r\n multiSelection: MultiSelectionProps,\r\n};\r\n\r\ntype State = {\r\n aggregations: ?Array,\r\n selected: Array,\r\n scrollToRow: number,\r\n documents: any,\r\n};\r\n\r\nexport class SearchResultContainer extends PureComponent {\r\n _isMounted: boolean;\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n this._isMounted = false;\r\n this.state = {\r\n aggregations: GetDefaultSearchBuckets(),\r\n selected: [],\r\n scrollToRow: props.activeRowIndex,\r\n documents: {},\r\n };\r\n }\r\n\r\n componentDidMount = () => {\r\n this._isMounted = true;\r\n if (this.props.viewMode) {\r\n this._maybeChangeViewMode(this.props.viewMode);\r\n } else {\r\n this._maybeChangeViewMode();\r\n }\r\n this.props.searchItem &&\r\n this._fetch(this._prepSearchRequest(this.props.searchItem));\r\n };\r\n\r\n componentWillUnmount = () => (this._isMounted = false);\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n /* istanbul ignore else */\r\n if (prevProps.searchItem !== this.props.searchItem) {\r\n this.props.multiSelection?.disable();\r\n this.setState(\r\n {\r\n aggregations: GetDefaultSearchBuckets(),\r\n selected: [],\r\n },\r\n () =>\r\n this._fetch(this._prepSearchRequest(this.props.searchItem))\r\n );\r\n }\r\n\r\n if (\r\n prevProps.result !== this.props.result &&\r\n this.props.status === Constants.OK\r\n ) {\r\n const result = this.props.result;\r\n /* istanbul ignore else */\r\n if (result != null) {\r\n if (\r\n this.props.result.autoBrowseToItem === true &&\r\n result.totalCount === 1\r\n ) {\r\n if (typeof this.props.onAutoBrowseToItem === \"function\") {\r\n this.props.onAutoBrowseToItem(0, result.rows[0]);\r\n } else {\r\n this.props.history.replace(\r\n getRoute(result.rows[0].itemUri, false, false)\r\n );\r\n }\r\n return;\r\n }\r\n // first result page? update counter\r\n this._updateToggleCounter(result.totalCount);\r\n /* istanbul ignore next */\r\n const aggregationsFromResult =\r\n result.aggregations != null ? result.aggregations : [];\r\n let aggregations: Array =\r\n GetDefaultSearchBuckets()\r\n .concat(\r\n aggregationsFromResult.filter(\r\n // Hide Aggregations from result that are provided via DefaultSearchBuckets\r\n (a) =>\r\n !GetDefaultSearchBuckets().some(\r\n (b) =>\r\n b.name.toUpperCase() ===\r\n a.name.toUpperCase()\r\n )\r\n )\r\n )\r\n .sort((a, b) => {\r\n var nameA = a.name.toUpperCase(); // ignore upper and lowercase\r\n var nameB = b.name.toUpperCase(); // ignore upper and lowercase\r\n if (nameA < nameB) {\r\n return -1;\r\n }\r\n /* istanbul ignore else */\r\n if (nameA > nameB) {\r\n return 1;\r\n }\r\n\r\n // names must be equal\r\n /* istanbul ignore next */\r\n return 0;\r\n });\r\n\r\n // update bucket.selected\r\n this.state.selected.forEach((filter) => {\r\n /* istanbul ignore else */\r\n if (filter.value != null) {\r\n const selectIndex = aggregations.findIndex(\r\n (i) => i.name === filter.name\r\n );\r\n /* istanbul ignore else */\r\n if (selectIndex !== -1) {\r\n aggregations[selectIndex].selected = [filter.value];\r\n }\r\n }\r\n });\r\n\r\n this._handleMoreRowsLoaded(\r\n result.rows,\r\n result.totalCount,\r\n false,\r\n {\r\n aggregations,\r\n }\r\n );\r\n\r\n this.props.multiSelection?.disable();\r\n\r\n this._maybeChangeViewMode(\r\n this.props.viewMode || result.listViewMode\r\n );\r\n }\r\n }\r\n /* istanbul ignore next */\r\n if (this.props.activeRowIndex !== prevProps.activeRowIndex) {\r\n this.setState((state) => {\r\n this._updateArrowNavigationRows(state.documents);\r\n return {\r\n scrollToRow: state.scrollToRow || this.props.activeRowIndex, //#59968\r\n };\r\n });\r\n }\r\n }\r\n\r\n _updateToggleCounter(count: number, loading?: boolean): void {\r\n let { dispatch } = this.props;\r\n let status = Constants.OK;\r\n if (loading === true) {\r\n status = Constants.LOADING;\r\n }\r\n /** Need to update both toggles for consistent UX */\r\n dispatch(\r\n togglesUpdateCounterAction({\r\n name: \"searchresult\",\r\n counts: { result: count },\r\n status: { result: status },\r\n })\r\n );\r\n dispatch(\r\n togglesUpdateCounterAction({\r\n name: \"search\",\r\n counts: { result: count },\r\n status: { result: status },\r\n })\r\n );\r\n }\r\n\r\n _prepSearchRequest = (searchItem: SearchItemDTO): SearchRequestDTO => {\r\n // let's build a searchRequest from an existing SearchItem\r\n const searchRequest: SearchRequestDTO = {\r\n pageNum: 0,\r\n id: searchItem.id,\r\n name: searchItem.name,\r\n searchType: searchItem.searchType,\r\n isCustom: false,\r\n searchText: searchItem.searchText,\r\n itemUri: searchItem.itemUri,\r\n scope: searchItem.scope,\r\n filters: (searchItem.filters || []).concat(\r\n this.props.extraFilters || []\r\n ),\r\n sorts: searchItem.sorts || [],\r\n nodeType: searchItem.nodeType,\r\n fakeUris: searchItem.fakeUris,\r\n };\r\n // any filterBar filters from searchItem? update bucket.selected\r\n const bucketFilters = searchRequest.filters.filter(\r\n (f) => f.valueType !== SearchValueType.NotSet && f.value != null\r\n );\r\n /** istanbul ignore else */\r\n if (bucketFilters.length > 0) {\r\n this.setState((prevState: state) => ({\r\n selected: prevState.selected.concat(bucketFilters),\r\n }));\r\n }\r\n return searchRequest;\r\n };\r\n\r\n // load first page of results\r\n _fetch(searchRequest: SearchRequestDTO, hideLoading?: boolean) {\r\n this._updateToggleCounter(0, true);\r\n this.props.dispatch(getSearchAction({ searchRequest }));\r\n }\r\n\r\n // load next page of results\r\n loadMoreRows = (pageNum: number): Promise => {\r\n const { searchRequest, result } = this.props;\r\n /** Trigger loading only on MapViewMode, due to totalCount on ListView */\r\n const hasMapViewMode =\r\n this.props.viewModeSetting.value === ListViewMode.Map;\r\n this._updateToggleCounter(\r\n /*istanbul ignore next */ result && !hasMapViewMode\r\n ? result.totalCount\r\n : 0,\r\n hasMapViewMode\r\n );\r\n\r\n // TODO use Redux action instead of directly loading from fetch!\r\n return fetchSearchResult(\r\n immutable.set(searchRequest, \"pageNum\", pageNum)\r\n ).then((result) => {\r\n /* istanbul ignore next */\r\n if (!this._isMounted) {\r\n return;\r\n }\r\n this._handleMoreRowsLoaded(result.rows, result.totalCount, true);\r\n return result;\r\n });\r\n };\r\n\r\n _onFilterBarSelect = (\r\n name: string,\r\n valueType: SearchValueTypeEnum,\r\n value: any\r\n ) => {\r\n const { selected } = this.state;\r\n const { searchRequest } = this.props;\r\n let newSelected = selected;\r\n let newSearchRequest = searchRequest;\r\n\r\n // changing a previous loaded one?\r\n /* istanbul ignore else */\r\n if (searchRequest.isCustom === false) {\r\n newSearchRequest = immutable.set(searchRequest, \"isCustom\", true);\r\n }\r\n\r\n // do we already a filter set?\r\n const selectIndex = selected.findIndex((i) => i.name === name);\r\n const filterIndex = searchRequest.filters.findIndex(\r\n (i) => i.name === name\r\n );\r\n if (filterIndex !== -1) {\r\n newSearchRequest = immutable.del(\r\n searchRequest,\r\n \"filters.\" + filterIndex\r\n );\r\n }\r\n\r\n /* istanbul ignore else */\r\n if (selectIndex !== -1) {\r\n newSelected = immutable.del(selected, String(selectIndex));\r\n }\r\n\r\n /* istanbul ignore else */\r\n if (value === \"__ALL__\" && filterIndex !== -1) {\r\n // enum value? set to 0 (NotSet/Unknown) instead of deleting it (otherwise it cannot overwrite any seachForm additionalParameters)\r\n if (\r\n [\r\n SearchValueType.ItemType,\r\n SearchValueType.FileSize,\r\n SearchValueType.RelativeDate,\r\n ].includes(searchRequest.filters[filterIndex].valueType)\r\n ) {\r\n newSearchRequest = immutable.set(\r\n searchRequest,\r\n [\"filters\", filterIndex, \"value\"],\r\n 0\r\n );\r\n }\r\n }\r\n\r\n /* istanbul ignore else */\r\n if (value !== \"__ALL__\") {\r\n // add new filter\r\n newSelected = newSelected.concat([{ name, value, valueType }]);\r\n if (name !== SORT_BUCKET_NAME) {\r\n const newFilter: SearchFilterDTO = {\r\n name,\r\n valueType,\r\n value,\r\n };\r\n newSearchRequest = immutable.push(\r\n newSearchRequest,\r\n \"filters\",\r\n newFilter\r\n );\r\n } else {\r\n const newSort: SearchSortDTO = {\r\n name: value,\r\n valueType,\r\n direction:\r\n searchRequest.sorts &&\r\n searchRequest.sorts[0] &&\r\n searchRequest.sorts[0].direction ===\r\n SortDirectionOptions.Ascending\r\n ? SortDirectionOptions.Descending\r\n : SortDirectionOptions.Ascending,\r\n };\r\n // TODO support multiple sort columns?\r\n newSearchRequest = immutable.set(newSearchRequest, \"sorts\", [\r\n newSort,\r\n ]);\r\n this.props.sortSetting.setValue(value);\r\n }\r\n }\r\n\r\n newSearchRequest = immutable.set(newSearchRequest, \"pageNum\", 0);\r\n this.setState({ selected: newSelected }, () => {\r\n /* istanbul ignore else */\r\n if (typeof this.props.onSetActiveRowIndex === \"function\")\r\n this.props.onSetActiveRowIndex(-1);\r\n this._fetch(newSearchRequest, true);\r\n });\r\n };\r\n\r\n _onFilterBarClear = () => {\r\n const { searchRequest, searchItem } = this.props;\r\n this.setState(\r\n {\r\n selected: [],\r\n },\r\n () => {\r\n if (searchItem) {\r\n this._fetch(this._prepSearchRequest(searchItem), true);\r\n return;\r\n }\r\n\r\n let newSearchRequest = searchRequest;\r\n newSearchRequest = immutable.set(\r\n newSearchRequest,\r\n \"filters\",\r\n []\r\n );\r\n newSearchRequest = immutable.set(newSearchRequest, \"sorts\", []);\r\n // TODO FilterBarClear should remove ALL BUT HIDDEN FILTERS!\r\n this._fetch(newSearchRequest, true);\r\n }\r\n );\r\n };\r\n\r\n //#region docmodal\r\n _isDocument = (row: SearchResultRowDTO): boolean => row.isDoc === true;\r\n\r\n _getNextDocumentIndex = (index) => {\r\n for (let i = index; i < this.props.result.totalCount; ++i) {\r\n const row = this._getDocument(i);\r\n /* istanbul ignore else */\r\n if (typeof row !== \"undefined\") {\r\n return i;\r\n }\r\n }\r\n return index - 1;\r\n };\r\n\r\n _getPrevDocumentIndex = (index: number): number => {\r\n for (let i = index; i >= 0; --i) {\r\n const row = this._getDocument(i);\r\n /* istanbul ignore else */\r\n if (typeof row !== \"undefined\") {\r\n return i;\r\n }\r\n }\r\n return index + 1;\r\n };\r\n\r\n _getDocument = (index: number): ?SearchResultRowDTO => {\r\n const row = Object.prototype.hasOwnProperty.call(\r\n this.state.documents,\r\n index\r\n );\r\n // Return only documents from multi selection\r\n if (\r\n this.props.multiSelection?.multiple &&\r\n !this.props.multiSelection?.activeRows.hasOwnProperty(index)\r\n ) {\r\n return undefined;\r\n }\r\n if (!row) {\r\n return undefined;\r\n } else {\r\n this.setState({\r\n scrollToRow: index,\r\n });\r\n return this.state.documents[index];\r\n }\r\n };\r\n\r\n _updateArrowNavigationRows = (documents = this.state.documents) => {\r\n const { postMessage, multiSelection, result } = this.props;\r\n // Update postMessage rows if applicable\r\n /* istanbul ignore next */\r\n if (result?.totalCount && postMessage?.setRows) {\r\n if (multiSelection?.multiple) {\r\n const reducedDocuments = {};\r\n Object.keys(documents).forEach((i) => {\r\n const index = parseInt(i, 10);\r\n if (multiSelection?.activeRows.hasOwnProperty(index)) {\r\n reducedDocuments[index] = documents[i];\r\n }\r\n });\r\n postMessage.setRows({\r\n ...reducedDocuments,\r\n length: result.totalCount,\r\n });\r\n } else {\r\n postMessage.setRows({\r\n ...documents,\r\n length: result.totalCount,\r\n });\r\n }\r\n }\r\n };\r\n\r\n _getDocModalProps = (activeRowIndex: number): DocModalProps => {\r\n this._updateArrowNavigationRows();\r\n return {\r\n activeRowIndex,\r\n totalCount: this.props.result.totalCount,\r\n onSetActiveRowIndex: (index: number, isNext: boolean): index => {\r\n const documentIndex = isNext\r\n ? this._getNextDocumentIndex(index)\r\n : this._getPrevDocumentIndex(index);\r\n /* istanbul ignore else */\r\n if (typeof this.props.onSetActiveRowIndex === \"function\") {\r\n this.props.onSetActiveRowIndex(\r\n documentIndex,\r\n this._getDocument(documentIndex)\r\n );\r\n }\r\n return documentIndex;\r\n },\r\n getActiveRowItemUri: this._getDocument,\r\n setTarget: this.props.postMessage?.setTarget,\r\n };\r\n };\r\n\r\n setDocuments = (documents: Array) =>\r\n this.setState({ documents, scrollToRow: -1 });\r\n\r\n _onClick = (\r\n e: SyntheticMouseEvent<*>,\r\n rowIndex: number,\r\n row: SearchResultRowDTO\r\n ) => {\r\n const prevRowIndex = this.props.activeRowIndex;\r\n let showViewer = true;\r\n /* istanbul ignore else */\r\n if (typeof this.props.onSetActiveRowIndex === \"function\")\r\n showViewer = this.props.onSetActiveRowIndex(\r\n rowIndex,\r\n e.ctrlKey || e.shiftKey || this.props.multiSelection?.multiple\r\n ? null\r\n : row\r\n );\r\n if (e.ctrlKey) {\r\n /* istanbul ignore else */\r\n if (!this.props.multiSelection?.multiple && prevRowIndex > -1) {\r\n this.props.multiSelection?.actions.handleToggle(prevRowIndex);\r\n }\r\n this.props.multiSelection?.actions.handleToggle(rowIndex);\r\n } else if (e.shiftKey) {\r\n const startIndex =\r\n prevRowIndex > rowIndex ? rowIndex : prevRowIndex;\r\n const endIndex = prevRowIndex > rowIndex ? prevRowIndex : rowIndex;\r\n for (let i = startIndex; i <= endIndex; i++) {\r\n /* istanbul ignore if */\r\n if (i < 0) continue;\r\n this.props.multiSelection?.actions.handleAdd(i);\r\n }\r\n } else if (this.props.multiSelection?.multiple) {\r\n this.props.multiSelection?.disable();\r\n e.stopPropagation();\r\n } else if (this._isDocument(row)) {\r\n /* istanbul ignore else */\r\n if (showViewer !== false) {\r\n CommandActionHandler(\"doc_preview\", {\r\n itemUri: row.itemUri,\r\n newWindow: e.altKey,\r\n searchTerm: (row.foundTerms || this.props.terms)\r\n .join(\" \")\r\n .replace(\"*\", \"\"),\r\n ...this._getDocModalProps(rowIndex),\r\n });\r\n }\r\n }\r\n };\r\n\r\n _onMoreClick = (\r\n e: SyntheticMouseEvent<*>,\r\n rowIndex: number,\r\n row: SearchResultRowDTO\r\n ) => {\r\n e.preventDefault();\r\n /* istanbul ignore else */\r\n if (typeof this.props.onSetActiveRowIndex === \"function\")\r\n this.props.onSetActiveRowIndex(rowIndex);\r\n if (\r\n this.props.multiSelection?.multiple &&\r\n Object.keys(this.props.multiSelection?.activeRows).length > 1 &&\r\n Object.prototype.hasOwnProperty.call(\r\n this.props.multiSelection?.activeRows,\r\n rowIndex\r\n )\r\n ) {\r\n openMultiSelectionActionPanel({\r\n ...this._getDocModalProps(rowIndex),\r\n activeRows: this.props.multiSelection?.activeRows,\r\n targetView: \"searchresult\",\r\n mapper: /* istanbul ignore next */ (row) => ({\r\n name: row.title,\r\n itemUri: row.itemUri,\r\n formatId: row.breadcrumb?.formatId,\r\n isDoc: row.isDoc,\r\n }),\r\n });\r\n } else {\r\n openSearchResultActionPanel({\r\n row: { ...row, targetView: \"searchresult\" },\r\n ...this._getDocModalProps(rowIndex),\r\n });\r\n }\r\n };\r\n //#endregion\r\n\r\n _maybeChangeViewMode = (newViewMode: ?ListViewModeEnum): void => {\r\n let viewMode, fallbackViewMode;\r\n\r\n /** Decide if the current or future ViewMode might be changed */\r\n if (newViewMode) {\r\n viewMode = newViewMode;\r\n } else {\r\n viewMode = this.props.viewModeSetting.value;\r\n }\r\n /** Set fallback ViewMode if current/future ViewMode is not supported */\r\n if (!SupportGeoMapViewer() && viewMode === ListViewMode.Map) {\r\n console.warn(\r\n `GeoMapViewer support is disabled. Using fallback viewMode \"${ListViewMode.List}\"`\r\n );\r\n fallbackViewMode = ListViewMode.List;\r\n }\r\n if (\r\n !isFeatureOn(Feature.searchCalendar) &&\r\n viewMode === ListViewMode.Calendar\r\n ) {\r\n console.warn(\r\n `CalendarViewer support is disabled. Using fallback viewMode \"${ListViewMode.List}\"`\r\n );\r\n fallbackViewMode = ListViewMode.List;\r\n }\r\n /** Change ViewMode if there is a fallbackViewMode or a newViewMode*/\r\n if (fallbackViewMode) {\r\n this.props.viewModeSetting.setValue(fallbackViewMode);\r\n } else if (\r\n this.props.viewModeSetting &&\r\n newViewMode !== this.props.viewModeSetting.value\r\n ) {\r\n this.props.viewModeSetting.setValue(newViewMode);\r\n }\r\n };\r\n\r\n _onViewModeChange = (viewMode: ListViewModeEnum): void =>\r\n this._maybeChangeViewMode(viewMode);\r\n\r\n _getAvailableViewModes = () => {\r\n const viewModes = [ListViewMode.List, ListViewMode.Grid];\r\n if (SupportGeoMapViewer()) viewModes.push(ListViewMode.Map);\r\n if (isFeatureOn(Feature.searchCalendar))\r\n viewModes.push(ListViewMode.Calendar);\r\n return viewModes;\r\n };\r\n\r\n _onCountOfGeoResults = (count: number): void =>\r\n this._updateToggleCounter(count, false);\r\n\r\n // _onTextFilter = (value: ?string) => {\r\n // // TODO update searchRequest.freetext and run query again\r\n // const { searchRequest } = this.props;\r\n // this._fetch(immutable.set(searchRequest, \"searchText\", value), true);\r\n // };\r\n\r\n _handleMoreRowsLoaded = (\r\n rows: Array,\r\n totalCount: number = 0,\r\n updateTotalCount = false,\r\n additionalState = {}\r\n ) => {\r\n // Store documents for pagination / multi selection\r\n const documents = {};\r\n const availableRows = {};\r\n for (let index in rows) {\r\n availableRows[index] = { ...rows[index] };\r\n /* istanbul ignore if */\r\n if (!this._isDocument(rows[index])) {\r\n continue;\r\n }\r\n documents[index] = rows[index].itemUri;\r\n }\r\n\r\n // Update multiSelection available Rows\r\n /* istanbul ignore next */\r\n this.props.multiSelection?.setAvailableRows(availableRows);\r\n\r\n this._updateArrowNavigationRows(documents);\r\n\r\n this.setState({ documents, scrollToRow: -1, ...additionalState });\r\n if (updateTotalCount) this._updateToggleCounter(totalCount);\r\n };\r\n\r\n _isRowActive = (rowIndex: number, activeState: boolean): boolean => {\r\n return this.props.multiSelection?.multiple\r\n ? this.props.multiSelection?.isSelected(rowIndex)\r\n : activeState;\r\n };\r\n\r\n render() {\r\n const {\r\n status,\r\n error,\r\n result,\r\n terms,\r\n activeRowIndex,\r\n isBreadcrumbReadonly,\r\n } = this.props;\r\n const { scrollToRow } = this.state;\r\n if (\r\n this.props.searchItem == null &&\r\n result == null &&\r\n status === Constants.NONE\r\n ) {\r\n return ;\r\n }\r\n\r\n // custom error message handling\r\n if (\r\n status === Constants.ERROR &&\r\n error != null &&\r\n error.eventId != null &&\r\n error.eventId.id === 1500 /*SEARCH_PARSE*/\r\n ) {\r\n return (\r\n \r\n
\r\n
\r\n Error parsing, field: {error.extra.field}, value:{\" \"}\r\n {error.extra.value}\r\n
\r\n
\r\n {error.message}\r\n
\r\n
\r\n );\r\n }\r\n /* istanbul ignore else */\r\n if (status === Constants.OK && result != null) {\r\n return (\r\n
\r\n {this.props.showFilterBar !== false && (\r\n \r\n )}\r\n\r\n {this.props.viewModeSetting.value === ListViewMode.Map && (\r\n \r\n )}\r\n\r\n {this.props.viewModeSetting.value ===\r\n ListViewMode.Calendar && (\r\n \r\n )}\r\n\r\n {this.props.viewModeSetting.value === ListViewMode.Grid && (\r\n \r\n )}\r\n {this.props.viewModeSetting.value === ListViewMode.List && (\r\n \r\n )}\r\n
\r\n );\r\n }\r\n\r\n return ;\r\n }\r\n}\r\n\r\nconst mapStateToProps = /* istanbul ignore next */ (state, ownProps) => ({\r\n status: s.searchStatusSelector(state),\r\n error: s.searchErrorSelector(state),\r\n searchRequest: s.searchRequestSelector(state),\r\n terms:\r\n s.searchStatusSelector(state) === Constants.OK\r\n ? s.searchTermsSelector(state)\r\n : [\"\"],\r\n result:\r\n s.searchStatusSelector(state) === Constants.OK\r\n ? s.searchResultSelector(state)\r\n : undefined,\r\n ...ownProps,\r\n});\r\n\r\nexport const SearchResultContainerWithoutMultiSelection = compose(\r\n withRouter,\r\n connect(mapStateToProps),\r\n SettingValue({\r\n name: \"searchResultViewMode\",\r\n namespace: \"viewModeSetting\",\r\n defaultValue: ListViewMode.List,\r\n }),\r\n SettingValue({\r\n name: \"searchResultSort\",\r\n namespace: \"sortSetting\",\r\n defaultValue: \"\",\r\n })\r\n)(SearchResultContainer);\r\n\r\nexport default compose(\r\n withRouter,\r\n connect(mapStateToProps),\r\n SettingValue({\r\n name: \"searchResultViewMode\",\r\n namespace: \"viewModeSetting\",\r\n defaultValue: ListViewMode.List,\r\n }),\r\n SettingValue({\r\n name: \"searchResultSort\",\r\n namespace: \"sortSetting\",\r\n defaultValue: \"\",\r\n }),\r\n withMultiSelection({\r\n delay: 600,\r\n })\r\n)(SearchResultContainer);\r\n","// @flow\r\nimport { Location } from \"history\";\r\nimport qs from \"data/queryString\";\r\nimport { persistor } from \"data/storeHelper\";\r\n\r\n/* istanbul ignore next */\r\n/**\r\n * create a valid GUID\r\n *\r\n * @returns {string} random guid\r\n */\r\nfunction randomGuid(): string {\r\n var guidHolder = \"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx\";\r\n var hex = \"0123456789abcdef\";\r\n var r = 0;\r\n var guidResponse = \"\";\r\n for (var i = 0; i < guidHolder.length; i++) {\r\n if (guidHolder[i] !== \"-\" && guidHolder[i] !== \"4\") {\r\n // each x and y needs to be random\r\n r = (Math.random() * 16) | 0;\r\n }\r\n\r\n if (guidHolder[i] === \"x\") {\r\n guidResponse += hex[r];\r\n } else if (guidHolder[i] === \"y\") {\r\n // clock-seq-and-reserved first hex is filtered and remaining hex values are random\r\n r &= 0x3; // bit and with 0011 to set pos 2 to zero ?0??\r\n r |= 0x8; // set pos 3 to 1 as 1???\r\n guidResponse += hex[r];\r\n } else {\r\n guidResponse += guidHolder[i];\r\n }\r\n }\r\n return guidResponse;\r\n}\r\n// export as function for test mocking\r\nconst functions = {\r\n randomGuid,\r\n};\r\nexport { functions };\r\n\r\n/**\r\n * creates a URL to request authentication from identityServer\r\n *\r\n * @export\r\n * @param {Object} state can include a \"from\" property to specify the return route after login (used by {@link getAuthCallback})\r\n * @returns absolute url to identity login process\r\n */\r\nexport function getAuthUrl(state?: { from: string }): string {\r\n const params = {\r\n client_id: window.CONFIG.auth.clientId,\r\n redirect_uri: window.CONFIG.auth.redirectUrl,\r\n response_type: window.CONFIG.auth.responseType || \"id_token token\",\r\n scope: window.CONFIG.auth.scope || \"openid\",\r\n state: /* istanbul ignore next */ state\r\n ? JSON.stringify(state)\r\n : undefined,\r\n\r\n nonce: functions.randomGuid(),\r\n // https://github.com/IdentityModel/oidc-client-js/issues/624\r\n // https://stackoverflow.com/a/23945116/1069189\r\n resource: window.CONFIG.auth.resource,\r\n //login_hint: pre-fill username on login form\r\n };\r\n if (window.CONFIG.auth.forceLogin === true) {\r\n params.prompt = window.CONFIG.auth.forceLoginPrompt || \"login\";\r\n }\r\n // http://docs.identityserver.io/en/release/endpoints/authorize.html\r\n return window.CONFIG.auth.authorizeEndpoint + \"?\" + qs.stringify(params);\r\n}\r\n\r\nexport type authInfo = {\r\n /** identity id_token */\r\n id_token: string,\r\n /** identity access_token */\r\n access_token: string,\r\n /** which route should the user land at */\r\n state: { from: string },\r\n /** ticks until tokens expire (absolute value, not related to token itself) */\r\n expires_in: number,\r\n};\r\n\r\n/**\r\n * parses the hash part of the url to retrieve identity authentication tokens - id_token, access_token, etc...\r\n * will also parse the state originally passed by {@link getAuthUrl}\r\n * @export\r\n * @param {Location} urlLocation\r\n * @returns object with all parsed identity values\r\n */\r\nexport function getAuthCallback(urlLocation: Location): authInfo {\r\n const search = urlLocation.hash.substring(1);\r\n const qr = qs.parse(search);\r\n /* istanbul ignore next */\r\n if (qr.error != null) {\r\n alert(qr.error_description);\r\n return null;\r\n }\r\n let expires_in = 73360; //1 hour default\r\n /* istanbul ignore else */\r\n if (qr.expires_in) {\r\n expires_in = parseInt(qr.expires_in, 10);\r\n }\r\n let expires_on = Date.now() + 1000 * expires_in;\r\n const parsed = parseJwt(qr.access_token || qr.id_token);\r\n if (parsed !== null && parsed.exp !== null) {\r\n expires_on = parsed.exp;\r\n }\r\n return {\r\n id_token: qr.id_token,\r\n access_token: qr.access_token || qr.id_token,\r\n state: /* istanbul ignore next */ qr.state\r\n ? JSON.parse(qr.state)\r\n : { from: \"/\" },\r\n expires_in,\r\n expires_on,\r\n };\r\n}\r\n\r\nfunction parseJwt(token) {\r\n let split = token.split(\".\");\r\n if (split.length < 2) {\r\n return null;\r\n }\r\n let base64Url = split[1];\r\n let base64 = base64Url.replace(/-/g, \"+\").replace(/_/g, \"/\");\r\n let jsonPayload = decodeURIComponent(\r\n window\r\n .atob(base64)\r\n .split(\"\")\r\n .map(function (c) {\r\n return \"%\" + (\"00\" + c.charCodeAt(0).toString(16)).slice(-2);\r\n })\r\n .join(\"\")\r\n );\r\n\r\n return JSON.parse(jsonPayload);\r\n}\r\n\r\n/**\r\n * will sign-out the current user invaliding the stored tokens and forwarding to the identity/EndSession Endpoint\r\n *\r\n * @export\r\n * @param {string} idToken\r\n */\r\nexport const signout = (idToken: string): Promise => {\r\n // #43383 clear all persisted data\r\n persistor.pause();\r\n persistor.flush().then(() => {\r\n persistor.purge().then(() =>\r\n window.location.assign(\r\n window.CONFIG.auth.endSessionEndpoint +\r\n \"?\" +\r\n qs.stringify({\r\n // by passing the original id_token the user gets a prompt to return to logoutRedirectUrl\r\n id_token_hint: idToken,\r\n // this must be the same as the Identity/Config.ClientStore.logoutRedirectUrl otherwise it wont work!\r\n post_logout_redirect_uri:\r\n window.CONFIG.auth.logoutRedirectUrl,\r\n })\r\n )\r\n );\r\n });\r\n};\r\n\r\n/**\r\n * will return the current location pathname + search values but remove any basename from the route\r\n *\r\n * @export\r\n * @returns relative url of current route (without basename)\r\n */\r\nexport function signinFromLocation(): string {\r\n return (window.location.pathname + window.location.search).replace(\r\n window.CONFIG.host.basename,\r\n \"\"\r\n );\r\n}\r\n\r\n/**\r\n * will redirect user after successful login to his original requested route\r\n *\r\n * @export\r\n */\r\nexport function signinRedirect(): void {\r\n window.location.assign(\r\n getAuthUrl({\r\n // Root.js/BrowserRouter already sets basename so avoid duplicating it\r\n from: signinFromLocation(),\r\n })\r\n );\r\n}\r\n\r\n// https://github.com/IdentityModel/oidc-client-js/blob/dev/src/UserManager.js\r\n// export function silentRenewUrl() {\r\n// return (\r\n// \"https://lns-w10.hs.local:5000/connect/authorize?\" +\r\n// qs.stringify({\r\n// client_id,\r\n// redirect_uri,\r\n// //id_token_hint: id_token,\r\n// prompt: \"none\",\r\n// response_type: \"id_token token\",\r\n// scope: \"openid inPoint.Web.API inPoint.Core.API\",\r\n// nonce: random()\r\n// //login_hint: pre-fill username on login form\r\n// })\r\n// );\r\n// }\r\n\r\n// export function getTokens(code: string) {\r\n// const url = \"https://lns-w10.hs.local:5000/connect/token\";\r\n\r\n// fetch(url, {\r\n// method: \"POST\",\r\n// headers: {\r\n// \"Content-Type\": \"application/x-www-form-urlencoded\"\r\n// },\r\n// body: qs.stringify({\r\n// code,\r\n// grant_type: \"refresh_token\",\r\n// client_id,\r\n// redirect_uri\r\n// })\r\n// })\r\n// .then(response => {\r\n// console.log(\"token response\", response);\r\n// const accessToken = response.access_token;\r\n// })\r\n// .catch(err => {\r\n// console.log(\"token error\", err);\r\n// });\r\n// }\r\n","// @flow\r\nimport React from \"react\";\r\nimport \"./index.css\";\r\nimport CardItem from \"./CardItem\";\r\nimport {\r\n type CardItemResultDTO,\r\n CardItemType,\r\n type CardItemTypeEnum,\r\n} from \"data/types\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport Status from \"components/Status\";\r\nimport NoData from \"components/NoData\";\r\n\r\ntype Props = {\r\n /** current fetch status */\r\n status: ConstantsEnum,\r\n /** all cards objects */\r\n cards?: Array,\r\n /** which panes are currently toggled */\r\n toggles: Array,\r\n /** callback when user clicks on a card\r\n * @param {CardItemResultDTO} item which card was clicked\r\n * @param {?SyntheticMouseEvent<*>} e click event details\r\n */\r\n onClick: (item: CardItemResultDTO, e: ?SyntheticMouseEvent<*>) => void,\r\n /** optional callback when user clicks on the three dots more\r\n * @param {CardItemResultDTO} item which card was clicked\r\n */\r\n onMoreClick?: (item: CardItemResultDTO) => void,\r\n /** optional function to validate whether to show the onMoreClick\r\n * @param {CardItemResultDTO} item which card\r\n * @default only for card.itemtype=Doc,Folder,Search,Task\r\n */\r\n showOnMoreClick?: (item: CardItemResultDTO) => boolean,\r\n /** which itemTypes to show */\r\n itemtypes?: Array,\r\n /** current filterText (or empty string if none) */\r\n filterText: string,\r\n};\r\n\r\nconst CardList = ({\r\n status,\r\n cards,\r\n toggles,\r\n onClick,\r\n onMoreClick,\r\n showOnMoreClick,\r\n itemtypes,\r\n filterText,\r\n}: Props) => {\r\n const _onMoreClick = (card: CardItemResultDTO) => {\r\n // onMoreClick defined at all?\r\n if (typeof onMoreClick === \"function\") {\r\n // custom evaluator defined?\r\n if (typeof showOnMoreClick === \"function\") {\r\n return showOnMoreClick(card)\r\n ? (e) => e.stopPropagation() || onMoreClick(card)\r\n : undefined;\r\n }\r\n // default evaluator (for backward compatibility)\r\n /* istanbul ignore else */\r\n if (\r\n [\r\n CardItemType.Doc,\r\n CardItemType.Folder,\r\n CardItemType.Search,\r\n CardItemType.Task,\r\n ].includes(card.itemtype)\r\n ) {\r\n return (e) => e.stopPropagation() || onMoreClick(card);\r\n }\r\n }\r\n // do not show onMore\r\n return undefined;\r\n };\r\n /* istanbul ignore else */\r\n if (status !== Constants.LOADING && cards != null) {\r\n const totalVisible = cards.filter(\r\n (item) =>\r\n toggles.includes(item.type) &&\r\n (itemtypes == null || itemtypes.includes(item.itemtype))\r\n ).length;\r\n if (totalVisible === 0) return ;\r\n else\r\n return (\r\n
    \r\n {cards &&\r\n cards.map((item) => (\r\n onClick(item, e)}\r\n onMoreClick={_onMoreClick(item)}\r\n dataTest={`cardItem-${item.uri}`}\r\n />\r\n ))}\r\n
\r\n );\r\n }\r\n\r\n return ;\r\n};\r\nCardList.displayName = \"CardList\";\r\nexport default CardList;\r\n","import actionTypes from \"../actions/actionTypes\";\r\nimport immutable from \"object-path-immutable\";\r\nimport panesDefaultState from \"../panes.js\";\r\n\r\nconst panesReducer = (state = panesDefaultState, action) => {\r\n switch (action.type) {\r\n case actionTypes.SPLITPANES_PERSIST:\r\n case actionTypes.SPLITPANES_SET:\r\n return immutable.set(\r\n state,\r\n [action.payload.view, action.payload.name],\r\n action.payload.dimensions\r\n );\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return panesDefaultState;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default panesReducer;\r\n\r\nexport const panesViewSelector = (state: Object, viewName: string) =>\r\n state.panes[viewName];\r\n","import actionTypes from \"data/actions/actionTypes\";\r\nimport Constants from \"data/constants\";\r\n\r\nconst initialState = {\r\n options: undefined,\r\n status: Constants.LOADING,\r\n};\r\n\r\nconst globalSearchReducer = (state = initialState, action) => {\r\n switch (action.type) {\r\n case actionTypes.GLOBALDEFAULTSEARCH_FETCH_RESULT:\r\n return { ...state, ...action.payload };\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return initialState;\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default globalSearchReducer;\r\n\r\nexport const globalSearchOptionsSelector = (state: Object) =>\r\n state.globalSearch.status === Constants.OK\r\n ? state.globalSearch.options\r\n : undefined;\r\n","import actionTypes from \"data/actions/actionTypes\";\r\n\r\nconst globalEventsReducer = (state = {}, action) => {\r\n switch (action.type) {\r\n case actionTypes.GLOBALEVENTS_SERVER:\r\n return { ...state, ...action.payload, id: action.receivedAt };\r\n\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return {};\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default globalEventsReducer;\r\n\r\nexport const globalEventsSelector = (state: Object) => state.globalEvents;\r\n// export const serverEventsTypeSelector = (state: Object) =>\r\n// state.serverEvents.type;\r\n// export const serverEventsItemUriSelector = (state: Object) =>\r\n// state.serverEvents.itemUri;\r\n","import actionTypes from \"../actions/actionTypes\";\r\nimport {\r\n NotificationStatusFlag,\r\n PriorityType,\r\n NotificationStyle,\r\n type NotificationDTO,\r\n} from \"data/types\";\r\nimport produce from \"immer\";\r\n\r\nexport const initialState: Array = [];\r\n\r\nconst notificationReducer = (state = initialState, action) =>\r\n produce(state, (draft) => {\r\n const { payload, type } = action;\r\n const i = state.findIndex(\r\n (i) => i.notificationId === payload?.notificationId\r\n );\r\n\r\n switch (type) {\r\n case actionTypes.NOTIFICATION_UPSERT:\r\n if (i === -1)\r\n draft.unshift({\r\n notificationId:\r\n payload?.notificationId ??\r\n window.crypto.randomUUID(),\r\n message: payload?.message,\r\n status: payload?.status ?? NotificationStatusFlag.New,\r\n priority:\r\n payload?.priority ?? PriorityType.Intermediate,\r\n style: payload?.style ?? NotificationStyle.Default,\r\n icon: payload?.icon,\r\n Component: payload?.Component,\r\n toast: payload?.toast ?? false,\r\n timestamp: payload?.timestamp ?? Date.now(),\r\n });\r\n else draft[i] = { ...draft[i], ...payload };\r\n break;\r\n case actionTypes.NOTIFICATION_DEL:\r\n if (i > -1) draft.splice(i, 1);\r\n else\r\n console.warn(\r\n `Not found. Cannot delete Notification ${payload.notificationId}`\r\n );\r\n break;\r\n case actionTypes.NOTIFICATION_STATUS:\r\n if (i === -1)\r\n draft.forEach((item, i) => {\r\n draft[i].status = payload.replace\r\n ? payload.status\r\n : draft[i].status | payload.status;\r\n });\r\n else\r\n draft[i].status = payload.replace\r\n ? payload.status\r\n : draft[i].status | payload.status;\r\n break;\r\n case actionTypes.NOTIFICATION_CLEAR:\r\n return payload == null\r\n ? initialState\r\n : draft.filter(\r\n (item) =>\r\n (payload.priority == null ||\r\n payload.priority !== item.priority) &&\r\n (payload.style == null ||\r\n payload.style !== item.style) &&\r\n (payload.status == null ||\r\n payload.status !== item.status)\r\n );\r\n /* istanbul ignore next */\r\n case actionTypes.PERSIST_PURGE:\r\n return initialState;\r\n default:\r\n break;\r\n }\r\n });\r\n\r\nexport default notificationReducer;\r\n\r\nexport const notificationSelector = (\r\n state: Any,\r\n notificationId: NotificationId = null\r\n): Array =>\r\n state.notification\r\n ?.filter(\r\n (i) => notificationId == null || i.notificationId === notificationId\r\n )\r\n ?.sort((a, b) =>\r\n a.timestamp > b.timestamp ? -1 : a.timestamp < b.timestamp ? 1 : 0\r\n ) ?? [];\r\n","// @flow\r\nimport React from \"react\";\r\nimport loc from \"i18next\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport Icons from \"@hs/icons\";\r\nimport CommandActionHandler from \"./index\";\r\nimport { getClassNames } from \"data/utils\";\r\nimport { ItemFlowDirection } from \"data/types\";\r\nimport styles from \"./CommandActionButton.module.css\";\r\n\r\n/**\r\n * Create itemAction localization identifier for CommandAction Button\r\n *\r\n * @param {action: string } {itemUri} CommandAction identifier string\r\n * @param {props?: any } {props} optional commandAction properties\r\n *\r\n */\r\nconst getItemActionLocalizationIdentifier = (\r\n action: string,\r\n props?: any\r\n): string => {\r\n switch (action) {\r\n case \"itemFlows\":\r\n let locId = `${action}_${\r\n props?.direction === ItemFlowDirection.out ? \"output\" : \"input\"\r\n }`;\r\n return props?.categoryId !== \"all\"\r\n ? `${locId}.${props.categoryId}`\r\n : locId;\r\n default:\r\n return action;\r\n }\r\n};\r\n\r\nconst CommandActionButton = ({\r\n className,\r\n action,\r\n icon,\r\n props,\r\n actionPrefix = \"itemActions\",\r\n bsStyle = \"link\",\r\n}: {\r\n className?: string,\r\n action: string,\r\n icon?: string,\r\n props?: any,\r\n actionPrefix?: string,\r\n bsStyle?: string,\r\n}) => {\r\n const label = loc.t(\r\n `${actionPrefix}:${getItemActionLocalizationIdentifier(\r\n action,\r\n props\r\n )}.name`\r\n );\r\n return (\r\n CommandActionHandler(action, props)}\r\n >\r\n {icon && }\r\n {label}\r\n \r\n );\r\n};\r\nCommandActionButton.displayName = \"CommandActionButton\";\r\nexport default CommandActionButton;\r\n","import _queryString, { StringifyOptions } from \"query-string\";\r\n\r\nconst queryString = {\r\n ..._queryString,\r\n stringify: (object: Record, options: StringifyOptions) =>\r\n _queryString.stringify(object, {\r\n skipNull: true,\r\n skipEmptyString: true,\r\n }),\r\n};\r\n\r\nexport default queryString;\r\n","// @flow\r\nimport React, { type ComponentType } from \"react\";\r\nimport { connect } from \"react-redux\";\r\nimport FormsyEditorBase from \"./FormsyEditorBase\";\r\nimport { fetchFormLookup, fetchFormLookupDependencies } from \"data/api\";\r\nimport {\r\n type ApiError,\r\n type FormLookupTypeEnum,\r\n FormLookupType,\r\n type FieldDefinitionDTO,\r\n type SearchFieldDefinitionDTO,\r\n type SearchFilterDTO,\r\n type FormLookupValue,\r\n type LookupValuesResultDTO,\r\n type SearchValueTypeEnum,\r\n SearchValueType,\r\n SearchOperator,\r\n} from \"data/types\";\r\nimport loc from \"i18next\";\r\nimport { userLanguage } from \"data/storeHelper\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport { AsyncPaginate } from \"react-select-async-paginate\";\r\nimport { createFilter, components } from \"react-select\";\r\nimport Status from \"components/Status\";\r\nimport CountBadge from \"components/CountBadge\";\r\nimport NativeSelect from \"components/NativeSelect\";\r\nimport { isHandheld } from \"data/bowser\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport Mark from \"@hs/mark\";\r\nimport SearchBucket from \"components/FilterBar/SearchBucket\";\r\nimport { getClassNames, closeMenuOnScroll } from \"data/utils\";\r\nimport styles from \"./LookupEditorControl.module.css\";\r\n\r\nconst { Option } = components;\r\n\r\ntype FetchFormResponseDTO = {\r\n options: Array,\r\n hasMore: boolean,\r\n additional: { pageNum: number },\r\n};\r\n\r\ntype Props = {\r\n /** whether handling a Document or Folder form */\r\n isDoc: boolean,\r\n /** requested formatId */\r\n formatId: number,\r\n /** requested itemUri */\r\n itemUri: string,\r\n /** commonName */\r\n name: string,\r\n /** current value */\r\n value: string,\r\n /** all ExtraAttributes */\r\n attributes: Array,\r\n /** Redux form changes */\r\n changes: ?Object,\r\n /** type of lookup */\r\n lookupType: FormLookupTypeEnum,\r\n /** when lookupType==FormLookupType.sf_ftlookup then this is the searchFormId */\r\n formId?: number,\r\n /** SearchValueType */\r\n valueType?: SearchValueTypeEnum,\r\n /** whether multiple selection is allowed */\r\n isMultiple: boolean,\r\n /** whether this is a required field */\r\n isRequired: boolean,\r\n /** whether this is a readonly field */\r\n isReadonly: boolean,\r\n /** filtering by matching any part of starts with */\r\n useContains: boolean,\r\n /** whether to use lookup values keys */\r\n useKeys: boolean,\r\n /** all available options */\r\n values?: Array,\r\n /** placeholder text to display when @see {value} is empty */\r\n placeholder?: string,\r\n /** optional children to render */\r\n children?: ComponentType<*>,\r\n /** optional parentName (dependent lookups) */\r\n parentName: string,\r\n};\r\n\r\ntype State = {\r\n inputValue: ?string,\r\n status: ConstantsEnum,\r\n loadIndex: number,\r\n};\r\n\r\nexport class LookupEditorControl extends React.Component {\r\n static defaultProps = {\r\n isDoc: false,\r\n formatId: 0,\r\n name: \"\",\r\n lookupType: FormLookupType.ea_lookup,\r\n isMultiple: false,\r\n isRequired: false,\r\n isReadonly: false,\r\n useContains: false,\r\n useKeys: false,\r\n };\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n this.state = {\r\n status: props.values ? Constants.OK : Constants.LOADING,\r\n loadIndex: 0,\r\n inputValue: null,\r\n };\r\n }\r\n\r\n /** re-render only when value changes! */\r\n shouldComponentUpdate = (nextProps: Props, nextState: State) =>\r\n nextProps.itemUri !== this.props.itemUri ||\r\n nextProps.value !== this.props.value ||\r\n nextProps.values !== this.props.values ||\r\n // used to force reloading\r\n nextState.loadIndex !== this.state.loadIndex ||\r\n nextState.inputValue !== this.state.inputValue;\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n /* istanbul ignore else */\r\n if (\r\n prevProps.attributes !== this.props.attributes ||\r\n prevProps.values !== this.props.values\r\n ) {\r\n this.setState(({ loadIndex }: State) => ({\r\n loadIndex: loadIndex + 1,\r\n }));\r\n }\r\n }\r\n\r\n getParentAsFilters = (filters = [], parentName = this.props.parentName) => {\r\n // Bail early if not EA\r\n if (this.props.attributes == null) {\r\n return filters;\r\n }\r\n const attr = this.props.attributes.find(\r\n (attr) => attr.name === parentName\r\n );\r\n // No parent found, return found filters\r\n if (attr == null) return filters;\r\n\r\n // Up the dependency tree\r\n if (attr.extra && attr.extra.parentLookupCommonName != null) {\r\n filters = this.getParentAsFilters(\r\n filters,\r\n attr.extra.parentLookupCommonName\r\n );\r\n }\r\n const filter: SearchFilterDTO = {\r\n name: parentName,\r\n op: SearchOperator.Equals,\r\n value: attr.value,\r\n };\r\n filters.push(filter);\r\n return filters;\r\n };\r\n\r\n getCurrentDependentLookupValues = (\r\n lookupValues = [],\r\n parentName = this.props.name.substring(3)\r\n ) => {\r\n // Bail early if not EA\r\n if (this.props.attributes == null) {\r\n return lookupValues;\r\n }\r\n // Re-use getParentAsFilters to get all parent values\r\n if (\r\n lookupValues.length === 0 &&\r\n parentName === this.props.name.substring(3)\r\n ) {\r\n lookupValues = this.getParentAsFilters(\r\n lookupValues,\r\n this.props.parentName\r\n ).map((filter) => ({\r\n name: filter.name,\r\n value: filter.value,\r\n }));\r\n }\r\n\r\n // Find any child\r\n const attr = this.props.attributes.find(\r\n (attr) =>\r\n attr.extra && attr.extra.parentLookupCommonName === parentName\r\n );\r\n\r\n if (attr == null) return lookupValues;\r\n\r\n const value = {\r\n name: attr.name,\r\n value: attr.value,\r\n };\r\n lookupValues.push(value);\r\n\r\n // Down the dependency tree\r\n return this.getCurrentDependentLookupValues(lookupValues, attr.name);\r\n };\r\n\r\n getValueByOperator = (value: any, op: SearchOperatorEnum) => {\r\n switch (op) {\r\n case SearchOperator.Contextor:\r\n case SearchOperator.ContextorContains:\r\n return value && value.T ? value.T : value;\r\n default:\r\n return value;\r\n }\r\n };\r\n\r\n fetchLookup = (\r\n keyword: string,\r\n loadedOptions: any,\r\n { pageNum }: { pageNum: number }\r\n ): Promise => {\r\n if (this.props.values) {\r\n return Promise.resolve({\r\n options: this.props.values,\r\n hasMore: false,\r\n additional: { pageNum: 0 },\r\n });\r\n }\r\n const name = this.props.name.substring(3); //remove formPrefix\r\n // collect other attribute values\r\n let filters: Array = [];\r\n if (\r\n this.props.lookupType === FormLookupType.sf_ftlookup &&\r\n this.props.changes != null\r\n ) {\r\n this.props.attributes.forEach((attr) => {\r\n const changed = this.props.changes[attr.name];\r\n // pass any other set filters (always pass ourselves as well)\r\n // NOTE: we need to pass everything to allow resetting predefined SearchParameters!\r\n // if (\r\n // changed != null &&\r\n // (changed.val != null || attr.name === name)\r\n // ) {\r\n const filter: SearchFilterDTO = {\r\n name: attr.name,\r\n op: changed.op,\r\n value: this.getValueByOperator(changed.val, changed.op),\r\n valueType: attr.valueType,\r\n boostLeafNode: attr.boostLeafNode,\r\n nodeType: attr.nodeType,\r\n };\r\n filters.push(filter);\r\n // }\r\n });\r\n }\r\n // collect any (parent(s)) parent value and add to filter\r\n if (this.props.parentName) {\r\n filters = this.getParentAsFilters(filters);\r\n }\r\n\r\n return fetchFormLookup({\r\n keyword,\r\n pageNum,\r\n isDoc: this.props.isDoc,\r\n formatId: this.props.formatId,\r\n itemUri: this.props.itemUri,\r\n name,\r\n lookupType: this.props.lookupType,\r\n id: this.props.formId,\r\n filters,\r\n values: this.props.attributes?.reduce((changes, a) => {\r\n changes[a.name] = a.value;\r\n return changes;\r\n }, {}),\r\n })\r\n .catch((err: ApiError) => {\r\n this.setState({\r\n status: Constants.ERROR,\r\n });\r\n return null;\r\n })\r\n .then((result: ?LookupValuesResultDTO) => {\r\n if (result != null && result.values != null) {\r\n this.setState({\r\n // values,\r\n status: Constants.OK,\r\n });\r\n return {\r\n options: result.values,\r\n hasMore: result.hasMore,\r\n additional: { pageNum: pageNum + 1 },\r\n };\r\n } else\r\n return {\r\n options: [],\r\n hasMore: false,\r\n additional: { pageNum: 0 },\r\n };\r\n });\r\n };\r\n\r\n _fixValue = (value: ?any | ?Array | ?FormLookupValue) => {\r\n if (Array.isArray(value)) {\r\n const values = value\r\n .map((v) => this._fixValue(v))\r\n .filter((v) => v != null);\r\n return values.length ? values : null;\r\n }\r\n return value?.T ? value : null;\r\n };\r\n\r\n _onChange = (\r\n value: ?Array | ?FormLookupValue,\r\n changeValue: Function\r\n ) =>\r\n this._handleDependenciesUpdate(\r\n this._handleLookupValue(value),\r\n changeValue\r\n );\r\n\r\n _prepareOtherValueFor = (name: string, value: any): any => {\r\n const target = this.props.attributes?.find((a) => a.name === name);\r\n let v = value;\r\n if (\r\n [\"List_Combo\", \"Lookup_Combo\", \"FullTextLookup_Combo\"].includes(\r\n target?.format\r\n )\r\n ) {\r\n v = { T: `${value}` };\r\n }\r\n if (v != null && typeof v === \"object\" && target?.extra?.useKeys) {\r\n v.K = `${value}`;\r\n }\r\n if (target?.extra?.isMultiple) {\r\n v = [v];\r\n }\r\n return v;\r\n };\r\n\r\n _handleLookupValue = (\r\n rawValue: ?Array | ?FormLookupValue,\r\n name: string = this.props.name\r\n ): Array => {\r\n const changed: Array = [];\r\n if (Array.isArray(rawValue)) {\r\n changed.push({\r\n name,\r\n value: this._fixValue(rawValue),\r\n });\r\n } else {\r\n const { O: others, ...current } = rawValue || {};\r\n const value = this._fixValue(current);\r\n changed.push({\r\n name,\r\n value,\r\n });\r\n if (others != null) {\r\n const splittedName = name.split(\".\");\r\n const prefix = splittedName.shift();\r\n Object.keys(others)\r\n .filter((name) => name !== splittedName.join(\".\"))\r\n .forEach((name) => {\r\n changed.push({\r\n name: `${prefix}.${name}`,\r\n value: this._prepareOtherValueFor(\r\n name,\r\n others[name]\r\n ),\r\n });\r\n });\r\n }\r\n }\r\n return changed;\r\n };\r\n\r\n _handleDependenciesUpdate = (\r\n changed: Array,\r\n changeValue: Function\r\n ) => {\r\n const splittedName = changed[0].name.split(\".\");\r\n const currentLookupValues = this.getCurrentDependentLookupValues();\r\n // Bail early if only one Lookup is present\r\n if (currentLookupValues.length === 0) {\r\n return changeValue(changed);\r\n }\r\n currentLookupValues.push({\r\n name: splittedName[1],\r\n value: changed[0].value,\r\n });\r\n fetchFormLookupDependencies({\r\n isDoc: this.props.isDoc,\r\n formatId: this.props.formatId,\r\n itemUri: this.props.itemUri,\r\n name: this.props.name.substring(3),\r\n lookupType: this.props.lookupType,\r\n currentLookupValues,\r\n })\r\n .then((dependentLookups) => {\r\n dependentLookups.forEach((lookup) => {\r\n const _lookup = this._handleLookupValue(\r\n lookup.value,\r\n `${splittedName[0]}.${lookup.name}`\r\n );\r\n // append updated lookup & other values\r\n changed = changed.concat(_lookup);\r\n });\r\n changeValue(changed);\r\n })\r\n .catch((e) => {\r\n changeValue(changed);\r\n });\r\n };\r\n\r\n _onInputChange = (inputValue: string): void =>\r\n this.setState({ inputValue });\r\n\r\n _valueRenderer = (props: any) => {\r\n const { value } = props;\r\n switch (this.props.valueType) {\r\n case SearchValueType.Decimal:\r\n case SearchValueType.DecimalFieldOnly:\r\n return value.toLocaleString(userLanguage());\r\n default:\r\n const valueWithIcon = (\r\n \r\n );\r\n /* istanbul ignore next */\r\n return valueWithIcon != null ? (\r\n <>\r\n {valueWithIcon} {value}\r\n \r\n ) : (\r\n value\r\n );\r\n }\r\n };\r\n\r\n _optionRenderer = (props: any) => {\r\n // https://github.com/JedWatson/react-select/issues/3128#issuecomment-451936743\r\n const { onMouseMove, onMouseOver, ...rest } = props.innerProps;\r\n const newProps = Object.assign({}, props, { innerProps: rest });\r\n const ValueComponent = this._valueRenderer;\r\n ValueComponent.displayName = \"LookupEditorControl._valueRenderer\";\r\n return (\r\n Option && (\r\n \r\n {this.props.lookupType === FormLookupType.sf_ftlookup ? (\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 render = () => (\r\n {\r\n /* istanbul ignore if */\r\n if (this.state.status === Constants.ERROR)\r\n return ;\r\n else {\r\n // only on mobile with values fallback to HTML select\r\n if (isHandheld() && this.props.values) {\r\n return (\r\n \r\n this._onChange(item, changeValue)\r\n }\r\n options={this.props.values}\r\n />\r\n );\r\n } else {\r\n // otherwise use full-featured react-select\r\n return (\r\n <>\r\n ({\r\n ...provided,\r\n width: \"100%\",\r\n minWidth: 120,\r\n whiteSpace: \"normal\",\r\n }),\r\n control: /* istanbul ignore next */ (\r\n provided,\r\n state\r\n ) => ({\r\n ...provided,\r\n height: this.props.isMultiple\r\n ? \"auto\"\r\n : 34,\r\n minHeight: \"fit-content\",\r\n borderRadius: 0,\r\n boxShadow:\r\n \"inset 0 1px 1px rgba(0, 0, 0, 0.075)\",\r\n }),\r\n valueContainer:\r\n /* istanbul ignore next */ (\r\n provided,\r\n state\r\n ) => ({\r\n ...provided,\r\n padding: \"0px 6px\",\r\n minHeight: 34,\r\n }),\r\n input: /* istanbul ignore next */ (\r\n provided,\r\n state\r\n ) => ({\r\n ...provided,\r\n margin: 0,\r\n padding: 0,\r\n }),\r\n dropdownIndicator:\r\n /* istanbul ignore next */ (\r\n provided,\r\n state\r\n ) => ({\r\n ...provided,\r\n padding: 4,\r\n }),\r\n indicatorSeparator:\r\n /* istanbul ignore next */ () => ({\r\n display: \"none\",\r\n }),\r\n clearIndicator:\r\n /* istanbul ignore next */ (\r\n provided,\r\n state\r\n ) => ({\r\n ...provided,\r\n padding: 0,\r\n }),\r\n menu: /* istanbul ignore next */ (\r\n provided,\r\n state\r\n ) => ({\r\n ...provided,\r\n marginTop: 0,\r\n borderRadius: 0,\r\n width: \"auto\",\r\n minWidth: \"100%\",\r\n // left: -300, // to set the dropdown bigger than the field - needs work to align correctly (and to the right side!)\r\n // minWidth: 300,\r\n // zIndex: 1051\r\n }),\r\n menuPortal: /* istanbul ignore next */ (\r\n provided,\r\n state\r\n ) => ({\r\n ...provided,\r\n zIndex: 9999,\r\n }),\r\n placeholder:\r\n /* istanbul ignore next */ (\r\n provided,\r\n state\r\n ) => ({\r\n ...provided,\r\n whiteSpace: \"nowrap\",\r\n color: \"hsl(0, 0%, 80%)\",\r\n }),\r\n option: /* istanbul ignore next */ (\r\n provided,\r\n state\r\n ) => {\r\n if (state.isSelected) {\r\n return Object.assign(\r\n {},\r\n provided,\r\n {\r\n boxShadow: \"none\",\r\n background: \"#0098AA\",\r\n textShadow: \"none\",\r\n cursor: \"pointer\",\r\n // border: \"1px solid #f5f5f5\"\r\n }\r\n );\r\n } else if (state.isFocused) {\r\n return Object.assign(\r\n {},\r\n provided,\r\n {\r\n boxShadow: \"none\",\r\n background: \"#f5f5f5\",\r\n textShadow: \"none\",\r\n cursor: \"pointer\",\r\n // border: \"1px solid #f5f5f5\"\r\n }\r\n );\r\n }\r\n return provided;\r\n },\r\n }}\r\n // async-paginate\r\n loadOptions={this.fetchLookup}\r\n debounceTimeout={300}\r\n additional={{\r\n pageNum: 0,\r\n }}\r\n cacheUniqs={[this.state.loadIndex]}\r\n onMenuClose={\r\n /*istanbul ignore next*/ () =>\r\n this.setState(\r\n (prevState: State) => ({\r\n loadIndex:\r\n prevState.loadIndex + 1,\r\n })\r\n )\r\n }\r\n // defaultOptions={true}\r\n // options\r\n getOptionLabel={\r\n /* istanbul ignore next */ (option: {\r\n T: \"\",\r\n }) => option.T\r\n }\r\n getOptionValue={\r\n /* istanbul ignore next */ (option: {\r\n K: \"\",\r\n T: \"\",\r\n }) =>\r\n this.props.useKeys\r\n ? option.K\r\n : option.T\r\n }\r\n filterOption={createFilter({\r\n ignoreAccents: false,\r\n })}\r\n // filterOption={createFilter({\r\n // ignoreCase: true,\r\n // ignoreAccents: false,\r\n // trim: true,\r\n // matchFrom: /* istanbul ignore next */ this\r\n // .props.useContains\r\n // ? \"any\"\r\n // : \"start\"\r\n // })}\r\n // behavior\r\n isClearable={true}\r\n openMenuOnFocus={true}\r\n // localizations\r\n placeholder={\r\n this.props.placeholder ||\r\n loc.t(\"common:validation.select\")\r\n }\r\n // selection\r\n onChange={\r\n /* istanbul ignore next */ (item) =>\r\n this._onChange(item, changeValue)\r\n }\r\n value={this._fixValue(value)}\r\n inputValue={this.state.inputValue}\r\n onInputChange={this._onInputChange}\r\n isMulti={this.props.isMultiple}\r\n delimiter=\",\"\r\n />\r\n {this.props.children}\r\n \r\n );\r\n }\r\n }\r\n }}\r\n {...this.props}\r\n value={this._fixValue(this.props.value)}\r\n />\r\n );\r\n}\r\n\r\nconst mapStateToProps = /* istanbul ignore next */ (\r\n state: State,\r\n ownProps: Props\r\n) => ({\r\n changes: s.searchFormChangesSelector(state),\r\n formId:\r\n ownProps.lookupType === FormLookupType.sf_ftlookup\r\n ? s.searchFormIdSelector(state)\r\n : -1,\r\n ...ownProps,\r\n // #56024 disable FT lookup when offline\r\n isReadonly: s.isOnlineSelector(state)\r\n ? ownProps.isReadonly\r\n : ownProps.lookupType === FormLookupType.ea_ftlookup,\r\n});\r\n\r\nexport default connect(mapStateToProps)(LookupEditorControl);\r\n","// @flow\r\nimport React from \"react\";\r\nimport Modal from \"components/Modal\";\r\n// import Button from \"react-bootstrap/lib/Button\";\r\nimport { createModal } from \"react-modal-promise\";\r\nimport Icons from \"@hs/icons\";\r\nimport { useModalPostMessageHandler } from \"hooks\";\r\nimport LoadingIframe from \"components/LoadingIframe\";\r\n\r\ntype Props = {\r\n /** react-modal-promise: whether to show dialog */\r\n open: boolean,\r\n /** react-modal-promise: callback when user closes Dialog */\r\n close: () => void,\r\n /** url to open in modal */\r\n url: string,\r\n /** iframe name */\r\n name?: string,\r\n /** whether to open Modal in Docked mode */\r\n docked?: boolean,\r\n};\r\n\r\nexport const ExternalLinkModal = ({\r\n open,\r\n close,\r\n url,\r\n name,\r\n docked,\r\n}: Props) => {\r\n useModalPostMessageHandler(close);\r\n\r\n return (\r\n \r\n \r\n \r\n {name || url}\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport const openExternalLinkModal = createModal(ExternalLinkModal);\r\n","// @flow\r\nimport React, { useState, useCallback, useRef } from \"react\";\r\nimport { usePdfHighlightInput } from \"hooks\";\r\nimport FormGroup from \"react-bootstrap/lib/FormGroup\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport ClearableInput from \"@hs/clearable-input\";\r\nimport Avatar from \"components/User/Avatar\";\r\nimport loc from \"i18next\";\r\nimport styles from \"./NoteInput.module.css\";\r\nimport { ActivityType, ItemNoteType, type ActivityDTO } from \"data/types\";\r\nimport { getClassNames } from \"data/utils\";\r\n\r\ntype Props = {\r\n /** callback when user wants to add note\r\n * @param {ActivityDTO} activity new note to add\r\n */\r\n onEnter: (activity: ActivityDTO) => void,\r\n /** optional callback when user aborts note\r\n * @param {SyntheticMouseEvent<*>} e mouse event\r\n */\r\n onAbort?: (e: SyntheticMouseEvent<*>) => void,\r\n /** current userId */\r\n userId: number,\r\n /** optional: initial values */\r\n activity?: ActivityDTO,\r\n};\r\n\r\nexport const getNoteType = (type: string): string => {\r\n switch (type) {\r\n case ItemNoteType.PdfHighlight:\r\n return type.toLowerCase();\r\n default:\r\n if (type != null)\r\n console.info(\r\n `Unknown ItemNoteType: ${type}, fallback to default.`\r\n );\r\n return \"note\";\r\n }\r\n};\r\n\r\nconst NoteInput = ({\r\n onEnter,\r\n onAbort,\r\n userId,\r\n activity = { what: ActivityType.comment, extras: null, text: \"\" },\r\n}: Props) => {\r\n const noteRef = useRef(null);\r\n const [value, setValue] = useState(activity.text);\r\n const [noteExtras, setNoteExtras] = useState(activity.extras);\r\n\r\n const handleNoteExtras = useCallback(\r\n (extras) =>\r\n setNoteExtras(\r\n extras != null\r\n ? /* istanbul ignore next */ extras\r\n : activity.extras\r\n ),\r\n [activity.extras]\r\n );\r\n\r\n const { handleHighlight, handleSelect } = usePdfHighlightInput(\r\n handleNoteExtras,\r\n noteRef\r\n );\r\n\r\n const handleEnter = useCallback(\r\n (text: string) => {\r\n onEnter({\r\n ...activity,\r\n text,\r\n extras: noteExtras,\r\n }).then((result) => {\r\n /* istanbul ignore else */\r\n if (result) {\r\n handleHighlight(null);\r\n setValue(\"\");\r\n handleSelect();\r\n }\r\n });\r\n },\r\n [onEnter, noteExtras, activity, handleHighlight, handleSelect]\r\n );\r\n\r\n const handleAbort = useCallback(\r\n (e) => {\r\n typeof onAbort === \"function\" && onAbort(e);\r\n setNoteExtras(activity.extras);\r\n setValue(\"\");\r\n handleSelect();\r\n },\r\n [onAbort, activity.extras, handleSelect]\r\n );\r\n\r\n return (\r\n
\r\n \r\n {userId && }\r\n \r\n \r\n {((activity.extras == null && noteExtras != null) ||\r\n activity.text !== \"\" ||\r\n activity.extras != null ||\r\n value !== activity.text) && (\r\n \r\n )}\r\n
\r\n );\r\n};\r\nNoteInput.displayName = \"NoteInput\";\r\nexport default NoteInput;\r\n","// @flow\r\nimport React, { useCallback, useEffect, useRef } from \"react\";\r\nimport Icons from \"@hs/icons\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport NoteInput, { getNoteType } from \"components/NoteInput\";\r\nimport {\r\n type ActivityDTO,\r\n type ActivityFieldDTO,\r\n ActivityType,\r\n ItemNoteType,\r\n ItemNoteTypeIcon,\r\n} from \"data/types\";\r\nimport Avatar from \"components/User/Avatar\";\r\nimport Table from \"react-bootstrap/lib/Table\";\r\nimport loc from \"i18next\";\r\nimport Badge from \"react-bootstrap/lib/Badge\";\r\nimport styles from \"./Activity.module.css\";\r\nimport ActionsMenu from \"components/ActionsMenu\";\r\nimport { LockInfoOn } from \"components/LockInfo\";\r\nimport { getClassNames } from \"data/utils\";\r\n\r\ntype Props = {\r\n /** activity to render */\r\n activity: ActivityDTO,\r\n /** current user's id */\r\n userId: number,\r\n /** whether to show activities details\r\n * @default {boolean} false\r\n */\r\n showDetails?: boolean,\r\n /** whether to show the Actions menu\r\n * @default {boolean} false\r\n */\r\n showActions?: boolean,\r\n /** whether to render in edit state\r\n * @default {boolean} false\r\n */\r\n isEdit: boolean,\r\n /** set items edit state\r\n * @param {boolean} isEdit new isEdit state\r\n */\r\n isHighlighted: boolean,\r\n /** callback when user chooses an action\r\n * @param {boolean} false\r\n */\r\n isSelected?: boolean,\r\n /** whether this activity is the last version available\r\n * @default {boolean} false\r\n */\r\n isLastVersion?: boolean,\r\n /** callback when user chooses an action\r\n * @param {string} actionId action identifier\r\n * @param {?any} payload optional payload\r\n */\r\n onAction: (actionId: string, payload: ?any) => void,\r\n /** what action menu to display\r\n * @default {string} docactivity_context\r\n */\r\n actionMenu: string,\r\n /** whether Activity is read-only */\r\n isReadOnly?: boolean,\r\n};\r\n\r\nconst getCommentIconString = (activity) => {\r\n if (\r\n activity?.extras?.$type == null ||\r\n !Object.prototype.hasOwnProperty.call(\r\n ItemNoteTypeIcon,\r\n activity.extras.$type\r\n )\r\n )\r\n return ItemNoteTypeIcon[ItemNoteType.Default];\r\n return ItemNoteTypeIcon[activity.extras.$type];\r\n};\r\n\r\n/** Renders a list of activities */\r\nconst Activity = ({\r\n activity,\r\n userId,\r\n showDetails,\r\n showActions,\r\n isEdit,\r\n isHighlighted,\r\n isSelected,\r\n isLastVersion,\r\n onAction,\r\n actionMenu,\r\n isReadOnly,\r\n}: Props) => {\r\n const renderWhatIcon = useCallback(() => {\r\n switch (activity.what) {\r\n case ActivityType.create:\r\n return ;\r\n case ActivityType.modifyContent:\r\n case ActivityType.modifyField:\r\n return ;\r\n case ActivityType.delete:\r\n return ;\r\n case ActivityType.comment:\r\n return (\r\n \r\n onAction(\"filter_note\")\r\n }\r\n name={getCommentIconString(activity)}\r\n title={loc.t(\"activity:note.filter\")}\r\n />\r\n );\r\n default:\r\n return null;\r\n }\r\n }, [activity, onAction]);\r\n\r\n const renderWhat = useCallback((): string => {\r\n switch (activity.what) {\r\n case ActivityType.create:\r\n case ActivityType.modifyContent:\r\n case ActivityType.modifyField:\r\n case ActivityType.comment:\r\n case ActivityType.delete:\r\n return loc.t(`common:act.changes_${activity.what}`, {\r\n date: activity.on,\r\n });\r\n case ActivityType.locked:\r\n // TODO custom ActionsMenu for Locked activitys (unlock!)\r\n return ;\r\n default:\r\n return \"unknown what=\" + activity.what;\r\n }\r\n }, [activity]);\r\n\r\n const renderChange = useCallback(\r\n (change: ActivityFieldDTO, index: number) => (\r\n \r\n {change.caption}\r\n {change.newVal}\r\n {change.oldVal}\r\n \r\n ),\r\n []\r\n );\r\n\r\n const renderChanges = useCallback(\r\n () => (\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {activity.changes.map((change, index) =>\r\n renderChange(change, index)\r\n )}\r\n \r\n
 {loc.t(\"common:act.changes_newVal\")}{loc.t(\"common:act.changes_oldVal\")}
\r\n
\r\n ),\r\n [activity, renderChange]\r\n );\r\n\r\n const activityRef = useRef(null);\r\n useEffect(() => {\r\n /* istanbul ignore else */\r\n if (isHighlighted && activityRef.current) {\r\n activityRef.current.scrollIntoView({\r\n block: \"center\",\r\n inline: \"center\",\r\n });\r\n }\r\n }, [isHighlighted]);\r\n\r\n const handleEnter: (activity: ActivityDTO) => Promise =\r\n useCallback(\r\n (activity: ActivityDTO) =>\r\n onAction(\"update_note\", activity).then(\r\n (result) => result && onAction(\"edit_note\", false)\r\n ),\r\n [onAction]\r\n );\r\n\r\n const handleAbort: (e: SyntheticMouseEvent<*>) => void = useCallback(\r\n (e) => e.stopPropagation() || onAction(\"edit_note\", false),\r\n [onAction]\r\n );\r\n\r\n const renderText = useCallback(() => {\r\n switch (activity.what) {\r\n case ActivityType.create:\r\n case ActivityType.modifyContent:\r\n case ActivityType.modifyField:\r\n if (activity.changes == null || activity.changes.length === 0)\r\n return null;\r\n return renderChanges();\r\n case ActivityType.comment:\r\n if (isEdit) {\r\n return (\r\n \r\n );\r\n } else {\r\n return

{activity.text}

;\r\n }\r\n case ActivityType.locked:\r\n return null;\r\n default:\r\n return \"unknown what=\" + activity.what;\r\n }\r\n }, [activity, isEdit, handleEnter, renderChanges, handleAbort]);\r\n\r\n const onShouldBeVisible = (action: { id: string }): boolean =>\r\n !(\r\n isLastVersion === true &&\r\n [\"sep\", \"restore\", \"delete\"].includes(action.id)\r\n );\r\n\r\n return (\r\n \r\n (!isEdit || (isEdit && !isHighlighted)) &&\r\n onAction(\"highlight_note\")\r\n }\r\n >\r\n
\r\n \r\n {activity.userName}\r\n {/* */}\r\n {renderWhatIcon()}\r\n {showActions &&\r\n [\r\n ActivityType.create,\r\n ActivityType.modifyContent,\r\n ActivityType.modifyField,\r\n ].includes(activity.what) && (\r\n \r\n \r\n {loc.t(\"common:version.text\", {\r\n version: activity.id,\r\n })}\r\n \r\n \r\n }\r\n name={actionMenu}\r\n className={styles.actions}\r\n onAction={onAction}\r\n onShouldBeVisible={onShouldBeVisible}\r\n />\r\n )}\r\n {activity.userId === userId &&\r\n activity.what === ActivityType.comment && (\r\n \r\n {!isEdit && !isReadOnly && (\r\n \r\n ((isEdit ||\r\n (!isEdit && isHighlighted)) &&\r\n e.stopPropagation()) ||\r\n onAction(\"edit_note\", true)\r\n }\r\n >\r\n \r\n \r\n )}\r\n {isEdit && (\r\n \r\n (isEdit && e.stopPropagation()) ||\r\n onAction(\"delete_note\")\r\n }\r\n >\r\n \r\n \r\n )}\r\n \r\n )}\r\n\r\n
{renderWhat()}
\r\n
\r\n \r\n {renderText(activity)}\r\n \r\n \r\n );\r\n};\r\nActivity.displayName = \"Activity\";\r\nActivity.defaultProps = {\r\n showDetails: false,\r\n showActions: false,\r\n isSelected: false,\r\n actionMenu: \"docactivity_context\",\r\n};\r\nexport default Activity;\r\n","// @flow\r\nimport React, { useState, useCallback, useEffect } from \"react\";\r\nimport { usePdfHighlightActivityList } from \"hooks\";\r\nimport {\r\n type ActivityDTO,\r\n ActivityType,\r\n ItemNoteType,\r\n type ItemNoteTypeEnum,\r\n} from \"data/types\";\r\nimport loc from \"i18next\";\r\nimport Activity from \"./Activity\";\r\n\r\ntype ActionCallback = (actionId: string, payload: T | number) => any;\r\ntype ActionFactory = (item: T, index: number) => ActionCallback;\r\n\r\ntype Props = {\r\n /** list of activities */\r\n items: Array,\r\n /** current user's id */\r\n userId: number,\r\n /** whether to show activities details */\r\n showDetails: boolean,\r\n /** whether to show history menu\r\n * @default {boolean} true\r\n */\r\n showActions?: boolean,\r\n /** whether to show notes (comment) entries */\r\n showNotes: boolean,\r\n /** whether to show history entries */\r\n showHistory: boolean,\r\n /** which version should be selected\r\n * 0 to show latest\r\n */\r\n currentVersion: number,\r\n /** callback when user chooses an action\r\n * @param {string} actionId action identifier\r\n * @param {ActivityDTO | number} payload payload or activity row index\r\n */\r\n onAction: ActionCallback,\r\n /** whether ActivityList is read-only */\r\n isReadOnly?: boolean,\r\n};\r\n\r\n/** Renders a list of activities */\r\nconst ActivityList = ({\r\n items,\r\n userId,\r\n showDetails,\r\n showNotes = true,\r\n showHistory = true,\r\n showActions = true,\r\n currentVersion,\r\n onAction,\r\n isReadOnly = false,\r\n}: Props) => {\r\n const [edit, setEdit] = useState(null);\r\n const [commentType, setCommentType] = useState(null);\r\n\r\n const [highlight, handleHighlight] = usePdfHighlightActivityList(\r\n items,\r\n userId,\r\n setEdit,\r\n onAction,\r\n isReadOnly\r\n );\r\n\r\n const handleAction: ActionFactory = useCallback(\r\n (item: ActivityDTO, index: number) =>\r\n (actionId: string, payload: any = index) => {\r\n switch (actionId) {\r\n case \"filter_note\":\r\n const itemCommentType: ItemNoteTypeEnum =\r\n (item.what === ActivityType.comment &&\r\n item.extras &&\r\n item.extras.$type) ||\r\n ItemNoteType.Default;\r\n return setCommentType(\r\n commentType !== itemCommentType\r\n ? itemCommentType\r\n : null\r\n );\r\n case \"edit_note\":\r\n return setEdit(payload ? item.id : null);\r\n case \"highlight_note\":\r\n return handleHighlight(\r\n highlight !== item.id ? item : null\r\n );\r\n case \"update_note\":\r\n return onAction(actionId, payload).then((success) => {\r\n /* istanbul ignore else */\r\n if (success) setEdit(null);\r\n return success;\r\n });\r\n case \"delete_note\":\r\n return onAction(actionId, payload).then((success) => {\r\n /* istanbul ignore else */\r\n if (success) {\r\n setEdit(null);\r\n handleHighlight(null);\r\n }\r\n return success;\r\n });\r\n default:\r\n return onAction(actionId, payload);\r\n }\r\n },\r\n [commentType, highlight, handleHighlight, onAction]\r\n );\r\n\r\n const filterType = useCallback(\r\n (item: ActivityDTO): boolean => {\r\n if (commentType != null)\r\n return (\r\n showNotes &&\r\n item.what === ActivityType.comment &&\r\n ((item.extras && item.extras.$type === commentType) ||\r\n (!item.extras && commentType === ItemNoteType.Default))\r\n );\r\n if (item.what === ActivityType.comment) return showNotes;\r\n return showHistory;\r\n },\r\n [commentType, showHistory, showNotes]\r\n );\r\n\r\n useEffect(() => {\r\n // Reset CommentType\r\n if (items.filter(filterType).length === 0) setCommentType(null);\r\n }, [filterType, items]);\r\n\r\n if (!showNotes && !showHistory)\r\n return
{loc.t(\"activity:list.invalid\")}
;\r\n let lastVersionId = 1;\r\n const totalVersions = items.reduce((accumulator, item: ActivityDTO) => {\r\n if (item.what !== ActivityType.comment) {\r\n lastVersionId = item.id;\r\n return accumulator + 1;\r\n }\r\n return accumulator;\r\n }, 0);\r\n\r\n return (\r\n <>\r\n {items.map(\r\n (item: ActivityDTO, index: number) =>\r\n filterType(item) && (\r\n 1 && showActions}\r\n onAction={handleAction(item, index)}\r\n isReadOnly={isReadOnly}\r\n />\r\n )\r\n )}\r\n \r\n );\r\n};\r\nActivityList.displayName = \"ActivityList\";\r\nexport default ActivityList;\r\n","// @flow\r\nimport React from \"react\";\r\nimport { type CleanupKeepInfoDTO, CleanupKeepVersionType } from \"data/types\";\r\nimport Alert from \"react-bootstrap/lib/Alert\";\r\nimport loc from \"i18next\";\r\nimport Icons from \"@hs/icons\";\r\n\r\ntype Props = {\r\n /** info object for Cleanup Keep Version */\r\n info: ?CleanupKeepInfoDTO,\r\n /** optional custom CSS class to apply */\r\n className?: string,\r\n};\r\n\r\nconst CleanupKeepInfo = ({ info, className }: Props) => {\r\n // no message if keeping them all\r\n if (info == null || info.type === CleanupKeepVersionType.All) return null;\r\n return (\r\n \r\n {\" \"}\r\n {loc.t(`docactivity:keep.${info.type}`, { count: info.count })}\r\n \r\n );\r\n};\r\nCleanupKeepInfo.displayName = \"CleanupKeepInfo\";\r\nexport default CleanupKeepInfo;\r\n","// @flow\r\nimport React from \"react\";\r\nimport { type RetentionInfoDTO, RetentionType } from \"data/types\";\r\nimport Alert from \"react-bootstrap/lib/Alert\";\r\nimport loc from \"i18next\";\r\nimport Icons from \"@hs/icons\";\r\n\r\ntype Props = {\r\n /** info object for Retention */\r\n info: ?RetentionInfoDTO,\r\n /** optional custom CSS class to apply */\r\n className?: string,\r\n};\r\n\r\nconst RetentionInfo = ({ info, className }: Props) => {\r\n // no message if default\r\n if (info == null || info.type === RetentionType.Default) return null;\r\n return (\r\n \r\n {\" \"}\r\n {loc.t(`docactivity:retention.${info.type}`, {\r\n months: info.months,\r\n })}\r\n \r\n );\r\n};\r\nRetentionInfo.displayName = \"RetentionInfo\";\r\nexport default RetentionInfo;\r\n","// @flow\r\nimport React, { useCallback } from \"react\";\r\nimport {\r\n type ActivityDTO,\r\n type CleanupKeepInfoDTO,\r\n type RetentionInfoDTO,\r\n} from \"data/types\";\r\nimport { isFeatureOn, Feature } from \"data/constants\";\r\nimport ActivityList from \"./ActivityList\";\r\nimport Status from \"components/Status\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport CleanupKeepInfo from \"./CleanupKeepInfo\";\r\nimport RetentionInfo from \"./RetentionInfo\";\r\nimport NoteInput from \"components/NoteInput\";\r\nimport styles from \"./Activities.module.css\";\r\n\r\ntype Props = {\r\n /** optional status defaults to OK*/\r\n status?: ConstantsEnum,\r\n /** list of activities */\r\n items: Array,\r\n /** cleanup keep versions info */\r\n cleanupKeepInfo: ?CleanupKeepInfoDTO,\r\n /** retention info */\r\n retentionInfo: ?RetentionInfoDTO,\r\n /** callback when user chooses an action\r\n * @param {string} actionId action identifier\r\n * @param {string} index activity row index\r\n */\r\n onAction: (actionId: string, index: number) => void,\r\n /** which version should be selected\r\n * 0 to show latest\r\n */\r\n currentVersion: number,\r\n /** whether to show all details */\r\n showDetails: boolean,\r\n /** whether to allow adding notes */\r\n showAddNote: boolean,\r\n /** whether to show notes (comment) entries */\r\n showNotes: boolean,\r\n /** whether to show history entries */\r\n showHistory: boolean,\r\n /** whether to show history menu */\r\n showActions: boolean,\r\n /** whether to show retention info */\r\n showRetentionInfo: boolean,\r\n /** current userId */\r\n userId: number,\r\n /** whether activities are read-only */\r\n isReadOnly: boolean,\r\n};\r\n\r\n/**\r\n * renders a list of document's activities\r\n */\r\nconst Activities = ({\r\n status = Constants.OK,\r\n items,\r\n cleanupKeepInfo,\r\n retentionInfo,\r\n onAction,\r\n currentVersion,\r\n showDetails,\r\n showAddNote,\r\n showNotes,\r\n showHistory,\r\n showActions,\r\n showRetentionInfo,\r\n userId,\r\n isReadOnly,\r\n}: Props) => {\r\n const handleEnter: (activity: ActivityDTO) => Promise =\r\n useCallback((activity) => onAction(\"add_note\", activity), [onAction]);\r\n return (\r\n
\r\n \r\n {showRetentionInfo && (\r\n <>\r\n \r\n \r\n \r\n )}\r\n \r\n {showAddNote && !isReadOnly && isFeatureOn(Feature.noteService) && (\r\n \r\n )}\r\n
\r\n );\r\n};\r\n\r\nActivities.displayName = \"Activities\";\r\nexport default Activities;\r\n\r\n// const useScrollToBottom = ({ className }) => {\r\n// React.useEffect(() => {\r\n// const elems = document.getElementsByClassName(className);\r\n// if (elems.length === 1) {\r\n// elems[0].scrollTo(0, elems[0].scrollHeight);\r\n// }\r\n// }, [className]);\r\n// };\r\n\r\n// actEnd: HTMLDivElement | null;\r\n\r\n// componentDidMount = () => this._scrollToBottom();\r\n\r\n// // componentDidUpdate = () => this._scrollToBottom();\r\n\r\n// _scrollToBottom = (smooth?: boolean) => {\r\n// if (\r\n// this.actEnd != null &&\r\n// typeof this.actEnd.scrollIntoView === \"function\"\r\n// ) {\r\n// if (smooth === true)\r\n// this.actEnd.scrollIntoView({ behavior: \"smooth\" });\r\n// else this.actEnd.scrollIntoView();\r\n// }\r\n// };\r\n","// @flow\r\nimport React, { PureComponent } from \"react\";\r\nimport { connect } from \"react-redux\";\r\nimport { compose } from \"redux\";\r\nimport Constants, {\r\n getDefaultsConfig,\r\n type ConstantsEnum,\r\n} from \"data/constants\";\r\nimport {\r\n fetchActivities,\r\n addItemNote,\r\n updateItemNote,\r\n deleteItemNote,\r\n delDocVersion,\r\n restoreDocVersion,\r\n} from \"data/api\";\r\nimport Activities from \"components/Activities\";\r\nimport Status from \"components/Status\";\r\nimport {\r\n ServerEventActionType,\r\n ServerEventItemType,\r\n type UserInfoResultDTO,\r\n type ActivitiesDTO,\r\n} from \"data/types\";\r\nimport GlobalEventsHandler from \"containers/GlobalEventsHandler\";\r\nimport { openConfirmModal } from \"components/ConfirmModal\";\r\nimport loc from \"i18next\";\r\nimport { toastActionResult } from \"data/toast\";\r\nimport CommandActionHandler from \"components/CommandActions\";\r\nimport moment from \"moment\";\r\nimport Moment from \"containers/Moment\";\r\nimport withOfflineHandler from \"containers/OfflineHandler\";\r\nimport { userLanguage } from \"data/storeHelper\";\r\n\r\ntype Props = {\r\n isDoc: boolean,\r\n /** the current itemUri */\r\n itemUri: ?string,\r\n /** the current formatId */\r\n formatId: ?number,\r\n /** Redux: the current User object */\r\n user: UserInfoResultDTO,\r\n /** GlobalEventsHandler.refreshId */\r\n refreshId: number,\r\n /** which version should be selected\r\n * 0 to show latest\r\n */\r\n currentVersion?: number,\r\n /** callback when user wants to see a specific version\r\n * @param {number} version which version to display\r\n * @param {number} itemUri itemUri including version\r\n */\r\n onShowVersion?: (version: number, itemUri: string) => void,\r\n /** whether to allow adding notes\r\n * @default {boolean} true\r\n */\r\n showAddNote?: boolean,\r\n /** whether to show notes (comment) entries\r\n * @default {boolean} true\r\n */\r\n showNotes?: boolean,\r\n /** whether to show history entries\r\n * @default {boolean} true\r\n */\r\n showHistory?: boolean,\r\n /** whether to show history menu\r\n * @default {boolean} true\r\n */\r\n showActions?: boolean,\r\n /** whether to show retention info\r\n * @default {boolean} true\r\n */\r\n showRetentionInfo?: boolean,\r\n /** whether activities are read-only\r\n * @default {boolean} false\r\n */\r\n isReadOnly?: boolean,\r\n};\r\n\r\ntype State = {\r\n status: ConstantsEnum,\r\n result: ?ActivitiesDTO,\r\n showDetails: boolean,\r\n /** whether to allow adding notes\r\n * @default {boolean} true\r\n */\r\n showAddNote?: boolean,\r\n /** whether to show notes (comment) entries\r\n * @default {boolean} true\r\n */\r\n showNotes?: boolean,\r\n /** whether to show history entries\r\n * @default {boolean} true\r\n */\r\n showHistory?: boolean,\r\n /** whether to show history menu\r\n * @default {boolean} true\r\n */\r\n showActions?: boolean,\r\n /** whether to show retention info\r\n * @default {boolean} true\r\n */\r\n showRetentionInfo?: boolean,\r\n};\r\n\r\n// TODO this will need refactoring once inPoint implemented Folder versioning\r\nexport class ActivitiesContainer extends PureComponent {\r\n state = {\r\n status: Constants.LOADING,\r\n result: null,\r\n showDetails: false,\r\n showAddNote: this.props.showAddNote || true,\r\n showNotes: this.props.showNotes || true,\r\n showHistory: this.props.showHistory || true,\r\n showActions: this.props.showActions || true,\r\n showRetentionInfo: this.props.showRetentionInfo || true,\r\n };\r\n\r\n static defaultProps = {\r\n currentVersion: 0,\r\n isReadOnly: false,\r\n };\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n moment.locale(userLanguage());\r\n this.format = `${moment.localeData().longDateFormat(\"L\")} ${moment\r\n .localeData()\r\n .longDateFormat(\"LTS\")}`;\r\n }\r\n\r\n componentDidMount = () => {\r\n this._fetch();\r\n this._setActivityListDefaults();\r\n };\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n /* istanbul ignore else */\r\n if (prevProps.itemUri !== this.props.itemUri) {\r\n this.setState(\r\n {\r\n status: Constants.LOADING,\r\n result: null,\r\n },\r\n () => {\r\n this._fetch();\r\n this._setActivityListDefaults();\r\n }\r\n );\r\n } else if (prevProps.refreshId !== this.props.refreshId) {\r\n this.setState(\r\n {\r\n status: Constants.LOADING,\r\n },\r\n () => this._fetch()\r\n );\r\n }\r\n }\r\n\r\n _fetch() {\r\n const { itemUri, offlineHandler } = this.props;\r\n if (itemUri != null) {\r\n offlineHandler\r\n .factory(fetchActivities)(itemUri)\r\n .catch((err) => {\r\n this.setState({\r\n status: Constants.ERROR,\r\n });\r\n return null;\r\n })\r\n .then((result: ActivitiesDTO) => {\r\n if (result != null) {\r\n this.setState({\r\n status: Constants.OK,\r\n result,\r\n });\r\n }\r\n });\r\n }\r\n }\r\n\r\n _setActivityListDefaults = () => {\r\n const defaults = getDefaultsConfig(\r\n this.props.itemUri,\r\n this.props.formatId\r\n );\r\n if (\r\n defaults == null ||\r\n !Object.prototype.hasOwnProperty.call(defaults, \"activityList\")\r\n ) {\r\n return;\r\n }\r\n this.setState({ ...defaults.activityList });\r\n };\r\n\r\n _onAddNote = (activity: ActivityDTO) => {\r\n if (this.props.itemUri == null) {\r\n toastActionResult(false, \"activity:note.notallowed\");\r\n return new Promise((resolve) => resolve(false));\r\n }\r\n activity.itemUri = this.props.itemUri;\r\n return addItemNote(activity)\r\n .then(() => true)\r\n .catch((err) => {\r\n console.warn(err);\r\n toastActionResult(false, \"activity:note.add\");\r\n return false;\r\n });\r\n };\r\n\r\n /* add additional checks here (e.g. date based) */\r\n _canUserUpdateOrDelete = (activity: ActivityDTO): boolean =>\r\n activity != null &&\r\n this.props.itemUri === activity.itemUri &&\r\n this.props.user.id === activity.userId;\r\n\r\n _onUpdateNote = (activity: ActivityDTO): Promise => {\r\n activity.itemUri = this.props.itemUri;\r\n if (!this._canUserUpdateOrDelete(activity)) {\r\n toastActionResult(false, \"activity:note.notallowed\");\r\n return new Promise((resolve) => resolve(false));\r\n }\r\n return updateItemNote(activity)\r\n .then(() => true)\r\n .catch((err) => {\r\n console.warn(err);\r\n toastActionResult(false, \"activity:note.update\");\r\n return false;\r\n });\r\n };\r\n\r\n _onDeleteNote = (activity: ActivityDTO): Promise => {\r\n activity.id = activity.id && Math.abs(activity.id);\r\n activity.itemUri = this.props.itemUri;\r\n if (!this._canUserUpdateOrDelete(activity)) {\r\n toastActionResult(false, \"activity:note.notallowed\");\r\n return new Promise((resolve) => resolve(false));\r\n }\r\n return openConfirmModal({\r\n body: loc.t(\"activity:note.delete.confirmBody\"),\r\n confirmButton: loc.t(\"activity:note.delete.confirmYes\"),\r\n }).then(async (confirmed) => {\r\n /* istanbul ignore else */\r\n if (confirmed === true) {\r\n try {\r\n const deleted = await deleteItemNote(\r\n this.props.itemUri,\r\n activity.id\r\n );\r\n if (!deleted)\r\n toastActionResult(false, \"activity:note.delete\");\r\n return deleted;\r\n } catch (err) {\r\n console.warn(err);\r\n toastActionResult(false, \"activity:note.delete\");\r\n return false;\r\n }\r\n }\r\n return false;\r\n });\r\n };\r\n\r\n _toggleDetails = () =>\r\n this.setState((prevState: State) => ({\r\n showDetails: !prevState.showDetails,\r\n }));\r\n\r\n _onAction = (actionId: string, payload: any) => {\r\n const activity =\r\n (typeof payload === \"number\" && this.state.result.items[payload]) ||\r\n {};\r\n const version = activity.id;\r\n const itemUriWithVersion = activity.itemUri;\r\n switch (actionId) {\r\n case \"view\":\r\n /* istanbul ignore else */\r\n if (typeof this.props.onShowVersion === \"function\")\r\n this.props.onShowVersion(version, itemUriWithVersion);\r\n break;\r\n case \"download\":\r\n CommandActionHandler(\"doc_download\", {\r\n itemUri: itemUriWithVersion,\r\n });\r\n break;\r\n case \"popout\":\r\n CommandActionHandler(\"doc_preview\", {\r\n itemUri: itemUriWithVersion,\r\n newWindow: true,\r\n });\r\n break;\r\n case \"details\":\r\n this._toggleDetails();\r\n break;\r\n case \"restore\":\r\n openConfirmModal({\r\n body: loc.t(\r\n \"docactivity_context:action_restore.confirmBody\"\r\n ),\r\n }).then((confirmed) => {\r\n if (confirmed === true) {\r\n this.restoreVersion(version);\r\n }\r\n });\r\n break;\r\n case \"delete\":\r\n openConfirmModal({\r\n body: loc.t(\r\n \"docactivity_context:action_delete.confirmBody\"\r\n ),\r\n confirmButton: loc.t(\"common:delete\"),\r\n }).then((confirmed) => {\r\n if (confirmed === true) {\r\n this.deleteVersion(version);\r\n }\r\n });\r\n break;\r\n case \"add_note\":\r\n return this._onAddNote(payload);\r\n case \"update_note\":\r\n return this._onUpdateNote(payload);\r\n case \"delete_note\":\r\n return this._onDeleteNote(activity);\r\n /* istanbul ignore next */\r\n default:\r\n console.warn(actionId);\r\n break;\r\n }\r\n };\r\n\r\n restoreVersion = (version: number) => {\r\n this.setState({ status: Constants.LOADING }, () => {\r\n restoreDocVersion(this.props.itemUri, version)\r\n .catch((err) => {\r\n console.warn(err);\r\n return null;\r\n })\r\n .then((success) => {\r\n // notify user\r\n toastActionResult(\r\n success === true,\r\n \"docactivity_context:action_restore\"\r\n );\r\n // refresh\r\n if (success === true) {\r\n // show new @latest version\r\n /* istanbul ignore else */\r\n if (typeof this.props.onShowVersion === \"function\")\r\n this.props.onShowVersion(0, this.props.itemUri);\r\n // refetch activity list\r\n this._fetch();\r\n } else {\r\n this.setState({\r\n status: Constants.ERROR,\r\n });\r\n }\r\n });\r\n });\r\n };\r\n\r\n deleteVersion = (version: number) => {\r\n this.setState({ status: Constants.LOADING }, () => {\r\n delDocVersion(this.props.itemUri, version)\r\n .catch((err) => {\r\n console.warn(err);\r\n return null;\r\n })\r\n .then((success) => {\r\n // notify user\r\n toastActionResult(\r\n success === true,\r\n \"docactivity_context:action_delete\"\r\n );\r\n // refresh\r\n if (success === true) {\r\n // in case it was selected reset to latest\r\n /* istanbul ignore else */\r\n\r\n if (\r\n this.props.currentVersion === version &&\r\n typeof this.props.onShowVersion === \"function\"\r\n ) {\r\n this.props.onShowVersion(0, this.props.itemUri);\r\n }\r\n // re-fetch activity list\r\n this._fetch();\r\n } else {\r\n this.setState({\r\n status: Constants.ERROR,\r\n });\r\n }\r\n });\r\n });\r\n };\r\n\r\n render() {\r\n const { status, result } = this.state;\r\n if (result != null && status !== Constants.ERROR) {\r\n return (\r\n \r\n );\r\n }\r\n return (\r\n \r\n );\r\n }\r\n}\r\n\r\n// apply Redux Store state to Component Properties\r\nconst mapStateToProps = /* istanbul ignore next */ (state, ownProps) => ({\r\n user: state.user,\r\n});\r\n\r\nexport default compose(\r\n connect(mapStateToProps),\r\n GlobalEventsHandler({\r\n items: [\r\n ServerEventItemType.document,\r\n ServerEventItemType.task,\r\n ServerEventItemType.activity,\r\n ],\r\n actions: [\r\n ServerEventActionType.add,\r\n ServerEventActionType.modify,\r\n ServerEventActionType.edit,\r\n ServerEventActionType.delete,\r\n ServerEventActionType.refresh,\r\n ],\r\n }),\r\n Moment,\r\n withOfflineHandler\r\n)(ActivitiesContainer);\r\n","// @flow\r\nimport React from \"react\";\r\nimport InputGroup from \"react-bootstrap/lib/InputGroup\";\r\nimport FormControl from \"react-bootstrap/lib/FormControl\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport { ParseArea, AreaToString } from \"components/MapViewer/utils\";\r\nimport {\r\n SupportGeoAreaEdit,\r\n getGeoAreaProvider,\r\n} from \"components/MapViewer/providerSupport\";\r\nimport { openMapModal } from \"components/MapModal\";\r\nimport styles from \"./GeoAreaInput.module.css\";\r\n\r\ntype Props = {\r\n /** displayName of field */\r\n label: ?string,\r\n /** current area in string format */\r\n value: ?string,\r\n /** whether to show an icon before the text field */\r\n showIcon: boolean,\r\n /** callback when user sets location\r\n * @param {string} value new area path in string format\r\n */\r\n onChange: (value: string) => void,\r\n /** callback when user sets area path by map\r\n * @param {string} area area coordinates\r\n */\r\n onManualArea?: (area: string) => void,\r\n /** optional CSS class to apply to root element */\r\n className?: string,\r\n /** placeholder text to display when @see {value} is empty */\r\n placeholder?: string,\r\n};\r\n\r\ntype State = {\r\n value: ?string,\r\n};\r\n\r\nclass GeoAreaInput extends React.PureComponent {\r\n static defaultProps = {\r\n showIcon: true,\r\n };\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n this.state = {\r\n value: props.value,\r\n };\r\n }\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n if (prevProps.value !== this.props.value) {\r\n this.setState({ value: this.props.value });\r\n }\r\n }\r\n\r\n /** change location input text value */\r\n changeValue = (e) =>\r\n this.setState({ value: e.target.value }, () =>\r\n this.props.onChange(this.state.value)\r\n );\r\n\r\n /** show map and allow user to change marker's location */\r\n _setAreaManually = () =>\r\n openMapModal({\r\n mapProvider: getGeoAreaProvider(),\r\n useMarker: true,\r\n setButtonLabel: loc.t(\"common:map.setArea\"),\r\n locations: [\r\n {\r\n attribute: this.props.label,\r\n label: this.props.label,\r\n allowEdit: true, // allow dragging/editing\r\n area: ParseArea(\r\n this.state.value != null &&\r\n String(this.state.value).length > 0\r\n ? this.state.value\r\n : \"0,0;0,0;0,0\"\r\n ),\r\n },\r\n ],\r\n onSet: (editLocationResult: MapEditLocationResult) => {\r\n this.props.onManualArea(AreaToString(editLocationResult.area));\r\n },\r\n });\r\n\r\n render = () => (\r\n \r\n {this.props.showIcon && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n {SupportGeoAreaEdit() && (\r\n \r\n \r\n \r\n )}\r\n \r\n {this.props.children}\r\n \r\n );\r\n}\r\nexport default GeoAreaInput;\r\n","import React from \"react\";\r\nimport FormsyEditorBase from \"./FormsyEditorBase\";\r\nimport GeoAreaInput from \"components/GeoAreaInput\";\r\n\r\nconst GeoAreaEditorControl = (props) => (\r\n (\r\n \r\n changeValue({ currentTarget: { value } })\r\n }\r\n onManualArea={\r\n /* istanbul ignore next */ (value: string) =>\r\n changeValue({ currentTarget: { value } })\r\n }\r\n placeholder={props.placeholder}\r\n />\r\n )}\r\n {...props}\r\n />\r\n);\r\nGeoAreaEditorControl.displayName = \"GeoAreaEditorControl\";\r\nexport default GeoAreaEditorControl;\r\n","import { combineReducers } from \"redux\";\r\nimport togglesReducer from \"./togglesReducer\";\r\nimport userReducer from \"./userReducer\";\r\nimport loginReducer from \"./loginReducer\";\r\nimport formReducer from \"./formReducer\";\r\nimport cardsReducer from \"./cardsReducer\";\r\nimport workflowReducer from \"./workflowReducer\";\r\nimport panesReducer from \"./panesReducer\";\r\nimport treeReducer from \"./treeReducer\";\r\nimport docsReducer from \"./docsReducer\";\r\nimport thumbnailsReducer from \"./thumbnailsReducer\";\r\nimport docsLayoutReducer from \"./docsLayoutReducer\";\r\nimport settingsReducer from \"./settingsReducer\";\r\nimport breadcrumbReducer from \"./breadcrumbReducer\";\r\nimport favoritesReducer from \"./favoritesReducer\";\r\nimport globalSearchReducer from \"./globalSearchReducer\";\r\nimport currentItemReducer from \"./currentItemReducer\";\r\nimport searchReducer from \"./searchReducer\";\r\nimport searchFormsReducer from \"./searchFormsReducer\";\r\nimport globalEventsReducer from \"./globalEventsReducer\";\r\nimport offlineReducer from \"./offlineReducer\";\r\nimport serviceWorkerReducer from \"./serviceWorkerReducer\";\r\nimport notificationReducer from \"./notificationReducer\";\r\nimport commandActionReducer from \"./commandActionReducer\";\r\n// import { reducer as oidcReducer } from \"redux-oidc\";\r\nimport { createResponsiveStateReducer } from \"redux-responsive\";\r\nimport transform from \"lodash/transform\";\r\nimport uppyRedux from \"@uppy/store-redux\";\r\nimport { reducer as networkReducer } from \"redux-saga-network-status\";\r\n\r\nconst appReducers = combineReducers({\r\n // oidc: oidcReducer,\r\n toggles: togglesReducer,\r\n user: userReducer,\r\n offline: offlineReducer,\r\n login: loginReducer,\r\n favorites: favoritesReducer,\r\n cards: cardsReducer,\r\n workflow: workflowReducer,\r\n tree: treeReducer,\r\n docs: docsReducer,\r\n thumbnails: thumbnailsReducer,\r\n docsLayout: docsLayoutReducer,\r\n panes: panesReducer,\r\n settings: settingsReducer,\r\n breadcrumb: breadcrumbReducer,\r\n globalSearch: globalSearchReducer,\r\n current: currentItemReducer,\r\n search: searchReducer,\r\n searchForms: searchFormsReducer,\r\n form: formReducer,\r\n globalEvents: globalEventsReducer,\r\n sw: serviceWorkerReducer,\r\n network: networkReducer,\r\n commandAction: commandActionReducer,\r\n browser: createResponsiveStateReducer(null, {\r\n extraFields: ({ greaterThan, is }) => ({\r\n // greaterThanOrEqual is built by transforming greaterThan\r\n greaterThanOrEqual: transform(\r\n greaterThan,\r\n (result, value, mediaType) => {\r\n // and combining the value with the `is` field\r\n result[mediaType] = value || is[mediaType];\r\n },\r\n {}\r\n ),\r\n }),\r\n }),\r\n uppy: uppyRedux.reducer,\r\n notification: notificationReducer,\r\n});\r\n\r\nexport default appReducers;\r\n","// @flow\r\nimport { type ComponentType } from \"react\";\r\nimport { type Location } from \"history\";\r\n\r\n// global const\r\nconst Constants = {\r\n NONE: \"\",\r\n OK: \"OK\",\r\n ERROR: \"ERROR\",\r\n LOADING: \"LOADING\",\r\n REFRESH: \"REFRESH\",\r\n};\r\n\r\nexport default Constants;\r\n\r\nexport type ConstantsEnum = $Keys;\r\n\r\n// used to give a nice displayName to HOCs\r\nexport const getDisplayName = (WrappedComponent: ComponentType) =>\r\n WrappedComponent.displayName || WrappedComponent.name || \"Component\";\r\n\r\n// finds an appsettings defaults config given an itemUri\r\nexport const getDefaultsConfig = (\r\n itemUri: string,\r\n formatId: number\r\n): Object | null => {\r\n if (\r\n itemUri &&\r\n window.CONFIG.general.defaults &&\r\n window.CONFIG.general.defaults.length > 0\r\n ) {\r\n // search by itemUri\r\n const defaults = window.CONFIG.general.defaults.find((item) => {\r\n let found = false;\r\n // check itemUri\r\n if (item.exactItemUri !== false) found = item.itemUri === itemUri;\r\n else found = itemUri.startsWith(item.itemUri);\r\n if (found) return found;\r\n // check formatIds\r\n if (formatId && formatId !== -1)\r\n found = item.formatIds && item.formatIds.includes(formatId);\r\n return found;\r\n });\r\n if (defaults != null) {\r\n return defaults;\r\n }\r\n\r\n // is there a global default (no itemUri nor formatIds)?\r\n const globalDefaults = window.CONFIG.general.defaults.find(\r\n (item) => item[\"itemUri\"] == null && item[\"formatIds\"] == null\r\n //item => !Object.prototype.hasOwnProperty.call(item, \"itemUri\")\r\n );\r\n /* istanbul ignore else */\r\n if (globalDefaults != null) {\r\n return globalDefaults;\r\n }\r\n }\r\n return null;\r\n};\r\n\r\n// Feature Toggles\r\n\r\nexport const Feature = {\r\n searchStatistics: \"searchStatistics\",\r\n searchAsYouType: \"searchAsYouType\",\r\n searchFacets: \"searchFacets\",\r\n searchCalendar: \"searchCalendar\",\r\n homeActions: \"homeActions\",\r\n offline: \"offline\",\r\n uppyLexmark: \"uppyLexmark\",\r\n noteService: \"noteService\",\r\n mailService: \"mailService\",\r\n rasterMapService: \"rasterMapService\",\r\n reminderService: \"reminderService\",\r\n shareService: \"shareService\",\r\n templateService: \"templateService\",\r\n workflowService: \"workflowService\",\r\n};\r\nexport type FeatureEnum = $Values;\r\n\r\nexport const isFeatureOn = (name: FeatureEnum) =>\r\n get(window.CONFIG, [\"general\", \"features\"], []).includes(name);\r\n\r\n/**\r\n * easy null-checked way to access a deep object\r\n * @link https://medium.com/javascript-inside/safely-accessing-deeply-nested-values-in-javascript-99bf72a0855a\r\n * @note could have used lodash._get but this is enough for our needs\r\n * @param {Object} o the object itself\r\n * @param {Array} p array of properties to drill down\r\n * @param {any} d default value in case on the way a null is encountered\r\n */\r\nexport const get = (o, p, d) =>\r\n p.reduce((xs, x) => (xs != null && xs[x] != null ? xs[x] : d), o);\r\n\r\nexport /**\r\n * checks if running in \"mini\" view\r\n *\r\n * @param {?Location} location\r\n */\r\nconst isMiniView = (location: ?Location) =>\r\n location?.pathname?.includes(\"/mini/\") ?? false;\r\n\r\nexport /**\r\n * checks if running in \"secureParams\" mode\r\n *\r\n * @param {?Location} location\r\n */\r\nconst isSecureParams = (location: ?Location) =>\r\n location != null ? location.search.indexOf(\"sp=\") >= 0 : false;\r\n","import { openConfirmModal } from \"components/ConfirmModal\";\r\nimport loc from \"i18next\";\r\n\r\nexport const openConflictModal = (name: string): Promise =>\r\n openConfirmModal({\r\n title: loc.t(\"common:conflict.title\", {\r\n name,\r\n }),\r\n body: loc.t(\"common:conflict.message\"),\r\n confirmButton: loc.t(\"common:conflict.overwrite\"),\r\n cancelButton: loc.t(\"common:conflict.cancel\"),\r\n requireSelection: true,\r\n });\r\n","// @flow\r\nimport loc from \"i18next\";\r\nimport produce from \"immer\";\r\nimport { type ToggleItemDTO, type ToggleDTO } from \"./types\";\r\n\r\nexport const Toggles = {\r\n home: {\r\n name: \"home\",\r\n isMultiple: false,\r\n toggles: [\r\n {\r\n value: \"action\",\r\n text: \"Actions\",\r\n icon: \"thumb-tack\",\r\n isSelected: true,\r\n isHidden: false,\r\n },\r\n {\r\n value: \"fav\",\r\n text: \"Favorites\",\r\n icon: \"star-o\",\r\n isSelected: false,\r\n },\r\n {\r\n value: \"rec\",\r\n text: \"Recents\",\r\n icon: \"history\",\r\n isSelected: false,\r\n },\r\n ],\r\n },\r\n wf: {\r\n name: \"wf\",\r\n isMultiple: false,\r\n toggles: [\r\n {\r\n value: \"start\",\r\n text: \"Start\",\r\n icon: \"calendar-plus-o\",\r\n isSelected: false,\r\n },\r\n {\r\n value: \"pending\",\r\n text: \"Pending\",\r\n icon: \"calendar-o\",\r\n isSelected: true,\r\n },\r\n // {\r\n // value: \"done\",\r\n // text: \"Done\",\r\n // icon: \"calendar-check-o\",\r\n // },\r\n ],\r\n },\r\n news: {\r\n name: \"news\",\r\n isMultiple: true,\r\n toggles: [\r\n {\r\n value: \"folders\",\r\n text: \"Folders\",\r\n icon: \"folder-o\",\r\n isSelected: true,\r\n },\r\n {\r\n value: \"documents\",\r\n text: \"Documents\",\r\n icon: \"file-o\",\r\n isSelected: true,\r\n },\r\n {\r\n value: \"shares\",\r\n text: \"shares\",\r\n icon: \"share\",\r\n isSelected: true,\r\n },\r\n {\r\n value: \"reminders\",\r\n text: \"reminders\",\r\n icon: \"clock-o\",\r\n isSelected: true,\r\n },\r\n ],\r\n },\r\n minipicker: {\r\n name: \"minipicker\",\r\n isMultiple: true,\r\n toggles: [\r\n {\r\n value: \"tree\",\r\n text: \"Tree\",\r\n icon: \"sitemap\",\r\n isSelected: true,\r\n },\r\n {\r\n value: \"doclist\",\r\n text: \"Documents\",\r\n icon: \"list\",\r\n isSelected: true,\r\n },\r\n ],\r\n },\r\n folder: {\r\n name: \"folder\",\r\n isMultiple: true,\r\n toggles: [\r\n {\r\n value: \"tree\",\r\n text: \"Tree\",\r\n icon: \"sitemap\",\r\n isSelected: true,\r\n },\r\n {\r\n value: \"form\",\r\n text: \"Classification\",\r\n icon: \"edit\",\r\n isSelected: true,\r\n },\r\n {\r\n value: \"doclist\",\r\n text: \"Documents\",\r\n icon: \"list\",\r\n isSelected: true,\r\n },\r\n ],\r\n },\r\n flat: {\r\n name: \"flat\",\r\n isMultiple: false,\r\n toggles: [\r\n {\r\n value: \"doclist\",\r\n text: \"Documents\",\r\n icon: \"list\",\r\n isSelected: true,\r\n isDisabled: true,\r\n },\r\n ],\r\n },\r\n mailbox: {\r\n name: \"mailbox\",\r\n isMultiple: true,\r\n toggles: [\r\n {\r\n value: \"tree\",\r\n text: \"Tree\",\r\n icon: \"sitemap\",\r\n isSelected: true,\r\n },\r\n {\r\n value: \"doclist\",\r\n text: \"Mails\",\r\n icon: \"list\",\r\n isSelected: true,\r\n },\r\n {\r\n value: \"viewer\",\r\n text: \"Viewer\",\r\n icon: \"envelope-o\",\r\n isSelected: true,\r\n },\r\n ],\r\n },\r\n miniflat: {\r\n name: \"miniflat\",\r\n isMultiple: true,\r\n toggles: [\r\n {\r\n value: \"doclist\",\r\n text: \"Mails\",\r\n icon: \"list\",\r\n isSelected: true,\r\n },\r\n {\r\n value: \"viewer\",\r\n text: \"Viewer\",\r\n icon: \"file-o\",\r\n isSelected: true,\r\n },\r\n ],\r\n },\r\n search: {\r\n name: \"search\",\r\n isMultiple: true,\r\n toggles: [\r\n {\r\n value: \"forms\",\r\n text: \"Forms\",\r\n icon: \"list-ul\",\r\n isSelected: true,\r\n isDisabled: false,\r\n },\r\n {\r\n value: \"search\",\r\n text: \"Manual\",\r\n icon: \"edit\",\r\n isSelected: true,\r\n isDisabled: false,\r\n },\r\n {\r\n value: \"result\",\r\n text: \"Results\",\r\n icon: \"list\",\r\n isSelected: false,\r\n isDisabled: true,\r\n },\r\n ],\r\n },\r\n searchresult: {\r\n name: \"searchresult\",\r\n isMultiple: false,\r\n toggles: [\r\n // {\r\n // value: \"form\",\r\n // text: \"Form\",\r\n // icon: \"edit\",\r\n // isSelected: false\r\n // },\r\n {\r\n value: \"result\",\r\n text: \"Results\",\r\n icon: \"list\",\r\n isSelected: true,\r\n isDisabled: true,\r\n },\r\n ],\r\n },\r\n document: {\r\n name: \"document\",\r\n isMultiple: true,\r\n toggles: [\r\n {\r\n value: \"viewer\",\r\n text: \"Document\",\r\n icon: \"file-o\",\r\n isSelected: true,\r\n },\r\n {\r\n value: \"form\",\r\n text: \"Form\",\r\n icon: \"edit\",\r\n isSelected: true,\r\n },\r\n {\r\n value: \"act\",\r\n text: \"Activity\",\r\n icon: \"history\",\r\n isSelected: true,\r\n },\r\n ],\r\n },\r\n docmodal: {\r\n name: \"docmodal\",\r\n isMultiple: true,\r\n toggles: [\r\n {\r\n value: \"viewer\",\r\n text: \"Document\",\r\n icon: \"file-o\",\r\n isSelected: true,\r\n },\r\n {\r\n value: \"form\",\r\n text: \"Form\",\r\n icon: \"edit\",\r\n isSelected: true,\r\n },\r\n {\r\n value: \"act\",\r\n text: \"Activity\",\r\n icon: \"history\",\r\n isSelected: true,\r\n },\r\n ],\r\n },\r\n upload: {\r\n name: \"upload\",\r\n isMultiple: true,\r\n toggles: [\r\n {\r\n value: \"files\",\r\n text: \"Files\",\r\n icon: \"files-o\",\r\n isSelected: true,\r\n },\r\n {\r\n value: \"form\",\r\n text: \"Target\",\r\n icon: \"bullseye\",\r\n isSelected: false,\r\n isDisabled: true,\r\n },\r\n ],\r\n },\r\n itemflows: {\r\n name: \"itemflows\",\r\n isMultiple: true,\r\n toggles: [\r\n {\r\n value: \"list\",\r\n text: \"Items\",\r\n icon: \"list-ul\",\r\n isSelected: true,\r\n },\r\n {\r\n value: \"form\",\r\n text: \"Form\",\r\n icon: \"edit\",\r\n isSelected: false,\r\n isDisabled: true,\r\n },\r\n ],\r\n },\r\n};\r\n\r\nexport default function getToggles(\r\n name: string,\r\n isCallback?: Function\r\n): ToggleDTO | void {\r\n const toggles = Toggles[name];\r\n if (toggles) {\r\n return produce(toggles, (draft) => {\r\n draft.toggles.forEach((toggle: ToggleItemDTO) => {\r\n toggle.text = loc.t(`${name}:toggles.${toggle.value}`);\r\n /* istanbul ignore else */\r\n if (typeof isCallback === \"function\")\r\n toggle = isCallback(toggle);\r\n });\r\n });\r\n }\r\n console.error(\"Cannot find toggles: \" + name);\r\n return undefined;\r\n}\r\n","// @flow\r\nimport React from \"react\";\r\nimport { openItemActionPanel } from \"components/ItemActionPanel\";\r\nimport Thumbnail from \"components/DocListSimple/Thumbnail\";\r\nimport store from \"data/store\";\r\n\r\nexport const openSearchResultActionPanel = ({\r\n row,\r\n ...contextProps\r\n}: {\r\n row: Object,\r\n}) =>\r\n openItemActionPanel({\r\n title: row.title,\r\n ext: row.ext,\r\n contextProps: {\r\n ...contextProps,\r\n itemUri: row.itemUri,\r\n name: row.title,\r\n ext: row.ext,\r\n isDoc: row.isDoc,\r\n formatId: row.breadcrumb.formatId,\r\n },\r\n breadcrumb: row.breadcrumb,\r\n thumbnail: row.isDoc && (\r\n \r\n ),\r\n attributes: row.attributes,\r\n targetView: row.targetView,\r\n });\r\n","// @flow\r\nimport React from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport loc from \"i18next\";\r\nimport CommandActionHandler from \"components/CommandActions\";\r\nimport { type ItemStatusesDTO, ItemStatuses, ItemLinkType } from \"data/types\";\r\nimport Icons from \"@hs/icons\";\r\n\r\nconst itemStatusMapping = {\r\n [ItemStatuses.Reminder]: Icons.Reminder,\r\n [ItemStatuses.Share]: Icons.Share,\r\n [ItemStatuses.Relation]: Icons.Relation,\r\n [ItemStatuses.PDF]: Icons.Pdf,\r\n [ItemStatuses.WFReport]: Icons.WorkflowReport,\r\n [ItemStatuses.Note]: Icons.Notes,\r\n [ItemStatuses.Link]: Icons.Link,\r\n [ItemStatuses.MailHasAttachment]: Icons.Email.Attachment,\r\n [ItemStatuses.MailReplied]: Icons.Email.Replied,\r\n [ItemStatuses.MailForwarded]: Icons.Email.Forwarded,\r\n [ItemStatuses.Locked]: Icons.Locked,\r\n [ItemStatuses.CloudSync]: Icons.Cloud,\r\n};\r\n\r\nconst getPropsForItemStatus = (\r\n status: ItemStatusesDTO,\r\n itemUri: string,\r\n ext: string,\r\n /** callback when user clicks on More... Button\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n */\r\n onMoreClick?: (e: SyntheticMouseEvent) => void\r\n) => {\r\n switch (status) {\r\n case 1: //ItemStatuses.Reminder\r\n return typeof onMoreClick === \"function\"\r\n ? {\r\n style: {\r\n cursor: \"pointer\",\r\n },\r\n onClick: onMoreClick,\r\n }\r\n : {};\r\n case 16: //ItemStatuses.WFReport\r\n return {\r\n style: {\r\n cursor: \"pointer\",\r\n },\r\n onClick: () =>\r\n CommandActionHandler(\"doc_related\", {\r\n itemUri,\r\n itemLinkType: ItemLinkType.WorkflowReport,\r\n }),\r\n };\r\n case 8192: //ItemStatuses.CloudSync\r\n return {\r\n style: {\r\n cursor: \"pointer\",\r\n },\r\n onClick: (e: SyntheticMouseEvent) =>\r\n CommandActionHandler(\"doc_editCloud\", {\r\n itemUri,\r\n ext,\r\n onlineEditor: !(e.ctrlKey || e.altKey),\r\n }),\r\n };\r\n default:\r\n return {};\r\n }\r\n};\r\n\r\nconst ItemStatusIcons = ({\r\n itemStatus,\r\n itemUri,\r\n ext,\r\n style,\r\n className,\r\n onMoreClick,\r\n}: {\r\n itemStatus: ItemStatusesDTO,\r\n itemUri: ?string,\r\n ext: ?string,\r\n style?: CSSStyleDeclaration,\r\n className?: string,\r\n /** callback when user clicks on More... Button\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n */\r\n onMoreClick?: (e: SyntheticMouseEvent) => void,\r\n}) => {\r\n if (itemStatus === ItemStatuses.Nothing) return null;\r\n const iconStyle = Object.assign({}, style, {\r\n marginRight: 2,\r\n });\r\n let bit = 1;\r\n let children = [];\r\n while (bit <= 8192) {\r\n if (itemStatus & bit) {\r\n const ItemStatusComponent = itemStatusMapping[bit];\r\n if (ItemStatusComponent != null) {\r\n const props = getPropsForItemStatus(\r\n bit,\r\n itemUri,\r\n ext,\r\n onMoreClick\r\n );\r\n children.push(\r\n \r\n \r\n \r\n );\r\n }\r\n }\r\n bit *= 2;\r\n }\r\n return children.length ? <>{children} : null;\r\n};\r\n\r\nItemStatusIcons.displayName = \"ItemStatusIcons\";\r\nItemStatusIcons.propTypes = {\r\n //itemStatus: PropTypes.number.isRequired,\r\n style: PropTypes.object,\r\n className: PropTypes.string,\r\n};\r\n\r\nexport default ItemStatusIcons;\r\n","//@flow\r\nimport React from \"react\";\r\nimport \"./SimpleAttribute.css\"; // TODO refactor to CSSModule - note used globally!\r\n\r\nexport const SimpleAttributeValue = ({\r\n value,\r\n className = \"a-val\",\r\n}: {\r\n value: string,\r\n className: string,\r\n}) => (\r\n \r\n {value}\r\n \r\n);\r\n\r\nconst SimpleAttribute = ({ attribute }: { attribute: Array }) => (\r\n \r\n \r\n {attribute[0]}\r\n {\" \"}\r\n \r\n \r\n);\r\nSimpleAttribute.displayName = \"SimpleAttribute\";\r\nexport default SimpleAttribute;\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"label\":\"AttributeLabel_label__1Rp17\"};","// @flow\r\nimport React from \"react\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\nimport styles from \"./LockInfo.module.css\";\r\n\r\nexport const LockInfoOn = ({ date }) => (\r\n
\r\n \r\n {loc.t(\"common:act.changes_locked\", { date })}\r\n
\r\n);\r\n","import React from \"react\";\r\nimport { useAsyncMemo } from \"hooks\";\r\nimport { siteDisplayName } from \"components/Sidebar/utils\";\r\nimport Dropdown from \"@hs/dropdown\";\r\nimport MenuItem from \"react-bootstrap/lib/MenuItem\";\r\nimport Icons from \"@hs/icons\";\r\nimport styles from \"./SiteSelect.module.css\";\r\nimport NativeSelect from \"components/NativeSelect\";\r\nimport bowser from \"data/bowser\";\r\nimport { sitesSelector } from \"data/storeHelper\";\r\n\r\nexport const SiteRow = ({\r\n site,\r\n className,\r\n}: {\r\n site: SidebarItemDTO,\r\n className?: string,\r\n}) => (\r\n
\r\n \r\n {siteDisplayName(site)}\r\n
\r\n);\r\nSiteRow.displayName = \"SiteRow\";\r\n\r\ntype Props = {\r\n /** callback with first itemUri after loading sites */\r\n onLoad: (itemUri: string) => void,\r\n /** which itemUri to pre-select */\r\n defaultItemUri: ?string,\r\n /** callback when user changes selection\r\n * @param {string} itemUri new selected site's itemUri\r\n */\r\n onChange: (itemUri: string) => void,\r\n};\r\n\r\n/**\r\n * will render a dropdown to select searchable sites\r\n */\r\nexport const SiteSelect = ({ onLoad, defaultItemUri, onChange }: Props) => {\r\n /**\r\n * Info: Why useAsyncMemo and not useMemo\r\n * onLoad (from parent) will always update parent while rendering child\r\n * Results in react error\r\n */\r\n const [selectedSite, filteredSites] = useAsyncMemo(\r\n async () => {\r\n const sites = sitesSelector();\r\n //Hide custom sites, recyclebin and AUSites\r\n const filteredSites =\r\n sites == null\r\n ? []\r\n : sites.filter(\r\n (site) =>\r\n site.source !== 1 &&\r\n ![4, 6].includes(site.siteType)\r\n );\r\n if (filteredSites.length === 0) return [null, []];\r\n if (defaultItemUri) {\r\n const selectedSite = filteredSites.find(\r\n (site) => site.itemUri === defaultItemUri\r\n );\r\n return [selectedSite, filteredSites];\r\n }\r\n\r\n /* istanbul ignore else */\r\n if (filteredSites.length > 0 && typeof onLoad === \"function\") {\r\n onLoad(filteredSites[0].itemUri);\r\n }\r\n return [null, filteredSites];\r\n },\r\n [onLoad, defaultItemUri],\r\n [null, []]\r\n );\r\n\r\n if (bowser.is(\"iOS\") || bowser.is(\"mobile\"))\r\n return (\r\n onChange(option.K)\r\n }\r\n defaultValue={{ K: defaultItemUri }}\r\n value={{ K: defaultItemUri }}\r\n options={filteredSites.map((site, index) => ({\r\n K: site.itemUri,\r\n T: siteDisplayName(site),\r\n }))}\r\n valueKey=\"K\"\r\n labelKey=\"T\"\r\n />\r\n );\r\n else\r\n return (\r\n \r\n \r\n {selectedSite && (\r\n \r\n )}\r\n \r\n \r\n {filteredSites.map((site, index) => (\r\n \r\n onChange(site.itemUri)\r\n }\r\n >\r\n \r\n \r\n ))}\r\n \r\n \r\n );\r\n};\r\nSiteSelect.displayName = \"SiteSelect\";\r\n\r\nexport default SiteSelect;\r\n","// @flow\r\nimport React, { PureComponent } from \"react\";\r\nimport {\r\n type SearchBucketDTO,\r\n type SearchFilterDTO,\r\n type SearchValueTypeEnum,\r\n type ListViewModeEnum,\r\n} from \"data/types\";\r\nimport { connect } from \"react-redux\";\r\nimport FilterBar from \"components/FilterBar\";\r\nimport * as s from \"data/reducers/selectors\";\r\n\r\ntype Props = {\r\n /** list of filters (and if any possible values) to show */\r\n aggregations: ?Array,\r\n /** currently selected filter values */\r\n selected: Array,\r\n /** callback when user selects a filter\r\n * @param {string} name field's common name\r\n * @param {SearchValueTypeEnum} valueType field's type\r\n * @param {Object} value the actual value selected\r\n */\r\n onSelect: (\r\n name: string,\r\n valueType: SearchValueTypeEnum,\r\n value: Object\r\n ) => void,\r\n /** callback when user wants to clear/reset all filter values */\r\n onClear?: () => void,\r\n /** callback when user wants to quickly filter by text */\r\n onFilterTextChange?: (value: ?string) => void,\r\n /** current filterText value */\r\n filterText: ?string,\r\n /** placeholder text to display on quick text filter */\r\n filterTextPlaceholder?: string,\r\n /** current viewMode */\r\n viewMode: ListViewModeEnum,\r\n /** which view modes to show/allow */\r\n viewModes?: Array,\r\n /** callback when user changes viewMode\r\n * @param {ListViewModeEnum} viewMode the viewMode the user chose\r\n */\r\n onViewModeChange: (viewMode: ListViewModeEnum) => void,\r\n /** whether filter should be rendered */\r\n renderFilter: ?boolean,\r\n /** whether filter should be disabled */\r\n disableFilter: ?boolen,\r\n};\r\n\r\ntype State = {\r\n aggregations: ?Array,\r\n};\r\n\r\n/** will render a filter/sort/views bar */\r\nexport class FilterBarContainer extends PureComponent {\r\n state = {\r\n aggregations: undefined,\r\n };\r\n\r\n componentDidMount = () =>\r\n this._prep(this.props.aggregations, this.props.selected);\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n /* istanbul ignore else */\r\n if (\r\n prevProps.aggregations !== this.props.aggregations ||\r\n prevProps.selected !== this.props.selected\r\n ) {\r\n this._prep(this.props.aggregations, this.props.selected);\r\n }\r\n }\r\n\r\n _prep(\r\n aggregations: ?Array,\r\n selected: Array\r\n ) {\r\n if (aggregations == null) {\r\n this.setState({ aggregations: undefined });\r\n } else {\r\n /* istanbul ignore next */\r\n let items = aggregations.slice(0);\r\n\r\n // update bucket.selected\r\n selected.forEach((filter) => {\r\n const item = items.find((i) => i.name === filter.name);\r\n /* istanbul ignore else */\r\n if (item != null) {\r\n item.selected = [filter.value];\r\n }\r\n });\r\n this.setState({\r\n aggregations: items,\r\n });\r\n }\r\n }\r\n\r\n _onSelect = ({\r\n name,\r\n value,\r\n valueType,\r\n }: {\r\n name: string,\r\n value: any,\r\n valueType?: SearchValueTypeEnum,\r\n }): void => {\r\n const { aggregations } = this.state;\r\n /* istanbul ignore next */\r\n if (aggregations == null) return;\r\n const aggregation = aggregations.find((b) => b.name === name);\r\n /* istanbul ignore else */\r\n if (aggregation != null) {\r\n this.props.onSelect(\r\n name,\r\n valueType || aggregation.valueType,\r\n value\r\n );\r\n }\r\n };\r\n\r\n render() {\r\n /* istanbul ignore else */\r\n if (this.state.aggregations == null) return null;\r\n\r\n return (\r\n String(s.value).length > 0\r\n ).length > 0\r\n }\r\n viewMode={this.props.viewMode}\r\n viewModes={this.props.viewModes}\r\n onViewModeChange={this.props.onViewModeChange}\r\n renderFilter={this.props.renderFilter}\r\n disableFilter={this.props.disableFilter}\r\n />\r\n );\r\n }\r\n}\r\n\r\nFilterBarContainer.displayName = \"FilterBarContainer\";\r\n\r\nconst mapStateToProps = /* istanbul ignore next */ (state, ownProps) => ({\r\n ...ownProps,\r\n disableFilter: s.isOnlineSelector(state) ? ownProps.disableFilter : true,\r\n});\r\n\r\nexport default connect(mapStateToProps)(FilterBarContainer);\r\n","// @flow\r\nimport React from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport FormControl from \"react-bootstrap/lib/FormControl\";\r\nimport styles from \"components/NativeSelect/NativeSelect.module.css\";\r\nimport loc from \"i18next\";\r\nimport { components } from \"react-select\";\r\nconst { DownChevron } = components;\r\n\r\nexport const RelativeDate = [\r\n \"NotSet\",\r\n \"Today\",\r\n \"Yesterday\",\r\n \"ThisWeek\",\r\n \"LastWeek\",\r\n \"ThisMonth\",\r\n \"LastMonth\",\r\n \"ThisYear\",\r\n \"LastYear\",\r\n];\r\n\r\nconst RelativeDatePicker = ({\r\n autoFocus,\r\n index,\r\n value,\r\n onChange,\r\n style,\r\n className,\r\n}: {\r\n autoFocus?: boolean,\r\n index: number,\r\n value?: string,\r\n onChange: Function,\r\n style?: Object,\r\n className?: string,\r\n}) => (\r\n
\r\n \r\n {RelativeDate.map((relDate, index) => (\r\n \r\n ))}\r\n \r\n \r\n
\r\n);\r\nRelativeDatePicker.displayName = \"RelativeDatePicker\";\r\nRelativeDatePicker.propTypes = {\r\n autoFocus: PropTypes.bool,\r\n index: PropTypes.number.isRequired,\r\n value: PropTypes.string,\r\n onChange: PropTypes.func.isRequired,\r\n};\r\nexport default RelativeDatePicker;\r\n","// @flow\r\nimport { Plugin } from \"@uppy/core\";\r\nimport { getFileExtension } from \"data/utils\";\r\nimport match from \"mime-match\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport store from \"data/store\";\r\nimport { getDefaultsConfig } from \"data/constants\";\r\nimport { toastStyled, toastTypes } from \"data/toast\";\r\nimport loc from \"i18next\";\r\n\r\n// export type uppyFile = {\r\n// id: string, // 'uppyteamkongjpg1501851828779'\r\n// name: string, // 'nature.jpg'\r\n// extension: string, // '.jpg'\r\n// type: string, // 'image/jpeg'\r\n// data: Object, // the Blob object\r\n// size: number | string, // 3947642 (returns 'N/A' if size cannot be determined)\r\n// preview: string, // value that can be used to populate \"src\" attribute of an \"img\" tag,\r\n// meta: uppyFileMetadata\r\n// };\r\n\r\ntype uppyRestrictions = {\r\n maxNumberOfFiles?: ?number,\r\n maxFileSize?: ?number,\r\n deniedFileTypes?: ?Array,\r\n allowedFileTypes?: ?Array,\r\n};\r\n\r\nexport /**\r\n * set current uppy restrictions\r\n *\r\n * @param {Object} uppyRef\r\n * @param {uppyRestrictions} restrictions\r\n * @returns {uppyRestrictions} restrictions set\r\n */\r\nconst setUppyRestrictions = (\r\n uppyRef,\r\n restrictions: uppyRestrictions\r\n): uppyRestrictions => {\r\n const updatedRestrictions = Object.assign(\r\n {},\r\n {\r\n maxNumberOfFiles: null,\r\n maxFileSize: null,\r\n deniedFileTypes: null,\r\n allowedFileTypes: null,\r\n },\r\n restrictions || {}\r\n );\r\n uppyRef.setOptions({\r\n restrictions: updatedRestrictions,\r\n });\r\n return updatedRestrictions;\r\n};\r\n\r\n// /* istanbul ignore next */\r\nexport default class UppyRestrictions extends Plugin {\r\n constructor(uppy: Object, opts: Object) {\r\n super(uppy, opts);\r\n this.uppy = uppy;\r\n this.type = \"Restrictions\";\r\n this.id = \"Restrictions\";\r\n this.title = \"uppy-restrictions\";\r\n\r\n // set default options\r\n const defaultOptions = {};\r\n\r\n // merge default options with the ones set by user\r\n this.opts = Object.assign({}, defaultOptions, opts);\r\n }\r\n\r\n install() {\r\n this.uppy.log(\"[restrictions] Installing UppyRestrictions Plugin\");\r\n\r\n // before actually adding files to uppy\r\n this.old_onBeforeFileAdded = this.uppy.opts.onBeforeFileAdded;\r\n this.uppy.opts.onBeforeFileAdded = this.onBeforeFileAdded;\r\n\r\n // before actually starting the upload\r\n this.old_onBeforeUpload = this.uppy.opts.onBeforeUpload;\r\n this.uppy.opts.onBeforeUpload = this.onBeforeUpload;\r\n\r\n this.uppy.on(\"restriction-failed\", this.onRestrictionFailed);\r\n }\r\n\r\n uninstall() {\r\n this.uppy.log(\"[restrictions] Removing UppyRestrictions Plugin\");\r\n\r\n this.uppy.opts.onBeforeFileAdded = this.old_onBeforeFileAdded;\r\n this.uppy.opts.onBeforeUpload = this.old_onBeforeUpload;\r\n\r\n this.uppy.off(\"restriction-failed\", this.onRestrictionFailed);\r\n setUppyRestrictions(this.uppy);\r\n }\r\n\r\n onRestrictionFailed = (file: Object, error: Object): void => {\r\n console.warn(\"[Restrictions] file restriction failed\", file, error);\r\n //this.uppy.info(\"This file type is not allowed\", \"error\", 500);-> does not always work!\r\n toastStyled({\r\n ...toastTypes.uppyError,\r\n message: loc.t(\"upload:restricted.message\"),\r\n });\r\n };\r\n\r\n /** double-check before actually uploading */\r\n onBeforeUpload = (files: Object) => {\r\n const restrictions = this._updateRestrictions();\r\n let restrictedFileIDs = [];\r\n Object.keys(files).forEach((fileID) => {\r\n if (\r\n false ===\r\n this._checkRestrictions(\r\n files[fileID],\r\n files,\r\n restrictions,\r\n true\r\n )\r\n ) {\r\n restrictedFileIDs.push(fileID);\r\n }\r\n });\r\n if (restrictedFileIDs.length > 0) {\r\n const restrictedFiles = restrictedFileIDs.map(\r\n (fileID) => files[fileID].name\r\n );\r\n toastStyled({\r\n ...toastTypes.uppyError,\r\n message:\r\n restrictedFileIDs.length === 1\r\n ? loc.t(\"upload:restricted.one\", {\r\n file: restrictedFiles[0],\r\n })\r\n : loc.t(\"upload:restricted.multiple\", {\r\n files: restrictedFiles.join(\", \"),\r\n }),\r\n });\r\n // abort all\r\n return false;\r\n }\r\n // continue\r\n return this.old_onBeforeUpload(files);\r\n };\r\n\r\n // https://uppy.io/docs/uppy/#onBeforeFileAdded-currentFile-files-gt-currentFile\r\n /** check before adding file to uppy */\r\n onBeforeFileAdded = (file: Object, files: Object) => {\r\n const restrictions = this._updateRestrictions();\r\n\r\n if (this._checkRestrictions(file, files, restrictions, false) === false)\r\n return false;\r\n else return this.old_onBeforeFileAdded(file, files);\r\n };\r\n\r\n /** update uppy restrictions based on current Defaults itemUri/formatId\r\n * @returns {Object} restrictions\r\n */\r\n _updateRestrictions = (): uppyRestrictions => {\r\n const state = store.getState();\r\n const viewName = s.currentNameSelector(state);\r\n const formatId = s.breadcrumbFormatIdSelector(state, viewName);\r\n const itemUri = s.breadcrumbItemUriSelector(state, viewName);\r\n const defaults = getDefaultsConfig(\r\n itemUri || \"pam-item://\",\r\n formatId || -1\r\n );\r\n // any Defaults configuration? set it\r\n if (defaults) {\r\n return setUppyRestrictions(this.uppy, defaults.upload);\r\n } else {\r\n // set empty retrictions\r\n return setUppyRestrictions(this.uppy);\r\n }\r\n };\r\n\r\n /**\r\n * Check if file passes a set of restrictions set in options: maxFileSize,\r\n * maxNumberOfFiles and allowedFileTypes.\r\n * lns -> additional checks for deniedFileTypes\r\n * @borrows https://github.com/transloadit/uppy/blob/856243a149739fbeeac9f75f1343c0bf71d6cf8f/packages/%40uppy/core/src/index.js#L438\r\n *\r\n * @param {object} file object to check\r\n * @param {object} files Object of IDs → files already added\r\n * @param {uppyRestrictions} restrictions which upload restrictions to apply\r\n * @param {boolean} beforeUpload onBeforeUpload calls with true\r\n * @returns {boolean} true if allowed, false if restricted\r\n * @private\r\n */\r\n _checkRestrictions = (\r\n file: Object,\r\n files: Object,\r\n restrictions: uppyRestrictions,\r\n beforeUpload: boolean\r\n ): boolean => {\r\n const {\r\n maxFileSize,\r\n maxNumberOfFiles,\r\n allowedFileTypes,\r\n deniedFileTypes,\r\n } = restrictions;\r\n\r\n if (maxNumberOfFiles) {\r\n if (\r\n Object.keys(files).length + (beforeUpload ? 0 : 1) >\r\n maxNumberOfFiles\r\n ) {\r\n this.uppy.log(\r\n `[Restrictions] only ${maxNumberOfFiles} maxNumberOfFiles are allowed`\r\n );\r\n return false;\r\n // throw new RestrictionError(\r\n // `${this.i18n(\"youCanOnlyUploadX\", {\r\n // smart_count: maxNumberOfFiles\r\n // })}`\r\n // );\r\n }\r\n }\r\n\r\n const ext = getFileExtension(file.name).toLowerCase();\r\n if (allowedFileTypes) {\r\n const isCorrectFileType = allowedFileTypes.some((type) => {\r\n // is this is a mime-type\r\n if (type.indexOf(\"/\") > -1) {\r\n /* istanbul ignore next */\r\n if (!file.type) return false;\r\n return match(file.type.replace(/;.*?$/, \"\"), type);\r\n }\r\n\r\n // otherwise this is likely an extension\r\n /* istanbul ignore else */\r\n if (type[0] === \".\") {\r\n return ext === type.toLowerCase();\r\n }\r\n return false;\r\n });\r\n\r\n if (!isCorrectFileType) {\r\n this.uppy.log(\r\n `[Restrictions] only ${allowedFileTypes.join(\r\n \", \"\r\n )} are allowed`\r\n );\r\n return false;\r\n // const allowedFileTypesString = allowedFileTypes.join(\", \");\r\n // throw new RestrictionError(\r\n // this.i18n(\"youCanOnlyUploadFileTypes\", {\r\n // types: allowedFileTypesString\r\n // })\r\n // );\r\n }\r\n }\r\n\r\n if (deniedFileTypes) {\r\n // https://github.com/transloadit/uppy/blob/856243a149739fbeeac9f75f1343c0bf71d6cf8f/packages/%40uppy/core/src/index.js#L438\r\n const isDeniedFileType = deniedFileTypes.some((type) => {\r\n // is this is a mime-type\r\n if (type.indexOf(\"/\") > -1) {\r\n /* istanbul ignore next */\r\n if (!file.type) return false;\r\n return match(file.type.replace(/;.*?$/, \"\"), type);\r\n }\r\n\r\n // otherwise this is likely an extension\r\n /* istanbul ignore else */\r\n if (type[0] === \".\") {\r\n return ext === type.toLowerCase();\r\n }\r\n return false;\r\n });\r\n\r\n if (isDeniedFileType) {\r\n this.uppy.log(\r\n `[Restrictions] ${deniedFileTypes.join(\r\n \", \"\r\n )} are not allowed`\r\n );\r\n // this.uppy.log(\r\n // `[restrictions] User tried to upload '${currentFile.name}' which is listed in the deniedFileTypes (${deniedFileTypes})`\r\n // );\r\n return false;\r\n }\r\n }\r\n\r\n // We can't check maxFileSize if the size is unknown.\r\n if (maxFileSize && file.data.size != null) {\r\n if (file.data.size > maxFileSize) {\r\n this.uppy.log(\r\n `[Restrictions] with ${file.data.size} exceeds maxFileSize set at ${maxFileSize}`\r\n );\r\n return false;\r\n // throw new RestrictionError(\r\n // `${this.i18n(\"exceedsSize\")} ${prettyBytes(maxFileSize)}`\r\n // );\r\n }\r\n }\r\n return true;\r\n };\r\n}\r\n","// @flow\r\nimport React from \"react\";\r\nimport Icons from \"@hs/icons\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport loc from \"i18next\";\r\nimport { openMapModal } from \"components/MapModal\";\r\nimport {\r\n ParseLocation,\r\n ParseRaster,\r\n ParseArea,\r\n} from \"components/MapViewer/utils\";\r\nimport {\r\n SupportGeoMapViewer,\r\n getGeoMapViewerProvider,\r\n getGeoRasterProvider,\r\n} from \"components/MapViewer/providerSupport\";\r\nimport { type MarkerDTO } from \"data/types\";\r\n\r\ntype Props = {\r\n /** current itemUri */\r\n itemUri: string,\r\n /** current formatId */\r\n formatId: number,\r\n /** location point or area in string format */\r\n value: string,\r\n /** marker name to show on map */\r\n label: string,\r\n /** whether to render button as disabled */\r\n disabled?: boolean,\r\n /** CSS style to apply to button */\r\n style?: CSSStyleDeclaration,\r\n /** optional (custom) location marker icon */\r\n marker?: MarkerDTO,\r\n};\r\n\r\nconst MapButton = ({\r\n itemUri,\r\n formatId,\r\n value,\r\n label,\r\n disabled,\r\n style,\r\n marker,\r\n}: Props) => {\r\n const showOnMap = () => {\r\n // area?\r\n if (value.includes(\";\")) {\r\n const area = ParseArea(value);\r\n openMapModal({\r\n title: label,\r\n mapProvider: getGeoMapViewerProvider(),\r\n useMarker: false,\r\n locations: [\r\n {\r\n attribute: label,\r\n label,\r\n area,\r\n },\r\n ],\r\n });\r\n } else if (value.includes(\":\")) {\r\n // raster\r\n const loc = ParseRaster(value);\r\n openMapModal({\r\n title: label,\r\n mapProvider: getGeoRasterProvider(itemUri, formatId),\r\n useMarker: true,\r\n locations: [\r\n {\r\n attribute: label,\r\n label,\r\n allowEdit: false,\r\n icon: marker,\r\n ...loc,\r\n },\r\n ],\r\n });\r\n } else {\r\n // exactly one point\r\n const loc = ParseLocation(value);\r\n openMapModal({\r\n title: label,\r\n mapProvider: getGeoMapViewerProvider(),\r\n useMarker: true,\r\n locations: [\r\n {\r\n attribute: label,\r\n label,\r\n allowEdit: false,\r\n icon: marker,\r\n ...loc,\r\n },\r\n ],\r\n });\r\n }\r\n };\r\n if (!SupportGeoMapViewer()) return null;\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\nMapButton.displayName = \"MapButton\";\r\nexport default MapButton;\r\n","// @flow\r\nimport React, { PureComponent } from \"react\";\r\nimport {\r\n type MapLocationInfo,\r\n type Location,\r\n type RasterLocation,\r\n type MapEditLocationResult,\r\n type MapProviderConfig,\r\n} from \"data/types\";\r\nimport { userLanguage } from \"data/storeHelper\";\r\nimport qs from \"data/queryString\";\r\nimport { fetchRasterMapLayers } from \"data/api\";\r\nimport NoData from \"components/NoData\";\r\nimport { correlationId } from \"data/storeHelper\";\r\nimport { CurrentItemContext } from \"data/context\";\r\n\r\ntype Props = {\r\n /** provider config to use\r\n * @default null retrieve default mapProvider from config.general.geo.name/key\r\n */\r\n mapProvider: ?MapProviderConfig,\r\n /** list of locations (markers) to show on the map */\r\n locations: ?Array,\r\n /** whether to render a \"center\" draggable pin marker */\r\n useMarker?: boolean,\r\n /** the current radius circle (in meters) - used by GeoRadiusInput */\r\n radius?: number,\r\n /** callback when user clicks an empty space on the map (only when useMarker=false & mapProvider.onClick exists)\r\n * @param {RasterLocation} rasterLocation the location the user clicked on the map\r\n */\r\n onClick?: (rasterLocation: RasterLocation) => void,\r\n /** callback after iframe loaded\r\n * @param {bool} success whether the iframe was loaded successfully\r\n */\r\n onLoad?: (success: boolean) => void,\r\n /** current itemUri (Note: Use MapViewer.WithContext to get current itemUri from CurrentItem.Provider) */\r\n itemUri: string,\r\n};\r\n\r\ntype State = {\r\n editLocationResult: ?MapEditLocationResult,\r\n fetchError: ?Object,\r\n};\r\n\r\nexport class MapViewer extends PureComponent {\r\n _iframe: HTMLIFrameElement | null;\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n this._iframe = React.createRef();\r\n this.state = {\r\n fetchError: null,\r\n editLocationResult: {\r\n location:\r\n props.locations != null && props.locations.length > 0\r\n ? props.locations[0]\r\n : null,\r\n area:\r\n props.locations != null && props.locations.length > 0\r\n ? props.locations[0].area\r\n : null,\r\n radius: props.radius,\r\n },\r\n };\r\n\r\n // validate raster configuration\r\n /* istanbul ignore next */\r\n if (\r\n (props.mapProvider == null ||\r\n props.mapProvider.isRaster !== true) &&\r\n props.locations &&\r\n props.locations.length > 0\r\n ) {\r\n // no .isRaster? make sure locations are not raster positions and warn user!\r\n const anyRaster = props.locations.find((l) =>\r\n Object.prototype.hasOwnProperty.call(l, \"rasterId\")\r\n );\r\n if (anyRaster) {\r\n this.state.fetchError = {\r\n message:\r\n \"Raster maps require manual configuration - Please review the Documentation!\",\r\n };\r\n }\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n /* istanbul ignore next */\r\n if (\r\n this.props.locations !== prevProps.locations &&\r\n this.props.locations != null\r\n ) {\r\n this._addLocationsToMap(this.props.locations);\r\n }\r\n }\r\n\r\n SetCenterMarker = (location: Location) => {\r\n /* istanbul ignore next */\r\n if (this._iframe.current == null) return;\r\n this._iframe.current.contentWindow.setCenterMarker(location);\r\n this.setState((prevState) => ({\r\n editLocationResult: {\r\n ...prevState.editLocationResult,\r\n location,\r\n },\r\n }));\r\n };\r\n\r\n /** retrieve current location edit result\r\n * @returns {number} current radius (in meters)\r\n */\r\n GetEditLocationResult = (): MapEditLocationResult =>\r\n this.state.editLocationResult;\r\n\r\n _fetchRasterLayers = (): Promise =>\r\n fetchRasterMapLayers({\r\n itemUri: this.props.itemUri,\r\n rasterMapIdSelector: this.props.mapProvider.rasterMapIdSelector,\r\n })\r\n .then((mapLayers) => mapLayers.layers)\r\n .catch((fetchError) => {\r\n console.error(fetchError);\r\n this.setState({ fetchError });\r\n return null;\r\n });\r\n\r\n _callOnLoad = (success: boolean) =>\r\n typeof this.props.onLoad === \"function\" && this.props.onLoad(success);\r\n\r\n _frameLoaded = async () => {\r\n let layers = null;\r\n if (this.props.mapProvider && this.props.mapProvider.isRaster) {\r\n layers = await this._fetchRasterLayers();\r\n if (layers == null) {\r\n this._callOnLoad(false);\r\n return;\r\n }\r\n }\r\n\r\n /* istanbul ignore next */\r\n if (this._iframe.current == null) {\r\n this._callOnLoad(false);\r\n return;\r\n }\r\n if (\r\n this.props.radius == null &&\r\n typeof this._iframe.current.contentWindow.showLocations ===\r\n \"function\"\r\n ) {\r\n this._iframe.current.contentWindow.showLocations(\r\n this.props.locations,\r\n this.props.useMarker !== false,\r\n /* istanbul ignore next */ (\r\n editLocationResult: MapEditLocationResult | RasterLocation\r\n ) => {\r\n if (this.props.useMarker) {\r\n // editing mode\r\n this.setState({ editLocationResult });\r\n } else if (\r\n this.props.mapProvider &&\r\n this.props.mapProvider.onClick &&\r\n typeof this.props.onClick === \"function\"\r\n ) {\r\n this.props.onClick(editLocationResult);\r\n }\r\n },\r\n layers\r\n );\r\n this._callOnLoad(true);\r\n } /* istanbul ignore else */ else if (\r\n this.props.radius != null &&\r\n this.props.locations.length > 0 &&\r\n typeof this._iframe.current.contentWindow.searchRadius ===\r\n \"function\"\r\n ) {\r\n this._iframe.current.contentWindow.searchRadius(\r\n this.props.locations[0],\r\n this.state.editLocationResult.radius,\r\n /* istanbul ignore next */ (\r\n editLocationResult: MapEditLocationResult\r\n ) =>\r\n this.setState({\r\n editLocationResult,\r\n })\r\n );\r\n this._callOnLoad(true);\r\n }\r\n\r\n this._callOnLoad(\r\n typeof this._iframe.current.contentWindow.showLocations ===\r\n \"function\" ||\r\n typeof this._iframe.current.contentWindow.searchRadius ===\r\n \"function\"\r\n );\r\n };\r\n\r\n _addLocationsToMap = (locations?: Array) => {\r\n /* istanbul ignore next */\r\n if (this._iframe.current == null) return;\r\n this._iframe.current.contentWindow.showMoreLocations(locations);\r\n };\r\n\r\n _getMapUrl = (): string => {\r\n const providerName =\r\n (this.props.mapProvider && this.props.mapProvider.name) ||\r\n window.CONFIG.general.geo.name ||\r\n \"leaflet-osm\";\r\n const providerKey =\r\n (this.props.mapProvider && this.props.mapProvider.key) ||\r\n window.CONFIG.general.geo.key;\r\n return (\r\n (process.env.PUBLIC_URL || \"\") +\r\n `/__map/${providerName}/index.html?` +\r\n qs.stringify({\r\n lang: userLanguage(),\r\n key: providerKey,\r\n correlationId: correlationId(),\r\n })\r\n );\r\n };\r\n\r\n render() {\r\n const { fetchError } = this.state;\r\n if (fetchError == null) {\r\n return (\r\n \r\n );\r\n }\r\n\r\n // custom error message handling\r\n return (\r\n \r\n
\r\n
\r\n Error: {fetchError.message}\r\n
\r\n
\r\n );\r\n }\r\n}\r\n\r\nconst MapViewerWithContext = (props: Props) => (\r\n \r\n {(itemUri) => }\r\n \r\n);\r\n\r\nMapViewer.WithContext = MapViewerWithContext;\r\nexport default MapViewer;\r\n","// @flow\r\nimport React from \"react\";\r\nimport Async from \"react-select/async\";\r\nimport loc from \"i18next\";\r\n// import debounce from \"lodash/debounce\";\r\nimport { LocationToString } from \"components/MapViewer/utils\";\r\nimport { getGeoPlacesProvider } from \"components/MapViewer/providerSupport\";\r\nimport { closeMenuOnScroll } from \"data/utils\";\r\nimport styles from \"./GeoPlaceInput.module.css\";\r\n\r\ntype Props = {\r\n /** initial string value to show */\r\n value?: string,\r\n /** callback when user selects a location */\r\n onChange: (location: string) => void,\r\n /** input placeholder */\r\n placeholder: string,\r\n /** CSS style to apply to container */\r\n style?: CSSStyleSheet,\r\n};\r\n\r\ntype State = {\r\n value: string,\r\n refreshIndex: number,\r\n};\r\n\r\n/**\r\n * renders a Select dropdown for Geocoding address search\r\n */\r\nexport default class GeoPlaceInput extends React.PureComponent {\r\n _geoCodingProvider: Object | null;\r\n\r\n static defaultProps = {\r\n placeholder: \"\",\r\n inline: false,\r\n };\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n this._initProvider();\r\n this.state = {\r\n value: /* istanbul ignore next */ props.value || \"\",\r\n refreshIndex: 0,\r\n };\r\n }\r\n\r\n componentDidUpdate(prevProps: Props, prevState: State) {\r\n if (prevProps.value !== this.props.value) {\r\n this.setState({\r\n value: this.props.value,\r\n refreshIndex: prevState.refreshIndex + 1,\r\n });\r\n }\r\n }\r\n\r\n _initProvider = () => {\r\n const providerMapping = {\r\n osm: \"openStreetMapProvider\",\r\n google: \"googleProvider\",\r\n bing: \"bingProvider\",\r\n esri: \"esriProvider\",\r\n };\r\n const providerName = providerMapping[getGeoPlacesProvider().name];\r\n /* istanbul ignore next */\r\n if (providerName == null) {\r\n alert(\r\n `Unknown setting under general/geoProvider.places.name - '${getGeoPlacesProvider()}' unknown!`\r\n );\r\n return;\r\n }\r\n // dynamically load only the requested geoProvider\r\n import(`leaflet-geosearch/lib/providers/${providerName}.js`)\r\n .then((provider) => {\r\n this._geoCodingProvider = new provider.default({\r\n // https://wiki.openstreetmap.org/wiki/Nominatim\r\n params: window.CONFIG.general.geo.places.params,\r\n });\r\n })\r\n .catch(\r\n /* istanbul ignore next */ (err) =>\r\n alert(\"Cannot load geoProvider: \" + err.message)\r\n );\r\n };\r\n\r\n getSAYT = (query?: string): Promise<*> => {\r\n if (this._geoCodingProvider == null) {\r\n return new Promise((resolve) => resolve([]));\r\n } else {\r\n return this._geoCodingProvider.search({ query });\r\n }\r\n };\r\n\r\n // getSAYT = debounce(this._getSAYT, 700, {\r\n // leading: false,\r\n // trailing: true,\r\n // maxWait: 1000\r\n // });\r\n\r\n _onChange = (option: ?Object) => {\r\n /* istanbul ignore next */\r\n if (option == null) return;\r\n this.props.onChange(\r\n LocationToString({\r\n latitude: option.y,\r\n longitude: option.x,\r\n })\r\n );\r\n };\r\n\r\n _onInputChange = (value, { action }) => {\r\n // console.log(action);\r\n if (action === \"input-change\" || action === \"set-value\") {\r\n this.setState({ value });\r\n }\r\n if (action === \"input-blur\") {\r\n this.props.onChange(this.state.value);\r\n }\r\n };\r\n\r\n render = () => (\r\n ({\r\n ...provided,\r\n ...this.props.style,\r\n }),\r\n control: /* istanbul ignore next */ (provided, state) => ({\r\n ...provided,\r\n height: 34,\r\n minHeight: \"fit-content\",\r\n borderRadius: 0,\r\n marginRight: -1,\r\n boxShadow: \"inset 0 1px 1px rgba(0, 0, 0, 0.075)\",\r\n width: \"100%\",\r\n }),\r\n valueContainer: /* istanbul ignore next */ (\r\n provided,\r\n state\r\n ) => ({\r\n ...provided,\r\n padding: \"0px 6px 0 12px\",\r\n width: \"100%\",\r\n maxHeight: 34,\r\n }),\r\n input: /* istanbul ignore next */ (provided, state) => ({\r\n ...provided,\r\n margin: 0,\r\n padding: 0,\r\n width: \"100%\",\r\n marginLeft: -3,\r\n }),\r\n clearIndicator: /* istanbul ignore next */ (\r\n provided,\r\n state\r\n ) => ({\r\n ...provided,\r\n padding: 4,\r\n }),\r\n placeholder: /* istanbul ignore next */ (provided, state) => ({\r\n ...provided,\r\n whiteSpace: \"nowrap\",\r\n color: \"hsl(0, 0%, 80%)\",\r\n marginLeft: -3,\r\n }),\r\n menu: /* istanbul ignore next */ (provided, state) => ({\r\n ...provided,\r\n marginTop: 0,\r\n marginBottom: 0,\r\n borderRadius: 0,\r\n }),\r\n menuPortal: /* istanbul ignore next */ (provided, state) => ({\r\n ...provided,\r\n zIndex: 9999,\r\n }),\r\n option: /* istanbul ignore next */ (provided, state) => {\r\n let style = Object.assign({}, provided, {\r\n whiteSpace: \"nowrap\",\r\n overflow: \"hidden\",\r\n textOverflow: \"ellipsis\",\r\n });\r\n if (state.isFocused) {\r\n style = Object.assign({}, style, {\r\n boxShadow: \"none\",\r\n background: \"#f5f5f5\",\r\n textShadow: \"none\",\r\n cursor: \"pointer\",\r\n // border: \"1px solid #f5f5f5\"\r\n });\r\n }\r\n return style;\r\n },\r\n }}\r\n components={{\r\n IndicatorSeparator: /* istanbul ignore next */ () => null,\r\n // Option: OptionRenderer,\r\n DropdownIndicator: /* istanbul ignore next */ () => null,\r\n }}\r\n // async loading\r\n cacheOptions={true}\r\n loadOptions={this.getSAYT}\r\n // behaviour\r\n isClearable\r\n menuPortalTarget={document.body}\r\n menuPlacement=\"auto\"\r\n closeMenuOnScroll={closeMenuOnScroll}\r\n // openMenuOnFocus={false}\r\n // openMenuOnClick={false}\r\n // localizations\r\n loadingMessage={\r\n /* istanbul ignore next */ () => loc.t(\"search.loading\")\r\n }\r\n placeholder={this.props.placeholder}\r\n noOptionsMessage={\r\n /* istanbul ignore next */ () =>\r\n loc.t(\"common:location.searchPlace\")\r\n }\r\n // selection\r\n onChange={this._onChange}\r\n onInputChange={this._onInputChange}\r\n inputValue={this.state.value}\r\n // defaultInputValue={this.state.value}\r\n />\r\n );\r\n}\r\n","// @flow\r\nimport { PdfPrintAction } from \"hooks/PostMessage/Actions\";\r\n/**\r\n * trigger pdf.js print dialog\r\n */\r\n\r\ntype Context = DocModalProps & {\r\n target?: any,\r\n};\r\n\r\nclass doc_print {\r\n execute = ({ target = window }: Context) => {\r\n target.postMessage(\r\n {\r\n source: \"inPoint\",\r\n type: PdfPrintAction,\r\n },\r\n \"*\"\r\n );\r\n return true;\r\n };\r\n}\r\nexport default doc_print;\r\n","// @flow\r\nimport React, { useState, useCallback } from \"react\";\r\nimport Constants from \"data/constants\";\r\nimport Status from \"components/Status\";\r\n\r\n/**\r\n * renders a local loading icon until iframe onLoad event is fired\r\n */\r\nconst LoadingIframe = ({\r\n onLoad,\r\n ...props\r\n}: {\r\n onLoad: () => void,\r\n props: Object,\r\n}) => {\r\n const [loading, setLoading] = useState(true);\r\n\r\n const _onLoad = useCallback(() => {\r\n setLoading(false);\r\n /* istanbul ignore else */\r\n if (typeof onLoad === \"function\") onLoad();\r\n }, [setLoading, onLoad]);\r\n\r\n return (\r\n <>\r\n {loading && }\r\n \r\n \r\n );\r\n};\r\n\r\nexport default LoadingIframe;\r\n","// @flow\r\nimport React, { useRef, useEffect } from \"react\";\r\nimport {\r\n type SiteTypeEnum,\r\n SiteType,\r\n CardType,\r\n type CardTypeEnum,\r\n CardItemType,\r\n type CardItemTypeEnum,\r\n} from \"data/types\";\r\nimport CountBadge from \"components/CountBadge\";\r\nimport Icons from \"@hs/icons\";\r\nimport Mark from \"@hs/mark\";\r\nimport ActionsButton from \"components/ActionPanel/ActionsButton\";\r\nimport { getClassNames } from \"data/utils\";\r\nimport { removeSpaces } from \"data/integrationTestUtils\";\r\n// import loc from \"i18next\";\r\n\r\n/**\r\n * renders a CardItem's subtype's icon\r\n */\r\nconst CardSubTypeIcon = ({\r\n cardtype,\r\n itemtype,\r\n name,\r\n style,\r\n}: {\r\n cardtype: CardTypeEnum,\r\n itemtype: CardItemTypeEnum,\r\n name: string,\r\n style?: CSSStyleDefinition,\r\n}) => {\r\n switch (itemtype) {\r\n case CardItemType.Task:\r\n return (\r\n \r\n );\r\n\r\n case CardItemType.Folder:\r\n return (\r\n \r\n );\r\n case CardItemType.Doc:\r\n const ext = name.substring(name.lastIndexOf(\".\"));\r\n return (\r\n \r\n );\r\n\r\n case CardItemType.ArchiveTarget:\r\n switch (cardtype) {\r\n case CardType.Rec:\r\n return (\r\n \r\n );\r\n case CardType.Fav:\r\n return (\r\n \r\n );\r\n default:\r\n return (\r\n \r\n );\r\n }\r\n\r\n case CardItemType.Search:\r\n case CardItemType.SearchForm:\r\n return (\r\n \r\n );\r\n\r\n case CardItemType.CommandAction:\r\n return cardtype === CardType.Task ? (\r\n \r\n ) : (\r\n \r\n );\r\n\r\n /* istanbul ignore next */\r\n default:\r\n console.log(\"Unknown CardItem.ItemType=\" + itemtype);\r\n return (\r\n \r\n );\r\n }\r\n};\r\n\r\n/**\r\n * returns the document's name without extension\r\n *\r\n * @param {CardItemTypeEnum} itemType doc if document\r\n * @param {string} name full filename\r\n * @returns {string} filename without extension\r\n */\r\nfunction onlyName(\r\n cardType: CardTypeEnum,\r\n itemType: CardItemTypeEnum,\r\n name: string\r\n): string {\r\n if (cardType !== CardType.Task && itemType === CardItemType.Doc) {\r\n return name.substring(0, name.lastIndexOf(\".\")) || name;\r\n }\r\n return name;\r\n}\r\n\r\n// const typeIcon = {\r\n// [CardType.Fav]: \"star\",\r\n// [CardType.Rec]: \"history\",\r\n// [CardType.Task]: \"tasks\"\r\n// // [CardType.Action]: \"puzzle-piece\"\r\n// };\r\n\r\nfunction cardColor(\r\n type: CardTypeEnum,\r\n itemtype: CardItemTypeEnum,\r\n siteType: SiteTypeEnum\r\n): string {\r\n if (type === CardType.Task) {\r\n return \"task\";\r\n }\r\n if (itemtype === CardItemType.Folder && siteType === SiteType.GlobalSites) {\r\n return \"top\";\r\n }\r\n return type;\r\n}\r\n\r\ntype Props = {\r\n /** the card item's type */\r\n itemtype: CardItemTypeEnum,\r\n /** the card site type */\r\n siteType: SiteTypeEnum,\r\n /** card type */\r\n type: CardTypeEnum,\r\n /** image in base64 encoding */\r\n image?: ?string | ?React.ReactElement,\r\n /** card name */\r\n name?: string,\r\n /** card's description */\r\n desc?: string,\r\n /** breadcrumb text */\r\n bcText?: string,\r\n /** whether should be visible */\r\n visible: boolean,\r\n /** callback when user clicks on a card\r\n * @param {SyntheticMouseEvent<*>} e HTML click event object\r\n */\r\n onClick: (e: SyntheticMouseEvent<*>) => void,\r\n /** optional callback when user clicks on the three dots more\r\n * @param {SyntheticMouseEvent<*>} e HTML click event object\r\n */\r\n onMoreClick?: (e: SyntheticMouseEvent<*>) => void,\r\n /** current filter text (empty string if none) */\r\n filterText: string,\r\n /** search statistics */\r\n count?: number,\r\n /** whether to mark Card as selected */\r\n isSelected?: boolean,\r\n extras?: Object,\r\n /** optional string to help test engines target this component */\r\n dataTest?: string,\r\n};\r\n\r\n/**\r\n * renders one Card\r\n */\r\nconst CardItem = ({\r\n itemtype,\r\n siteType,\r\n bcText,\r\n type,\r\n image,\r\n name,\r\n desc,\r\n visible,\r\n extras,\r\n onClick,\r\n onMoreClick,\r\n filterText,\r\n count,\r\n isSelected,\r\n dataTest,\r\n}: Props) => {\r\n const liRef = useRef(null);\r\n useEffect(() => {\r\n if (isSelected === true) {\r\n window.setTimeout(() => {\r\n liRef.current != null &&\r\n liRef.current.scrollIntoView(/*{ behavior: \"smooth\" }*/);\r\n }, 100);\r\n }\r\n }, [isSelected]);\r\n\r\n const className = [\"card\", cardColor(type, itemtype, siteType)];\r\n /* istanbul ignore else */\r\n if (isSelected) {\r\n className.push(\"selected\");\r\n }\r\n return (\r\n // \r\n \r\n
\r\n {\r\n /* istanbul ignore next */ image != null &&\r\n typeof image === \"string\" &&\r\n (!image.startsWith(\"data:image\") &&\r\n [CardType.Task, CardType.Action].includes(type) ? (\r\n
\r\n \r\n
\r\n ) : (\r\n \"\"\r\n ))\r\n }\r\n {\r\n /* istanbul ignore next */ image != null &&\r\n React.isValidElement(image) && <>{image}\r\n }\r\n {image == null && (\r\n <>\r\n
\r\n \r\n
\r\n {siteType !== SiteType.NotSet && (\r\n \r\n )}\r\n {count != null && count !== -1 && (\r\n \r\n )}\r\n \r\n )}\r\n
\r\n
\r\n \r\n \r\n {onlyName(\r\n type,\r\n itemtype,\r\n name /* istanbul ignore next */ || \"\"\r\n )}\r\n \r\n {type === CardType.Task &&\r\n extras != null &&\r\n extras.name != null && (\r\n
\r\n {/* */}\r\n \r\n {extras.name}\r\n
\r\n )}\r\n {/* {bcText && (\r\n
\r\n {bcText}\r\n
\r\n )} */}\r\n
\r\n\r\n {desc && (\r\n
\r\n
\r\n {desc}\r\n
\r\n
\r\n )}\r\n \r\n
\r\n {siteType !== SiteType.NotSet && (\r\n \r\n {bcText && (\r\n \r\n )}\r\n
\r\n )}\r\n {typeof onMoreClick === \"function\" && (\r\n \r\n )}\r\n {/*
\r\n \r\n
*/}\r\n \r\n \r\n // \r\n );\r\n};\r\nCardItem.displayName = \"CardItem\";\r\nexport default CardItem;\r\n","// global geolocator settings\r\nconst geoLocatorOptions = (custom: Object) => ({\r\n enableHighAccuracy: true,\r\n timeout: 5000,\r\n maximumWait: 10000, // max wait time for desired accuracy\r\n maximumAge: 0, // disable cache\r\n desiredAccuracy: 2, // meters\r\n fallbackToIP: false,\r\n addressLookup: false, // requires Google API key if true\r\n timezone: false, // requires Google API key if true\r\n //map: \"map-canvas\", // interactive map element id (or options object)\r\n staticMap: false, // get a static map image URL (boolean or options object)\r\n ...custom,\r\n});\r\nexport default geoLocatorOptions;\r\n","import { hasCacheSupport, isListed } from \"data/utils\";\r\nimport { getStorageEstimate } from \"data/storage\";\r\nimport { JL } from \"data/logging\";\r\n\r\nexport default class ApiCacheManager {\r\n constructor() {\r\n this._log = JL(\"ApiCacheManager\");\r\n this.OpenCache = this.OpenCache.bind(this);\r\n this.DeleteCache = this.DeleteCache.bind(this);\r\n this.CacheExists = this.CacheExists.bind(this);\r\n this.LogEstimates = this.LogEstimates.bind(this);\r\n }\r\n\r\n /**\r\n * Returns a handle to the requested cache\r\n *\r\n * @returns {Promise} cache handler\r\n * @memberof ApiCacheManager\r\n * @public\r\n */\r\n OpenCache = (id: string): Promise => {\r\n if (!hasCacheSupport())\r\n throw new Error(\"Browser does not support cache!\");\r\n return window.caches.open(id);\r\n };\r\n\r\n /**\r\n * Deletes the requested cache\r\n *\r\n * @returns {Promise} f the cache was actually deleted and a false if something went wrong or the cache doesn’t exist\r\n * @memberof ApiCacheManager\r\n * @public\r\n */\r\n DeleteCache = (id: string): Promise => {\r\n if (!hasCacheSupport())\r\n throw new Error(\"Browser does not support cache!\");\r\n return window.caches.delete(id);\r\n };\r\n\r\n /**\r\n * Checks if an existing Cache key already exists\r\n * @returns {Promise} true or false\r\n * @memberof ApiCacheManager\r\n * @public\r\n */\r\n CacheExists = (id: string): Promise => {\r\n if (!hasCacheSupport())\r\n throw new Error(\"Browser does not support cache!\");\r\n return window.caches.keys().then((keys) => isListed(id, keys));\r\n };\r\n\r\n /**\r\n * Logs to the console some storage usage estimates\r\n *\r\n * @memberof ApiCacheManager\r\n * @public\r\n */\r\n LogEstimates = (id: string): void => {\r\n // show total number of cached items - unfortunately it is not possible to retrieve cache total in diskspace\r\n // https://github.com/w3c/ServiceWorker/issues/587\r\n this.OpenCache(id).then((cache) =>\r\n cache.keys().then(async (cachedRequests) => {\r\n this._log.info(() => ({\r\n msg: `[storage] total of ${cachedRequests.length} cached items`,\r\n id,\r\n }));\r\n const estimate = await getStorageEstimate();\r\n /* istanbul ignore next */\r\n if (estimate != null) {\r\n this._log.info(() => ({\r\n msg: `[storage] total usage estimate: ${estimate.usageInGb} out of ${estimate.quotaInGb}Gb used (${estimate.percentUsed}%)`,\r\n estimate,\r\n id,\r\n }));\r\n }\r\n })\r\n );\r\n };\r\n}\r\n","import ApiManagerBase, { type Context } from \"./ApiManagerBase\";\r\nimport {\r\n ContentType,\r\n type OfflineItemDTO,\r\n CustomHttpHeader,\r\n type ApiMethodRef,\r\n DEFAULT_CACHE_NAME,\r\n} from \"data/types\";\r\nimport ApiCacheManager from \"data/ApiCacheManager\";\r\nimport { JL } from \"jsnlog\";\r\n\r\n/**\r\n * Specifically used by offlineSaga to sync \"make available offline\"marked for offline items\r\n *\r\n * @export\r\n * @class ApiManagerMakeAvailableOffline\r\n * @extends {ApiManagerBase}\r\n */\r\nexport default class ApiManagerMakeAvailableOffline extends ApiManagerBase {\r\n constructor(offlineItem: OfflineItemDTO) {\r\n super();\r\n this._log = JL(\"ApiManagerMakeAvailableOffline\");\r\n this._offlineItem = offlineItem;\r\n this._apiCache = new ApiCacheManager();\r\n this.CacheExists = this.CacheExists.bind(this);\r\n this.DeleteCache = this.DeleteCache.bind(this);\r\n this.LogEstimates = this.LogEstimates.bind(this);\r\n this.CheckLicense = this.CheckLicense.bind(this);\r\n this.EOL = this.EOL.bind(this);\r\n this._callWithDeps = this._callWithDeps.bind(this);\r\n this._runTransformer = this._runTransformer.bind(this);\r\n this._addToCache = this._addToCache.bind(this);\r\n }\r\n\r\n _callWithDeps = async (\r\n name: string,\r\n args?: Object = {}\r\n ): Promise> => {\r\n // calling the API method will effectively cache it\r\n const context = await this._callReturnContext(name, args);\r\n const { cache } = context.request;\r\n if (cache == null || cache.depsAnalyzer == null) return [];\r\n else return cache.depsAnalyzer(context.body, context.request.params);\r\n };\r\n\r\n /**\r\n * Deletes the whole current OfflineItem's cache\r\n * @returns {Promise} true if the cache was actually deleted and false if something went wrong or the cache doesn’t exist\r\n * @memberof ApiManagerMakeAvailableOffline\r\n * @public\r\n */\r\n DeleteCache = (): Promise => {\r\n /* istanbul ignore else */\r\n if (this._offlineItem) {\r\n return this._apiCache.DeleteCache(this._offlineItem.id);\r\n } else {\r\n return Promise.reject(false);\r\n }\r\n };\r\n\r\n /**\r\n * Checks if an existing Cache key already exists\r\n * @returns {Promise} true or false\r\n * @memberof ApiManagerMakeAvailableOffline\r\n * @public\r\n */\r\n CacheExists = (): Promise => {\r\n /* istanbul ignore else */\r\n if (this._offlineItem) {\r\n return this._apiCache.CacheExists(this._offlineItem.id);\r\n } else {\r\n return Promise.reject(false);\r\n }\r\n };\r\n\r\n /**\r\n * Logs to the console some storage usage estimates\r\n * @memberof ApiManagerMakeAvailableOffline\r\n * @public\r\n */\r\n LogEstimates = (): void => {\r\n /* istanbul ignore else */\r\n if (this._offlineItem) {\r\n this._apiCache.LogEstimates(this._offlineItem.id);\r\n }\r\n };\r\n\r\n /**\r\n * Prepares request's HTTP headers\r\n * @memberof ApiManagerMakeAvailableOffline\r\n * @param {Context} context query context\r\n * @returns {Promise} current context\r\n * @override\r\n */\r\n async BeforeFetch(context: Context): Promise {\r\n context = await super.BeforeFetch(context);\r\n // tell serviceWorker to skip these requests - we'll cache them\r\n context.options.headers.delete(CustomHttpHeader.CacheStrategy);\r\n // #55379 tell the server we are requesting for offline cache\r\n context.options.headers.append(CustomHttpHeader.OfflineSync, \"true\");\r\n return context;\r\n }\r\n\r\n /**\r\n * We skip licensing check when caching offline items\r\n * @param {Context} context query context\r\n * @returns {Promise} current context\r\n * @memberof ApiManagerMakeAvailableOffline\r\n * @override\r\n */\r\n async CheckLicense(context: Context): Promise {\r\n return context;\r\n }\r\n\r\n // TODO handle API custom errors instead of throwing\r\n // async CheckCustomError(context: Context): Promise {\r\n // }\r\n\r\n /**\r\n * Convert response body and cache it\r\n * @param {Context} context query context\r\n * @returns {Promise} current context\r\n * @memberof ApiManagerMakeAvailableOffline\r\n * @override\r\n */\r\n async EOL(context: Context): Promise {\r\n this._log.debug(() => ({\r\n msg: `${context.request.name}: EOL`,\r\n apiContext: context,\r\n }));\r\n\r\n // custom transformer function defined?\r\n context = this._runTransformer(context);\r\n\r\n await this._addToCache(context);\r\n\r\n return context;\r\n }\r\n\r\n _runTransformer = (context: Context): Promise => {\r\n if (\r\n context.request &&\r\n typeof context.request.transformer === \"function\"\r\n ) {\r\n if (\r\n context.request.contentType !== ContentType.AUTO &&\r\n context.request.contentType !== ContentType.JSON\r\n ) {\r\n throw new Error(\r\n `ApiCatalog method ${context.request.name} error: cache.transformer can only be used on ContentType.AUTO or JSON!`\r\n );\r\n }\r\n try {\r\n // transform it and convert back to body\r\n const cacheBody = JSON.stringify(\r\n context.request.transformer(context.body)\r\n );\r\n\r\n // return/cache this response instead\r\n context.response = new Response(cacheBody, context.response);\r\n } catch (e) {\r\n this._log.fatalException(\r\n () => ({\r\n msg: \"error while transforming body\",\r\n body: context.body,\r\n apiMethod: context.request.name,\r\n apiContext: context,\r\n }),\r\n e\r\n );\r\n throw new Error(\r\n \"Could not transform body for \" + context.request.name\r\n );\r\n }\r\n }\r\n return context;\r\n };\r\n\r\n _addToCache = async (context: Context): void => {\r\n // note: better control here than having the serviceWorker do this; cons - #54575 we need to handle our own cache store\r\n const cache = await this._apiCache.OpenCache(this._offlineItem.id);\r\n if (cache != null) {\r\n const cacheKey = this._getFullCacheKey(context);\r\n // note: no need to clone response here since .DecodeBody() does it for us!\r\n try {\r\n await cache.put(cacheKey, context.response);\r\n\r\n // Delete existing cache entry from Default store\r\n // Fixes #58699 Remove offline availability is not available\r\n const defaultCache = await this._apiCache.OpenCache(\r\n DEFAULT_CACHE_NAME\r\n );\r\n const deleted = await defaultCache.delete(cacheKey);\r\n /* istanbul ignore next */\r\n if (deleted) {\r\n this._log.info(() => ({\r\n msg: `Deleted duplicate cacheKey from defaultStore.`,\r\n cacheKey,\r\n defaultCache: DEFAULT_CACHE_NAME,\r\n cache: this._offlineItem.id,\r\n }));\r\n }\r\n } catch (e) {\r\n this._log.fatalException(\r\n () => ({\r\n msg: \"could not store cacheKey\",\r\n cacheKey: cacheKey,\r\n apiMethod: context.request.name,\r\n apiContext: context,\r\n }),\r\n e\r\n );\r\n throw new Error(\"Could not store cacheKey \" + cacheKey);\r\n }\r\n } else {\r\n this._log.fatalException(() => ({\r\n msg: \"could not open cache for offlineItem\",\r\n apiMethod: context.request.name,\r\n offlineItem: this._offlineItem,\r\n }));\r\n throw new Error(\"Could not open cache for storing offlineItem\");\r\n }\r\n };\r\n}\r\n","import {\r\n fork,\r\n all,\r\n call,\r\n put,\r\n takeLatest,\r\n select,\r\n spawn,\r\n take,\r\n race,\r\n} from \"redux-saga/effects\";\r\nimport { delay } from \"redux-saga\";\r\nimport {\r\n startOfflineSyncAction,\r\n offlineSyncStartedAction,\r\n offlineSyncDoneAction,\r\n setOfflineItemSyncStatusAction,\r\n removeOfflineItemAction,\r\n setOfflineItemDepsMapAction,\r\n} from \"data/actions\";\r\nimport { actions as networkActions } from \"redux-saga-network-status\";\r\nimport * as networkActionTypes from \"redux-saga-network-status/lib/actionTypes\";\r\nimport actionTypes from \"data/actions/actionTypes\";\r\nimport {\r\n CustomHttpHeader,\r\n OfflineSyncStatus,\r\n type ApiMethodRef,\r\n} from \"data/types\";\r\nimport ApiManagerMakeAvailableOffline from \"data/ApiManagerMakeAvailableOffline\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport { fetchOfflineItems, fetchUser } from \"data/api\";\r\nimport { hasCacheSupport } from \"data/utils\";\r\nimport { JL } from \"data/logging\";\r\nimport { replayOfflineQueue } from \"data/offline/offlineQueue\";\r\nimport { isFeatureOn, Feature } from \"data/constants\";\r\n\r\nconst _log = JL(\"offlineSaga\");\r\n\r\n// caching API instances per offlineItem\r\nlet APIs = {};\r\nconst getAPI = (item: OfflineItemDTO) =>\r\n APIs[item.id] == null\r\n ? (APIs[item.id] = new ApiManagerMakeAvailableOffline(item))\r\n : APIs[item.id];\r\nlet isSyncing = false;\r\n\r\nlet promptedForPersistentStorage = false;\r\nconst depsMap = {};\r\n\r\nexport function* updateUser() {\r\n yield call(fetchUser);\r\n}\r\n\r\nexport function* startSync(action) {\r\n try {\r\n isSyncing = true;\r\n _log.debug(() => \"starting sync\");\r\n const items = action.payload.items; //exact items to sync\r\n if (items && items.length > 0) {\r\n console.time(\"[offline]\");\r\n let anyOfflineItemSyncErrors = false;\r\n yield put(offlineSyncStartedAction());\r\n\r\n // cache global items non itemUri specific\r\n yield call(preFetchGlobals, { id: \"api\" });\r\n\r\n for (var i = 0; i < items.length; i++) {\r\n const item = items[i];\r\n _log.debug(() => ({\r\n msg: \"syncing\",\r\n bc: item.breadcrumb.text,\r\n offlineItem: item,\r\n }));\r\n depsMap[item.id] = {\r\n name: item.breadcrumb.text,\r\n children: [],\r\n attributes: {\r\n itemUri: item.itemUri,\r\n },\r\n };\r\n\r\n try {\r\n yield put(\r\n setOfflineItemSyncStatusAction({\r\n item,\r\n status: OfflineSyncStatus.Syncing,\r\n })\r\n );\r\n\r\n const t0 = performance.now();\r\n yield call(preFetchFolder, item, item.itemUri);\r\n const took = performance.now() - t0;\r\n\r\n // retrieve item from redux to check for errors\r\n const storeItems = yield select(s.offlineItemsSelector);\r\n /* istanbul ignore if */\r\n if (storeItems == null) {\r\n throw new Error(\r\n \"offlineSaga could not retrieve all offlineItems\"\r\n );\r\n }\r\n const storeItem = storeItems[item.id];\r\n /* istanbul ignore if */\r\n if (storeItem == null) {\r\n throw new Error(\r\n \"offlineSaga could not retrieve offlineItem \" +\r\n item.id\r\n );\r\n }\r\n\r\n /* istanbul ignore else */\r\n if (storeItem.status === OfflineSyncStatus.Syncing) {\r\n // no errors, update to done!\r\n yield put(\r\n setOfflineItemSyncStatusAction({\r\n item,\r\n status: OfflineSyncStatus.Synced,\r\n took,\r\n })\r\n );\r\n delete depsMap[item.id].attributes.error;\r\n } else {\r\n anyOfflineItemSyncErrors = true;\r\n }\r\n } catch (e) {\r\n anyOfflineItemSyncErrors = true;\r\n _log.fatalException(\r\n () => ({\r\n msg: \"error while syncing\",\r\n bc: item.breadcrumb.text,\r\n offlineItem: item,\r\n }),\r\n e\r\n );\r\n depsMap[item.id].attributes.error = e;\r\n depsMap[item.id]._collapsed = false;\r\n yield put(\r\n setOfflineItemSyncStatusAction({\r\n item,\r\n message: e.message,\r\n status: OfflineSyncStatus.SyncedWithErrors,\r\n })\r\n );\r\n }\r\n console.timeLog(\"[offline]\", item);\r\n yield call(getAPI(item).LogEstimates);\r\n }\r\n yield put(\r\n offlineSyncDoneAction({\r\n status: anyOfflineItemSyncErrors\r\n ? OfflineSyncStatus.SyncedWithErrors\r\n : OfflineSyncStatus.Synced,\r\n })\r\n );\r\n console.timeEnd(\"[offline]\");\r\n }\r\n } catch (e) {\r\n /* istanbul ignore next */\r\n _log.fatalException(() => \"Error in startSync()\", e);\r\n\r\n /* istanbul ignore next */\r\n yield put(\r\n offlineSyncDoneAction({\r\n status: OfflineSyncStatus.Error,\r\n message: e.message,\r\n })\r\n );\r\n } finally {\r\n // release all API instances\r\n APIs = {};\r\n }\r\n isSyncing = false;\r\n}\r\n\r\nfunction* preFetchGlobals(item: OfflineItemDTO): void {\r\n _log.debug(() => ({\r\n msg: \"pre-fetching globals\",\r\n item,\r\n }));\r\n const globalApis = [\r\n {\r\n name: \"getArchiveTargets\",\r\n params: {\r\n offline: true,\r\n },\r\n },\r\n ];\r\n for (const apiGlobal of globalApis) {\r\n yield call(getAPI(item)._callWithDeps, apiGlobal.name, {\r\n params: apiGlobal.params,\r\n });\r\n }\r\n}\r\n\r\nfunction* preFetchFolder(item: OfflineItemDTO, itemUri: string): void {\r\n if (item.isDoc !== false) {\r\n _log.warn(() => ({\r\n msg: \"cannot pre-fetch offlineItem as currently only Folders are supported!\",\r\n offlineItem: item,\r\n }));\r\n throw new Error(\"Only Folders are supported for offline sync!\");\r\n }\r\n\r\n _log.debug(() => ({\r\n msg: \"pre-fetching Folder\",\r\n item,\r\n itemUri,\r\n }));\r\n\r\n // starting point is always the tree\r\n const childMapRef = {\r\n name: \"fetchTree\",\r\n children: [],\r\n attributes: {\r\n itemUri,\r\n },\r\n };\r\n depsMap[item.id].children.push(childMapRef);\r\n const rootDep = {\r\n name: \"fetchTree\",\r\n params: {\r\n itemUri,\r\n deep: false,\r\n all: true, // no paging\r\n },\r\n };\r\n yield call(fetchDeps, item, rootDep, childMapRef);\r\n}\r\n\r\nfunction* fetchDeps(item: OfflineItemDTO, dep: ApiMethodRef, mapRef): void {\r\n _log.debug(() => ({\r\n msg: \"Fetching DEP:\",\r\n dep,\r\n }));\r\n const t0 = performance.now();\r\n const { name, ...args } = dep;\r\n const deps = yield call(getAPI(item)._callWithDeps, dep.name, args);\r\n const took = Math.round(performance.now() - t0) + \"ms\";\r\n mapRef.attributes = {\r\n took,\r\n ...dep.params,\r\n };\r\n\r\n _log.debug(() => ({\r\n msg: \"Retrieved sub-dependencies\",\r\n dep,\r\n args,\r\n deps,\r\n }));\r\n\r\n for (const dep of deps) {\r\n try {\r\n // add child dependencies for processing\r\n const childMapRef = {\r\n name: dep.name,\r\n children: [],\r\n attributes: {},\r\n };\r\n mapRef.children.push(childMapRef);\r\n\r\n yield call(fetchDeps, item, dep, childMapRef);\r\n } catch (e) {\r\n _log.warn(() => ({\r\n msg: \"error while fetchDeps\",\r\n dep,\r\n e,\r\n }));\r\n\r\n yield put(\r\n setOfflineItemSyncStatusAction({\r\n item,\r\n message: e.message,\r\n status: OfflineSyncStatus.SyncedWithErrors,\r\n })\r\n );\r\n }\r\n }\r\n}\r\n\r\nfunction* removeOfflineItem(action) {\r\n _log.debug(() => ({\r\n msg: \"remove offline item\",\r\n offlineItem: action.payload.item,\r\n }));\r\n const itemAPI = yield call(getAPI, action.payload.item);\r\n // remove window.cache entries\r\n itemAPI.DeleteCache().then((isSuccess) => {\r\n if (isSuccess)\r\n _log.debug(() => ({\r\n msg: \"successfully deleted cache\",\r\n offlineItem: action.payload.item,\r\n }));\r\n else\r\n _log.warn(() => ({\r\n msg: \"could not delete cache\",\r\n offlineItem: action.payload.item,\r\n }));\r\n });\r\n}\r\n\r\nexport function* checkOfflineItems() {\r\n const hasOfflineItems = yield select(s.userHasOfflineItemsSelector);\r\n // retrieve current offline items\r\n const currentOffline = yield select(s.offlineItemsSelector);\r\n /* istanbul ignore else */\r\n if (\r\n hasOfflineItems /* istanbul ignore next */ ||\r\n Object.keys(currentOffline).length > 0\r\n ) {\r\n // https://storage.spec.whatwg.org/#example-3a7051a8\r\n if (\r\n !promptedForPersistentStorage &&\r\n navigator.storage &&\r\n navigator.storage.persist\r\n ) {\r\n // eslint-disable-next-line no-loop-func\r\n navigator.storage.persist().then((persistent) => {\r\n promptedForPersistentStorage = true;\r\n /* istanbul ignore else */\r\n if (persistent)\r\n _log.info(\r\n () =>\r\n \"Storage will not be cleared except by explicit user action\"\r\n );\r\n else\r\n _log.warn(\r\n () =>\r\n \"Storage may be cleared by the UA under storage pressure.\"\r\n );\r\n });\r\n }\r\n\r\n // manual offline files\r\n try {\r\n // yield put(\r\n // setOfflineSyncStatusAction({\r\n // status: OfflineSyncStatus.Syncing,\r\n // })\r\n // );\r\n\r\n const itemsToSync = [];\r\n\r\n // Update cached User network call to fix #56961 (update detached)\r\n yield spawn(updateUser);\r\n // retrieve new ones (with .LastUpdate) from server\r\n const items = yield call(fetchOfflineItems);\r\n\r\n // let's check the new ones\r\n for (const item of items) {\r\n // do we have this one already?\r\n const currentOfflineItem = currentOffline[item.id];\r\n // same same? no need to sync\r\n if (\r\n currentOfflineItem &&\r\n currentOfflineItem.lastUpdate === item.lastUpdate &&\r\n [\r\n OfflineSyncStatus.Synced,\r\n OfflineSyncStatus.SyncedWithErrors,\r\n OfflineSyncStatus.Error,\r\n ].includes(currentOfflineItem.status)\r\n ) {\r\n const exists = yield call(\r\n getAPI(currentOfflineItem).CacheExists\r\n );\r\n if (exists) {\r\n _log.debug(() => ({\r\n msg: \"item already synchronized\",\r\n offlineItem: currentOfflineItem,\r\n }));\r\n continue;\r\n }\r\n }\r\n // TODO better granularity of which ItemsUris within an OfflineItem to sync?\r\n itemsToSync.push(item);\r\n }\r\n // process currentOfflineItems that have been removed!\r\n for (const currentOfflineItem of Object.values(currentOffline)) {\r\n const item = items.find((i) => i.id === currentOfflineItem.id);\r\n // does not exist anymore! purge\r\n if (item == null) {\r\n yield put(removeOfflineItemAction(currentOfflineItem));\r\n }\r\n }\r\n\r\n if (itemsToSync.length > 0) {\r\n _log.debug(() => ({\r\n msg: \"checkOfflineItems: itemsToSync\",\r\n itemsToSync,\r\n }));\r\n // TODO should we clear current cache for this item as a whole?\r\n // put(setOfflineItemSyncStatusAction) BEFORE startOfflineSyncAction() so they are all visible in the sidebar!\r\n for (const item of itemsToSync) {\r\n yield put(\r\n setOfflineItemSyncStatusAction({\r\n item,\r\n status: OfflineSyncStatus.Unknown,\r\n })\r\n );\r\n }\r\n yield put(startOfflineSyncAction(itemsToSync));\r\n } else {\r\n _log.debug(() => \"checkOfflineItems: nothing to sync!\");\r\n // yield put(\r\n // setOfflineSyncStatusAction({\r\n // status: OfflineSyncStatus.Synced,\r\n // })\r\n // );\r\n }\r\n } catch (e) {\r\n _log.fatalException(\r\n () => ({ msg: \"Error in checkOfflineItems()\" }),\r\n e\r\n );\r\n yield put(\r\n offlineSyncDoneAction({\r\n status: OfflineSyncStatus.Error,\r\n message: e.message,\r\n })\r\n );\r\n }\r\n }\r\n}\r\n\r\nexport function* watchOfflineSync() {\r\n while (true) {\r\n const isOnline = yield select(s.isApiOnlineSelector);\r\n // if (!isOnline) {\r\n // const hasBeenOnline = yield select(s.hasBeenOnlineSelector);\r\n // if (!hasBeenOnline) {\r\n // yield call(delay, 1000 * 5);\r\n // continue;\r\n // }\r\n // }\r\n if (isOnline && !isSyncing) {\r\n // check pending offline queue\r\n yield call(replayOfflineQueue);\r\n // check offlineItems to cache\r\n yield call(checkOfflineItems);\r\n }\r\n yield race({\r\n user: take(actionTypes.OFFLINE_SYNC_UPDATE),\r\n network: take(networkActionTypes.PING_SUCCESS),\r\n timeout: delay(1000 * 60), // TODO #54607 appSettings offline refresh timeout\r\n });\r\n }\r\n}\r\n\r\n/* istanbul ignore next */\r\nfunction* getDepsMap(action) {\r\n yield put(\r\n setOfflineItemDepsMapAction(\r\n action.payload.item,\r\n depsMap[action.payload.item.id]\r\n )\r\n );\r\n}\r\n\r\n/* istanbul ignore next */\r\nfunction persistNetworkStatus(action) {\r\n // To avoid race-condition with network-status reducer = > calculate online status by ourself\r\n const offline = [\r\n networkActionTypes.PING_FAILURE,\r\n networkActionTypes.NAVIGATOR_OFFLINE,\r\n ];\r\n const payload = {\r\n isOnline: !offline.includes(action.type),\r\n };\r\n window.caches.open(\"swConfig\").then((cache) =>\r\n cache\r\n .put(\r\n \"/swConfig\",\r\n new Response(JSON.stringify(payload), {\r\n status: 200,\r\n headers: { \"Content-Type\": \"application/json\" },\r\n })\r\n )\r\n .then(() =>\r\n _log.info(() => ({\r\n msg: \"Persited Networkstatus to cache\",\r\n payload,\r\n }))\r\n )\r\n );\r\n}\r\n\r\n/* istanbul ignore next */\r\nfunction* watchNetworkStatus() {\r\n yield takeLatest(\r\n [\r\n networkActionTypes.PING_SUCCESS,\r\n networkActionTypes.PING_FAILURE,\r\n networkActionTypes.NAVIGATOR_ONLINE,\r\n networkActionTypes.NAVIGATOR_OFFLINE,\r\n ],\r\n persistNetworkStatus\r\n );\r\n}\r\n\r\nfunction* offlineSaga() {\r\n if (!hasCacheSupport()) {\r\n _log.info(\r\n () =>\r\n \"Browser does not support Caching - offlineItems cannot be synchronized!\"\r\n );\r\n return;\r\n }\r\n if (!isFeatureOn(Feature.offline)) {\r\n _log.info(\r\n () =>\r\n \"Offline feature disabled in appsettings - offlineItems cannot be synchronized!\"\r\n );\r\n return;\r\n }\r\n\r\n yield all([\r\n // listen for sync requests\r\n takeLatest(actionTypes.OFFLINE_SYNC_REQUEST, startSync),\r\n // listen for removals\r\n takeLatest(actionTypes.OFFLINEITEM_REMOVE, removeOfflineItem),\r\n // retrieve last offlineItem sync and add it to redux store\r\n takeLatest(actionTypes.OFFLINEITEM_DEPSMAP_REQUEST, getDepsMap),\r\n // background sync job\r\n fork(watchOfflineSync),\r\n // handle online/offline changes\r\n fork(watchNetworkStatus),\r\n ]);\r\n}\r\n\r\nexport default offlineSaga;\r\n\r\n// continuos check for actual server connectivity - forked by rootSaga\r\n/* istanbul ignore next*/\r\nexport function* checkServerConnectivity() {\r\n // check for network outages\r\n const correlationId = yield select(s.userCorrelationIdSelector);\r\n const pingUrl = `${window.CONFIG.host.basename}/ping`;\r\n var headers = new Headers();\r\n if (correlationId != null) {\r\n headers.append(CustomHttpHeader.CorrelationId, correlationId);\r\n }\r\n yield put(\r\n networkActions.startWatchNetworkStatus(\r\n new Request(pingUrl, {\r\n headers,\r\n })\r\n )\r\n );\r\n // additionally, periodically check for server connection\r\n // while (true) {\r\n // if (!isSyncing) {\r\n // if (yield select(isNavigatorOnlineSelector)) {\r\n // yield put(networkActions.ping(pingUrl));\r\n // }\r\n // }\r\n // yield call(delay, 1000 * 10); //every 10sec\r\n // }\r\n}\r\n","import { call, put, takeLatest, select } from \"redux-saga/effects\";\r\nimport actionTypes from \"data/actions/actionTypes\";\r\nimport { getUserResultAction } from \"data/actions\";\r\nimport { fetchUser } from \"data/api\";\r\nimport Constants from \"data/constants\";\r\nimport { version } from \"../../../package.json\";\r\nimport { signout } from \"data/loginFlow\";\r\nimport * as s from \"data/reducers/selectors\";\r\n\r\n// worker Saga: will be fired on USER_FETCH_REQUESTED actions\r\nfunction* getUser(action) {\r\n try {\r\n const user = yield call(fetchUser);\r\n window.CONFIG.web_version = version;\r\n window.CONFIG.provider_fileVersion = user.provider_fileVersion;\r\n window.CONFIG.provider_serviceVersion = user.provider_serviceVersion;\r\n window.CONFIG.general.features = user.features;\r\n\r\n yield put(getUserResultAction({ status: Constants.OK, info: user }));\r\n //}\r\n } catch (e) {\r\n yield put(\r\n getUserResultAction({ status: Constants.ERROR, message: e.message })\r\n );\r\n }\r\n}\r\n\r\nfunction* logoutUser() {\r\n const idToken = yield select(s.loginIdTokenSelector);\r\n yield call(signout, idToken);\r\n}\r\n\r\nfunction* userSaga() {\r\n yield takeLatest(actionTypes.USER_FETCH_REQUESTED, getUser);\r\n yield takeLatest(actionTypes.LOGIN_SIGNOUT, logoutUser);\r\n}\r\n\r\nexport default userSaga;\r\n","import {\r\n call,\r\n put,\r\n takeLatest,\r\n takeEvery,\r\n select,\r\n take,\r\n race,\r\n} from \"redux-saga/effects\";\r\nimport { delay } from \"redux-saga\";\r\nimport actionTypes from \"data/actions/actionTypes\";\r\nimport {\r\n getFavoritesAction,\r\n getFavoritesResultAction,\r\n setCurrentBreadcrumb,\r\n} from \"data/actions\";\r\nimport { fetchFavorites } from \"data/api\";\r\nimport Constants from \"data/constants\";\r\nimport * as s from \"data/reducers/selectors\";\r\n\r\nconst breadcrumbSelector = (state, viewName) => state.breadcrumb[viewName];\r\n\r\nfunction* getFavorites(action) {\r\n try {\r\n const favorites = yield call(fetchFavorites);\r\n yield put(\r\n getFavoritesResultAction({ status: Constants.OK, favorites })\r\n );\r\n\r\n // const breadcrumb = yield select(breadcrumbSelector);\r\n // yield put(setCurrentBreadcrumb(breadcrumb));\r\n } catch (e) {\r\n yield put(\r\n getFavoritesResultAction({\r\n status: Constants.ERROR,\r\n message: e.message,\r\n })\r\n );\r\n }\r\n}\r\n\r\nfunction* checkIsFav(action) {\r\n const breadcrumb = yield select(\r\n breadcrumbSelector,\r\n action.payload.viewName\r\n );\r\n // only check if unknown\r\n if (breadcrumb != null && breadcrumb.isFav == null) {\r\n let stateFavoritesStatus = yield select(s.favoritesStatusSelector);\r\n if (\r\n [Constants.LOADING, Constants.REFRESH].includes(\r\n stateFavoritesStatus\r\n )\r\n ) {\r\n const { timeout } = yield race({\r\n favoritesFetched: take(actionTypes.FAVORITES_FETCH_RESULT),\r\n timeout: call(delay, 5000),\r\n });\r\n stateFavoritesStatus = yield select(s.favoritesStatusSelector);\r\n /* istanbul ignore if */\r\n if (timeout || stateFavoritesStatus !== Constants.OK) {\r\n return;\r\n }\r\n }\r\n const stateFavorites = yield select(s.favoritesFavoritesSelector);\r\n // only check if favorites known\r\n /* istanbul ignore else */\r\n if (stateFavorites != null) {\r\n const isFav = stateFavorites.includes(breadcrumb.itemUri);\r\n // update state\r\n yield put(setCurrentBreadcrumb({ ...action.payload, isFav }));\r\n }\r\n }\r\n}\r\n\r\nexport function* refreshFavorites(action) {\r\n /* istanbul ignore else */\r\n if (\"favorite\" === action.payload.item) {\r\n return yield put(getFavoritesAction(Constants.REFRESH));\r\n }\r\n}\r\n\r\nfunction* favoritesSaga() {\r\n yield takeLatest(actionTypes.FAVORITES_FETCH_REQUEST, getFavorites);\r\n yield takeEvery(actionTypes.CURRENT_BREADCRUMB, checkIsFav);\r\n yield takeEvery(actionTypes.GLOBALEVENTS_SERVER, refreshFavorites);\r\n}\r\n\r\nexport default favoritesSaga;\r\n","import { select, call, put, takeLatest, cancelled } from \"redux-saga/effects\";\r\nimport { delay } from \"redux-saga\";\r\nimport actionTypes from \"data/actions/actionTypes\";\r\nimport { cardsCardsSelector } from \"data/reducers/selectors\";\r\nimport {\r\n getCardsResultAction,\r\n getCardsByEntityAction,\r\n getCardsByEntityResultAction,\r\n} from \"data/actions\";\r\nimport { fetchCards, fetchCardsByEntity } from \"data/api\";\r\nimport {\r\n ServerEventItemType,\r\n ServerEventActionType,\r\n CardType,\r\n CardItemType,\r\n type ServerEventItemTypeEnum,\r\n type CardItemTypeEnum,\r\n} from \"data/types\";\r\nimport Constants from \"data/constants\";\r\n\r\n// worker Saga: will be fired on CARDS_FETCH_REQUESTED actions\r\nexport function* getCards(action) {\r\n const abortController = new AbortController();\r\n\r\n try {\r\n const cards = yield call(fetchCards, abortController.signal);\r\n yield put(getCardsResultAction({ status: Constants.OK, cards }));\r\n } catch (e) {\r\n yield put(\r\n getCardsResultAction({\r\n status: Constants.ERROR,\r\n message: e.message,\r\n })\r\n );\r\n } finally {\r\n if (yield cancelled()) {\r\n // Cancel the API call if the saga was cancelled\r\n abortController.abort();\r\n }\r\n }\r\n}\r\n\r\nconst getCardItemTypeFrom = (\r\n itemType: ServerEventItemTypeEnum\r\n): CardItemTypeEnum => {\r\n switch (itemType) {\r\n case ServerEventItemType.document:\r\n return CardItemType.Doc;\r\n case ServerEventItemType.folder:\r\n return CardItemType.Folder;\r\n case ServerEventItemType.search:\r\n return CardItemType.Search;\r\n /* istanbul ignore next */\r\n default:\r\n return null;\r\n }\r\n};\r\n\r\nexport function* refreshCards(action) {\r\n const params = {};\r\n\r\n // Handle recent changes\r\n if (\r\n action.payload.action === ServerEventActionType.view &&\r\n [\r\n ServerEventItemType.document,\r\n ServerEventItemType.folder,\r\n ServerEventItemType.search,\r\n ].includes(action.payload.item)\r\n ) {\r\n params.cardTypes = [CardType.Rec];\r\n params.cardItemTypes = [getCardItemTypeFrom(action.payload.item)];\r\n }\r\n\r\n // Handle favorite changes\r\n if (action.payload.item === ServerEventItemType.favorite) {\r\n params.cardTypes = [CardType.Fav];\r\n params.cardItemTypes = [\r\n CardItemType.Doc,\r\n CardItemType.Folder,\r\n CardItemType.Search,\r\n ];\r\n }\r\n\r\n /* istanbul ignore else */\r\n if (params.cardTypes == null || params.cardItemTypes == null) {\r\n return;\r\n }\r\n\r\n // De-bouncer\r\n yield call(delay, 10000);\r\n\r\n yield put(\r\n getCardsByEntityAction(\r\n params.cardTypes,\r\n params.cardItemTypes,\r\n Constants.REFRESH\r\n )\r\n );\r\n}\r\n\r\nexport function* getCardsByEntity(action) {\r\n const params = {\r\n cardTypes: action.payload.cardTypes,\r\n cardItemTypes: action.payload.cardItemTypes,\r\n };\r\n\r\n const abortController = new AbortController();\r\n try {\r\n const cards = yield call(\r\n fetchCardsByEntity,\r\n params,\r\n abortController.signal\r\n );\r\n yield put(\r\n getCardsByEntityResultAction({\r\n status: Constants.OK,\r\n cards,\r\n cardTypes: action.payload.cardTypes,\r\n cardItemTypes: action.payload.cardItemTypes,\r\n })\r\n );\r\n } catch (e) {\r\n const cards = yield select(cardsCardsSelector);\r\n yield put(\r\n getCardsResultAction({\r\n status: Constants.ERROR,\r\n message: e.message,\r\n cards,\r\n })\r\n );\r\n } finally {\r\n if (yield cancelled()) {\r\n // Cancel the API call if the saga was cancelled\r\n abortController.abort();\r\n }\r\n }\r\n}\r\n\r\nfunction* cardsSaga() {\r\n yield takeLatest(actionTypes.CARDS_FETCH_REQUESTED, getCards);\r\n yield takeLatest(\r\n actionTypes.CARDS_FETCH_ENTITY_REQUESTED,\r\n getCardsByEntity\r\n );\r\n yield takeLatest(actionTypes.GLOBALEVENTS_SERVER, refreshCards);\r\n}\r\n\r\nexport default cardsSaga;\r\n","import { call, put, takeLatest, cancelled } from \"redux-saga/effects\";\r\nimport { delay } from \"redux-saga\";\r\nimport actionTypes from \"data/actions/actionTypes\";\r\nimport {\r\n getWorkflowCards,\r\n getWorkflowCardsResult,\r\n getWorkflowProvidersResult,\r\n togglesUpdateCounterAction,\r\n} from \"data/actions\";\r\nimport { fetchWorkflowCards, fetchWorkflowProviders } from \"data/api\";\r\nimport Constants from \"data/constants\";\r\nimport countBy from \"lodash/countBy\";\r\n\r\nexport const lib = {\r\n delay,\r\n};\r\n\r\nconst defaultCount = {\r\n start: 0,\r\n pending: 0,\r\n // done: 0,\r\n};\r\nconst countCards = (cards?: Array) => ({\r\n ...defaultCount,\r\n ...countBy(cards || /* istanbul ignore next */ [], \"extras.toggle\"),\r\n});\r\n\r\n// worker Saga: will be fired on WF_FETCH_REQUESTED actions\r\nexport function* getCards(action) {\r\n let status = {\r\n start: Constants.LOADING,\r\n pending: Constants.LOADING,\r\n };\r\n let counts = { ...defaultCount };\r\n yield put(\r\n togglesUpdateCounterAction({\r\n name: \"wf\",\r\n counts,\r\n status,\r\n })\r\n );\r\n if (action?.payload?.status === Constants.REFRESH) {\r\n // this delay in combination with takeLatest\r\n // is our debouncer to avoid multiple calls\r\n yield call(lib.delay, 10000);\r\n }\r\n\r\n // https://decembersoft.com/posts/redux-saga-abort-controller-cancel-api-calls/\r\n const abortController = new AbortController();\r\n try {\r\n const cards = yield call(fetchWorkflowCards, abortController.signal);\r\n yield put(getWorkflowCardsResult({ status: Constants.OK, cards }));\r\n status = {\r\n start: Constants.OK,\r\n pending: Constants.OK,\r\n };\r\n counts = countCards(cards);\r\n } catch (e) {\r\n yield put(\r\n getWorkflowCardsResult({\r\n status: Constants.ERROR,\r\n message: e.message,\r\n })\r\n );\r\n status = {\r\n start: Constants.ERROR,\r\n pending: Constants.ERROR,\r\n };\r\n } finally {\r\n if (yield cancelled()) {\r\n // Cancel the API call if the saga was cancelled\r\n abortController.abort();\r\n }\r\n yield put(\r\n togglesUpdateCounterAction({\r\n name: \"wf\",\r\n counts,\r\n status,\r\n })\r\n );\r\n }\r\n}\r\n\r\n// worker Saga: will be fired on WF_PROVIDERS_FETCH_REQUESTED actions\r\nexport function* getProviders(action) {\r\n const abortController = new AbortController();\r\n\r\n try {\r\n const providers = yield call(\r\n fetchWorkflowProviders,\r\n abortController.signal\r\n );\r\n yield put(\r\n getWorkflowProvidersResult({ status: Constants.OK, providers })\r\n );\r\n } catch (e) {\r\n yield put(\r\n getWorkflowProvidersResult({\r\n status: Constants.ERROR,\r\n message: e.message,\r\n })\r\n );\r\n } finally {\r\n if (yield cancelled()) {\r\n // Cancel the API call if the saga was cancelled\r\n abortController.abort();\r\n }\r\n }\r\n}\r\n\r\nfunction* refreshCards(action) {\r\n /* istanbul ignore else */\r\n if (\r\n action.payload.action === \"view\" &&\r\n [\"document\", \"folder\", \"task\", \"search\"].includes(action.payload.item)\r\n ) {\r\n return yield put(getWorkflowCards(Constants.REFRESH));\r\n }\r\n}\r\n\r\nfunction* workflowSaga() {\r\n yield takeLatest(actionTypes.WF_PROVIDERS_FETCH_REQUESTED, getProviders);\r\n yield takeLatest(actionTypes.WF_FETCH_REQUESTED, getCards);\r\n yield takeLatest(actionTypes.GLOBALEVENTS_SERVER, refreshCards);\r\n}\r\n\r\nexport default workflowSaga;\r\n","import { call, put, takeLatest, cancelled } from \"redux-saga/effects\";\r\nimport actionTypes from \"data/actions/actionTypes\";\r\nimport { getTreeResultAction } from \"data/actions\";\r\nimport { fetchTree } from \"data/api\";\r\nimport Constants from \"data/constants\";\r\n\r\nexport function* getTree(action) {\r\n // https://decembersoft.com/posts/redux-saga-abort-controller-cancel-api-calls/\r\n const abortController = new AbortController();\r\n\r\n try {\r\n const tree = yield call(fetchTree, {\r\n itemUri: action.payload.itemUri,\r\n filter: action.payload.filter,\r\n deep: action.payload.deep,\r\n all: action.payload.all,\r\n signal: abortController.signal,\r\n });\r\n yield put(\r\n getTreeResultAction({ status: Constants.OK, tree, error: null })\r\n );\r\n } catch (e) {\r\n yield put(\r\n getTreeResultAction({\r\n status: Constants.ERROR,\r\n error: e,\r\n })\r\n );\r\n } finally {\r\n if (yield cancelled()) {\r\n // Cancel the API call if the saga was cancelled\r\n abortController.abort();\r\n }\r\n }\r\n}\r\n\r\nfunction* treeSaga() {\r\n yield takeLatest(actionTypes.TREE_FETCH_REQUEST, getTree);\r\n}\r\n\r\nexport default treeSaga;\r\n","import { call, put, takeLatest, cancelled, select } from \"redux-saga/effects\";\r\nimport actionTypes from \"data/actions/actionTypes\";\r\nimport { getDocsResultAction } from \"data/actions\";\r\nimport { fetchDocs, fetchDocsCsv, fetchDocCount } from \"data/api\";\r\nimport Constants from \"data/constants\";\r\nimport FileSaver from \"file-saver\";\r\nimport * as s from \"data/reducers/selectors\";\r\n\r\n// fetches batch of results\r\nexport function* getDocs(action) {\r\n // https://decembersoft.com/posts/redux-saga-abort-controller-cancel-api-calls/\r\n const abortController = new AbortController();\r\n\r\n // this delay in combination with takeLatest\r\n // is our debouncer to avoid multiple calls\r\n // yield call(delay, 300);\r\n try {\r\n const result = yield call(\r\n fetchDocs,\r\n action.payload.itemUri,\r\n action.payload.pageNum,\r\n action.payload.sorts,\r\n action.payload.filters,\r\n action.payload.cols,\r\n abortController.signal\r\n );\r\n\r\n yield put(\r\n getDocsResultAction({\r\n status: Constants.OK,\r\n result,\r\n totalCount: result.rowCount,\r\n error: null,\r\n })\r\n );\r\n\r\n // do we need to fetch the real totalCount?\r\n if (\r\n (action.payload.pageNum === 0 ||\r\n action.payload.pageNum === undefined) &&\r\n result.rowCount > 0 &&\r\n result.rowCount === result.pageSize\r\n ) {\r\n const totalCount = yield call(\r\n fetchDocCount,\r\n action.payload.itemUri,\r\n action.payload.filters,\r\n abortController.signal\r\n );\r\n yield put(\r\n getDocsResultAction({\r\n status: Constants.OK,\r\n result,\r\n totalCount: totalCount >= 0 ? totalCount : result.rowCount, // Handle -1/-2 responses from server\r\n error: null,\r\n })\r\n );\r\n }\r\n } catch (e) {\r\n yield put(\r\n getDocsResultAction({\r\n status: Constants.ERROR,\r\n error: e,\r\n })\r\n );\r\n } finally {\r\n if (yield cancelled()) {\r\n // console.log(\"getDocs cancelled\");\r\n // Cancel the API call if the saga was cancelled\r\n abortController.abort();\r\n }\r\n }\r\n}\r\n\r\nfunction* exportToCsv() {\r\n const itemUri = yield select(s.currentItemUriSelector);\r\n const filters = yield select(s.docsFiltersSelector);\r\n const sorts = yield select(s.docsSortsSelector);\r\n\r\n const blob = yield call(fetchDocsCsv, itemUri, sorts, filters);\r\n FileSaver.saveAs(blob, \"inPoint.Web.Export.csv\");\r\n}\r\n\r\nfunction* docsSaga() {\r\n yield takeLatest(actionTypes.DOCS_FETCH_REQUEST, getDocs);\r\n yield takeLatest(actionTypes.DOCS_EXPORT_CSV, exportToCsv);\r\n}\r\n\r\nexport default docsSaga;\r\n","import { call, put, take, takeEvery, select, race } from \"redux-saga/effects\";\r\nimport { delay } from \"redux-saga\";\r\nimport actionTypes from \"data/actions/actionTypes\";\r\nimport { getDocsAction, setDocsLayoutAction } from \"data/actions\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport { DocListFilterOperators, SearchValueType } from \"data/types\";\r\nimport {\r\n GetDefaults,\r\n ResetFilters,\r\n GetFilterValueAsString,\r\n} from \"components/DocListFilterModal/Utils\";\r\nimport immutable from \"object-path-immutable\";\r\nimport Constants, { getDefaultsConfig } from \"data/constants\";\r\n\r\nconst resultSelector = (state) => state.docs;\r\nconst currentItemSelector = (state) => state.current;\r\nconst formatIdSelector = (state) =>\r\n s.breadcrumbFormatIdSelector(state, s.currentNameSelector(state));\r\n\r\n// clears all filters & sorts (in case none is available, will reset everything)\r\nfunction* resetFilters() {\r\n const result = yield select(resultSelector);\r\n const formatId = yield select(formatIdSelector);\r\n if (result != null && result.cols != null && result.cols.length > 0) {\r\n yield put(\r\n setDocsLayoutAction({\r\n sorts: [],\r\n filters: ResetFilters(\r\n result.itemUri,\r\n formatId,\r\n result.filters,\r\n result.cols\r\n ),\r\n })\r\n );\r\n } else {\r\n // bruteforce - delete everything\r\n yield put(setDocsLayoutAction());\r\n }\r\n}\r\n\r\n// create a filter based on a value referenced from the result.rows\r\nfunction* setFilterByRef(action) {\r\n const status = yield select(s.docsStatusSelector);\r\n if (status !== Constants.OK) return;\r\n\r\n const { docContextClick, resetValues } = action.payload;\r\n const result = yield select(resultSelector);\r\n const formatId = yield select(formatIdSelector);\r\n //const filters = yield select(s.docsFiltersSelector);\r\n //const cols = yield select(s.docsColsSelector);\r\n /* istanbul ignore else */\r\n if (result != null && result.cols != null) {\r\n // get current filters\r\n let filters = result.filters;\r\n // none yet? create default list\r\n if (filters == null || filters.length === 0) {\r\n filters = GetDefaults(\r\n result.itemUri,\r\n formatId,\r\n result.cols\r\n ).filters;\r\n }\r\n if (resetValues) {\r\n // reset values ONLY (operators stay as they are)\r\n filters = ResetFilters(\r\n result.itemUri,\r\n formatId,\r\n filters,\r\n result.cols\r\n );\r\n }\r\n const { cols } = result;\r\n const colName = cols[docContextClick.columnIndex].name;\r\n\r\n // then set our own\r\n const newfilters = filters.map((filter, index) => {\r\n if (filter.name === colName) {\r\n let newfilter = immutable.set(filter, \"values\", [\r\n docContextClick.rowIndex === -1\r\n ? \"\"\r\n : GetFilterValueAsString(\r\n result.rows[docContextClick.rowIndex][\r\n docContextClick.columnIndex\r\n ]\r\n ),\r\n ]);\r\n if (\r\n [\r\n DocListFilterOperators.None,\r\n DocListFilterOperators.Between,\r\n DocListFilterOperators.NotBetween,\r\n // DocListFilterOperators.Contains\r\n ].includes(newfilter.operator)\r\n )\r\n newfilter.operator = DocListFilterOperators.Equals;\r\n if (\r\n [DocListFilterOperators.DoesNotContain].includes(\r\n newfilter.operator\r\n )\r\n )\r\n newfilter.operator = DocListFilterOperators.NotEquals;\r\n return newfilter;\r\n }\r\n return filter;\r\n });\r\n yield put(setDocsLayoutAction({ filters: newfilters }));\r\n }\r\n}\r\n\r\nfunction* setFilterByName(action) {\r\n const result = yield select(resultSelector);\r\n const formatId = yield select(formatIdSelector);\r\n /* istanbul ignore else */\r\n if (result == null || result.cols == null) return;\r\n\r\n const { name, valueType, operator, value } = action.payload;\r\n // get current filters\r\n let filters = result.filters;\r\n // none yet? create default list\r\n if (filters == null || filters.length === 0) {\r\n filters = GetDefaults(result.itemUri, formatId, result.cols).filters;\r\n }\r\n\r\n // new value to assign; reset or set value\r\n let newValue =\r\n value === \"__ALL__\" ||\r\n (valueType === SearchValueType.RelativeDate && value === \"NotSet\")\r\n ? \"\"\r\n : value;\r\n // Transform to Array (if not already an array)\r\n if (!Array.isArray(newValue)) {\r\n newValue = [newValue];\r\n }\r\n // find requested filter\r\n const idx = filters.findIndex((f) => f.name === name);\r\n let newFilters = filters;\r\n if (idx === -1) {\r\n // add new filter\r\n newFilters = immutable.push(filters, undefined, {\r\n name,\r\n operator,\r\n values: newValue,\r\n });\r\n } else {\r\n newFilters = immutable.set(filters, [idx], {\r\n name,\r\n operator: operator || filters[idx].operator,\r\n values: newValue,\r\n });\r\n }\r\n // publish the changed filters\r\n yield put(setDocsLayoutAction({ filters: newFilters }));\r\n}\r\n\r\nfunction* getDocsLayout(action) {\r\n let formatId = yield select(formatIdSelector);\r\n if (formatId == null) {\r\n yield take(actionTypes.CURRENT_BREADCRUMB);\r\n formatId = yield select(formatIdSelector);\r\n }\r\n // anything saved in storage?\r\n const { currentItemLoaded, timeout } = yield race({\r\n currentItemLoaded: take(actionTypes.CURRENTITEM_LOADED),\r\n timeout: call(delay, 2000),\r\n });\r\n if (\r\n !timeout &&\r\n currentItemLoaded &&\r\n currentItemLoaded.payload.layout != null\r\n ) {\r\n /* console.debug(\r\n \"restoring layout from storage\",\r\n currentItemLoaded.payload.layout\r\n ); */\r\n yield put(setDocsLayoutAction(currentItemLoaded.payload.layout));\r\n return;\r\n }\r\n // or maybe defaults config?\r\n const defaults = getDefaultsConfig(action.payload.itemUri, formatId);\r\n /* istanbul ignore else */\r\n if (defaults !== null) {\r\n const { filters, sorts } = defaults;\r\n /* istanbul ignore else */\r\n if (filters != null /* istanbul ignore next */ || sorts != null) {\r\n /* console.debug(\"setting layout from defaults\", defaults); */\r\n yield put(setDocsLayoutAction({ filters, sorts }));\r\n return;\r\n }\r\n }\r\n\r\n // create default\r\n const result = yield select(resultSelector);\r\n if (result != null && result.cols != null) {\r\n /* console.debug(\"setting layout by GetDefaults()\"); */\r\n yield put(\r\n setDocsLayoutAction(\r\n GetDefaults(result.itemUri, formatId, result.cols)\r\n )\r\n );\r\n return;\r\n } else if (action.payload.allowPreFetch === true) {\r\n // only if param \"allowPreFetch\" is set! (related to showDocs=true and immediately showing filters)\r\n const currentItem = yield select(currentItemSelector);\r\n /* console.debug(\"setting layout by first getting schema\"); */\r\n yield put(getDocsAction({ pageNum: -1, itemUri: currentItem.itemUri }));\r\n const docsresult = yield take(actionTypes.DOCS_FETCH_RESULT);\r\n yield put(\r\n setDocsLayoutAction(\r\n GetDefaults(\r\n currentItem.itemUri,\r\n formatId,\r\n docsresult.payload.result.cols\r\n )\r\n )\r\n );\r\n return;\r\n }\r\n\r\n yield put(setDocsLayoutAction());\r\n}\r\n\r\nfunction* setFilterText(action) {\r\n yield setFilterByName(action);\r\n}\r\n\r\nfunction* docsSaga() {\r\n yield takeEvery(actionTypes.DOCS_FILTERS_RESET, resetFilters);\r\n yield takeEvery(actionTypes.DOCS_FILTERS_SETBYREF, setFilterByRef);\r\n yield takeEvery(actionTypes.DOCS_FILTERS_SETBYNAME, setFilterByName);\r\n yield takeEvery(actionTypes.DOCS_FILTERTEXT_SET, setFilterText);\r\n\r\n yield takeEvery(actionTypes.DOCS_LAYOUT_REQUEST, getDocsLayout);\r\n}\r\n\r\nexport default docsSaga;\r\n","import { call, put, takeEvery, select } from \"redux-saga/effects\";\r\nimport { delay } from \"redux-saga\";\r\nimport getToggles from \"data/toggles\";\r\nimport actionTypes from \"data/actions/actionTypes\";\r\nimport {\r\n togglesChangeAction,\r\n currentItemLoadedAction,\r\n //setCurrentItemAction,\r\n saveCurrentItemAction,\r\n setSplitPanesAction,\r\n} from \"data/actions\";\r\nimport { viewStorage, cacheStorage } from \"data/storage\";\r\nimport {\r\n isMiniView,\r\n isFeatureOn,\r\n Feature,\r\n getDefaultsConfig,\r\n} from \"data/constants\";\r\nimport produce from \"immer\";\r\nimport * as s from \"data/reducers/selectors\";\r\n\r\nconst togglesSelector = (state) => state.toggles;\r\nconst panesSelector = (state) => state.panes;\r\n\r\nconst ignoredViews = [\"itemflows\", \"upload\", \"search\"];\r\nconst isIgnoredView = (view) => ignoredViews.indexOf(view) > -1;\r\n\r\nfunction* loadSettings(action) {\r\n try {\r\n const currentItemName = yield select(s.currentNameSelector);\r\n const currentItemUri = yield select(s.currentItemUriSelector);\r\n const name = yield call(getName, action, currentItemName);\r\n\r\n // Bail early if on ignored view\r\n /* istanbul ignore if */\r\n if (isIgnoredView(name)) {\r\n yield put(currentItemLoadedAction());\r\n return;\r\n }\r\n\r\n const key = yield call(getKey, name, currentItemUri);\r\n const value = yield call(\r\n [\r\n shouldPersist(currentItemUri) ? viewStorage : cacheStorage,\r\n \"getItem\",\r\n ],\r\n name\r\n );\r\n\r\n /**\r\n * Note: Currently the toggles in the store to not match the toggles we need to persist.\r\n * Some redundant code is already here for moving everything to a saga (maybe not the current one)\r\n * see TogglesHandler HOC\r\n */\r\n const isPersisted = yield select((state) =>\r\n s.togglesPersistedSelector(state, currentItemName)\r\n );\r\n\r\n const usePersistedToggles = !!(isPersisted || value?.toggles);\r\n\r\n const selectedToggles = isPersisted\r\n ? yield select((state) =>\r\n s.selectedTogglesSelector(state, currentItemName)\r\n )\r\n : value?.toggles;\r\n\r\n if (\r\n value != null &&\r\n selectedToggles != null &&\r\n !selectedToggles.every(\r\n (t) =>\r\n value.toggles?.includes(t) /* istanbul ignore next */ ?? []\r\n )\r\n ) {\r\n value.toggles = selectedToggles;\r\n }\r\n\r\n /* istanbul ignore next */\r\n const toggles = produce(getToggles(name), (draft) => {\r\n draft.toggles = draft.toggles.map((toggle) => {\r\n toggle.isSelected = usePersistedToggles\r\n ? selectedToggles?.includes(toggle.value) ??\r\n toggle.isSelected\r\n : toggle.isSelected;\r\n switch (name) {\r\n case \"home\":\r\n // Fix persisted hidden toggles\r\n if (\r\n toggle.value === \"action\" &&\r\n !isFeatureOn(Feature.homeActions)\r\n ) {\r\n toggle.isHidden = true;\r\n toggle.isSelected = false;\r\n }\r\n // Trigger action view on home in Mini-View\r\n if (\r\n isMiniView(window.location) &&\r\n toggle.value !== \"action\" &&\r\n isFeatureOn(Feature.homeActions)\r\n ) {\r\n console.warn(\r\n `Mini View \"${name}\" currently does not support \"${value}\", falling back to \"action\"`\r\n );\r\n toggle.value = \"action\";\r\n }\r\n break;\r\n default:\r\n break;\r\n }\r\n return toggle;\r\n });\r\n\r\n // Always select at least one\r\n if (!draft.toggles.some((t) => t.isSelected)) {\r\n draft.toggles.find((t) => !t.isHidden).isSelected = true;\r\n }\r\n });\r\n // console.log(\"aaa settoggles\", { ...toggles.toggles });\r\n yield put(togglesChangeAction(currentItemName, toggles.toggles));\r\n\r\n if (value !== null) {\r\n value.layout = yield call(\r\n [\r\n shouldPersist(currentItemUri) ? viewStorage : cacheStorage,\r\n \"getItem\",\r\n ],\r\n key\r\n );\r\n\r\n if (\r\n Object.prototype.hasOwnProperty.call(value, \"panes\") &&\r\n !isPersisted\r\n ) {\r\n for (let key in value.panes) {\r\n yield put(\r\n setSplitPanesAction({\r\n view: name,\r\n name: key,\r\n dimensions: value.panes[key],\r\n })\r\n );\r\n }\r\n }\r\n\r\n // console.log(\"loadsettings\", value, name);\r\n }\r\n\r\n yield put(currentItemLoadedAction(value));\r\n } catch (e) {\r\n /* istanbul ignore next */\r\n console.warn(e);\r\n }\r\n}\r\n\r\nfunction shouldPersist(itemUri: string): boolean {\r\n const def = getDefaultsConfig(itemUri);\r\n if (def != null && def.persist != null) return def.persist;\r\n else return true;\r\n}\r\n\r\nfunction* calcCurrentItem(action) {\r\n yield call(delay, 500);\r\n try {\r\n const currentItemName = yield select(s.currentNameSelector);\r\n const currentItemUri = yield select(s.currentItemUriSelector);\r\n const name = yield call(getName, action, currentItemName);\r\n\r\n // Bail early if on ignored view\r\n /* istanbul ignore if */\r\n if (isIgnoredView(name)) {\r\n return;\r\n }\r\n\r\n const key = yield call(getKey, name, currentItemUri);\r\n // console.log(\"calcCurrentItem\", action.type, name, key);\r\n\r\n /* istanbul ignore next */\r\n let value = yield call(\r\n [\r\n shouldPersist(currentItemUri) ? viewStorage : cacheStorage,\r\n \"getItem\",\r\n ],\r\n name\r\n );\r\n // console.log(\"val\", action.type, value);\r\n /* istanbul ignore next */\r\n if (value == null) {\r\n value = {};\r\n }\r\n\r\n /* istanbul ignore next */\r\n value.layout = yield call(\r\n [\r\n shouldPersist(currentItemUri) ? viewStorage : cacheStorage,\r\n \"getItem\",\r\n ],\r\n key\r\n );\r\n\r\n // Setup defaults\r\n const toggles = yield select(togglesSelector);\r\n value.toggles = toggles[name][\"_selected\"];\r\n const panes = yield select(panesSelector);\r\n value.panes = panes[name] /* istanbul ignore next */ || [];\r\n value.layout = {};\r\n\r\n //console.log(\"action\", action);\r\n switch (action.type) {\r\n /* istanbul ignore next */\r\n case actionTypes.CURRENTITEM_SET:\r\n //yield call(loadSettings, action);\r\n break;\r\n\r\n case actionTypes.TOGGLES_PERSIST:\r\n value.toggles = action.payload.toggles\r\n .filter((t) => t.isSelected)\r\n .map((t) => t.value);\r\n break;\r\n\r\n case actionTypes.SPLITPANES_PERSIST:\r\n value.panes[action.payload.name] = action.payload.dimensions;\r\n break;\r\n\r\n case actionTypes.DOCS_LAYOUT_SET:\r\n const filters =\r\n action.payload.filters ||\r\n (yield select(s.docsLayoutFiltersSelector));\r\n const sorts =\r\n action.payload.sorts ||\r\n (yield select(s.docsLayoutSortsSelector));\r\n value.layout = {\r\n filters,\r\n sorts,\r\n };\r\n break;\r\n\r\n /* istanbul ignore next */\r\n default:\r\n console.warn(\r\n \"currentItemSaga.calcCurrentItem cannot handle action.type=\" +\r\n action.type\r\n );\r\n break;\r\n }\r\n\r\n yield put(\r\n saveCurrentItemAction({\r\n name,\r\n key,\r\n value,\r\n persist: shouldPersist(currentItemUri),\r\n })\r\n );\r\n } catch (e) {\r\n /* istanbul ignore next */\r\n console.warn(e);\r\n }\r\n}\r\n\r\nfunction* saveCurrentItem(action) {\r\n try {\r\n const {\r\n name,\r\n key,\r\n value: { layout, ...rest },\r\n persist,\r\n } = action.payload;\r\n // console.log(\"saveCurrentItem\", action.type, key, value);\r\n yield call(\r\n [persist ? viewStorage : cacheStorage, \"setItem\"],\r\n name,\r\n rest\r\n );\r\n yield call(\r\n [persist ? viewStorage : cacheStorage, \"setItem\"],\r\n key,\r\n layout\r\n );\r\n } catch (e) {\r\n /* istanbul ignore next */\r\n console.warn(e);\r\n }\r\n}\r\n\r\nexport function getKey(name, currentItemUri) {\r\n switch (name) {\r\n // doc* settings are global and not itemUri specific\r\n case \"document\":\r\n case \"docmodal\":\r\n // const folderItemUri = currentItemUri.substring(\r\n // 0,\r\n // currentItemUri.indexOf(\"@eid\")\r\n // );\r\n // return `${name}_${folderItemUri}`;\r\n return name;\r\n default:\r\n return `${name}_${currentItemUri}`;\r\n }\r\n}\r\n\r\nexport function getName(action, currentItemName) {\r\n let name;\r\n switch (action.type) {\r\n case actionTypes.CURRENTITEM_SET:\r\n case actionTypes.TOGGLES_PERSIST:\r\n name = action.payload.name;\r\n break;\r\n case actionTypes.DOCS_LAYOUT_SET:\r\n name = currentItemName;\r\n break;\r\n case actionTypes.SPLITPANES_PERSIST:\r\n name = action.payload.view;\r\n break;\r\n default:\r\n console.warn(\r\n \"currentItemSaga.getName cannot handle action.type=\" +\r\n action.type\r\n );\r\n return null;\r\n }\r\n return name;\r\n}\r\n\r\nfunction* currentItemSaga() {\r\n // this will reload settings from storage (and apply them) whenever CURRENTITEM changes\r\n yield takeEvery(actionTypes.CURRENTITEM_SET, loadSettings);\r\n // this will calculate the settings for the CURRENTITEM\r\n yield takeEvery(\r\n [\r\n //actionTypes.CURRENTITEM_SET,\r\n actionTypes.TOGGLES_PERSIST,\r\n actionTypes.SPLITPANES_PERSIST,\r\n actionTypes.DOCS_LAYOUT_SET,\r\n ],\r\n calcCurrentItem\r\n );\r\n // this will save settings in storage\r\n yield takeEvery(actionTypes.CURRENTITEM_SAVE, saveCurrentItem);\r\n}\r\n\r\nexport default currentItemSaga;\r\n","import { call, put, takeLatest, select, cancelled } from \"redux-saga/effects\";\r\nimport actionTypes from \"data/actions/actionTypes\";\r\nimport {\r\n getSearchResultAction,\r\n renameSearchFavoriteResultAction,\r\n getSearchFormResultAction,\r\n globalSearchDefaultResultAction,\r\n getSearchFormListResultAction,\r\n getSearchCountResultAction,\r\n togglesUpdateCounterAction,\r\n} from \"data/actions\";\r\nimport { SearchRequestType } from \"data/types\";\r\nimport {\r\n fetchSearchResult,\r\n fetchSearchFormList,\r\n fetchSearchForm,\r\n fetchSAYT,\r\n fetchSearchCount,\r\n} from \"data/api\";\r\nimport Constants from \"data/constants\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport immutable from \"object-path-immutable\";\r\n\r\n// fetches batch of results\r\nfunction* getSearchResult(action) {\r\n try {\r\n let count = 0;\r\n let status = Constants.LOADING;\r\n yield updateResultToggles(count, status);\r\n\r\n const result = yield call(\r\n fetchSearchResult,\r\n action.payload.searchRequest\r\n );\r\n\r\n status = Constants.OK;\r\n count = result.totalCount;\r\n yield updateResultToggles(count, status);\r\n\r\n yield put(\r\n getSearchResultAction({\r\n status,\r\n result,\r\n terms: [\r\n (\r\n action.payload.searchRequest\r\n .searchText /* istanbul ignore next */ || \"\"\r\n )\r\n .replace(/\\[[^\\s]+/g, \"\")\r\n .trim(),\r\n ],\r\n })\r\n );\r\n } catch (e) {\r\n yield put(\r\n getSearchResultAction({\r\n status: Constants.ERROR,\r\n error: /* istanbul ignore next */ e.data || e.message,\r\n })\r\n );\r\n }\r\n}\r\n\r\nexport function* getSearchCountResult(action) {\r\n // https://decembersoft.com/posts/redux-saga-abort-controller-cancel-api-calls/\r\n const abortController = new AbortController();\r\n try {\r\n const result = yield call(\r\n fetchSearchCount,\r\n action.payload.searchRequest,\r\n abortController.signal\r\n );\r\n\r\n yield put(\r\n getSearchCountResultAction({\r\n status: Constants.OK,\r\n result,\r\n })\r\n );\r\n } catch (e) {\r\n yield put(\r\n getSearchCountResultAction({\r\n status: Constants.ERROR,\r\n message: e.message,\r\n })\r\n );\r\n } finally {\r\n if (yield cancelled()) {\r\n // console.log(\"getDocs cancelled\");\r\n // Cancel the API call if the saga was cancelled\r\n abortController.abort();\r\n }\r\n }\r\n}\r\n\r\nfunction* renameSearchFavorite(action) {\r\n const searchRequest = yield select(s.searchRequestSelector);\r\n // TODO searchFavorite rename existing\r\n if (\r\n searchRequest.searchType !== SearchRequestType.Favorite ||\r\n searchRequest.isCustom\r\n ) {\r\n yield put(\r\n renameSearchFavoriteResultAction({\r\n status: Constants.OK,\r\n message: \"\",\r\n searchRequest: immutable.set(\r\n searchRequest,\r\n \"name\",\r\n action.payload.name\r\n ),\r\n })\r\n );\r\n }\r\n}\r\n\r\nfunction* updateResultToggle(name, result, status) {\r\n yield put(\r\n togglesUpdateCounterAction({\r\n name,\r\n counts: { result },\r\n status: { result: status },\r\n })\r\n );\r\n}\r\n\r\nfunction* updateResultToggles(count, status) {\r\n yield updateResultToggle(\"searchresult\", count, status);\r\n yield updateResultToggle(\"search\", count, status);\r\n}\r\n\r\nfunction* resetSearch() {\r\n yield updateResultToggles(-1, Constants.OK);\r\n}\r\n\r\nfunction* updateSearchFormToggles(counts, status) {\r\n yield put(\r\n togglesUpdateCounterAction({\r\n name: \"forms\",\r\n counts,\r\n status,\r\n })\r\n );\r\n yield put(\r\n togglesUpdateCounterAction({\r\n name: \"search\",\r\n counts: {\r\n forms: counts,\r\n },\r\n status: {\r\n forms: status,\r\n },\r\n })\r\n );\r\n}\r\n\r\nfunction* getSearchFormList(action) {\r\n try {\r\n yield updateSearchFormToggles(-1, Constants.LOADING);\r\n const result = yield call(fetchSearchFormList);\r\n yield updateSearchFormToggles(result.length, Constants.OK);\r\n yield put(\r\n getSearchFormListResultAction({\r\n status: Constants.OK,\r\n result,\r\n })\r\n );\r\n } catch (e) {\r\n yield put(\r\n getSearchFormListResultAction({\r\n status: Constants.ERROR,\r\n message: e.message,\r\n })\r\n );\r\n }\r\n}\r\n\r\nfunction* getSearchForm(action) {\r\n try {\r\n const result = yield call(\r\n fetchSearchForm,\r\n action.payload.id,\r\n action.payload.model\r\n );\r\n\r\n yield put(\r\n getSearchFormResultAction({\r\n status: Constants.OK,\r\n result,\r\n })\r\n );\r\n } catch (e) {\r\n yield put(\r\n getSearchFormResultAction({\r\n status: Constants.ERROR,\r\n message: e.message,\r\n })\r\n );\r\n }\r\n}\r\n\r\nfunction* getGlobalDefault(action) {\r\n try {\r\n const result = yield call(fetchSAYT);\r\n yield put(\r\n globalSearchDefaultResultAction({\r\n status: Constants.OK,\r\n options: result,\r\n })\r\n );\r\n } catch (e) {\r\n yield put(\r\n globalSearchDefaultResultAction({\r\n status: Constants.ERROR,\r\n message: e.message,\r\n })\r\n );\r\n }\r\n}\r\n\r\nfunction* searchSaga() {\r\n yield takeLatest(actionTypes.SEARCH_FETCH_REQUEST, getSearchResult);\r\n yield takeLatest(actionTypes.SEARCH_COUNT_REQUEST, getSearchCountResult);\r\n yield takeLatest(\r\n actionTypes.SEARCH_FAVRENAME_REQUEST,\r\n renameSearchFavorite\r\n );\r\n yield takeLatest(actionTypes.SEARCH_FORM_FETCH_REQUEST, getSearchForm);\r\n yield takeLatest(\r\n actionTypes.GLOBALDEFAULTSEARCH_FETCH_REQUEST,\r\n getGlobalDefault\r\n );\r\n yield takeLatest(\r\n actionTypes.SEARCH_FORM_LIST_FETCH_REQUEST,\r\n getSearchFormList\r\n );\r\n yield takeLatest(actionTypes.SEARCH_RESET, resetSearch);\r\n}\r\n\r\nexport default searchSaga;\r\n","import {\r\n call,\r\n put,\r\n take,\r\n actionChannel,\r\n race,\r\n flush,\r\n cancelled,\r\n} from \"redux-saga/effects\";\r\nimport { buffers } from \"redux-saga\";\r\nimport actionTypes from \"data/actions/actionTypes\";\r\nimport { docThumbnailResultAction } from \"data/actions\";\r\nimport { fetchThumbnail } from \"data/api\";\r\nimport Constants from \"data/constants\";\r\n\r\nfunction* thumbnailsSaga() {\r\n // 1- Create a channel for request actions\r\n const requestChan = yield actionChannel(\r\n actionTypes.DOCS_THUMBNAIL_REQUEST,\r\n buffers.expanding()\r\n );\r\n while (true) {\r\n // 2- take from the channel\r\n const { payload } = yield take(requestChan);\r\n\r\n // support cancellation\r\n // https://github.com/redux-saga/redux-saga/issues/1046\r\n // eslint-disable-next-line\r\n const { task, cancel } = yield race({\r\n task: call(getThumbnail, payload),\r\n cancel: take(actionTypes.CURRENTITEM_SET),\r\n });\r\n\r\n /* istanbul ignore next */\r\n if (cancel !== undefined) {\r\n yield flush(requestChan);\r\n // Don't need these actions, do nothing.\r\n }\r\n }\r\n}\r\n\r\nexport function* getThumbnail(payload) {\r\n // https://decembersoft.com/posts/redux-saga-abort-controller-cancel-api-calls/\r\n const abortController = new AbortController();\r\n\r\n try {\r\n const result = yield call(\r\n fetchThumbnail,\r\n payload.itemUri,\r\n abortController.signal\r\n );\r\n\r\n yield put(\r\n docThumbnailResultAction({\r\n itemUri: payload.itemUri,\r\n status: Constants.OK,\r\n result,\r\n })\r\n );\r\n } catch (e) {\r\n yield put(\r\n docThumbnailResultAction({\r\n itemUri: payload.itemUri,\r\n status: Constants.ERROR,\r\n message: e.message,\r\n })\r\n );\r\n } finally {\r\n if (yield cancelled()) {\r\n // Cancel the API call if the saga was cancelled\r\n abortController.abort();\r\n }\r\n }\r\n}\r\n\r\nexport default thumbnailsSaga;\r\n","import { all, call, take, put, cancelled, select } from \"redux-saga/effects\";\r\nimport { channel, eventChannel, buffers, delay } from \"redux-saga\";\r\nimport { serverEventAction } from \"data/actions\";\r\nimport { actions as networkActions } from \"redux-saga-network-status\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport { HubConnection, HubConnectionBuilder } from \"@microsoft/signalr\";\r\nimport { get } from \"data/constants\";\r\nimport { CustomHttpHeader } from \"data/types\";\r\nimport { JL } from \"jsnlog\";\r\n\r\nconst _log = JL(\"Notifications\");\r\nconst actionChannel = channel();\r\n\r\nfunction createSocket(\r\n accessToken: string,\r\n correlationId: string\r\n): HubConnection {\r\n return new HubConnectionBuilder()\r\n .withAutomaticReconnect({\r\n nextRetryDelayInMilliseconds: /*istanbul ignore next*/ (\r\n retryContext\r\n ) => {\r\n if (retryContext.elapsedMilliseconds < 60000) {\r\n // If we've been reconnecting for less than 60 seconds so far,\r\n // wait between 0 and 10 seconds before the next reconnect attempt.\r\n return Math.random() * 10000;\r\n } else {\r\n // If we've been reconnecting for more than 60 seconds so far, try only every 5mins\r\n return 1000 * 60 * 5;\r\n }\r\n },\r\n })\r\n .configureLogging(\"warn\")\r\n .withUrl(\r\n get(\r\n window.CONFIG,\r\n [\"notificationsUrl\", \"global\"],\r\n \"/notifications/global\"\r\n ) +\r\n \"?correlationId=\" +\r\n encodeURIComponent(correlationId),\r\n {\r\n // https://docs.microsoft.com/en-us/aspnet/core/signalr/configuration?view=aspnetcore-5.0&tabs=dotnet#configure-bearer-authentication\r\n accessTokenFactory: /*istanbul ignore next*/ () => accessToken,\r\n headers: {\r\n [CustomHttpHeader.CorrelationId]: correlationId,\r\n },\r\n }\r\n )\r\n .build();\r\n}\r\n\r\nfunction signalChannel(connection) {\r\n return eventChannel((emit) => {\r\n const pingUrl = `${window.CONFIG.host.basename}/ping`;\r\n // https://docs.microsoft.com/en-us/aspnet/signalr/overview/guide-to-the-api/hubs-api-guide-javascript-client#how-to-handle-connection-lifetime-events\r\n connection.on(\"ReceiveMessage\", emit);\r\n connection.onreconnecting(\r\n /*istanbul ignore next*/ (error) => {\r\n actionChannel.put(networkActions.ping(pingUrl));\r\n _log.warn(() => ({\r\n msg: \"SignalR reconnecting\",\r\n error,\r\n }));\r\n }\r\n );\r\n connection.onreconnected(\r\n /*istanbul ignore next*/ (connectionId) => {\r\n actionChannel.put(networkActions.ping(pingUrl));\r\n _log.warn(() => ({\r\n msg: \"SignalR reconnected with connectionId\",\r\n connectionId,\r\n }));\r\n }\r\n );\r\n connection.onclose(\r\n /*istanbul ignore next*/ (error) => {\r\n actionChannel.put(networkActions.ping(pingUrl));\r\n _log.warn(() => ({\r\n msg: \"SignalR connection closed\",\r\n error,\r\n }));\r\n }\r\n );\r\n // cleanup when channel closes\r\n return /*istanbul ignore next*/ () =>\r\n connection &&\r\n typeof connection.close === \"function\" &&\r\n connection.close();\r\n }, buffers.expanding());\r\n}\r\n\r\n/* istanbul ignore next*/\r\nfunction* getToken() {\r\n // try for max. 1sec * 30\r\n for (let i = 0; i < 30; i++) {\r\n const accessToken = yield select(s.loginAccessTokenSelector);\r\n if (accessToken != null) return accessToken;\r\n else yield call(delay, 1000);\r\n }\r\n _log.warn(\r\n () => \"Cannot retrieve user token; no server pushed notifications!\"\r\n );\r\n // throw new Error(\"Cannot retrieve token\")\r\n return null;\r\n}\r\n\r\nfunction* notificationLoop(chan) {\r\n while (true) {\r\n try {\r\n // wait for incoming message\r\n const message = yield take(chan);\r\n // console.log(\"signalR message: \", message);\r\n // publish to Redux store for further handling\r\n yield put(serverEventAction(message));\r\n } finally {\r\n /* istanbul ignore if */\r\n if (yield cancelled()) {\r\n chan.close();\r\n }\r\n }\r\n }\r\n}\r\n\r\n/* istanbul ignore next */\r\nfunction* actionLoop() {\r\n while (true) {\r\n const action = yield take(actionChannel);\r\n yield put(action);\r\n }\r\n}\r\n\r\nexport default function* notificationsSaga() {\r\n // create a SignalR connection socket\r\n try {\r\n // get user's token\r\n const accessToken = yield call(getToken);\r\n // no token? no game\r\n /* istanbul ignore next */\r\n if (accessToken == null) {\r\n throw new Error(\"No Access Token\");\r\n }\r\n const correlationId = yield select(s.userCorrelationIdSelector);\r\n const connection = yield call(createSocket, accessToken, correlationId);\r\n // create our Redux-Saga channel and register for client-side methods\r\n const chan = yield call(signalChannel, connection);\r\n\r\n // start listening\r\n connection\r\n .start()\r\n .then(\r\n /*istanbul ignore next*/ (result) =>\r\n _log.info(() => \"SignalR Connected!\")\r\n )\r\n .catch(\r\n /*istanbul ignore next*/ (e) => {\r\n throw e;\r\n }\r\n );\r\n\r\n yield all([notificationLoop(chan), actionLoop()]);\r\n } catch (e) {\r\n /* istanbul ignore next */\r\n _log.fatalException(() => \"SignalR Connection failed: \", e);\r\n }\r\n}\r\n","import { call, take, actionChannel, select, put } from \"redux-saga/effects\";\r\nimport { toast } from \"react-toastify\";\r\nimport {\r\n userLanguageSelector,\r\n settingValueSelector,\r\n} from \"data/reducers/selectors\";\r\nimport actionTypes from \"data/actions/actionTypes\";\r\nimport { notificationUpsertAction } from \"data/actions\";\r\nimport { Toast, RoutedToast } from \"data/toast\";\r\nimport { NotificationType } from \"data/types\";\r\nimport { buffers } from \"redux-saga\";\r\nimport Icons from \"@hs/icons\";\r\n\r\nfunction* triggerNotificationAPI({ message, handleClick, autoClose, icon }) {\r\n const lang = yield select(userLanguageSelector);\r\n const notification = new Notification(message, {\r\n dir: \"auto\",\r\n lang,\r\n icon: icon\r\n ? `${window.CONFIG.host.basename}/__notification/${icon}.png`\r\n : undefined,\r\n });\r\n /* istanbul ignore else */\r\n if (handleClick) {\r\n notification.addEventListener(\"click\", handleClick);\r\n }\r\n /* istanbul ignore else */\r\n if (autoClose) {\r\n setTimeout(notification.close.bind(notification), autoClose);\r\n }\r\n return notification;\r\n}\r\n\r\nfunction triggerReactToastify({\r\n icon,\r\n message,\r\n details,\r\n handleClick,\r\n style,\r\n isRouted,\r\n className,\r\n toastId,\r\n autoClose,\r\n position,\r\n}) {\r\n const Component = isRouted ? RoutedToast : Toast;\r\n const toastOptions = {\r\n type: style,\r\n className,\r\n toastId,\r\n autoClose,\r\n position,\r\n theme: \"colored\",\r\n icon: icon && ,\r\n };\r\n\r\n Object.keys(toastOptions).forEach((key) =>\r\n toastOptions[key] === undefined ? delete toastOptions[key] : {}\r\n );\r\n\r\n toast(\r\n ,\r\n toastOptions\r\n );\r\n}\r\n\r\nfunction* toastSaga() {\r\n const channel = yield actionChannel(\r\n actionTypes.NOTIFICATION_TOAST,\r\n buffers.expanding()\r\n );\r\n\r\n while (true) {\r\n const { payload } = yield take(channel);\r\n const notificationType = yield select((state) =>\r\n settingValueSelector(\"notificationType\", state)\r\n );\r\n let toast = payload.toast;\r\n if (notificationType === NotificationType.API) {\r\n // Update toast property with notification reference to close notification\r\n toast = yield call(triggerNotificationAPI, {\r\n ...payload.toast,\r\n message: payload.message,\r\n icon: payload.icon,\r\n });\r\n } else {\r\n triggerReactToastify({\r\n ...payload.toast,\r\n toastId: payload.notificationId,\r\n message: payload.message,\r\n style: payload.style,\r\n icon: payload.icon,\r\n });\r\n }\r\n yield put(notificationUpsertAction({ ...payload, toast }));\r\n }\r\n}\r\n\r\nexport default toastSaga;\r\n","import { buffers } from \"redux-saga\";\r\nimport {\r\n actionChannel,\r\n all,\r\n call,\r\n flush,\r\n fork,\r\n put,\r\n race,\r\n select,\r\n takeLatest,\r\n takeEvery,\r\n take,\r\n} from \"redux-saga/effects\";\r\nimport actionTypes from \"data/actions/actionTypes\";\r\nimport { dispatch } from \"data/storeHelper\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport { CommandActionStatusFlag } from \"data/types\";\r\nimport {\r\n commandActionQueueAddAction,\r\n commandActionQueueRemoveAction,\r\n commandActionRemoveAction,\r\n commandActionItemStatusAction,\r\n commandActionStatusAction,\r\n commandActionLogAction,\r\n notificationUpsertAction,\r\n notificationDelAction,\r\n notificationToastAction,\r\n} from \"data/actions\";\r\nimport { commandActionRequestSelector } from \"data/reducers/selectors\";\r\nimport { actionMappings } from \"components/CommandActions\";\r\nimport loc from \"i18next\";\r\nimport { toastTypes } from \"data/toast\";\r\nimport { JL } from \"data/logging\";\r\n\r\nconst log = JL(\"commandActionSaga\");\r\n\r\nfunction* handleCommandActionRequest({ payload }) {\r\n const { guid, commandAction, props } = payload;\r\n const actionHandler = new actionMappings[commandAction]();\r\n\r\n log.info(() => ({\r\n msg: \"Handle CommandAction request\",\r\n payload,\r\n actionHandler,\r\n }));\r\n\r\n if (props.multiple && actionHandler.queueMultiple) {\r\n log.info(() => ({\r\n msg: \"Add commandAction to queue\",\r\n commandAction,\r\n guid,\r\n }));\r\n yield put(\r\n notificationUpsertAction({\r\n notificationId: guid,\r\n message: loc.t(`commandAction:${commandAction}.queued`, {\r\n count: payload.items.length,\r\n name: payload.items?.map((i) => i.name).join(\", \"),\r\n }),\r\n })\r\n );\r\n for (let item of payload?.items) {\r\n yield put(\r\n commandActionQueueAddAction({\r\n guid,\r\n commandAction,\r\n actionHandler,\r\n props: { ...props, ...item },\r\n })\r\n );\r\n yield put(\r\n commandActionItemStatusAction(\r\n guid,\r\n item.itemUri,\r\n Constants.LOADING,\r\n true\r\n )\r\n );\r\n }\r\n } else {\r\n yield executeCommandAction({\r\n payload: {\r\n commandAction,\r\n actionHandler,\r\n context: {\r\n dispatch,\r\n ...props,\r\n },\r\n guid,\r\n },\r\n });\r\n yield put(commandActionRemoveAction(guid));\r\n }\r\n}\r\n\r\nfunction getToastType(status) {\r\n switch (true) {\r\n case (status & CommandActionStatusFlag.Success) > 0:\r\n return toastTypes.success;\r\n case (status & CommandActionStatusFlag.Partial) > 0:\r\n return toastTypes.partial;\r\n default:\r\n return toastTypes.failure;\r\n }\r\n}\r\n\r\nfunction getToastMessage(commandAction, status) {\r\n let state = \"failure\";\r\n switch (true) {\r\n case (status & CommandActionStatusFlag.Success) > 0:\r\n state = \"success\";\r\n break;\r\n case (status & CommandActionStatusFlag.Partial) > 0:\r\n state = \"partial\";\r\n break;\r\n default:\r\n break;\r\n }\r\n return loc.t(`commandAction:${commandAction.commandAction}.${state}`, {\r\n count: commandAction.items.length,\r\n ok: commandAction.items.filter((i) => i.status === Constants.OK).length,\r\n error: commandAction.items.filter((i) => i.status === Constants.ERROR)\r\n .length,\r\n name: commandAction.items.map((i) => i.name).join(\", \"),\r\n });\r\n}\r\n\r\nfunction* updateCommandActionStatus({ payload }) {\r\n const commandAction = (yield select((state) =>\r\n commandActionRequestSelector(state, payload.guid)\r\n ))?.[0];\r\n if (commandAction == null) {\r\n log.warn(() => ({\r\n msg: \"Cannot update CommandAction Status\",\r\n payload,\r\n }));\r\n return;\r\n }\r\n log.info(() => ({\r\n msg: \"updateCommandActionStatus\",\r\n commandAction,\r\n payload,\r\n }));\r\n let status = CommandActionStatusFlag.NotSet;\r\n if (commandAction?.items?.some((i) => i.status === Constants.ERROR))\r\n status |= CommandActionStatusFlag.Error;\r\n if (commandAction?.items?.every((i) => i.status !== Constants.LOADING)) {\r\n status |= CommandActionStatusFlag.Done;\r\n if (commandAction?.items?.every((i) => i.status === Constants.OK)) {\r\n status |= CommandActionStatusFlag.Success;\r\n yield put(commandActionRemoveAction(payload.guid));\r\n } else if (\r\n !commandAction?.items?.every((i) => i.status === Constants.ERROR)\r\n )\r\n status |= CommandActionStatusFlag.Partial;\r\n log.info(() => ({\r\n msg: \"Command Action queue completed\",\r\n guid: payload.guid,\r\n commandAction,\r\n }));\r\n yield put(\r\n notificationToastAction({\r\n ...getToastType(status),\r\n notificationId: payload.guid,\r\n log: commandAction.log,\r\n message: getToastMessage(commandAction, status),\r\n })\r\n );\r\n } else {\r\n if (commandAction?.items?.some((i) => i.status !== Constants.LOADING))\r\n status |= CommandActionStatusFlag.Partial;\r\n status |= CommandActionStatusFlag.Loading;\r\n }\r\n yield put(commandActionStatusAction(payload.guid, status, true));\r\n}\r\n\r\nfunction* handleQueueRequest(payload, channel) {\r\n log.info(() => ({\r\n msg: \"handleQueueRequest\",\r\n payload,\r\n }));\r\n const { guid, actionHandler, commandAction, props } = payload;\r\n const context = {\r\n dispatch,\r\n ...props,\r\n };\r\n actionHandler.logger = (success, identifier, context) =>\r\n dispatch(\r\n commandActionLogAction(guid, {\r\n timestamp: Date.now(),\r\n status: success ? Constants.OK : Constants.ERROR,\r\n message: loc.t(\r\n `${identifier}.${success ? \"success\" : \"failure\"}`,\r\n context\r\n ),\r\n details: {\r\n ...props,\r\n commandAction: commandAction.commandAction,\r\n },\r\n })\r\n );\r\n log.info(() => ({\r\n msg: \"Update actionHandler.logger to log current details\",\r\n actionHandler,\r\n context,\r\n }));\r\n const itemStatus = yield executeCommandAction({\r\n payload: { actionHandler, commandAction, context, guid },\r\n });\r\n yield put(\r\n commandActionItemStatusAction(guid, props.itemUri, itemStatus, true)\r\n );\r\n}\r\n\r\nfunction* executeCommandAction({ payload }): ConstantsEnum {\r\n const { actionHandler, commandAction, context, guid } = payload;\r\n log.info(() => ({\r\n msg: `Execute commandAction \"${commandAction}\"`,\r\n actionHandler,\r\n context,\r\n }));\r\n const shouldExecute =\r\n typeof actionHandler?.render !== \"function\" ||\r\n !actionHandler?.shouldRender ||\r\n (yield call(actionHandler.render, context));\r\n if (!shouldExecute || typeof actionHandler?.execute !== \"function\") {\r\n yield put(commandActionQueueRemoveAction(guid));\r\n return Constants.OK;\r\n }\r\n let itemStatus = Constants.LOADING;\r\n try {\r\n const result = yield call(actionHandler.execute, context);\r\n if (typeof actionHandler?.report === \"function\")\r\n yield call(actionHandler.report, result, context);\r\n itemStatus = result ? Constants.OK : Constants.ERROR;\r\n log.info(() => ({\r\n msg: `Executed commandAction \"${commandAction}\"`,\r\n actionHandler,\r\n context,\r\n result,\r\n itemStatus,\r\n }));\r\n } catch (error) {\r\n itemStatus = Constants.ERROR;\r\n log.error(() => ({\r\n msg: `Error while executing commandAction \"${commandAction}\"`,\r\n actionHandler,\r\n context,\r\n error,\r\n itemStatus,\r\n }));\r\n }\r\n return itemStatus;\r\n}\r\n\r\nfunction* abortCommandAction({ payload }, channel) {\r\n yield flush(channel);\r\n yield put(\r\n commandActionStatusAction(\r\n payload.guid,\r\n CommandActionStatusFlag.Done | CommandActionStatusFlag.Partial,\r\n true\r\n )\r\n );\r\n yield rebuildQueue();\r\n}\r\n\r\nfunction* removeCommandAction({ payload }, channel) {\r\n channel && (yield flush(channel));\r\n yield put(commandActionRemoveAction(payload.guid));\r\n yield put(notificationDelAction(payload.guid));\r\n yield rebuildQueue();\r\n}\r\n\r\nfunction* handleCommandActionQueueAction(action, payload, channel) {\r\n switch (action?.type) {\r\n case actionTypes.COMMANDACTION_ABORT:\r\n yield call(abortCommandAction, action, channel);\r\n break;\r\n case actionTypes.COMMANDACTION_QUEUE_REMOVE:\r\n yield call(removeCommandAction, action, channel);\r\n break;\r\n case actionTypes.COMMANDACTION_QUEUE_PAUSE:\r\n yield call(pauseQueue, payload, channel);\r\n break;\r\n default:\r\n // Continue with requests\r\n break;\r\n }\r\n}\r\n\r\nfunction* pauseQueue(payload, channel) {\r\n // Re-add to queue (since we paused)\r\n yield put(commandActionQueueAddAction(payload));\r\n // Wait for command to continue queue\r\n const action = (yield race([\r\n take(actionTypes.COMMANDACTION_ABORT),\r\n take(actionTypes.COMMANDACTION_QUEUE_REMOVE),\r\n take(actionTypes.COMMANDACTION_QUEUE_START),\r\n ])).find((a) => a != null);\r\n yield call(handleCommandActionQueueAction, action, channel);\r\n}\r\n\r\nfunction* rebuildQueue() {\r\n const requests = (yield select(commandActionRequestSelector)).filter(\r\n (req) => req.status === CommandActionStatusFlag.Loading\r\n );\r\n if (requests.length === 0) return;\r\n log.info(() => ({\r\n msg: \"rebuildQueue\",\r\n requests,\r\n }));\r\n for (let payload of requests) {\r\n yield call(handleCommandActionRequest, { payload });\r\n }\r\n}\r\n\r\nfunction* watchCommandActionQueue() {\r\n const channel = yield actionChannel(\r\n actionTypes.COMMANDACTION_QUEUE_ADD,\r\n buffers.expanding()\r\n );\r\n while (true) {\r\n const { payload } = yield take(channel);\r\n const action = (yield race([\r\n call(handleQueueRequest, payload, channel),\r\n take(actionTypes.COMMANDACTION_ABORT),\r\n take(actionTypes.COMMANDACTION_QUEUE_REMOVE),\r\n take(actionTypes.COMMANDACTION_QUEUE_PAUSE),\r\n ])).find((a) => a != null);\r\n log.info(() => ({\r\n msg: \"watchCommandActionQueue\",\r\n action,\r\n payload,\r\n }));\r\n yield call(handleCommandActionQueueAction, action, payload, channel);\r\n }\r\n}\r\n\r\nfunction* commandActionSaga() {\r\n yield all([\r\n // listen for command action requests\r\n takeLatest(\r\n actionTypes.COMMANDACTION_REQUEST,\r\n handleCommandActionRequest\r\n ),\r\n // listen for command action item status changes\r\n takeEvery(\r\n actionTypes.COMMANDACTION_ITEM_STATUS,\r\n updateCommandActionStatus\r\n ),\r\n // watch Command Action Queue\r\n fork(watchCommandActionQueue),\r\n ]);\r\n}\r\n\r\nexport default commandActionSaga;\r\n","import { all, fork } from \"redux-saga/effects\";\r\nimport offlineSaga, { checkServerConnectivity } from \"./offlineSaga\";\r\nimport userSaga from \"./userSaga\";\r\nimport favoritesSaga from \"./favoritesSaga\";\r\nimport cardsSaga from \"./cardsSaga\";\r\nimport workflowSaga from \"./workflowSaga\";\r\nimport treeSaga from \"./treeSaga\";\r\nimport docsSaga from \"./docsSaga\";\r\nimport docsLayoutSaga from \"./docsLayoutSaga\";\r\nimport currentItemSaga from \"./currentItemSaga\";\r\nimport searchSaga from \"./searchSaga\";\r\nimport thumbnailsSaga from \"./thumbnailsSaga\";\r\nimport watchNetworkStatus from \"redux-saga-network-status\";\r\nimport notificationsSaga from \"./notificationsSaga\";\r\nimport toastSaga from \"./toastSaga\";\r\nimport commandActionSaga from \"./commandActionSaga\";\r\n\r\nexport default function* rootSaga() {\r\n yield all([\r\n fork(watchNetworkStatus),\r\n fork(checkServerConnectivity),\r\n fork(offlineSaga),\r\n fork(userSaga),\r\n fork(cardsSaga),\r\n fork(workflowSaga),\r\n fork(favoritesSaga),\r\n fork(treeSaga),\r\n fork(docsSaga),\r\n fork(docsLayoutSaga),\r\n fork(currentItemSaga),\r\n fork(searchSaga),\r\n fork(thumbnailsSaga),\r\n fork(notificationsSaga),\r\n fork(toastSaga),\r\n fork(commandActionSaga),\r\n ]);\r\n}\r\n\r\nexport function* localRootSaga() {\r\n yield all([\r\n fork(watchNetworkStatus),\r\n fork(checkServerConnectivity),\r\n fork(favoritesSaga),\r\n fork(treeSaga),\r\n fork(docsSaga),\r\n fork(docsLayoutSaga),\r\n fork(currentItemSaga),\r\n fork(searchSaga),\r\n fork(thumbnailsSaga),\r\n fork(toastSaga),\r\n fork(commandActionSaga),\r\n ]);\r\n}\r\n","// @flow\r\nimport React from \"react\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport HelpBlock from \"react-bootstrap/lib/HelpBlock\";\r\nimport Icons from \"@hs/icons\";\r\nimport { getLocalizedText } from \"data/utils\";\r\nimport { type ItemActionConfig } from \"data/types\";\r\nimport styles from \"./ItemAction.module.css\";\r\n\r\nconst ItemAction = ({\r\n action,\r\n onAction,\r\n}: {\r\n action: ItemActionConfig,\r\n onAction: (action: ItemActionConfig) => void,\r\n}) => (\r\n
\r\n onAction(action)}\r\n className={styles.button}\r\n >\r\n {\" \"}\r\n {getLocalizedText(action.name) || \"N/A\"}\r\n \r\n {action.desc && (\r\n \r\n {getLocalizedText(action.desc)}\r\n \r\n )}\r\n
\r\n);\r\nItemAction.displayName = \"ActionPanel.ItemAction\";\r\nexport default ItemAction;\r\n","// @flow\r\nimport React, { useMemo, useCallback } from \"react\";\r\nimport Icons from \"@hs/icons\";\r\nimport {\r\n GridListConstant,\r\n DocListColumnType,\r\n type DocColumnResultDTO,\r\n type DocListLayout,\r\n} from \"data/types\";\r\nimport ValueFactory from \"components/Attributes/SummaryAttribute/ValueFactory\";\r\nimport styles from \"./RowResultByLayout.module.css\";\r\nimport { getClassNames } from \"data/utils\";\r\n\r\ntype Props = {\r\n /** CSS styles to apply */\r\n style?: StyleSheet,\r\n /** the row object */\r\n row: Object,\r\n /** row index */\r\n index: number,\r\n /** requested layout */\r\n layout?: DocListLayout,\r\n /** all the columns */\r\n cols: Array,\r\n /** whether row should be marked as selected */\r\n isSelected: boolean,\r\n /** callback when user single clicks the whole row\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n * @param {string} itemUri the row's itemUri\r\n * @param {number} index the row's index\r\n */\r\n onSingleClick?: (\r\n e: SyntheticMouseEvent,\r\n itemUri: string,\r\n index: number\r\n ) => void,\r\n};\r\n\r\n/**\r\n * Render one document row in \"Simple\" layout mode\r\n */\r\nconst RowResultByLayout = ({\r\n style,\r\n row,\r\n index,\r\n layout,\r\n cols,\r\n isSelected,\r\n onSingleClick,\r\n}: Props) => {\r\n const itemUri = useMemo(() => row[row.length - 1], [row]);\r\n // map requested columns (layout.cols) to existing ones (cols)\r\n const colIndexes = useMemo(() => {\r\n let result = [];\r\n if (layout && layout.cols) {\r\n layout.cols.forEach((colName) => {\r\n const colIdx = cols.findIndex((col) => col.name === colName);\r\n /* istanbul ignore if */\r\n if (colIdx === -1) {\r\n console.warn(\r\n \"RowResultByLayout: Cannot find column named: \" +\r\n colName\r\n );\r\n } else {\r\n result.push(colIdx);\r\n }\r\n });\r\n } else {\r\n // show a reasonable default - icon, name\r\n const extensionColIndex = cols.findIndex(\r\n (col) => col.name === GridListConstant.ExtensionIcon\r\n );\r\n if (extensionColIndex !== -1) result.push(extensionColIndex);\r\n let nameColIndex = cols.findIndex(\r\n (col) => col.type === DocListColumnType.WebDavName\r\n );\r\n // FlatAUs do not have any Name columns\r\n if (nameColIndex === -1) nameColIndex = 0;\r\n result.push(nameColIndex);\r\n }\r\n return result;\r\n }, [layout, cols]);\r\n const _onSingleClick = useCallback(\r\n (e: SyntheticMouseEvent<*>) => {\r\n e.stopPropagation();\r\n\r\n /* istanbul ignore else */\r\n if (typeof onSingleClick === \"function\")\r\n onSingleClick(e, itemUri, index);\r\n },\r\n [onSingleClick, itemUri, index]\r\n );\r\n\r\n return (\r\n \r\n {colIndexes.map((colIndex, colNameIndex) => {\r\n switch (cols[colIndex].name) {\r\n case GridListConstant.ExtensionIcon:\r\n return (\r\n \r\n \r\n \r\n );\r\n default:\r\n let value = row[colIndex];\r\n if (\r\n Object.prototype.hasOwnProperty.call(value, \"$type\")\r\n ) {\r\n value = (\r\n \r\n );\r\n }\r\n return (\r\n 2\r\n ? styles.lastcell\r\n : \"\"\r\n )}\r\n style={{\r\n width: cols[colIndex].width,\r\n textAlign: [\r\n \"LongValue\",\r\n \"IntValue\",\r\n ].includes(cols[colIndex].type)\r\n ? \"right\"\r\n : \"left\",\r\n }}\r\n >\r\n {value}\r\n \r\n );\r\n }\r\n })}\r\n \r\n );\r\n};\r\n\r\nRowResultByLayout.displayName = \"DocListSimple.RowResultByLayout\";\r\nRowResultByLayout.defaultProps = {\r\n isSelected: false,\r\n};\r\nexport default RowResultByLayout;\r\n","import React from \"react\";\r\nimport Icons from \"@hs/icons\";\r\nimport Thumbnail from \"components/DocListSimple/Thumbnail\";\r\nimport NoData from \"components/NoData\";\r\nimport styles from \"./itemView_docListGallery.module.css\";\r\nimport { useSwipeable } from \"react-swipeable\";\r\n\r\nconst Thumbs = ({ result, onClick }) =>\r\n Object.keys(result.rows).map((key, index) => {\r\n const name = result.rows[key][1]; //hopefully it's always at that position ;)\r\n const itemUri = result.rows[key][result.cols.length - 1];\r\n return (\r\n onClick(itemUri)}\r\n >\r\n \r\n \r\n );\r\n });\r\nThumbs.displayName = \"ItemView_DocListGallery.Thumbs\";\r\n\r\nconst ItemView_DocListGallery = ({ result, onClick }) => {\r\n const stripRef = React.useRef();\r\n const goLeft = /*istanbul ignore next*/ () =>\r\n (stripRef.current.scrollLeft -= 80);\r\n const goRight = /*istanbul ignore next*/ () =>\r\n (stripRef.current.scrollLeft += 80);\r\n const handlers = useSwipeable({\r\n onSwipeLeft: goLeft,\r\n onSwipeRight: goRight,\r\n });\r\n\r\n if (result && result.rows && result.rowCount > 0) {\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 }\r\n\r\n return ;\r\n};\r\nItemView_DocListGallery.displayName = \"ItemViews.DocListGallery\";\r\nexport default ItemView_DocListGallery;\r\n","import React, { useState } from \"react\";\r\nimport { useAsync } from \"hooks\";\r\nimport Constants from \"data/constants\";\r\nimport { fetchDocs } from \"data/api\";\r\nimport Status from \"components/Status\";\r\nimport CountBadge from \"components/CountBadge\";\r\nimport ViewModes from \"components/FilterBar/ViewModes\";\r\nimport {\r\n ListViewMode,\r\n type ItemActionViewConfig,\r\n type ItemActionConfig,\r\n} from \"data/types\";\r\nimport styles from \"./itemView_docList.module.css\";\r\nimport DocListSimple from \"components/DocListSimple\";\r\nimport RowResultByLayout from \"components/DocListSimple/RowResultByLayout\";\r\nimport Divider from \"components/Divider\";\r\nimport ItemViewDocListGallery from \"./itemView_docListGallery\";\r\n\r\ntype ItemActionViewDocListConfig = ItemActionViewConfig & {\r\n viewMode?: ListViewModeEnum,\r\n layout?: DocListLayout,\r\n};\r\n\r\n/**\r\n * shows a doclist view for a folder\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n */\r\nconst ItemView_DocList = ({\r\n itemUri,\r\n action,\r\n view,\r\n onItemUriAction,\r\n}: {\r\n itemUri: string,\r\n action: ItemActionConfig,\r\n view: ItemActionViewDocListConfig,\r\n onItemUriAction: (itemUri: string) => void,\r\n}) => {\r\n const [viewMode, setViewMode] = useState(\r\n view.viewMode || ListViewMode.List\r\n );\r\n\r\n // get documents\r\n const state = useAsync(async () => {\r\n try {\r\n const docs = await fetchDocs(\r\n itemUri,\r\n 0,\r\n view.layout && view.layout.sorts,\r\n view.layout && view.layout.filters,\r\n view.layout && view.layout.cols\r\n );\r\n return docs;\r\n } catch (err) {\r\n console.warn(\"Error while fetchDocs\", err);\r\n throw err;\r\n }\r\n }, [itemUri]);\r\n\r\n if (state.loading || state.error) {\r\n return (\r\n \r\n
\r\n {view.header}{\" \"}\r\n {state.loading && (\r\n \r\n )}\r\n {state.error && (\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 {view.header}\r\n \r\n
\r\n {state.value.rowCount > 0 && (\r\n \r\n setViewMode(viewMode)\r\n }\r\n />\r\n )}\r\n \r\n }\r\n >\r\n <>\r\n {viewMode === ListViewMode.List && (\r\n
\r\n \r\n console.warn(\r\n \"Paging is not supported for the ItemView_DocList!\"\r\n )\r\n }\r\n setSorting={\r\n /* istanbul ignore next */ () =>\r\n console.warn(\r\n \"Setting Sorting is not supported for the ItemView_DocList!\"\r\n )\r\n }\r\n layout={view.layout}\r\n requestShowFilter={\r\n /* istanbul ignore next */ () =>\r\n console.warn(\r\n \"Setting Filters is not supported for the ItemView_DocList!\"\r\n )\r\n }\r\n showThumbnails={false}\r\n showFilterbar={false} // cannot use Filters/Sorting due to centralized Redux store\r\n onSingleClick={\r\n /* istanbul ignore next */ (\r\n e,\r\n itemUri,\r\n index\r\n ) => onItemUriAction(itemUri)\r\n }\r\n />\r\n
\r\n )}\r\n {viewMode === ListViewMode.Thumbnails && (\r\n \r\n onItemUriAction(itemUri)\r\n }\r\n />\r\n )}\r\n \r\n \r\n );\r\n }\r\n};\r\n\r\nexport default ItemView_DocList;\r\n","import React from \"react\";\r\nimport Activities from \"containers/Activities\";\r\nimport { type ItemActionViewConfig, type ItemActionConfig } from \"data/types\";\r\n\r\ntype ItemActionViewActivityListConfig = ItemActionViewConfig & {\r\n /** whether this item is a Document or Folder */\r\n isDoc?: boolean,\r\n /** whether to allow adding notes\r\n * @default {boolean} false\r\n */\r\n showAddNote?: boolean,\r\n /** whether to show notes (comment) entries\r\n * @default {boolean} true\r\n */\r\n showNotes?: boolean,\r\n /** whether to show history entries\r\n * @default {boolean} false\r\n */\r\n showHistory?: boolean,\r\n /** whether to show retention info\r\n * @default {boolean} false\r\n */\r\n showRetentionInfo?: boolean,\r\n};\r\n\r\n/**\r\n * shows the ActivityList\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ formatId: number }} { formatId }\r\n * @param {{ action: ItemActionConfig }} { action }\r\n * @param {{ view: ItemActionViewActivityListConfig }} { view }\r\n * @param {{ onItemUriAction: (itemUri: string) => void }} { onItemUriAction }\r\n */\r\nconst ItemView_ActivityList = ({\r\n itemUri,\r\n formatId,\r\n action,\r\n view,\r\n onItemUriAction,\r\n}: {\r\n itemUri: string,\r\n formatId: number,\r\n action: ItemActionConfig,\r\n view: ItemActionViewActivityListConfig,\r\n onItemUriAction: (itemUri: string) => void,\r\n}) => (\r\n \r\n);\r\n\r\nItemView_ActivityList.displayName = \"ItemViews.ActivityList\";\r\nexport default ItemView_ActivityList;\r\n","import React from \"react\";\r\nimport { compose } from \"redux\";\r\nimport { useAsync } from \"hooks\";\r\nimport Constants from \"data/constants\";\r\nimport { fetchWorkflowInfo } from \"data/api\";\r\nimport Status from \"components/Status\";\r\nimport styles from \"./itemView_workflow.module.css\";\r\nimport CountBadge from \"components/CountBadge\";\r\nimport Attributes from \"components/Attributes\";\r\nimport Divider from \"components/Divider\";\r\nimport {\r\n type ItemActionViewConfig,\r\n type ItemActionConfig,\r\n type WorkflowAction,\r\n ServerEventItemType,\r\n} from \"data/types\";\r\nimport ItemActions from \"components/ActionPanel/ItemActions\";\r\nimport loc from \"i18next\";\r\nimport { get } from \"data/constants\";\r\nimport GlobalEventsHandler from \"containers/GlobalEventsHandler\";\r\n\r\n/**\r\n * shows the pending Workflow Actions\r\n */\r\nexport const WorkflowActions = ({\r\n onClick,\r\n actions,\r\n}: {\r\n onClick: (props: Object) => void,\r\n actions: Array,\r\n}) => {\r\n const workflowActions = actions.map((action) => ({\r\n icon: action.icon,\r\n name: action.caption,\r\n desc: action.description,\r\n url: action.page,\r\n }));\r\n const onActionClick = (action) =>\r\n onClick({\r\n title: action.name,\r\n url: action.url,\r\n });\r\n return ;\r\n};\r\nWorkflowActions.displayName = \"ItemViews.Workflow.Actions\";\r\n\r\nexport /**\r\n * shows Workflow\r\n *\r\n * @param {{ actions: Array }} { actions }\r\n */\r\nconst ItemView_Workflow = ({\r\n refreshId,\r\n onClick,\r\n itemUri,\r\n action,\r\n view,\r\n}: {\r\n refreshId: number,\r\n onClick: (props: Object) => void,\r\n itemUri: string,\r\n action: ItemActionConfig,\r\n view: ItemActionViewConfig,\r\n}) => {\r\n const state = useAsync(async () => {\r\n try {\r\n const info = get(\r\n action,\r\n [\"commandAction\", \"props\", \"workflow\"],\r\n null\r\n );\r\n const wfs = await fetchWorkflowInfo({\r\n provider: info && info.provider,\r\n wfId: info && info.wfid,\r\n itemUri,\r\n });\r\n return wfs;\r\n } catch (err) {\r\n console.warn(\"Error while fetchWorkflow\", err);\r\n throw err;\r\n }\r\n }, [action, itemUri, refreshId]);\r\n\r\n if (state.loading || state.error) {\r\n return (\r\n \r\n
\r\n {state.loading && (\r\n \r\n )}\r\n {state.error && (\r\n \r\n )}{\" \"}\r\n {loc.t(\"ipwf:loading\")}\r\n
\r\n \r\n }\r\n />\r\n );\r\n } else if (state.value == null || state.value === \"\") {\r\n return null;\r\n } else {\r\n return state.value.map((wf) => (\r\n \r\n
\r\n {wf.name} ({wf.status})\r\n {wf.progress != null && (\r\n \r\n )}\r\n
\r\n \r\n }\r\n >\r\n <>\r\n {wf.attributes && (\r\n
\r\n \r\n
\r\n )}\r\n {wf.actions && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n ));\r\n }\r\n};\r\n\r\nItemView_Workflow.displayName = \"ItemViews.Workflow\";\r\n// export default ItemView_Workflow;\r\n\r\nexport default compose(\r\n GlobalEventsHandler({\r\n items: [ServerEventItemType.task],\r\n })\r\n)(ItemView_Workflow);\r\n","import React, { useCallback } from \"react\";\r\nimport { getLocalizedText } from \"data/utils\";\r\nimport Icons from \"@hs/icons\";\r\nimport { type EnumValue } from \"data/types\";\r\n\r\ntype Props = {\r\n enum: Array>,\r\n value: T,\r\n name: string,\r\n label: string,\r\n isMulti: boolean,\r\n className: string,\r\n};\r\n\r\nconst EnumIcon = ({\r\n name,\r\n label,\r\n enum: enumValues,\r\n className,\r\n isMulti,\r\n value,\r\n}: Props) => {\r\n const renderEnumValue = useCallback(\r\n (enumValue: EnumValue) =>\r\n enumValue &&\r\n enumValue.icon && (\r\n \r\n {typeof enumValue.icon === \"string\" ? (\r\n \r\n ) : (\r\n enumValue.icon\r\n )}\r\n \r\n ),\r\n [name, label]\r\n );\r\n return value ? (\r\n \r\n {isMulti\r\n ? enumValues\r\n .filter((e) => (value & e.value) > 0)\r\n .map((e) => renderEnumValue(e))\r\n : renderEnumValue(enumValues.find((e) => e.value === value))}\r\n \r\n ) : null;\r\n};\r\n\r\nEnumIcon.displayName = \"EnumIcon\";\r\nexport default EnumIcon;\r\n","import React, { useMemo } from \"react\";\r\nimport Icons from \"@hs/icons\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport PrincipalAvatar from \"components/User/PrincipalAvatar\";\r\nimport HelpBlock from \"react-bootstrap/lib/HelpBlock\";\r\nimport loc from \"i18next\";\r\nimport styles from \"./ReminderItem.module.css\";\r\nimport EnumIcon from \"./EnumIcon\";\r\nimport {\r\n LocalDateStringOption,\r\n CustomActionState,\r\n ReminderTypeFlags,\r\n ReminderTypeFlagsEnumValues,\r\n ReminderPriority,\r\n ReminderPriorityEnumValues,\r\n} from \"data/types\";\r\nimport { toastStyled, toastTypes } from \"data/toast\";\r\nimport { userLanguage } from \"data/storeHelper\";\r\n\r\ntype Props = {\r\n reminder: ReminderDTO,\r\n isEditAllowed: boolean,\r\n onEdit: () => void,\r\n onDelete: () => void,\r\n className: string,\r\n};\r\n\r\nconst ReminderItem = ({\r\n reminder: { customAction, ...reminder },\r\n isEditAllowed,\r\n onEdit,\r\n onDelete,\r\n className = \"\",\r\n}: Props) => {\r\n const reminderTypeEnumValues = useMemo(\r\n () =>\r\n customAction == null\r\n ? ReminderTypeFlagsEnumValues\r\n : ReminderTypeFlagsEnumValues.concat({\r\n value: ReminderTypeFlags.CustomAction,\r\n label:\r\n customAction.displayName ||\r\n \"$reminder:type.customAction\",\r\n icon: (\r\n \r\n customAction.error &&\r\n toastStyled({\r\n message: customAction.error,\r\n ...toastTypes.failure,\r\n })\r\n }\r\n className={`${styles.customAction}${\r\n customAction.state === CustomActionState.Error\r\n ? ` ${styles.error}`\r\n : \"\"\r\n }`}\r\n />\r\n ),\r\n }),\r\n [customAction]\r\n );\r\n return (\r\n \r\n {reminder.priority !== ReminderPriority.Normal && (\r\n \r\n )}\r\n \r\n {new Date(reminder.date).toLocaleDateString(\r\n userLanguage(),\r\n LocalDateStringOption.DateTime\r\n )}\r\n \r\n \r\n {reminder.recipient && (\r\n \r\n \r\n \r\n )}\r\n {reminder.reason}\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\nReminderItem.displayName = \"ReminderItem\";\r\nexport default ReminderItem;\r\n","import React, { useCallback, useState } from \"react\";\r\nimport { useAsync, useAbortController } from \"hooks\";\r\nimport { fetchReminders, deleteReminder } from \"data/api\";\r\nimport Constants from \"data/constants\";\r\nimport Status from \"components/Status\";\r\nimport ReminderItem from \"components/Reminder/ReminderItem\";\r\nimport {\r\n ReminderTypeFlags,\r\n LocalDateStringOption,\r\n type ItemActionViewConfig,\r\n type ItemActionConfig,\r\n} from \"data/types\";\r\nimport { toastActionResult } from \"data/toast\";\r\nimport { openConfirmModal } from \"components/ConfirmModal\";\r\nimport loc from \"i18next\";\r\nimport { userLanguage } from \"data/storeHelper\";\r\nimport CommandActionHandler from \"components/CommandActions\";\r\n\r\ntype Props = {\r\n onClick: (props: Object) => void,\r\n itemUri: string,\r\n action: ItemActionConfig,\r\n view: ItemActionViewConfig,\r\n};\r\n\r\nfunction getLocContextFor(reminder) {\r\n return {\r\n date: new Date(reminder.date).toLocaleDateString(\r\n userLanguage(),\r\n LocalDateStringOption.DateTime\r\n ),\r\n user: reminder.recipient.displayName,\r\n };\r\n}\r\n\r\nconst ItemView_Reminder = ({ onClick, itemUri, action }: Props) => {\r\n const [reminders, setReminders] = useState(null);\r\n const abortController = useAbortController();\r\n\r\n const handleDelete = useCallback(\r\n (reminder) => {\r\n const locContext = getLocContextFor(reminder);\r\n openConfirmModal({\r\n body: loc.t(\"reminder:action_delete.confirmBody\", locContext),\r\n confirmButton: loc.t(\"reminder:action_delete.confirmYes\"),\r\n }).then((confirmed) => {\r\n /* istanbul ignore else */\r\n if (confirmed === true) {\r\n deleteReminder(\r\n reminder.id,\r\n itemUri,\r\n abortController(true).signal\r\n )\r\n .then((success) => {\r\n if (success) {\r\n const _reminders = reminders.filter(\r\n (r) => r.id !== reminder.id\r\n );\r\n setReminders(_reminders);\r\n }\r\n toastActionResult(\r\n success === true,\r\n \"reminder:action_delete\",\r\n locContext\r\n );\r\n return success;\r\n })\r\n .catch((error) => {\r\n console.error(error);\r\n toastActionResult(\r\n false,\r\n \"reminder:action_delete\",\r\n locContext\r\n );\r\n });\r\n }\r\n });\r\n },\r\n [reminders, abortController, itemUri]\r\n );\r\n\r\n const handleSave = useCallback(\r\n (reminder, id) => {\r\n /* istanbul ignore else */\r\n if (id > 0) {\r\n const _reminder = {\r\n ...reminder,\r\n creator: { ...reminder.creator },\r\n recipient: { ...reminder.recipient },\r\n id,\r\n };\r\n const _reminders = [...reminders];\r\n const idx = _reminders.findIndex((r) => r.id === id);\r\n if (idx > -1) {\r\n _reminders.splice(idx, 1, reminder);\r\n } else {\r\n _reminders.push(_reminder);\r\n }\r\n setReminders(_reminders);\r\n }\r\n },\r\n [reminders]\r\n );\r\n\r\n const handleEdit = useCallback(\r\n (reminder) =>\r\n CommandActionHandler(action.commandAction.name, {\r\n ...action.commandAction.props,\r\n reminder,\r\n onSave: handleSave,\r\n }),\r\n [handleSave, action.commandAction.name, action.commandAction.props]\r\n );\r\n\r\n const handleReadOnly = useCallback(\r\n (reminder, type) =>\r\n toastActionResult(\r\n false,\r\n `reminder:action_readonly_${type}`,\r\n getLocContextFor(reminder)\r\n ),\r\n []\r\n );\r\n\r\n const state = useAsync(async () => {\r\n try {\r\n const reminders = await fetchReminders(\r\n itemUri,\r\n abortController(true).signal\r\n );\r\n setReminders(reminders);\r\n } catch (e) {\r\n console.error(e);\r\n throw e;\r\n }\r\n });\r\n if (state.loading || state.error) {\r\n return (\r\n \r\n );\r\n }\r\n const isLoaded =\r\n !(state.loading || state.error) && Array.isArray(reminders);\r\n const hasReminders = isLoaded && reminders.length > 0;\r\n if (!hasReminders) {\r\n return
;\r\n }\r\n return reminders.map((r) => (\r\n \r\n r.isReadOnly ? handleReadOnly(r, \"edit\") : handleEdit(r)\r\n }\r\n isEditAllowed={!r.isReadOnly}\r\n onDelete={() =>\r\n r.isReadOnly ? handleReadOnly(r, \"delete\") : handleDelete(r)\r\n }\r\n />\r\n ));\r\n};\r\n\r\nItemView_Reminder.displayName = \"ItemViews.Reminder\";\r\nexport default ItemView_Reminder;\r\n","import React, { useCallback, useMemo } from \"react\";\r\nimport ItemActions from \"components/ActionPanel/ItemActions\";\r\nimport { connect, type Dispatch } from \"react-redux\";\r\nimport { resetDocFilters, setDocFilterByRef } from \"data/actions\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport {\r\n GetDefaults,\r\n GetFilterValueAsString,\r\n} from \"components/DocListFilterModal/Utils\";\r\nimport { getLocalizedText } from \"data/utils\";\r\n\r\nimport {\r\n DocListColumnType,\r\n DocListFilterOperators,\r\n type DocListFilterRequestDTO,\r\n} from \"data/types\";\r\n\r\ntype Props = {\r\n onClick: (props: Object) => void,\r\n itemUri: string,\r\n action: ItemActionConfig,\r\n view: ItemActionViewConfig,\r\n filters: Array,\r\n dispatch: Dispatch,\r\n};\r\n\r\ntype DocListClickContext = {\r\n rowIndex: number,\r\n columnIndex: number,\r\n itemUri: string,\r\n};\r\n\r\nconst Icons = {\r\n filterByValue: \"filter\",\r\n filterAddValue: \"filter\",\r\n filterRemove: \"eraser\",\r\n reset: \"times\",\r\n};\r\n\r\nconst getActionArgs = (\r\n actionId: string,\r\n context: DocListClickContext,\r\n cols,\r\n filters,\r\n rows\r\n): {} | { col: string, operator: string, value: string } => {\r\n if (\r\n actionId === \"reset\" ||\r\n context.columnIndex == null ||\r\n context.rowIndex == null ||\r\n cols == null ||\r\n cols[context.columnIndex] == null ||\r\n filters == null\r\n ) {\r\n return {};\r\n }\r\n\r\n // find filter reference\r\n const filter = filters.find(\r\n (f) => f.name === cols[context.columnIndex].name\r\n );\r\n\r\n /* istanbul ignore if */\r\n if (filter == null) {\r\n return {};\r\n }\r\n\r\n // replace \"None\" with \"Equal\"\r\n let opType = filter.operator;\r\n // those operators are not supported - will be replaced (if chosen) in _setDocFilter()\r\n /* istanbul ignore if */\r\n if (\r\n [\r\n DocListFilterOperators.None,\r\n DocListFilterOperators.Between,\r\n DocListFilterOperators.NotBetween,\r\n ].includes(opType)\r\n )\r\n opType = DocListFilterOperators.Equals;\r\n /* istanbul ignore if */\r\n if ([DocListFilterOperators.DoesNotContain].includes(opType))\r\n opType = DocListFilterOperators.NotEquals;\r\n\r\n // arguments used in i18n.json which are then shown in ContextMenu\r\n return {\r\n col: cols[context.columnIndex].caption,\r\n opType,\r\n operator: getLocalizedText(\"$folder:action_filter.operators.\" + opType),\r\n value: GetFilterValueAsString(\r\n rows[context.rowIndex][context.columnIndex]\r\n ),\r\n };\r\n};\r\n\r\nexport const showAction = (\r\n actionId: string,\r\n context: DocListClickContext,\r\n cols,\r\n filters,\r\n rows\r\n): boolean => {\r\n if (\r\n context.columnIndex == null ||\r\n context.rowIndex == null ||\r\n cols == null ||\r\n rows == null\r\n )\r\n return false;\r\n\r\n // always allow resetting filters\r\n if (actionId === \"reset\") return true;\r\n\r\n const col = cols[context.columnIndex];\r\n\r\n // no sorting/filtering allowed?\r\n /* istanbul ignore else */\r\n if (!col.canSort) return false;\r\n\r\n // find filter reference\r\n const filter = filters.find((f) => f.name === col.name);\r\n // can we actually have a filter for it?\r\n /* istanbul ignore else */\r\n if (filter == null) return false;\r\n\r\n // filter already set?\r\n // TODO filterRemove always displayed!\r\n const isFilterSet = String(filter.values[0]).length > 0;\r\n // show filterRemove, but hide the filterAdd options\r\n if (isFilterSet && actionId === \"filterRemove\") {\r\n return true;\r\n } else if (actionId === \"filterRemove\") return false;\r\n\r\n // no support for some column types\r\n /* istanbul ignore else */\r\n if (\r\n [\r\n DocListColumnType.DateTimeValue,\r\n DocListColumnType.ObjectValue,\r\n DocListColumnType.DateTimeOffsetValue,\r\n ].includes(col.type)\r\n )\r\n return false;\r\n\r\n // check empty value\r\n /* istanbul ignore if */\r\n if (\r\n rows[context.rowIndex] == null ||\r\n rows[context.rowIndex][context.columnIndex] == null\r\n )\r\n return false;\r\n const value = GetFilterValueAsString(\r\n rows[context.rowIndex][context.columnIndex]\r\n );\r\n /* istanbul ignore if */\r\n if (String(value).length === 0) return false;\r\n return true;\r\n};\r\n\r\nexport const ItemView_Filter = ({\r\n view,\r\n itemUri,\r\n columnIndex,\r\n rowIndex,\r\n filters,\r\n cols,\r\n rows,\r\n dispatch,\r\n onAction,\r\n}: Props) => {\r\n const context = useMemo(\r\n (): DocListClickContext => ({\r\n rowIndex,\r\n columnIndex,\r\n itemUri,\r\n }),\r\n [rowIndex, columnIndex, itemUri]\r\n );\r\n\r\n const actions = useMemo(\r\n () =>\r\n view.actions\r\n .filter((action) =>\r\n showAction(action, context, cols, filters, rows)\r\n )\r\n .map((action) => ({\r\n id: action,\r\n name: getLocalizedText(\r\n `$doclist_context:actions.${action}`,\r\n getActionArgs(action, context, cols, filters, rows)\r\n ),\r\n icon: Icons[action],\r\n })),\r\n [view.actions, context, cols, rows, filters]\r\n );\r\n\r\n const onActionClick = useCallback(\r\n (action) => {\r\n switch (action.id) {\r\n case \"filterByValue\":\r\n dispatch(setDocFilterByRef(context, true));\r\n break;\r\n case \"filterAddValue\":\r\n dispatch(setDocFilterByRef(context, false));\r\n break;\r\n case \"filterRemove\":\r\n dispatch(\r\n setDocFilterByRef(\r\n {\r\n columnIndex: columnIndex,\r\n rowIndex: -1, //clear values of this filter\r\n },\r\n false\r\n )\r\n );\r\n break;\r\n case \"reset\":\r\n dispatch(resetDocFilters());\r\n break;\r\n default:\r\n console.warn(\r\n `Unknown ActionId ${action.id} will be ignored`\r\n );\r\n }\r\n onAction();\r\n },\r\n [dispatch, context, columnIndex, onAction]\r\n );\r\n if (rowIndex == null || columnIndex == null || cols == null || rows == null)\r\n return null;\r\n return ;\r\n};\r\nItemView_Filter.displayName = \"ItemViews.Filter\";\r\n\r\n//#region redux\r\nconst mapStateToProps = /* istanbul ignore next */ (state, ownProps) => {\r\n let filters = s.docsLayoutFiltersSelector(state);\r\n const cols = s.docsColsSelector(state);\r\n const formatId = s.breadcrumbFormatIdSelector(\r\n state,\r\n s.currentNameSelector(state)\r\n );\r\n /* istanbul ignore else */\r\n if (filters == null || filters.length === 0) {\r\n /* istanbul ignore else */\r\n if (cols != null) {\r\n filters = GetDefaults(ownProps.itemUri, formatId, cols).filters;\r\n }\r\n }\r\n return {\r\n filters,\r\n cols,\r\n rows: s.docsRowsSelector(state),\r\n ...ownProps,\r\n };\r\n};\r\n//#endregion\r\n\r\nexport default connect(mapStateToProps)(ItemView_Filter);\r\n","import React from \"react\";\r\nimport CommandActionHandler from \"components/CommandActions\";\r\nimport { type ItemActionConfig } from \"data/types\";\r\n\r\nimport ItemView_DocList from \"./itemView_docList\";\r\nimport ItemView_ActivityList from \"./itemView_activityList\";\r\nimport ItemView_Workflow from \"./itemView_workflow\";\r\nimport ItemView_Reminder from \"./itemView_reminder\";\r\nimport ItemView_Filter from \"./itemView_filter\";\r\n\r\nconst viewMappings = {\r\n itemView_docList: ItemView_DocList,\r\n itemView_activityList: ItemView_ActivityList,\r\n itemView_workflow: ItemView_Workflow,\r\n itemView_reminder: ItemView_Reminder,\r\n itemView_filter: ItemView_Filter,\r\n};\r\n\r\nconst Factory = ({\r\n action,\r\n onAction,\r\n}: {\r\n action: ItemActionConfig,\r\n onAction: () => void,\r\n}) => {\r\n const componentClass = viewMappings[action.view && action.view.name];\r\n if (componentClass == null) {\r\n alert(\r\n `CommandAction ${action.id} defines an unknown view named ${action.view.name}`\r\n );\r\n return null;\r\n } else {\r\n let props = { onAction };\r\n if (\r\n action.commandAction != null &&\r\n action.commandAction.props != null\r\n ) {\r\n props = Object.assign(props, action.commandAction.props, {\r\n action: action,\r\n view: action.view,\r\n onItemUriAction: (itemUri: string) =>\r\n CommandActionHandler(\r\n action.commandAction.name,\r\n Object.assign({}, action.commandAction.props, {\r\n itemUri,\r\n })\r\n ),\r\n onClick: (props: Object) =>\r\n CommandActionHandler(\r\n action.commandAction.name,\r\n Object.assign({}, action.commandAction.props, props)\r\n ),\r\n });\r\n } else {\r\n console.warn(\r\n `Since action ${action.id} has a view defined ${action.view.name} but no CommandAction defined, no contextProps will be passed on!`\r\n );\r\n }\r\n return React.createElement(componentClass, props);\r\n }\r\n};\r\nFactory.displayName = \"itemViews.Factory\";\r\nexport default Factory;\r\n","// @flow\r\nimport React from \"react\";\r\nimport Row from \"react-bootstrap/lib/Row\";\r\nimport ItemAction from \"./ItemAction\";\r\nimport { type ItemActionConfig } from \"data/types\";\r\nimport styles from \"./ItemActions.module.css\";\r\nimport ItemViewFactory from \"components/CommandActions/itemViews/Factory\";\r\n\r\ntype Props = {\r\n /** list of actions to render\r\n * @type {Array}\r\n */\r\n actions: Array,\r\n /** callback when user runs an action\r\n * @param {ItemActionConfig} action which action to execute\r\n */\r\n onAction: (action: ItemActionConfig) => void,\r\n};\r\n\r\n/**\r\n * will render a list of itemActions\r\n */\r\nconst ItemActions = ({ actions, onAction }: Props) => (\r\n
\r\n {actions.map((action: ItemActionConfig, index: number) => (\r\n \r\n {action.view ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n ))}\r\n
\r\n);\r\nItemActions.displayName = \"ActionPanel.ItemActions\";\r\nexport default ItemActions;\r\n","// @flow\r\nimport React from \"react\";\r\nimport { type ListViewModeEnum } from \"data/types\";\r\nimport Dropdown from \"@hs/dropdown\";\r\nimport MenuItem from \"react-bootstrap/lib/MenuItem\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\nimport { ViewModeIcon } from \"./ViewModes\";\r\n\r\ntype Props = {\r\n /** current selected viewMode */\r\n viewMode: ListViewModeEnum,\r\n /** all available viewModes to render */\r\n viewModes?: Array,\r\n /** callback when user changes viewMode\r\n * @param {ListViewModeEnum} viewMode the viewMode the user chose\r\n */\r\n onChange: (viewMode: ListViewModeEnum) => void,\r\n /** options CSS class name to apply */\r\n className?: string,\r\n};\r\n\r\n/** render a Dropdownlist with requested viewModes marking the currently active viewMode */\r\nconst ViewModesMenu = ({ viewMode, viewModes, onChange, className }: Props) => (\r\n \r\n \r\n \r\n \r\n \r\n {viewModes.map((vm) => (\r\n onChange(vm)}\r\n >\r\n \r\n {loc.t(`common:view.${vm}`)}\r\n \r\n ))}\r\n \r\n \r\n);\r\n\r\nViewModesMenu.displayName = \"ViewModesMenu\";\r\nexport default ViewModesMenu;\r\n","// @flow\r\nimport React from \"react\";\r\nimport { type ListViewModeEnum } from \"data/types\";\r\nimport ToggleButtonGroup from \"react-bootstrap/lib/ToggleButtonGroup\";\r\nimport ToggleButton from \"react-bootstrap/lib/ToggleButton\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\nimport { ViewModeIcon } from \"./ViewModes\";\r\n\r\ntype Props = {\r\n /** current selected viewMode */\r\n viewMode: ListViewModeEnum,\r\n /** all available viewModes to render */\r\n viewModes?: Array,\r\n /** callback when user changes viewMode\r\n * @param {ListViewModeEnum} viewMode the viewMode the user chose\r\n */\r\n onChange: (viewMode: ListViewModeEnum) => void,\r\n /** options CSS class name to apply */\r\n className?: string,\r\n};\r\n\r\n/** render a Dropdownlist with requested viewModes marking the currently active viewMode */\r\nconst ViewModesButtons = ({\r\n viewMode,\r\n viewModes,\r\n onChange,\r\n className,\r\n}: Props) => (\r\n <>\r\n {/*
{loc.t(\"view.menuCaption\")}
*/}\r\n \r\n {/* \r\n \r\n */}\r\n {viewModes.map((vm) => (\r\n onChange(vm)}\r\n >\r\n \r\n \r\n ))}\r\n \r\n \r\n);\r\nViewModesButtons.displayName = \"ViewModesButtons\";\r\nexport default ViewModesButtons;\r\n","// @flow\r\nimport React from \"react\";\r\nimport { connect } from \"react-redux\";\r\nimport ViewModesMenu from \"./ViewModesMenu\";\r\nimport ViewModesButtons from \"./ViewModesButtons\";\r\nimport { type ListViewModeEnum, ListViewMode } from \"data/types\";\r\nimport styles from \"./ViewModes.module.css\";\r\n\r\nexport const ViewModeIcon = {\r\n [ListViewMode.Thumbnails]: \"picture-o\",\r\n [ListViewMode.List]: \"list\",\r\n [ListViewMode.Grid]: \"table\",\r\n [ListViewMode.Map]: \"globe\",\r\n [ListViewMode.Calendar]: \"calendar\",\r\n};\r\n\r\ntype Props = {\r\n /** current selected ViewMode */\r\n viewMode: ListViewModeEnum,\r\n /** all available viewModes to render */\r\n viewModes: Array,\r\n /** callback when user selects a different viewMode\r\n * @param {ListViewModeEnum} viewMode new selected viewMode\r\n */\r\n onChange: (viewMode: ListViewModeEnum) => void,\r\n};\r\n\r\n/** render the ViewMenu choice with requested viewModes marking the currently active viewMode */\r\nexport const ViewModes = (props: Props) => {\r\n if (\r\n props.viewModes == null ||\r\n props.viewMode == null ||\r\n props.viewModes.length <= 1\r\n )\r\n return null;\r\n else\r\n return props.browser.greaterThanOrEqual.large ? (\r\n \r\n ) : (\r\n \r\n );\r\n};\r\nViewModes.displayName = \"ViewModes\";\r\n\r\n// apply Redux Store state to Component Properties\r\nconst mapStateToProps = /* istanbul ignore next */ (state, ownProps) => ({\r\n browser: state.browser,\r\n ...ownProps,\r\n});\r\n\r\nexport default connect(mapStateToProps)(ViewModes);\r\n","// configuration file for components/ActionsMenu\r\n// localized text defined in data/i8n.*.json {viewName}/actions\r\nconst ActionMenus = {\r\n docactivity_context: [\r\n {\r\n id: \"details\",\r\n },\r\n {\r\n id: \"view\",\r\n },\r\n {\r\n id: \"popout\",\r\n },\r\n {\r\n id: \"download\",\r\n },\r\n {\r\n id: \"sep\",\r\n type: \"separator\",\r\n },\r\n {\r\n id: \"restore\",\r\n },\r\n {\r\n id: \"delete\",\r\n },\r\n ],\r\n docactivity_readonly_context: [\r\n {\r\n id: \"details\",\r\n },\r\n {\r\n id: \"view\",\r\n },\r\n ],\r\n};\r\n\r\nexport default ActionMenus;\r\n","// @flow\r\nimport React from \"react\";\r\nimport MenuItem from \"react-bootstrap/lib/MenuItem\";\r\nimport actionMenus from \"data/actionMenus\";\r\nimport loc from \"i18next\";\r\n\r\ntype ActionMenuItem = {\r\n id: string,\r\n text: string,\r\n type: null | \"separator\" | \"header\",\r\n};\r\n\r\ntype Props = {\r\n menuName: string,\r\n item: ActionMenuItem,\r\n /** callback to decide whether specified action should be visible\r\n * @param {object} action action object for which to decide visibility\r\n * @returns {boolean} true if should be visible, false to not render\r\n */\r\n onShouldBeVisible: ?(action: { id: string }) => boolean,\r\n /** callback to retrieve parameters to show in the action's text */\r\n onGetActionTextArguments: ?(actionId: string) => Object,\r\n /** callback when user selects action from ActionsMenu */\r\n onSelect: (id: string) => void,\r\n};\r\n\r\nexport const RenderActionMenuItem = ({\r\n menuName,\r\n item,\r\n onShouldBeVisible,\r\n onGetActionTextArguments,\r\n onSelect,\r\n}: Props) => {\r\n if (typeof onShouldBeVisible === \"function\") {\r\n if (!onShouldBeVisible(item)) return null;\r\n }\r\n const args =\r\n typeof onGetActionTextArguments === \"function\"\r\n ? onGetActionTextArguments(item.id)\r\n : {};\r\n\r\n return (\r\n \r\n {item.type !== \"separator\" &&\r\n loc.t(`${menuName}:actions.${item.id}`, args)}\r\n \r\n );\r\n};\r\n\r\nfunction RenderActionsMenu(\r\n name: string,\r\n onShouldBeVisible: ?(action: { id: string }) => boolean,\r\n onGetActionTextArguments: ?(actionId: string) => Object,\r\n onSelect: (id: string) => void\r\n) {\r\n if (!Object.prototype.hasOwnProperty.call(actionMenus, name)) return null;\r\n\r\n return actionMenus[name].map((item, key) => (\r\n {\r\n if (typeof id === \"string\") onSelect(id);\r\n }\r\n }\r\n />\r\n ));\r\n}\r\n\r\nexport default RenderActionsMenu;\r\n","// @flow\r\nimport React from \"react\";\r\nimport RenderActionsMenu from \"./Render\";\r\nimport Dropdown from \"@hs/dropdown\";\r\nimport Icons from \"@hs/icons\";\r\nimport styles from \"./ActionsMenu.module.css\";\r\nimport { getClassNames } from \"data/utils\";\r\n\r\ntype Props = {\r\n /** view name */\r\n name: string,\r\n /** callback when user selects action from ActionsMenu\r\n * @param {string} actionId which action has been selected by the user\r\n */\r\n onAction: (actionId: string) => void,\r\n /** callback to decide whether specified action should be visible\r\n * @param {object} action action object for which to decide visibility\r\n * @returns {boolean} true if should be visible, false to not render\r\n */\r\n onShouldBeVisible?: (action: { id: string }) => boolean,\r\n /** whether to disable the whole actionsMenu */\r\n disabled?: boolean,\r\n /** optional CSS class to apply to dropdown */\r\n className?: string,\r\n toggleComponent?: React.Element,\r\n};\r\n\r\n/**\r\n * renders a dropdown menu with actions\r\n */\r\nconst ActionsMenu = ({\r\n name,\r\n onAction,\r\n onShouldBeVisible,\r\n disabled,\r\n className,\r\n toggleComponent,\r\n}: Props) => (\r\n \r\n \r\n {toggleComponent ? (\r\n toggleComponent\r\n ) : (\r\n \r\n )}\r\n \r\n \r\n {RenderActionsMenu(name, onShouldBeVisible, null, onAction)}\r\n \r\n \r\n);\r\n\r\nActionsMenu.displayName = \"ActionsMenu\";\r\nexport default ActionsMenu;\r\n","// @flow\r\nimport React, { useMemo, useCallback, useContext } from \"react\";\r\nimport { MultiSelectionContext } from \"data/context\";\r\nimport Icons from \"@hs/icons\";\r\nimport ItemStatusIcons from \"components/ItemStatusIcons\";\r\nimport Attributes from \"components/Attributes\";\r\nimport {\r\n GridListConstant,\r\n type DocColumnResultDTO,\r\n type docFilterText,\r\n DocListColumnType,\r\n} from \"data/types\";\r\n// import { shortItemUri } from \"components/ItemUriLink\";\r\nimport Thumbnail from \"./Thumbnail\";\r\nimport Mark from \"@hs/mark\";\r\nimport ValueFactory from \"components/Attributes/SummaryAttribute/ValueFactory\";\r\nimport { getClassNames, getValue } from \"data/utils\";\r\nimport { isHandheld } from \"data/bowser\";\r\nimport withStickyToggle from \"containers/StickyToggle\";\r\nimport StickyToggleStyle from \"containers/StickyToggle/style\";\r\nimport styles from \"./RowResult.module.css\";\r\n\r\ntype Props = {\r\n /** CSS styles to apply */\r\n style?: StyleSheet,\r\n /** the row object */\r\n row: Object,\r\n /** row index */\r\n index: number,\r\n /** all the columns */\r\n cols: Array,\r\n /** whether row should be marked as selected */\r\n isSelected: boolean,\r\n /** callback when user clicks document icon\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n */\r\n onIconClick?: (e: SyntheticMouseEvent<*>) => void,\r\n /** callback when user single clicks the whole row\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n * @param {string} itemUri the row's itemUri\r\n * @param {number} index the row's index\r\n */\r\n onSingleClick?: (\r\n e: SyntheticMouseEvent,\r\n itemUri: string,\r\n index: number\r\n ) => void,\r\n /** callback when user double clicks the whole row\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n * @param {string} itemUri the row's itemUri\r\n * @param {number} index the row's index\r\n */\r\n onDoubleClick?: (\r\n e: SyntheticMouseEvent,\r\n itemUri: string,\r\n index: number\r\n ) => void,\r\n /** callback when user clicks on More... Button\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n * @param {string} itemUri the row's itemUri\r\n * @param {number} index the row's index\r\n */\r\n onMoreClick?: (\r\n e: SyntheticMouseEvent,\r\n itemUri: string,\r\n index: number\r\n ) => void,\r\n /** whether to disable the More... button */\r\n actionsDisabled?: boolean,\r\n /** callback when row has been rendered (and HTML loaded) */\r\n onLoad?: () => void,\r\n /** whether to show thumbnails or just file types' icons */\r\n showThumbnail: boolean,\r\n /** quick filter details */\r\n filterText: ?docFilterText,\r\n};\r\n\r\n/**\r\n * Render one document row in \"Simple\" layout mode\r\n */\r\nexport const RowResult = (props: Props) => {\r\n const {\r\n className,\r\n style,\r\n row,\r\n index,\r\n cols,\r\n isSelected,\r\n isHovered,\r\n filterText,\r\n onIconClick,\r\n onSingleClick,\r\n onDoubleClick,\r\n onMoreClick,\r\n onMouseEnter,\r\n onMouseLeave,\r\n onLoad,\r\n showThumbnail,\r\n divRef,\r\n onTouchStart,\r\n onTouchMove,\r\n onTouchEnd,\r\n onMouseDown,\r\n onMouseUp,\r\n onContextMenu,\r\n } = props;\r\n\r\n /* istanbul ignore next */\r\n const {\r\n multiple,\r\n renderCheckbox,\r\n isSelected: isMultiSelected,\r\n } = useContext(MultiSelectionContext) || {\r\n multiple: false,\r\n renderCheckbox: () => null,\r\n isSelected: (index: number) => false,\r\n };\r\n\r\n const itemUri = useMemo(() => row[row.length - 1], [row]);\r\n\r\n const handleSingleClick = useCallback(\r\n (e: SyntheticMouseEvent<*>) => {\r\n e.stopPropagation();\r\n /* istanbul ignore else */\r\n if (typeof onSingleClick === \"function\")\r\n onSingleClick(e, itemUri, index);\r\n },\r\n [itemUri, index, onSingleClick]\r\n );\r\n\r\n const handleDoubleClick = useCallback(\r\n (e: SyntheticMouseEvent<*>) => {\r\n e.stopPropagation();\r\n /* istanbul ignore else */\r\n if (typeof onDoubleClick === \"function\")\r\n onDoubleClick(e, itemUri, index);\r\n },\r\n [itemUri, index, onDoubleClick]\r\n );\r\n\r\n const handleIconClick = useCallback(\r\n (e: SyntheticMouseEvent<*>) => {\r\n e.stopPropagation();\r\n /* istanbul ignore else */\r\n if (typeof onIconClick === \"function\")\r\n onIconClick(e, itemUri, index);\r\n },\r\n [itemUri, index, onIconClick]\r\n );\r\n\r\n const renderName = useCallback(() => {\r\n let nameColIndex = cols.findIndex(\r\n (col) => col.type === DocListColumnType.WebDavName\r\n );\r\n // FlatAUs do not have any Name columns\r\n if (nameColIndex === -1) nameColIndex = 1;\r\n\r\n const col = cols[nameColIndex];\r\n\r\n let name = row[nameColIndex];\r\n if (typeof name !== \"string\") {\r\n name = (\r\n \r\n );\r\n }\r\n\r\n if (\r\n filterText &&\r\n filterText.name &&\r\n filterText.value &&\r\n filterText.name.toUpperCase() === col.name.toUpperCase()\r\n ) {\r\n return {name};\r\n } else return name;\r\n }, [row, cols, filterText]);\r\n\r\n const extensionColIndex = useMemo(\r\n () =>\r\n cols.findIndex((col) => col.name.toUpperCase() === \"EXTENSIONICON\"),\r\n [cols]\r\n );\r\n const statusColIndex = useMemo(\r\n () =>\r\n cols.findIndex(\r\n (col) => col.name.toUpperCase() === \"ICONITEMSTATUS\"\r\n ),\r\n [cols]\r\n );\r\n const sizeColIndex = useMemo(\r\n () => cols.findIndex((col) => col.type === DocListColumnType.FileSize),\r\n [cols]\r\n );\r\n\r\n const size = useMemo(\r\n () => getValue(row[sizeColIndex]),\r\n [row, sizeColIndex]\r\n );\r\n const attributes = useMemo(\r\n () =>\r\n cols.reduce((accumulator, col, idx, arr) => {\r\n const val = row[idx];\r\n if (\r\n ![\r\n GridListConstant.ExtensionIcon.toUpperCase(),\r\n GridListConstant.IconItemStatus.toUpperCase(),\r\n GridListConstant.ItemUri.toUpperCase(),\r\n ].includes(col.name.toUpperCase()) &&\r\n col.type !== DocListColumnType.WebDavName &&\r\n col.type !== DocListColumnType.FileSize &&\r\n val != null\r\n ) {\r\n if (typeof val === \"string\") {\r\n accumulator.push([col.caption, val]);\r\n } else {\r\n accumulator.push({\r\n caption: col.caption,\r\n value: val,\r\n });\r\n }\r\n }\r\n\r\n return accumulator;\r\n }, []),\r\n [cols, row]\r\n );\r\n const combinedClassNames = getClassNames(\r\n className,\r\n styles.row,\r\n multiple\r\n ? isMultiSelected(index)\r\n ? styles.active\r\n : null\r\n : isSelected\r\n ? styles.active\r\n : null,\r\n isHovered ? styles.hovered : null,\r\n showThumbnail ? styles.thumbnail : null,\r\n isHandheld() ? (multiple ? styles.multi : null) : styles.multi\r\n );\r\n return (\r\n \r\n {(multiple || (isHovered && !isHandheld())) &&\r\n renderCheckbox(index, styles.checkbox)}\r\n
\r\n {showThumbnail && (\r\n \r\n )}\r\n {!showThumbnail && (\r\n \r\n )}\r\n
\r\n
\r\n {sizeColIndex !== -1 && size !== \"0 B\" && size + \" \"}\r\n {showThumbnail && (\r\n \r\n )}\r\n \r\n
\r\n
{renderName()}
\r\n \r\n
\r\n );\r\n};\r\nRowResult.displayName = \"RowResult\";\r\nRowResult.defaultProps = {\r\n isSelected: false,\r\n showThumbnail: false,\r\n};\r\n\r\nconst RowResultWithStickyToggle = withStickyToggle({\r\n renderDiv: false,\r\n usePortal: false,\r\n getStyle: StickyToggleStyle.List,\r\n isActiveProp: \"isSelected\",\r\n})(RowResult);\r\n\r\nexport default RowResultWithStickyToggle;\r\n","// @flow\r\nimport React, { PureComponent } from \"react\";\r\nimport { type docsResultState } from \"data/reducers/types\";\r\nimport { type DocListLayout } from \"data/types\";\r\nimport CellMeasurer from \"react-virtualized/dist/commonjs/CellMeasurer\";\r\nimport CellMeasurerCache from \"react-virtualized/dist/commonjs/CellMeasurer/CellMeasurerCache\";\r\nimport Measure from \"react-measure\";\r\nimport ReactResizeDetector from \"react-resize-detector\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport ContextMenuHandler from \"components/ContextMenu/Handler\";\r\nimport Icons from \"@hs/icons\";\r\nimport NoDocs from \"components/NoDocs\";\r\nimport ListGroup from \"react-bootstrap/lib/ListGroup\";\r\nimport List from \"react-virtualized/dist/commonjs/List\";\r\nimport InfiniteLoader from \"react-virtualized/dist/commonjs/InfiniteLoader\";\r\nimport \"react-virtualized/styles.css\"; // only needs to be imported once\r\nimport styles from \"./DocListSimple.module.css\";\r\nimport RowResult from \"./RowResult\";\r\nimport isEqual from \"lodash/isEqual\";\r\n\r\ntype Props = {\r\n /** doclist fetch result */\r\n result: docsResultState,\r\n /** total number of documents */\r\n totalCount: number,\r\n /** callback to request loading next page */\r\n loadMoreRows: ({ rowIndex: number }) => Promise,\r\n /** docList layout settings */\r\n layout?: DocListLayout,\r\n /** callback to set filtering on a specific column\r\n * @param {string} colName name of column to filter\r\n */\r\n requestShowFilter: (colName: string) => void,\r\n /** which row index is currently selected */\r\n activeRowIndex?: ?number,\r\n /** which row index to bring into view */\r\n scrollToRow?: ?number,\r\n /** which row is the UI currently updating\r\n * @param {number} rowStartIndex row index in result.rows\r\n */\r\n rowStartIndexUpdated: (rowStartIndex: number) => void,\r\n /** callback when user clicks document icon\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n */\r\n onIconClick?: (e: SyntheticMouseEvent) => void,\r\n /** callback when user single clicks the whole row\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n * @param {string} itemUri the row's itemUri\r\n * @param {number} rowIndex the row's index\r\n */\r\n onSingleClick?: (\r\n e: SyntheticMouseEvent,\r\n itemUri: string,\r\n rowIndex: number\r\n ) => void,\r\n /** callback when user clicks on More... button\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n * @param {string} itemUri the row's itemUri\r\n * @param {number} index the row's index\r\n */\r\n onMoreClick?: (\r\n e: SyntheticMouseEvent,\r\n itemUri: string,\r\n index: number\r\n ) => void,\r\n /** whether to disable the More... button */\r\n actionsDisabled?: boolean,\r\n /** callback when user right clicks the whole row\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n * @param {number} rowIndex the row's index\r\n * @param {number} columnsIndex the column's index\r\n * @param {string} itemUri the row's itemUri\r\n */\r\n onContextClick?: (\r\n e: SyntheticMouseEvent,\r\n rowIndex: number,\r\n columnIndex: number,\r\n itemUri: string\r\n ) => void,\r\n /** React.Node children */\r\n children?: Node,\r\n /** whether to show thumbnails or just file types' icons */\r\n showThumbnails?: boolean,\r\n /** minimum row height (in px) */\r\n minRowHeight?: number,\r\n /** alternative Component used to Render each Row */\r\n RenderRowComponentClass?: React.Node,\r\n};\r\n\r\ntype State = {\r\n rows: Object,\r\n pageSize: number,\r\n pagesStatus: Array,\r\n activeRowIndex: number,\r\n hoveredRowIndex: number,\r\n refreshId: number,\r\n};\r\n\r\n/**\r\n * Renders the Tiles/Thumbnails documents list\r\n */\r\nclass DocListSimple extends PureComponent {\r\n _cache: Object;\r\n _list: List | null; // internal ref to rendered virtualized List Component\r\n // _autoHide: AutoHide | null;\r\n\r\n static defaultProps = {\r\n showThumbnails: false,\r\n RenderRowComponentClass: RowResult,\r\n };\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n this._initCellMeasurerCache(props);\r\n\r\n this.state = {\r\n //first page results loaded by DocListContainer\r\n rows: props.result.rows,\r\n pageSize: props.result.pageSize,\r\n //first page already pre-loaded otherwise we wouldn't be here\r\n pagesStatus: [Constants.OK],\r\n activeRowIndex:\r\n props.activeRowIndex != null ? props.activeRowIndex : -1,\r\n hoveredRowIndex: -1,\r\n refreshId: 0,\r\n };\r\n }\r\n\r\n componentDidUpdate(prevProps: Props, prevState: State) {\r\n /* istanbul ignore else */\r\n if (prevProps.showThumbnails !== this.props.showThumbnails) {\r\n this._initCellMeasurerCache(this.props);\r\n this._onResize();\r\n }\r\n\r\n if (!isEqual(this.props.result.rows, this.state.rows)) {\r\n this.setState(\r\n ({ pagesStatus, refreshId }) => ({\r\n rows: this.props.result.rows,\r\n pagesStatus: pagesStatus.map((p, i) =>\r\n p === Constants.LOADING\r\n ? i === this.props.pageNum\r\n ? Constants.OK\r\n : null\r\n : p\r\n ),\r\n refreshId: ++refreshId,\r\n }),\r\n () => {\r\n this._cache.clearAll();\r\n }\r\n );\r\n }\r\n }\r\n\r\n _initCellMeasurerCache = (props: Props) => {\r\n this._cache = new CellMeasurerCache({\r\n fixedWidth: true,\r\n minHeight:\r\n props.minRowHeight ||\r\n /* istanbul ignore next */ (props.showThumbnails ? 85 : 55),\r\n });\r\n };\r\n\r\n /* istanbul ignore next */ _onResize = (width: number, height: number) => {\r\n /* istanbul ignore next */\r\n this.setState(\r\n ({ refreshId }: State) => ({\r\n refreshId: ++refreshId,\r\n }),\r\n () => this._cache.clearAll()\r\n );\r\n };\r\n\r\n _isRowLoaded = ({ index }: { index: number }) => {\r\n return Object.prototype.hasOwnProperty.call(this.state.rows, index);\r\n };\r\n\r\n _loadMoreRows = ({\r\n startIndex,\r\n stopIndex,\r\n }: {\r\n startIndex: number,\r\n stopIndex: number,\r\n }) => {\r\n const { rows, pageSize, pagesStatus } = this.state;\r\n //console.log(\"loadMoreRows\", startIndex, stopIndex);\r\n\r\n // calc pagenumber\r\n let pageNum = 0;\r\n /* istanbul ignore else */\r\n if (startIndex > 0) {\r\n // specific row index requested? calc page number\r\n pageNum = Math.floor(startIndex / pageSize) - 1;\r\n }\r\n // check that stopIndex is indeed included\r\n /* istanbul ignore next */\r\n if ((pageNum + 1) * pageSize < stopIndex) {\r\n pageNum++;\r\n }\r\n\r\n // page already loaded/requested?\r\n /* istanbul ignore next */\r\n if (\r\n (pagesStatus[pageNum] === Constants.OK ||\r\n pagesStatus[pageNum] === Constants.LOADING) &&\r\n !(\r\n Object.prototype.hasOwnProperty.call(rows, startIndex) &&\r\n Object.prototype.hasOwnProperty.call(rows, stopIndex)\r\n )\r\n )\r\n return;\r\n\r\n // fetch\r\n pagesStatus[pageNum] = Constants.LOADING;\r\n this.props.loadMoreRows(pageNum);\r\n };\r\n\r\n _rowRenderer = ({\r\n index,\r\n isScrolling,\r\n key,\r\n parent,\r\n style,\r\n }: {\r\n index: number,\r\n isScrolling: boolean,\r\n key: number,\r\n parent: Object,\r\n style: StyleSheet,\r\n }) => {\r\n if (this._isRowLoaded({ index })) {\r\n const { rows } = this.state;\r\n const row = rows[index];\r\n const itemUri = row[row.length - 1];\r\n const handleRowMoreClick = (e) => {\r\n /* istanbul ignore else */\r\n if (typeof this.props.onMoreClick === \"function\")\r\n this.props.onMoreClick(e, itemUri, index);\r\n };\r\n const handleRowContextMenu = (e) => {\r\n this._cellOnContextMenu(e, index, itemUri);\r\n };\r\n const handleRowMouseEnter = (e) => {\r\n this.setState({ hoveredRowIndex: index });\r\n };\r\n return (\r\n \r\n {({ measure }) => (\r\n \r\n {React.createElement(\r\n this.props.RenderRowComponentClass,\r\n {\r\n index,\r\n row,\r\n onLoad: this._onResize,\r\n showThumbnail: this.props.showThumbnails,\r\n filterText: this.props.result.filterText,\r\n layout: this.props.layout,\r\n cols: this.props.result.cols,\r\n isSelected:\r\n this.props.activeRowIndex === index,\r\n isHovered:\r\n this.state.hoveredRowIndex === index,\r\n onIconClick: this.props.onIconClick,\r\n onSingleClick: this.props.onSingleClick,\r\n onMoreClick: handleRowMoreClick,\r\n onDoubleClick: this.props.onDoubleClick,\r\n actionsDisabled: this.props.actionsDisabled,\r\n }\r\n )}\r\n \r\n )}\r\n \r\n );\r\n } else {\r\n return (\r\n \r\n {({ measure }) => (\r\n \r\n \r\n \r\n )}\r\n \r\n );\r\n }\r\n };\r\n\r\n _cellOnContextMenu = (\r\n e: SyntheticMouseEvent<*>,\r\n rowIndex: number,\r\n itemUri: string\r\n ) => {\r\n this.setState({ activeRowIndex: rowIndex });\r\n e.preventDefault();\r\n e.persist();\r\n /* istanbul ignore else */\r\n if (typeof this.props.onContextClick === \"function\") {\r\n //console.log(e.target.innerText, columnIndex);\r\n this.props.onContextClick(e, rowIndex, 0, itemUri);\r\n }\r\n };\r\n\r\n render() {\r\n const { rows } = this.state;\r\n const count =\r\n this.props.totalCount === 0\r\n ? this.props.result.rowCount\r\n : this.props.totalCount;\r\n\r\n return (\r\n \r\n {(dimensions) => (\r\n \r\n \r\n \r\n {({ onRowsRendered, registerChild }) => (\r\n {\r\n this._list = ref;\r\n registerChild(ref);\r\n }}\r\n deferredMeasurementCache={this._cache}\r\n width={dimensions.width}\r\n height={dimensions.height}\r\n rowCount={count}\r\n rowHeight={this._cache.rowHeight}\r\n rowRenderer={this._rowRenderer}\r\n onRowsRendered={onRowsRendered}\r\n overscanRowCount={10}\r\n noRowsRenderer={() => (\r\n \r\n )}\r\n rows={rows}\r\n scrollToIndex={this.props.scrollToRow}\r\n scrollToAlignment=\"start\"\r\n />\r\n )}\r\n \r\n \r\n \r\n {this.props.children}\r\n \r\n )}\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default DocListSimple;\r\n","// @flow\r\nimport React from \"react\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport loc from \"i18next\";\r\nimport Icons from \"@hs/icons\";\r\n\r\nconst OpenFiltersButton = ({ onClick }: { onClick: Function }) => (\r\n \r\n \r\n {loc.t(\"actionCategory:filter.name\")}\r\n \r\n);\r\nOpenFiltersButton.displayName = \"OpenFiltersButton\";\r\nexport default OpenFiltersButton;\r\n","// @flow\r\nimport React, { useContext } from \"react\";\r\nimport { useRecycleBin } from \"hooks\";\r\nimport NoData from \"components/NoData\";\r\nimport { IsFiltered } from \"components/DocListFilterModal/Utils\";\r\nimport { type DocListLayout } from \"data/types\";\r\nimport OpenFiltersButton from \"./OpenFiltersButton\";\r\nimport CommandActionButton from \"components/CommandActions/CommandActionButton\";\r\nimport { ItemContext } from \"data/context\";\r\nimport styles from \"./NoDocs.module.css\";\r\n\r\nconst NoDocs = ({\r\n layout,\r\n requestShowFilter,\r\n showAddDocument,\r\n}: {\r\n layout?: DocListLayout,\r\n requestShowFilter?: Function,\r\n showAddDocument?: boolean,\r\n}) => {\r\n const { isDocAssignmentAllowed, itemUri, itemStatus } =\r\n useContext(ItemContext) || {};\r\n const [, , , checkIfInRecycleBin] = useRecycleBin(itemUri, itemStatus);\r\n const hasActiveFilter =\r\n layout != null &&\r\n layout.filters &&\r\n requestShowFilter != null &&\r\n IsFiltered(layout.filters);\r\n const canUploadDocument =\r\n showAddDocument &&\r\n !hasActiveFilter &&\r\n itemUri &&\r\n isDocAssignmentAllowed &&\r\n !checkIfInRecycleBin();\r\n return (\r\n \r\n {(hasActiveFilter || canUploadDocument) && (\r\n
\r\n {hasActiveFilter && (\r\n \r\n )}\r\n {canUploadDocument && (\r\n \r\n )}\r\n
\r\n )}\r\n
\r\n );\r\n};\r\nNoDocs.displayName = \"NoDocs\";\r\nNoDocs.defaultProps = {\r\n showAddDocument: true,\r\n};\r\nexport default NoDocs;\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrapper\":\"Status_wrapper__1xrEx\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"btnToast\":\"toast_btnToast__1G1AD\",\"toast\":\"toast_toast__WLizo\",\"detail\":\"toast_detail__2jbz7\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"modal\":\"Modal_modal__1cXJL\",\"fs\":\"Modal_fs__1ig4z\",\"docked\":\"Modal_docked__yb-5V\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"button\":\"ItemAction_button__3fwaS\",\"icon\":\"ItemAction_icon__1ZbDt\",\"desc\":\"ItemAction_desc__3Ql9P\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"top\":\"itemView_docList_top___U4a4\",\"wrapper\":\"itemView_docList_wrapper__2nlL6\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrapper\":\"ValueUser_wrapper__OYl1d\",\"icon\":\"ValueUser_icon__2h4ez\",\"avatar\":\"ValueUser_avatar__1VVKf\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"button\":\"StickyToggle_button__29V1n\",\"wrapper\":\"StickyToggle_wrapper__2zrSm\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"noteContainer\":\"NoteInput_noteContainer__35zt_\",\"noteWrapper\":\"NoteInput_noteWrapper__op-sG\",\"noteInput\":\"NoteInput_noteInput__1CY0F\",\"highlight\":\"NoteInput_highlight__3iRLs\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrapper\":\"Activities_wrapper__13MQj\",\"info\":\"Activities_info__1k3pe\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"title\":\"ItemActionPanel_title__3xKil\",\"wrapper\":\"ItemActionPanel_wrapper__1Wsxv\",\"bc\":\"ItemActionPanel_bc__3rbA-\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"picker\":\"PickerModal_picker__1uvkV\",\"button\":\"PickerModal_button__mndRK\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"icon\":\"Button_icon__uy-69\",\"badge\":\"Button_badge__3fXV6\",\"status\":\"Button_status__84hFh\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"PlaceInput_container__Yz99t\",\"inputGroup\":\"PlaceInput_inputGroup__3vN1D\",\"iconWrapper\":\"PlaceInput_iconWrapper__3GUOj\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"dropdownButton\":\"GeoRadiusInput_dropdownButton__3jxaT\",\"radius\":\"GeoRadiusInput_radius__3O3pp\",\"unit\":\"GeoRadiusInput_unit__2eoLl\"};","import React from \"react\";\r\nimport LocalContactInfo from \"components/LocalContactInfo\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport styles from \"./PageStatus.module.css\";\r\nimport { getClassNames } from \"data/utils\";\r\n\r\ntype Props = {\r\n /** current status */\r\n status: ConstantsEnum,\r\n /** optional message to display\r\n * NOTE: only visible when status = ERROR or LOADING\r\n */\r\n message?: string,\r\n /** optional React element to show below message\r\n * NOTE: only visible when status = ERROR or LOADING\r\n */\r\n children?: React.ElementType,\r\n};\r\n\r\nconst PageStatus = ({ status, message, children }: Props) => (\r\n
\r\n \"inPoint\r\n {[Constants.ERROR, Constants.LOADING].includes(status) && (\r\n
\r\n {message}\r\n {children}\r\n {status === Constants.ERROR && }\r\n
\r\n )}\r\n
\r\n);\r\nPageStatus.displayName = \"PageStatus\";\r\nPageStatus.defaultProps = {\r\n status: Constants.NONE,\r\n};\r\nexport default PageStatus;\r\n","import queryString from \"data/queryString\";\r\nimport {\r\n type SidebarItemDTO,\r\n SpecialFoldersItemURIs,\r\n SystemWebDavName,\r\n} from \"data/types\";\r\nimport loc from \"i18next\";\r\n\r\nlet siteActiveCache = {\r\n uri: null,\r\n orderedIndex: -1,\r\n};\r\n\r\n// HACK for some reason the LinkContainer does not receive the correct match object\r\nexport const isSiteActive = (\r\n location: Location,\r\n sitesOrdered: Array,\r\n site: SidebarItemDTO\r\n): boolean => {\r\n const qs = queryString.parse(location.search);\r\n const qsuri =\r\n location.hash !== SpecialFoldersItemURIs.RecycleBinUri &&\r\n qs.uri !== SpecialFoldersItemURIs.RecycleBinUri\r\n ? \"pam-item://\" + qs.uri\r\n : SpecialFoldersItemURIs.RecycleBinUri;\r\n\r\n // no need to find qsuri every time\r\n if (siteActiveCache.uri === qsuri) {\r\n return (\r\n site.itemUri === sitesOrdered[siteActiveCache.orderedIndex].itemUri\r\n );\r\n }\r\n // do we have an exact match?\r\n const orderedIndex = sitesOrdered.findIndex(\r\n (orderedSite) => orderedSite.itemUri === qsuri\r\n );\r\n // ...then take it\r\n if (orderedIndex !== -1) {\r\n siteActiveCache = { uri: qsuri, orderedIndex };\r\n return site.itemUri === sitesOrdered[orderedIndex].itemUri;\r\n } else {\r\n // find closest neighbour\r\n const orderedIndex2 = sitesOrdered.findIndex(\r\n (orderedSite) => qsuri.indexOf(orderedSite.itemUri) === 0\r\n );\r\n if (orderedIndex2 !== -1) {\r\n siteActiveCache = { uri: qsuri, orderedIndex: orderedIndex2 };\r\n return site.itemUri === sitesOrdered[orderedIndex2].itemUri;\r\n }\r\n }\r\n //if uri does not exist at all in our sidebar\r\n siteActiveCache = { uri: null, orderedIndex: -1 };\r\n return false;\r\n};\r\n\r\nexport const siteDisplayName = (site: SidebarItemDTO): string => {\r\n const nameIndex = Object.values(SystemWebDavName).indexOf(site.caption);\r\n\r\n if (nameIndex !== -1) {\r\n return loc.t(`common:siteItemType.${site.siteType}`);\r\n }\r\n\r\n return site.caption;\r\n};\r\n","import { compose, createStore, applyMiddleware } from \"redux\";\r\nimport appReducers from \"data/reducers\";\r\n// redux-persist\r\nimport { persistStore, persistReducer } from \"redux-persist\";\r\nimport {\r\n // transformCorrelationId,\r\n transformInitialState,\r\n} from \"data/persistTransforms\";\r\nimport { LocalNodeDevelopment } from \"./config\";\r\n// responsive\r\nimport { responsiveStoreEnhancer } from \"redux-responsive\";\r\n// sagas\r\nimport createSagaMiddleware from \"redux-saga\";\r\n//import { version } from \"../../package.json\";\r\nimport { persistStorage } from \"data/storage\";\r\nimport { initialState as loginInitialState } from \"data/reducers/loginReducer\";\r\n// import { initialState as userInitialState } from \"data/reducers/userReducer\";\r\nimport { setupLogging } from \"data/logging\";\r\n\r\nexport const injectConfigFromServer = async () => {\r\n let config;\r\n try {\r\n const url = `${window.CONFIG.host.basename}/config`;\r\n const result = await fetch(url);\r\n config = await result.json();\r\n } catch (e) {\r\n console.error(\r\n `Cannot load appsettings from inPoint.Web.Server. Please check if the Server is running and the proxy is configured`,\r\n e\r\n );\r\n }\r\n return config || LocalNodeDevelopment;\r\n};\r\n\r\n/* istanbul ignore next */\r\nif (process.env.NODE_ENV !== \"production\") {\r\n // Log the initial state\r\n //console.log(store.getState())\r\n // Every time the state changes, log it\r\n // Note that subscribe() returns a function for unregistering the listener//let unsubscribe =\r\n /* store.subscribe(() => {\r\n console.log(\"%c store\", \"color: orange\", store.getState());\r\n }); */\r\n // this sets window.CONFIG either locally (node.js server) or when hosted, from MVC\r\n\r\n /* istanbul ignore next */\r\n if (typeof window.CONFIG === \"string\") {\r\n window.CONFIG = LocalNodeDevelopment;\r\n injectConfigFromServer().then((config) => (window.CONFIG = config));\r\n }\r\n}\r\n\r\n/* istanbul ignore next */\r\nif (process.env.JEST_WORKER_ID === undefined) {\r\n setupLogging();\r\n}\r\n\r\n// create the saga middleware\r\nexport const sagaMiddleware = createSagaMiddleware();\r\n\r\n// redux-persist\r\nconst transforms = [\r\n /*transformCorrelationId()*/\r\n];\r\n/* istanbul ignore next */\r\nif (window.CONFIG.auth.forceLogin === true || window.CONFIG.token != null) {\r\n transforms.push(transformInitialState(\"login\", loginInitialState));\r\n // transforms.push(transformInitialState(\"user\", userInitialState));\r\n}\r\n\r\nconst persistConfig = {\r\n key: \"root\",\r\n version: 3,\r\n whitelist: [\r\n \"settings\",\r\n /*\"user\",*/ \"login\",\r\n \"cards\",\r\n \"offline\",\r\n \"notification\",\r\n ],\r\n storage: persistStorage, //localForage,\r\n debug: process.env.NODE_ENV !== \"production\",\r\n autoRehydrate: true,\r\n transforms,\r\n};\r\nconst reducer = persistReducer(persistConfig, appReducers);\r\n\r\n// simple Redux console logger\r\n// https://twitter.com/dan_abramov/status/629347448247468032?lang=en\r\n/* function logger({ getState }) {\r\n return next => action => {\r\n //console.time();\r\n console.groupCollapsed(action.type);\r\n console.info(\"dispatching:\", action);\r\n const result = next(action);\r\n console.log(\"next state:\", getState());\r\n console.groupEnd();\r\n //console.timeEnd();\r\n return result;\r\n };\r\n} */\r\n\r\n// http://redux.js.org/\r\nconst middlewares = [sagaMiddleware];\r\n/* if (process.env.NODE_ENV !== \"production\") {\r\n middlewares.push(logger);\r\n} */\r\n\r\nconst composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;\r\nconst store = createStore(\r\n reducer,\r\n composeEnhancers(responsiveStoreEnhancer, applyMiddleware(...middlewares))\r\n);\r\n\r\nexport const persistor = persistStore(store);\r\n\r\nexport default store;\r\n","import { createTransform } from \"redux-persist\";\r\n// https://github.com/rt2zz/redux-persist\r\n\r\n// // do not store/reload the correlationId (used for server-side logging)\r\n// export const transformCorrelationId = /* istanbul ignore next */ () =>\r\n// createTransform(\r\n// // transform state on its way to being serialized and persisted.\r\n// (inboundState, key) => {\r\n// return { ...inboundState, correlationId: undefined };\r\n// },\r\n// // transform state being rehydrated\r\n// (outboundState, key) => {\r\n// return { ...outboundState, correlationId: undefined };\r\n// },\r\n// // define which reducers this transform gets called for.\r\n// { whitelist: [\"user\"] }\r\n// );\r\n\r\nexport const transformInitialState = /* istanbul ignore next */ (\r\n reducerName,\r\n initialState\r\n) =>\r\n createTransform(\r\n // transform state on its way to being serialized and persisted.\r\n (inboundState, key) => {\r\n return {\r\n ...inboundState,\r\n ...initialState,\r\n };\r\n },\r\n // transform state being rehydrated\r\n (outboundState, key) => {\r\n return {\r\n ...outboundState,\r\n ...initialState,\r\n };\r\n },\r\n // define which reducers this transform gets called for.\r\n { whitelist: [reducerName] }\r\n );\r\n\r\n// // optionally skip storing/loading the login reducer (forcing user to re-login every time)\r\n// export const transformLoginToken = createTransform(\r\n// // transform state on its way to being serialized and persisted.\r\n// (inboundState, key) => {\r\n// return {\r\n// ...inboundState,\r\n// ...loginInitialState\r\n// };\r\n// },\r\n// // transform state being rehydrated\r\n// (outboundState, key) => {\r\n// return {\r\n// ...outboundState,\r\n// ...loginInitialState\r\n// };\r\n// },\r\n// // define which reducers this transform gets called for.\r\n// { whitelist: [\"login\"] }\r\n// );\r\n\r\n// // optionally skip storing/loading the login reducer (forcing user to re-login every time)\r\n// export const transformUserToken = createTransform(\r\n// // transform state on its way to being serialized and persisted.\r\n// (inboundState, key) => {\r\n// return {\r\n// ...inboundState,\r\n// ...userInitialState\r\n// };\r\n// },\r\n// // transform state being rehydrated\r\n// (outboundState, key) => {\r\n// return {\r\n// ...outboundState,\r\n// ...userInitialState\r\n// };\r\n// },\r\n// // define which reducers this transform gets called for.\r\n// { whitelist: [\"user\"] }\r\n// );\r\n","// @flow\r\nimport React, { type Node } from \"react\";\r\nimport loc from \"i18next\";\r\nimport styles from \"./NoData.module.css\";\r\n\r\nconst NoData = ({\r\n locContext,\r\n children,\r\n}: {\r\n locContext?: string,\r\n children?: Node,\r\n}) => (\r\n
\r\n {loc.t(\"nodata\", { context: locContext })}\r\n {children}\r\n
\r\n);\r\nNoData.displayName = \"NoData\";\r\nexport default NoData;\r\n","//@flow\r\nimport { inPointAction, inPointActionLink } from \"components/ItemUriLink\";\r\n\r\n/**\r\n * opens inPoint.Client to execute command action for the specified itemUris\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ items?: Array }} { items }\r\n * @param {{ commandAction?: string}} { commandAction }\r\n */\r\n\r\ntype Context = {\r\n itemUri: string,\r\n items?: Array,\r\n commandAction?: string,\r\n};\r\n\r\nclass ip_commandAction {\r\n execute({ itemUri, items, commandAction }: Context) {\r\n window.location.assign(\r\n inPointActionLink(\r\n inPointAction.commandAction,\r\n items?.length ? undefined : itemUri,\r\n items?.length ? items.map((item) => item.itemUri) : undefined,\r\n {\r\n name: commandAction,\r\n }\r\n )\r\n );\r\n return true;\r\n }\r\n}\r\n\r\nexport default ip_commandAction;\r\n","import ip_commandAction from \"./ip_commandAction\";\r\n\r\n/**\r\n * opens inPoint.Client to archive to the specified itemUri\r\n *\r\n * @param {{ itemUri?: string }} { itemUri }\r\n */\r\n\r\nclass ip_archive extends ip_commandAction {\r\n execute = ({ itemUri }: { itemUri?: string }) =>\r\n super.execute({ itemUri, commandAction: \"ArchiveCommandAction\" });\r\n}\r\n\r\nexport default ip_archive;\r\n","import ip_commandAction from \"./ip_commandAction\";\r\n\r\n/**\r\n * opens inPoint.Client to browse to the specified itemUri\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n */\r\n\r\nclass ip_browse extends ip_commandAction {\r\n execute = ({ itemUri }: { itemUri: string }) =>\r\n super.execute({ itemUri, commandAction: \"ItemBrowseCommandAction\" });\r\n}\r\n\r\nexport default ip_browse;\r\n","import ip_commandAction from \"./ip_commandAction\";\r\n\r\n/**\r\n * opens inPoint.Client to edit to the specified itemUri\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n */\r\n\r\nclass ip_edit extends ip_commandAction {\r\n execute = ({ itemUri }: { itemUri: string }) =>\r\n super.execute({ itemUri, commandAction: \"DocumentOpenCommandAction\" });\r\n}\r\n\r\nexport default ip_edit;\r\n","import ip_commandAction from \"./ip_commandAction\";\r\n\r\n/**\r\n * opens inPoint.Client to show properties window for the specified itemUri\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ isDoc: boolean }} { isDoc }\r\n */\r\n\r\nclass ip_properties extends ip_commandAction {\r\n execute = ({ itemUri, isDoc }: { itemUri: string, isDoc: boolean }) =>\r\n super.execute({\r\n itemUri,\r\n commandAction: isDoc\r\n ? \"DocumentEditAttributesCommandAction\"\r\n : \"FolderEditAttributesCommandAction\",\r\n });\r\n}\r\n\r\nexport default ip_properties;\r\n","import { openConfirmModal } from \"components/ConfirmModal\";\r\nimport { delItemUri } from \"data/api\";\r\nimport loc from \"i18next\";\r\nimport { toastActionResult } from \"data/toast\";\r\n\r\n/**\r\n * deletes an existing folder by itemUri\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ name: string }} { name }\r\n */\r\n\r\ntype Context = {\r\n itemUri: string,\r\n name: string,\r\n};\r\n\r\nclass folder_delete {\r\n queueMultiple: boolean = true;\r\n logger: () => any = toastActionResult;\r\n shouldRender: boolean = true;\r\n\r\n render = async ({ name }: Context): Promise => {\r\n this.shouldRender = false;\r\n return await openConfirmModal({\r\n body: loc.t(\"commandAction:folder_delete.confirmBody\", { name }),\r\n confirmButton: loc.t(\"commandAction:folder_delete.confirmYes\"),\r\n });\r\n };\r\n\r\n execute = async ({ itemUri }: Context): Promise => {\r\n try {\r\n return await delItemUri(itemUri);\r\n } catch (err) {\r\n console.warn(err);\r\n return false;\r\n }\r\n };\r\n\r\n report = async (success: boolean, { name }: Context): Promise => {\r\n this.logger(success === true, \"commandAction:folder_delete\", { name });\r\n };\r\n}\r\n\r\nexport default folder_delete;\r\n","import { formSetEditModeAction } from \"data/actions\";\r\n\r\n/**\r\n * starts editing the current folder form\r\n */\r\n\r\nclass folder_editClassification {\r\n execute = ({ dispatch }) => dispatch(formSetEditModeAction(\"folder\", true));\r\n}\r\nexport default folder_editClassification;\r\n","import React, { useCallback, useMemo } from \"react\";\r\nimport FormsyEditorBase from \"./FormsyEditorBase\";\r\nimport DropdownButton from \"react-bootstrap/lib/DropdownButton\";\r\nimport MenuItem from \"react-bootstrap/lib/MenuItem\";\r\nimport ButtonGroup from \"react-bootstrap/lib/ButtonGroup\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport Icons from \"@hs/icons\";\r\nimport { type EnumValue } from \"data/types\";\r\nimport { getLocalizedText } from \"data/utils\";\r\n\r\ntype Props = {\r\n /** Enum Values */\r\n enum: Array>,\r\n /** Is a required field */\r\n isRequired?: boolean,\r\n /** Is a read only field */\r\n isReadonly?: boolean,\r\n /** wheather it is an Enum or and EnumFlag */\r\n isMulti?: boolean,\r\n};\r\n\r\ntype EnumRendererProps = {\r\n isValid: boolean,\r\n enum: Array>,\r\n value?: int,\r\n name: string,\r\n changeValue: () => void,\r\n};\r\n\r\nconst ButtonGroupEnumRenderer = (props: EnumRendererProps) => (\r\n \r\n {props.enum.map((enumValue) => (\r\n props.onChange(enumValue.value)}\r\n disabled={!!props.isReadonly}\r\n active={props.isActive(enumValue.value)}\r\n >\r\n {enumValue.icon && typeof enumValue.icon === \"string\" ? (\r\n \r\n ) : (\r\n enumValue.icon\r\n )}{\" \"}\r\n {getLocalizedText(enumValue.label)}\r\n \r\n ))}\r\n \r\n);\r\n\r\nconst DropdownEnumRenderer = (props: EnumRendererProps) => (\r\n e.stopPropagation()}\r\n >\r\n {props.enum.map((enumValue, idx) => (\r\n props.onChange(enumValue.value)}\r\n active={props.isActive(enumValue.value)}\r\n >\r\n {enumValue.icon && typeof enumValue.icon === \"string\" ? (\r\n \r\n ) : (\r\n enumValue.icon\r\n )}{\" \"}\r\n {getLocalizedText(enumValue.label)}\r\n \r\n ))}\r\n \r\n);\r\n\r\nconst EnumRenderer = {\r\n ButtonGroup: ButtonGroupEnumRenderer,\r\n Dropdown: DropdownEnumRenderer,\r\n};\r\n\r\nconst EnumEditorControl = (props: Props) => {\r\n const isActive = useCallback(\r\n (enumValue: int) =>\r\n props.isMulti\r\n ? (props.value & enumValue) > 0\r\n : enumValue === props.value,\r\n [props.isMulti, props.value]\r\n );\r\n\r\n const handleFlagsChange = useCallback(\r\n (enumValue: int) =>\r\n (props.value & enumValue) > 0\r\n ? props.value & ~enumValue\r\n : props.value | enumValue,\r\n [props.value]\r\n );\r\n\r\n const handleChange = useCallback(\r\n (changeValue: () => void, enumValue: int) => {\r\n const newValue = props.isMulti\r\n ? handleFlagsChange(enumValue)\r\n : enumValue;\r\n changeValue({ currentTarget: { value: newValue } });\r\n },\r\n [props.isMulti, handleFlagsChange]\r\n );\r\n const activeLabels = useMemo(\r\n () =>\r\n props.enum\r\n .filter((enumValue) =>\r\n props.isMulti\r\n ? (props.value & enumValue.value) > 0\r\n : enumValue.value ===\r\n props.value /* istanbul ignore next */ ||\r\n (enumValue.value == null && props.value == null)\r\n )\r\n .map((enumValue) => (\r\n \r\n {enumValue.icon &&\r\n typeof enumValue.icon === \"string\" ? (\r\n \r\n ) : (\r\n enumValue.icon\r\n )}{\" \"}\r\n {getLocalizedText(enumValue.label)}\r\n \r\n )),\r\n [props.enum, props.value, props.isMulti, props.name]\r\n );\r\n const EnumRenderComponent = useMemo(() => {\r\n if (\r\n typeof props.component === \"string\" &&\r\n EnumRenderer.hasOwnProperty(props.component)\r\n ) {\r\n return EnumRenderer[props.component];\r\n }\r\n if (props.component != null && typeof props.component === \"function\") {\r\n return props.component;\r\n }\r\n return EnumRenderer.ButtonGroup;\r\n }, [props.component]);\r\n return (\r\n void,\r\n isValid: boolean\r\n ) => (\r\n \r\n handleChange(changeValue, enumValue)\r\n }\r\n />\r\n )}\r\n {...props}\r\n />\r\n );\r\n};\r\n\r\nEnumEditorControl.displayName = \"EnumEditorControl\";\r\nexport default EnumEditorControl;\r\n","import loc from \"i18next\";\r\nimport {\r\n LocalDateStringOption,\r\n ShareType,\r\n type ShareTypeEnum,\r\n} from \"data/types\";\r\nimport { userLanguage } from \"data/storeHelper\";\r\n\r\nexport const isEditable = (shareType: ShareTypeEnum): boolean =>\r\n [ShareType.Anonym, ShareType.WebShare, ShareType.Share].includes(shareType);\r\n\r\nexport const getShareDate = (expires: string) =>\r\n expires\r\n ? loc.t(`share:action.date`, {\r\n expires: new Date(expires).toLocaleDateString(\r\n userLanguage(),\r\n LocalDateStringOption.Date\r\n ),\r\n })\r\n : \"\";\r\n\r\nexport const getBytes = (bytes: number): string => {\r\n const i = Math.floor(Math.log(bytes) / Math.log(1024));\r\n return (\r\n (!bytes && \"0 Bytes\") ||\r\n (bytes / Math.pow(1024, i)).toFixed(2) +\r\n \" \" +\r\n [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\"][i]\r\n );\r\n};\r\n\r\nexport const getItemKey = (isDoc: boolean, isMixed: boolean = false) =>\r\n isMixed ? \"mixed\" : isDoc ? \"document\" : \"folder\";\r\nexport const getActionKey = (isEdit: boolean) => (isEdit ? \"update\" : \"create\");\r\n\r\nexport /**\r\n * Maps EnumValues to their designated icons\r\n *\r\n * @param { id: string } { enum value identifier }\r\n * @returns {string} fontawesome 4.7 icon identifier\r\n */\r\nconst getEnumIcon = (id: string): ?string => {\r\n switch (id) {\r\n // ShareAccessControlListType\r\n case \"view\":\r\n return \"eye\";\r\n case \"edit\":\r\n return \"pencil\";\r\n case \"delete\":\r\n return \"pencil-square-o\";\r\n // ShareType\r\n case \"anonym\":\r\n return \"globe\";\r\n case \"webshare\":\r\n return \"cloud-upload\";\r\n case \"link\":\r\n return \"link\";\r\n case \"share\":\r\n return \"share-alt\";\r\n case \"attachment\":\r\n return \"envelope-o\";\r\n case \"pdf\":\r\n return \"file-pdf-o\";\r\n /* istanbul ignore next */\r\n default:\r\n return undefined;\r\n }\r\n};\r\n","import React, { useCallback, useEffect } from \"react\";\r\nimport loc from \"i18next\";\r\nimport TextEditorControl from \"components/ExtraAttributes/EditorControl/TextEditorControl\";\r\nimport DateEditorControl from \"components/ExtraAttributes/EditorControl/DateEditorControl\";\r\nimport EnumEditorControl from \"components/ExtraAttributes/EditorControl/EnumEditorControl\";\r\nimport { isEditable } from \"components/ShareModal/Utils\";\r\nimport {\r\n ShareType,\r\n DateTimeFormat,\r\n type ShareActionDTO,\r\n type ShareTypeEnum,\r\n} from \"data/types\";\r\n\r\ntype Props = {\r\n onChange: (value) => void,\r\n onConfirm: (name: sting, value: ShareTypeEnum) => Promise,\r\n name: string,\r\n value?: ShareActionDTO,\r\n extras?: any,\r\n};\r\n\r\nconst ShareActionForm = ({\r\n onChange,\r\n onConfirm,\r\n name,\r\n value: shareAction,\r\n extras = {},\r\n}: Props) => {\r\n const handleChange = useCallback(\r\n (name: string, value: any) =>\r\n onChange({ ...shareAction, [name]: value }),\r\n [onChange, shareAction]\r\n );\r\n const handleShareAsChange = useCallback(\r\n (nameAndIndex, indexValue) => {\r\n const [name, index] = nameAndIndex.split(\".\");\r\n const value = [...shareAction.shareAs];\r\n value[index] = indexValue;\r\n return onChange({ ...shareAction, [name]: value });\r\n },\r\n [onChange, shareAction]\r\n );\r\n const handleConfirmedChange = useCallback(\r\n (name: string, value: ShareTypeEnum) =>\r\n onConfirm(name, value).then(\r\n (success) => success && handleChange(name, value)\r\n ),\r\n [handleChange, onConfirm]\r\n );\r\n const { typeEnumValues, aclEnumValues } = extras;\r\n useEffect(() => {\r\n if (\r\n typeof shareAction.expires === \"undefined\" ||\r\n (!isEditable(shareAction.type) && shareAction.expires != null)\r\n ) {\r\n handleChange(\"expires\", null);\r\n }\r\n }, [shareAction, handleChange]);\r\n return (\r\n <>\r\n
\r\n \r\n {isEditable(shareAction.type) && (\r\n \r\n )}\r\n
\r\n {isEditable(shareAction.type) && (\r\n <>\r\n {shareAction.type === ShareType.Share &&\r\n shareAction.shareAs.map((shareAs, i) => (\r\n \r\n ))}\r\n \r\n value == null ||\r\n new Date(value) - Date.now() > 0,\r\n }}\r\n validationErrors={{\r\n isGreaterThanNow: loc.t(\r\n \"common:validation.greaterThanNow\"\r\n ),\r\n }}\r\n />\r\n \r\n )}\r\n \r\n );\r\n};\r\n\r\nShareActionForm.displayName = \"ShareActionForm\";\r\nexport default ShareActionForm;\r\n","import React, { type Component } from \"react\";\r\nimport Alert from \"react-bootstrap/lib/Alert\";\r\nimport ButtonToolbar from \"react-bootstrap/lib/ButtonToolbar\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport FormsyEditorBase from \"components/ExtraAttributes/EditorControl/FormsyEditorBase\";\r\nimport ShareActionForm from \"components/ShareModal/ShareActionForm\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\nimport styles from \"./ShareAction.module.css\";\r\nimport { type ShareActionDTO } from \"data/types\";\r\n\r\ntype Props = {\r\n value?: ShareActionDTO,\r\n name: string,\r\n extras: any,\r\n onChange: () => void,\r\n onConfirm: (name: string, value: ShareTypeEnum) => Promise,\r\n onCancel?: () => void,\r\n Form?: Component,\r\n};\r\n\r\nconst ShareActionEditorControl = ({\r\n Form = ShareActionForm,\r\n ...props\r\n}: Props) => (\r\n void,\r\n isValid: boolean\r\n ) => (\r\n
\r\n \r\n {typeof props.onCancel === \"function\" && (\r\n
\r\n {\" \"}\r\n {props.header}\r\n
\r\n )}\r\n \r\n changeValue({ currentTarget: { value } })\r\n }\r\n onConfirm={props.onConfirm}\r\n />\r\n {typeof props.onCancel === \"function\" && (\r\n \r\n \r\n {loc.t(\"close\")}\r\n \r\n \r\n )}\r\n
\r\n
\r\n )}\r\n {...props}\r\n />\r\n);\r\n\r\nShareActionEditorControl.displayName = \"ShareActionEditorControl\";\r\nexport default ShareActionEditorControl;\r\n","import React, { useState, useCallback, useMemo, useRef } from \"react\";\r\nimport FormsyEditorBase from \"./FormsyEditorBase\";\r\nimport Mark from \"@hs/mark\";\r\nimport PrincipalAvatar from \"components/User/PrincipalAvatar\";\r\nimport loc from \"i18next\";\r\nimport { fetchSearchPrincipal } from \"data/api\";\r\nimport {\r\n PrincipalType,\r\n type UserPrincipalDTO,\r\n type GroupPrincipalDTO,\r\n type ApiError,\r\n} from \"data/types\";\r\nimport { closeMenuOnScroll } from \"data/utils\";\r\nimport Async from \"react-select/async\";\r\nimport AsyncCreatable from \"react-select/async-creatable\";\r\nimport { components } from \"react-select\";\r\nimport { validationRules } from \"formsy-react\";\r\nimport styles from \"./PrincipalEditorControl.module.css\";\r\nimport { useAbortController } from \"hooks\";\r\n\r\nconst { Option } = components;\r\n\r\ntype Props = {\r\n /** Allows to create new User */\r\n createUser?: boolean,\r\n /** Allows to create new Group */\r\n createGroup?: boolean,\r\n /** Handle Users */\r\n includeUsers?: boolean,\r\n /** Handle UserGroups */\r\n includeGroups?: boolean,\r\n /** Is a required field */\r\n isRequired?: boolean,\r\n /** Can multiple Users be selected */\r\n isMulti?: boolean,\r\n /** Can input be cleared */\r\n isClearable?: boolean,\r\n /** New UserId reference */\r\n newUserIdRef?: { current?: int },\r\n /** Focus the control when it is mounted */\r\n autoFocus?: boolean,\r\n};\r\n\r\nconst PrincipalEditorControl = (props: Props) => {\r\n const localNewUserIdRef = useRef(0);\r\n const abortController = useAbortController();\r\n const {\r\n isMulti = false,\r\n createUser = false,\r\n createGroup = false,\r\n includeUsers = true,\r\n includeGroups = false,\r\n newUserIdRef = localNewUserIdRef,\r\n } = props;\r\n const [keyword, setKeyword] = useState(\"\");\r\n\r\n const getNewId = useCallback(() => {\r\n newUserIdRef.current -= 1;\r\n return newUserIdRef.current;\r\n }, [newUserIdRef]);\r\n\r\n const types = useMemo(() => {\r\n const types = [];\r\n /* istanbul ignore else */\r\n if (includeUsers)\r\n types.push(loc.t(`principal.type.user${isMulti ? \"s\" : \"\"}`));\r\n /* istanbul ignore else */\r\n if (includeGroups)\r\n types.push(loc.t(`principal.type.group${isMulti ? \"s\" : \"\"}`));\r\n return types.join(\r\n isMulti ? loc.t(\"principal.type.and\") : loc.t(\"principal.type.or\")\r\n );\r\n }, [includeUsers, includeGroups, isMulti]);\r\n\r\n const Component = useMemo(\r\n () => (createUser || createGroup ? AsyncCreatable : Async),\r\n [createUser, createGroup]\r\n );\r\n const componentProps = useMemo(\r\n () =>\r\n createUser || createGroup\r\n ? {\r\n createOptionPosition: \"first\",\r\n isValidNewOption: (\r\n inputValue: string,\r\n selectValue?: Array = [],\r\n selectOptions?: Array = []\r\n ) =>\r\n inputValue &&\r\n selectOptions.find(\r\n (principal) =>\r\n principal &&\r\n principal.email &&\r\n principal.email.toLowerCase() ===\r\n inputValue.toLowerCase()\r\n ) == null &&\r\n createUser &&\r\n validationRules.isEmail(selectValue, inputValue),\r\n getNewOptionData: (\r\n inputValue: string,\r\n optionLabel: React.Node\r\n ): any => {\r\n const isEmail = validationRules.isEmail(\r\n undefined,\r\n inputValue\r\n );\r\n return {\r\n id: getNewId(),\r\n $type: isEmail\r\n ? PrincipalType.User\r\n : PrincipalType.Group,\r\n displayName: inputValue,\r\n email: isEmail ? inputValue : undefined,\r\n };\r\n },\r\n }\r\n : {},\r\n [createUser, createGroup, getNewId]\r\n );\r\n\r\n const handleInputChange = useCallback((keyword: string) => {\r\n setKeyword(keyword);\r\n return keyword;\r\n }, []);\r\n\r\n const handleSearchAsYouType = useCallback(\r\n (\r\n keyword: string\r\n ): Promise> => {\r\n if (keyword.length > 0) {\r\n return fetchSearchPrincipal(\r\n keyword,\r\n !!includeUsers,\r\n !!includeGroups,\r\n /* !! Do NOT abort multiple calls, since Async react-select, caches responses !! */\r\n abortController().signal\r\n )\r\n .catch((err: ApiError) => {\r\n return [];\r\n })\r\n .then((options) => options);\r\n } else {\r\n // TODO return previously used emails\r\n return Promise.resolve([]);\r\n }\r\n },\r\n [includeUsers, includeGroups, abortController]\r\n );\r\n const optionRenderer = useCallback(\r\n (props) =>\r\n Option && (\r\n \r\n ),\r\n [keyword]\r\n );\r\n return (\r\n void,\r\n isValid: boolean\r\n ) => (\r\n ({\r\n ...provided,\r\n width: \"100%\",\r\n minWidth: 191,\r\n }),\r\n control: /* istanbul ignore next */ (\r\n provided,\r\n state\r\n ) => ({\r\n ...provided,\r\n minHeight: 34,\r\n borderColor: isValid\r\n ? provided.borderColor\r\n : \"#a94442\",\r\n borderRadius: 0,\r\n }),\r\n menu: /* istanbul ignore next */ (provided, state) => ({\r\n ...provided,\r\n borderRadius: 0,\r\n marginTop: 0,\r\n }),\r\n menuPortal: /* istanbul ignore next */ (\r\n provided,\r\n state\r\n ) => ({\r\n ...provided,\r\n zIndex: 9999,\r\n }),\r\n valueContainer: /* istanbul ignore next */ (\r\n provided,\r\n state\r\n ) => ({\r\n ...provided,\r\n padding: \"0px 6px\",\r\n minHeight: 34,\r\n }),\r\n input: /* istanbul ignore next */ (\r\n provided,\r\n state\r\n ) => ({\r\n ...provided,\r\n margin: 0,\r\n padding: 0,\r\n }),\r\n dropdownIndicator: /* istanbul ignore next */ (\r\n provided,\r\n state\r\n ) => ({\r\n ...provided,\r\n padding: 4,\r\n }),\r\n clearIndicator: /* istanbul ignore next */ (\r\n provided,\r\n state\r\n ) => ({\r\n ...provided,\r\n padding: 4,\r\n }),\r\n option: /* istanbul ignore next */ (\r\n provided,\r\n state\r\n ) => {\r\n let style = {\r\n ...provided,\r\n display: \"flex\",\r\n width: \"100%\",\r\n alignItems: \"center\",\r\n };\r\n /* istanbul ignore next */\r\n if (state.isFocused) {\r\n return Object.assign({}, style, {\r\n boxShadow: \"none\",\r\n background: \"#f5f5f5\",\r\n textShadow: \"none\",\r\n cursor: \"pointer\",\r\n // border: \"1px solid #f5f5f5\"\r\n });\r\n }\r\n return style;\r\n },\r\n }}\r\n components={{\r\n Option: optionRenderer,\r\n }}\r\n // async loading\r\n cacheOptions={true}\r\n loadOptions={handleSearchAsYouType}\r\n // options\r\n getOptionLabel={\r\n /* istanbul ignore next */\r\n (option: UserPrincipalDTO | GroupPrincipalDTO) =>\r\n option.displayName\r\n }\r\n getOptionValue={\r\n /* istanbul ignore next */\r\n (option: UserPrincipalDTO | GroupPrincipalDTO) =>\r\n option.id\r\n }\r\n defaultOptions={true}\r\n isMulti={props.isMulti || false}\r\n // behaviour\r\n isClearable={props.isClearable || false}\r\n openMenuOnFocus={true}\r\n // localizations\r\n aria-label={loc.t(\"principal.search.prompt\", { types })}\r\n loadingMessage={\r\n /* istanbul ignore next */\r\n () => loc.t(\"principal.search.loading\")\r\n }\r\n placeholder={loc.t(\"principal.placeholder\", { types })}\r\n noOptionsMessage={\r\n /* istanbul ignore next */\r\n () => loc.t(\"principal.search.prompt\", { types })\r\n }\r\n // selection\r\n onInputChange={handleInputChange}\r\n onChange={(value) =>\r\n changeValue({\r\n currentTarget: {\r\n value:\r\n Array.isArray(value) && !value.length\r\n ? null\r\n : value,\r\n },\r\n })\r\n }\r\n menuPortalTarget={document.body}\r\n menuPlacement=\"auto\"\r\n closeMenuOnScroll={closeMenuOnScroll}\r\n value={props.value}\r\n autoFocus={props.autoFocus}\r\n {...componentProps}\r\n />\r\n )}\r\n {...props}\r\n />\r\n );\r\n};\r\n\r\nPrincipalEditorControl.displayName = \"PrincipalEditorControl\";\r\nexport default PrincipalEditorControl;\r\n","import React, { useCallback, useMemo } from \"react\";\r\nimport Icons from \"@hs/icons\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport PrincipalEditorControl from \"components/ExtraAttributes/EditorControl/PrincipalEditorControl\";\r\nimport EnumEditorControl from \"components/ExtraAttributes/EditorControl/EnumEditorControl\";\r\nimport { ShareType, type SharePrincipalDTO } from \"data/types\";\r\nimport loc from \"i18next\";\r\nimport { getLocalizedText } from \"data/utils\";\r\n\r\ntype Props = {\r\n onRemove: (value) => void,\r\n onChange: (value) => void,\r\n name: string,\r\n value?: SharePrincipalDTO,\r\n extras?: any,\r\n};\r\n\r\nconst SharePrincipalForm = ({\r\n onChange,\r\n onRemove,\r\n name,\r\n value: sharePrincipal,\r\n extras = { aclEnumValues: null, acl: null, newUserIdRef: null },\r\n}: Props) => {\r\n const handleChange = useCallback(\r\n (name: string, value: any) =>\r\n onChange({\r\n ...sharePrincipal,\r\n principal: sharePrincipal.principal\r\n ? { ...sharePrincipal.principal }\r\n : null,\r\n [name]: value,\r\n }),\r\n [onChange, sharePrincipal]\r\n );\r\n const aclEnumValuesWithDefault = useMemo(() => {\r\n const aclEnumValuesOrEmpty = extras.aclEnumValues || [];\r\n const withDefault = [...aclEnumValuesOrEmpty];\r\n const defaultAcl = aclEnumValuesOrEmpty.find(\r\n (enumValue) => enumValue.value === extras.acl\r\n );\r\n withDefault.unshift({\r\n value: null,\r\n label: loc.t(\"share:acl.default\", {\r\n default: defaultAcl\r\n ? getLocalizedText(defaultAcl.label)\r\n : \"n/a\",\r\n }),\r\n });\r\n return withDefault;\r\n }, [extras.aclEnumValues, extras.acl]);\r\n return (\r\n <>\r\n \r\n {extras.type === ShareType.Share && (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nSharePrincipalForm.displayName = \"SharePrincipalForm\";\r\nexport default SharePrincipalForm;\r\n","import React, { useCallback } from \"react\";\r\nimport Icons from \"@hs/icons\";\r\nimport ButtonToolbar from \"react-bootstrap/lib/ButtonToolbar\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport FormsyEditorBase from \"components/ExtraAttributes/EditorControl/FormsyEditorBase\";\r\nimport SharePrincipalForm from \"components/ShareModal/SharePrincipalForm\";\r\nimport loc from \"i18next\";\r\nimport { SharePrincipalType } from \"data/types\";\r\nimport styles from \"./SharePrincipal.module.css\";\r\n\r\ntype Props = {\r\n name: string,\r\n extras: any,\r\n value: Array,\r\n};\r\n\r\nconst SharePrincipalEditorControl = (props: Props) => {\r\n const handleChange = useCallback(\r\n (value, changeValue, currentPrincipal, currentIdx) =>\r\n changeValue({\r\n currentTarget: {\r\n value: value.map((principal, idx) =>\r\n idx === currentIdx ? currentPrincipal : principal\r\n ),\r\n },\r\n }),\r\n []\r\n );\r\n const handleRemove = useCallback((value, changeValue, currentIdx) => {\r\n const sharePrincipal = value.filter(\r\n (principal, idx) => idx !== currentIdx\r\n );\r\n changeValue({\r\n currentTarget: {\r\n value: sharePrincipal.length ? sharePrincipal : null,\r\n },\r\n });\r\n }, []);\r\n const { name, value, onChange } = props;\r\n const handleAdd = useCallback(() => {\r\n const principals = value != null ? [...value] : [];\r\n principals.push({\r\n $type: SharePrincipalType.Share,\r\n principal: null,\r\n acl: null,\r\n });\r\n onChange(name, principals);\r\n }, [onChange, name, value]);\r\n\r\n return (\r\n ,\r\n changeValue: (name: string, value?: ShareActionDTO) => void,\r\n isValid: boolean\r\n ) => (\r\n
\r\n {!Array.isArray(value) ? (\r\n \r\n {loc.t(\"share:principal.empty\")}\r\n \r\n ) : (\r\n value.map((sharePrincipal, idx) => (\r\n \r\n \r\n handleChange(\r\n value,\r\n changeValue,\r\n currentPrincipal,\r\n idx\r\n )\r\n }\r\n onRemove={() =>\r\n handleRemove(value, changeValue, idx)\r\n }\r\n />\r\n
\r\n ))\r\n )}\r\n \r\n \r\n {\" \"}\r\n {loc.t(\"share:principal.new\")}\r\n \r\n \r\n \r\n )}\r\n {...props}\r\n />\r\n );\r\n};\r\n\r\nSharePrincipalEditorControl.displayName = \"SharePrincipalEditorControl\";\r\nexport default SharePrincipalEditorControl;\r\n","import React from \"react\";\r\nimport Alert from \"react-bootstrap/lib/Alert\";\r\nimport loc from \"i18next\";\r\nimport styles from \"./ExternalUser.module.css\";\r\n\r\ntype Props = {\r\n value: Array,\r\n onDelete?: () => void,\r\n};\r\n\r\nconst ExternalUserViewerControl = ({ value, onDelete }: Props) => (\r\n
\r\n \r\n \r\n
\r\n {value.map((user) => (\r\n \r\n {user.displayName}\r\n {typeof onDelete === \"function\" && (\r\n onDelete(user.id)}\r\n >\r\n ×\r\n \r\n )}\r\n
\r\n ))}\r\n
\r\n \r\n \r\n);\r\n\r\nExternalUserViewerControl.displayName = \"ExternalUserViewerControl\";\r\nexport default ExternalUserViewerControl;\r\n","import React, { useMemo } from \"react\";\r\nimport Alert from \"react-bootstrap/lib/Alert\";\r\nimport loc from \"i18next\";\r\nimport styles from \"./ShareAction.module.css\";\r\nimport Icons from \"@hs/icons\";\r\nimport { getShareDate } from \"components/ShareModal/Utils\";\r\n\r\ntype Props = {\r\n isDoc: boolean,\r\n value: ShareActionDTO,\r\n onEdit: () => void,\r\n extras?: any,\r\n};\r\n\r\nconst ShareActionViewerControl = ({\r\n itemKey,\r\n value,\r\n onEdit,\r\n extras = {},\r\n}: Props) => {\r\n const { type, expires, acl } = value;\r\n const { count, docCount, folderCount } = extras;\r\n const [identifier, context] = useMemo(\r\n () => [\r\n `${type}.${itemKey}`,\r\n {\r\n acl: loc.t(`share:acl.${acl}`),\r\n date: getShareDate(expires),\r\n count,\r\n document: loc.t(`share:name.document`, { count: docCount }),\r\n folder: loc.t(`share:name.folder`, { count: folderCount }),\r\n },\r\n ],\r\n [type, expires, acl, itemKey, count, docCount, folderCount]\r\n );\r\n return (\r\n
\r\n \r\n {\" \"}\r\n {loc.t(`share:action.${identifier}`, context)}\r\n \r\n
\r\n );\r\n};\r\n\r\nShareActionViewerControl.displayName = \"ShareActionViewerControl\";\r\nexport default ShareActionViewerControl;\r\n","import React from \"react\";\r\nimport styles from \"./Attachments.module.css\";\r\nimport InputGroup from \"react-bootstrap/lib/InputGroup\";\r\nimport AttributeLabel from \"components/ExtraAttributes/AttributeLabel\";\r\nimport ViewerControlBase from \"components/ExtraAttributes/ViewerControl/ViewerControlBase\";\r\nimport Icons from \"@hs/icons\";\r\nimport { getBytes } from \"../Utils\";\r\nimport { type ShareAttachment } from \"data/types\";\r\n\r\nconst AttachmentsViewerControl = ({\r\n header,\r\n value: attachments,\r\n ext,\r\n showBytes = true,\r\n}: {\r\n header?: string,\r\n value: Array,\r\n ext?: string,\r\n showBytes?: boolean,\r\n}) =>\r\n attachments?.map((attachment, i) =>\r\n attachment == null ? null : (\r\n \r\n {header && }\r\n \r\n \r\n \r\n \r\n \r\n \r\n {attachment.name}\r\n {showBytes && (\r\n \r\n {\" \"}\r\n {\" (\" + getBytes(attachment.size) + \")\"}\r\n \r\n )}\r\n \r\n \r\n \r\n )\r\n );\r\n\r\nAttachmentsViewerControl.displayName = \"AttachmentsViewerControl\";\r\nexport default AttachmentsViewerControl;\r\n","import React, {\r\n useCallback,\r\n useState,\r\n useMemo,\r\n useEffect,\r\n useRef,\r\n} from \"react\";\r\nimport Formsy from \"formsy-react\";\r\nimport loc from \"i18next\";\r\nimport ShareActionEditorControl from \"./EditorControl/ShareAction\";\r\nimport SharePrincipalEditorControl from \"./EditorControl/SharePrincipal\";\r\nimport PrincipalEditorControl from \"components/ExtraAttributes/EditorControl/PrincipalEditorControl\";\r\nimport MemoEditorControl from \"components/ExtraAttributes/EditorControl/MemoEditorControl\";\r\nimport ExternalUserViewerControl from \"./ViewerControl/ExternalUser\";\r\nimport ShareActionViewerControl from \"./ViewerControl/ShareAction\";\r\nimport AttachmentsViewerControl from \"./ViewerControl/Attachments\";\r\nimport { getEnumIcon } from \"./Utils\";\r\nimport {\r\n AllowedShareActionFlags,\r\n ShareType,\r\n SharePrincipalType,\r\n type ShareTypeEnum,\r\n type ShareFormDTO,\r\n type EnumValue,\r\n} from \"data/types\";\r\n\r\ntype Props = {\r\n items: Array,\r\n share: ShareFormDTO,\r\n setCanSubmit: () => void,\r\n handleSave: () => void,\r\n handleChange: () => void,\r\n handleConfirm: (name: string, value: ShareTypeEnum) => Promise,\r\n isAdvanced: boolean,\r\n isDoc: boolean,\r\n isEdit: boolean,\r\n attachments?: Array,\r\n aclEnumValues?: Array>,\r\n folderCount: number,\r\n docCount: number,\r\n};\r\n\r\nconst ShareForm = ({\r\n items,\r\n share,\r\n setCanSubmit,\r\n handleSave,\r\n handleChange,\r\n handleConfirm,\r\n isAdvanced,\r\n setIsAdvanced,\r\n allowedShareActionFlags,\r\n aclEnumValues,\r\n isDoc,\r\n isEdit,\r\n attachments,\r\n itemKey,\r\n folderCount,\r\n docCount,\r\n}: Props) => {\r\n const disableSubmit = useCallback(\r\n () => setCanSubmit(false),\r\n [setCanSubmit]\r\n );\r\n const enableSubmit = useCallback(() => setCanSubmit(true), [setCanSubmit]);\r\n const [isActionEdit, setIsActionEdit] = useState(false);\r\n const [oldAdvanced, setOldAdvanced] = useState(!isAdvanced);\r\n const toggleFlag = useCallback((flag, setFlag) => setFlag(!flag), []);\r\n const principals = useMemo(\r\n () => (share.principals == null ? [] : share.principals),\r\n [share.principals]\r\n );\r\n\r\n const newUserId = useRef(0);\r\n\r\n useEffect(() => {\r\n // Only re-calculate principals if isAdvanced has changed\r\n if (oldAdvanced === isAdvanced) {\r\n return;\r\n }\r\n\r\n // Only re-calculate principals if there are any and NOT while editing\r\n if (!principals.length || isEdit) {\r\n setOldAdvanced(isAdvanced);\r\n return;\r\n }\r\n\r\n if (isAdvanced) {\r\n handleChange(\r\n \"principals\",\r\n principals.map((r) => ({\r\n principal: r,\r\n acl: null,\r\n $type: SharePrincipalType.Share,\r\n }))\r\n );\r\n } else {\r\n const changedPrincipals = principals\r\n .filter((r) => r.principal != null)\r\n .map((r) => r.principal);\r\n handleChange(\r\n \"principals\",\r\n changedPrincipals.length > 0 ? changedPrincipals : null\r\n );\r\n }\r\n setOldAdvanced(isAdvanced);\r\n }, [isAdvanced, oldAdvanced, handleChange, principals, isEdit]);\r\n\r\n // ExternalUser\r\n const externalUsers = useMemo(\r\n () =>\r\n principals\r\n .filter((r) =>\r\n r && Object.prototype.hasOwnProperty.call(r, \"principal\")\r\n ? r.principal && r.principal.id < 0\r\n : r && r.id < 0\r\n )\r\n .map((r) =>\r\n Object.prototype.hasOwnProperty.call(r, \"principal\")\r\n ? r.principal\r\n : r\r\n ),\r\n [principals]\r\n );\r\n const handleUserRemove = useCallback(\r\n (id: int) => {\r\n const changedPrincipals = principals.filter((r) =>\r\n Object.prototype.hasOwnProperty.call(r, \"principal\")\r\n ? r.principal.id !== id\r\n : r.id !== id\r\n );\r\n handleChange(\r\n \"principals\",\r\n changedPrincipals.length ? changedPrincipals : null\r\n );\r\n },\r\n [principals, handleChange]\r\n );\r\n\r\n const typeEnumValues = useMemo(\r\n (): Array> =>\r\n Object.keys(ShareType)\r\n .filter(\r\n (key) =>\r\n ((allowedShareActionFlags &\r\n AllowedShareActionFlags.Anonym) >\r\n 0 &&\r\n ShareType[key] === ShareType.Anonym) ||\r\n ((allowedShareActionFlags &\r\n AllowedShareActionFlags.WebShare) >\r\n 0 &&\r\n ShareType[key] === ShareType.WebShare) ||\r\n ((allowedShareActionFlags &\r\n AllowedShareActionFlags.Share) >\r\n 0 &&\r\n ShareType[key] === ShareType.Share) ||\r\n ((allowedShareActionFlags &\r\n AllowedShareActionFlags.Link) >\r\n 0 &&\r\n ShareType[key] === ShareType.Link) ||\r\n (isDoc &&\r\n (allowedShareActionFlags &\r\n AllowedShareActionFlags.Attachment) >\r\n 0 &&\r\n ShareType[key] === ShareType.Attachment) ||\r\n (isDoc &&\r\n (allowedShareActionFlags &\r\n AllowedShareActionFlags.Pdf) >\r\n 0 &&\r\n ShareType[key] === ShareType.Pdf)\r\n )\r\n .map((key) => ({\r\n value: ShareType[key],\r\n label: `$share:type.${ShareType[key]}`,\r\n icon: getEnumIcon(ShareType[key]),\r\n })),\r\n [allowedShareActionFlags, isDoc]\r\n );\r\n\r\n const extras = useMemo(\r\n () => ({\r\n items,\r\n newUserIdRef: newUserId,\r\n type: share.action.type,\r\n acl: share.action.acl,\r\n aclEnumValues,\r\n typeEnumValues,\r\n count: folderCount + docCount,\r\n docCount,\r\n folderCount,\r\n }),\r\n [\r\n share.action.type,\r\n share.action.acl,\r\n aclEnumValues,\r\n typeEnumValues,\r\n items,\r\n folderCount,\r\n docCount,\r\n ]\r\n );\r\n\r\n return (\r\n \r\n {isAdvanced ? (\r\n <>\r\n \r\n \r\n \r\n ) : (\r\n <>\r\n {isActionEdit ? (\r\n \r\n toggleFlag(isActionEdit, setIsActionEdit)\r\n }\r\n />\r\n ) : (\r\n \r\n toggleFlag(isActionEdit, setIsActionEdit)\r\n }\r\n />\r\n )}\r\n \r\n \r\n )}\r\n {share.action.type === ShareType.Share &&\r\n externalUsers.length > 0 && (\r\n \r\n )}\r\n {share.action.type !== ShareType.Share && (\r\n \r\n )}\r\n {share.action.type === ShareType.Pdf && (\r\n \r\n )}\r\n {share.action.type === ShareType.Attachment && (\r\n \r\n )}\r\n \r\n );\r\n};\r\n\r\nShareForm.displayName = \"ShareForm\";\r\nexport default ShareForm;\r\n","import React, { useCallback, useState, useEffect } from \"react\";\r\nimport isEqual from \"lodash/isEqual\";\r\nimport { useAsync, useAbortController, usePersistSetting } from \"hooks\";\r\nimport {\r\n fetchShare,\r\n deleteShare,\r\n createShare,\r\n updateShare,\r\n checkShareName,\r\n} from \"data/api\";\r\nimport Constants from \"data/constants\";\r\nimport Status from \"components/Status\";\r\nimport { createModal } from \"react-modal-promise\";\r\nimport { openConfirmModal } from \"components/ConfirmModal\";\r\nimport { toastActionResult } from \"data/toast\";\r\nimport loc from \"i18next\";\r\nimport Modal, { ModalSize } from \"components/Modal\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport Checkbox from \"react-bootstrap/lib/Checkbox\";\r\nimport Icons from \"@hs/icons\";\r\nimport ShareForm from \"./ShareForm\";\r\nimport styles from \"./ShareModal.module.css\";\r\nimport {\r\n getShareDate,\r\n isEditable,\r\n getActionKey,\r\n} from \"components/ShareModal/Utils\";\r\nimport {\r\n AllowedShareActionFlags,\r\n ShareType,\r\n ShareAccessControlListType,\r\n type ShareDTO,\r\n type ShareFormDTO,\r\n type ShareAttachment,\r\n type AllowedShareActionFlagsEnum,\r\n} from \"data/types\";\r\n\r\ntype Props = {\r\n open: boolean,\r\n close: () => void,\r\n itemUris: Array,\r\n items: Array,\r\n name: string,\r\n isEdit: boolean,\r\n canEdit: boolean,\r\n isDoc: boolean,\r\n allowedShareActionFlags: AllowedShareActionFlagsEnum,\r\n aclEnumValues?: Array>,\r\n attachments?: Array,\r\n shareType?: ShareTypeEnum,\r\n folderCount: number,\r\n docCount: number,\r\n};\r\n\r\nconst getShare = async (\r\n allowedShareActionFlags: AllowedShareActionFlagsEnum,\r\n itemUris: Array,\r\n shareAs: Array,\r\n shareType: ShareTypeEnum\r\n): ShareFormDTO => ({\r\n itemUris,\r\n action: {\r\n allowedFlags: allowedShareActionFlags,\r\n type: shareType,\r\n acl: ShareAccessControlListType.View,\r\n shareAs: await checkShareName(itemUris, shareAs), //Always get an initial valid shareAs\r\n expires: null,\r\n },\r\n principals: null,\r\n message: null,\r\n});\r\n\r\nexport const ShareModal = (props: Props) => {\r\n const {\r\n open,\r\n close,\r\n itemUris,\r\n items,\r\n name,\r\n itemKey,\r\n isEdit,\r\n canEdit,\r\n isDoc,\r\n allowedShareActionFlags: allowedShareActionFlagsFromProps,\r\n aclEnumValues,\r\n attachments,\r\n shareType: shareTypeFromProps,\r\n folderCount,\r\n docCount,\r\n } = props;\r\n\r\n // Load persisted settings\r\n const [isAdvancedFromSettings, persistIsAdvancedToSettings] =\r\n usePersistSetting({\r\n name: \"shareIsAdvanced\",\r\n defaultValue: false,\r\n });\r\n const [shareTypeFromSettings, persistShareTypeToSettings] =\r\n usePersistSetting({\r\n name: \"shareDefaultType\",\r\n defaultValue: ShareType.Share,\r\n });\r\n const [isPersisted, persistIsPersisted] = usePersistSetting({\r\n name: \"shareIsPersisted\",\r\n defaultValue: false,\r\n });\r\n\r\n // Setup variables\r\n const [share, setShare] = useState();\r\n const [shareAs, setShareAs] = useState();\r\n const [canSubmit, setCanSubmit] = useState(false);\r\n const [isSubmitting, setIsSubmitting] = useState(false);\r\n const [isAdvanced, setIsAdvanced] = useState(\r\n isEdit || isAdvancedFromSettings\r\n );\r\n const [allowedShareActionFlags, setAllowedShareActionFlags] = useState(\r\n allowedShareActionFlagsFromProps\r\n );\r\n const shareType = shareTypeFromProps || shareTypeFromSettings;\r\n\r\n const abortController = useAbortController();\r\n\r\n const state = useAsync(async () => {\r\n if (isEdit) {\r\n try {\r\n return await fetchShare(\r\n itemUris[0],\r\n abortController().signal\r\n ).then((share) => {\r\n setAllowedShareActionFlags(share.action.allowedFlags);\r\n setShareAs(share.action.shareAs); //Update name to NOT check again.\r\n setShare(share);\r\n });\r\n } catch (err) {\r\n console.warn(\"Error while fetchShare\", err);\r\n throw err;\r\n }\r\n } else {\r\n setShare(\r\n await getShare(\r\n allowedShareActionFlags,\r\n itemUris,\r\n items.map((i) => i.name),\r\n shareType\r\n )\r\n );\r\n }\r\n }, []);\r\n\r\n const handleConfirm = useCallback(\r\n (name: string, value: ShareTypeEnum) => {\r\n if (!isEdit && canEdit && name === \"type\" && isEditable(value)) {\r\n if (items.length > 1) {\r\n toastActionResult(\r\n false,\r\n \"share:action_update\",\r\n {\r\n name,\r\n context: \"multiple\",\r\n },\r\n \"multi_share_edit\"\r\n );\r\n } else {\r\n return openConfirmModal({\r\n body: loc.t(\r\n `share:action_update.confirmBody.${itemKey}`\r\n ),\r\n confirmButton: loc.t(\"share:action_update.confirmYes\"),\r\n }).then(\r\n (success) =>\r\n success &&\r\n (close() ||\r\n openShareModal({ ...props, isEdit: true }))\r\n );\r\n }\r\n }\r\n return new Promise((resolve) => resolve(true));\r\n },\r\n [props, isEdit, canEdit, close, itemKey, items]\r\n );\r\n\r\n // Handle not allowed Share Types (by Settings or Acl)\r\n useEffect(() => {\r\n // Wait until initial share is loaded\r\n if (state.loading || state.error || share == null) return;\r\n\r\n const shareTypeKey = Object.keys(ShareType).find(\r\n (key) => ShareType[key] === share.action.type\r\n );\r\n let changeShareType = false;\r\n /* istanbul ignore else */\r\n if (\r\n shareTypeKey == null ||\r\n !(\r\n (allowedShareActionFlags &\r\n AllowedShareActionFlags[shareTypeKey]) >\r\n 0\r\n )\r\n ) {\r\n console.warn(\r\n `ShareType \"${ShareType[shareTypeKey]}\" is not allowed by AllowedShareActionFlags`\r\n );\r\n changeShareType = true;\r\n }\r\n\r\n /* istanbul ignore else */\r\n if (canEdit && !isEdit && share.action.type === ShareType.Share) {\r\n console.warn(\r\n `You can only create one Share per itemUri, changing to next available ShareType`\r\n );\r\n changeShareType = true;\r\n handleConfirm(\"type\", ShareType.Share);\r\n }\r\n\r\n /* istanbul ignore else */\r\n if (changeShareType) {\r\n const newShareTypeKey = Object.keys(ShareType).find(\r\n (key) =>\r\n key !== shareTypeKey &&\r\n (allowedShareActionFlags & AllowedShareActionFlags[key]) > 0\r\n );\r\n if (newShareTypeKey == null) {\r\n toastActionResult(false, \"share:action_allowed\", {\r\n name,\r\n });\r\n close();\r\n }\r\n setShare({\r\n ...share,\r\n action: { ...share.action, type: ShareType[newShareTypeKey] },\r\n });\r\n }\r\n }, [\r\n name,\r\n isEdit,\r\n canEdit,\r\n handleConfirm,\r\n allowedShareActionFlags,\r\n share,\r\n state.error,\r\n state.loading,\r\n close,\r\n ]);\r\n\r\n const handleChange = useCallback((name: string, value: any) => {\r\n setShare((r) => ({ ...r, [name]: value }));\r\n }, []);\r\n\r\n const handlePersistSettings = useCallback(() => {\r\n if (isPersisted === false) {\r\n return;\r\n }\r\n persistShareTypeToSettings(share.action.type);\r\n persistIsAdvancedToSettings(isAdvanced);\r\n }, [\r\n share,\r\n isAdvanced,\r\n isPersisted,\r\n persistShareTypeToSettings,\r\n persistIsAdvancedToSettings,\r\n ]);\r\n\r\n const upsertShare = useCallback(\r\n (shareAs: ?Array = null) => {\r\n setIsSubmitting(true);\r\n const upsertShare = isEdit ? updateShare : createShare;\r\n const SHARE: ShareDTO = {\r\n names: items?.map((i) => i.name),\r\n itemUris: items?.map((i) => i.itemUri),\r\n action: { ...share.action },\r\n principals: share.principals,\r\n message: share.message,\r\n };\r\n if (shareAs != null) {\r\n SHARE.action.shareAs = shareAs;\r\n }\r\n const locContext = {\r\n name: items.length > 1 ? name : SHARE.action.shareAs.join(\", \"),\r\n date: getShareDate(SHARE.action.expires),\r\n };\r\n upsertShare(SHARE, abortController(true).signal)\r\n .then((success) => {\r\n toastActionResult(\r\n success,\r\n `share:action_${getActionKey(isEdit)}`,\r\n locContext\r\n );\r\n if (success) close();\r\n else setIsSubmitting(false);\r\n })\r\n .catch(() => {\r\n setIsSubmitting(false);\r\n toastActionResult(\r\n false,\r\n `share:action_${getActionKey(isEdit)}`,\r\n locContext\r\n );\r\n });\r\n },\r\n [isEdit, share, abortController, close, items, name]\r\n );\r\n\r\n const handleSave = useCallback(() => {\r\n if (\r\n share.action.type === ShareType.Share &&\r\n !isEqual(share.action.shareAs, shareAs)\r\n ) {\r\n // if share AND shareAs not initial value check for unique share name\r\n // NOTE: Formsy validation, cannot handle async validation with ajax calls\r\n checkShareName(\r\n itemUris,\r\n share.action.shareAs,\r\n abortController(true).signal\r\n )\r\n .then((proposedShareAs) => {\r\n if (!isEqual(proposedShareAs, share.action.shareAs)) {\r\n // i18n context\r\n const name = share.action.shareAs.filter(\r\n (s, i) => s !== proposedShareAs[i]\r\n );\r\n const proposed = proposedShareAs.filter(\r\n (s, i) => s !== share.action.shareAs[i]\r\n );\r\n // if shareAs is already present, await confirmation\r\n openConfirmModal({\r\n body: loc.t(\"share:action_unique.confirmBody\", {\r\n name,\r\n proposed,\r\n }),\r\n confirmButton: loc.t(\r\n \"share:action_unique.confirmYes\",\r\n { proposed }\r\n ),\r\n }).then((confirmed) => {\r\n /* istanbul ignore else */\r\n if (confirmed === true) {\r\n upsertShare(proposedShareAs);\r\n } else {\r\n setIsAdvanced(true);\r\n }\r\n });\r\n } else {\r\n // if shareAs is OK\r\n upsertShare();\r\n }\r\n })\r\n .catch(() => toastActionResult(false, \"share:action_unique\"));\r\n } else {\r\n upsertShare();\r\n }\r\n handlePersistSettings();\r\n }, [\r\n upsertShare,\r\n share,\r\n abortController,\r\n itemUris,\r\n shareAs,\r\n handlePersistSettings,\r\n ]);\r\n\r\n const handleDelete = useCallback(() => {\r\n openConfirmModal({\r\n body: loc.t(\"share:action_delete.confirmBody\", { name }),\r\n confirmButton: loc.t(\"share:action_delete.confirmYes\"),\r\n }).then((confirmed) => {\r\n /* istanbul ignore else */\r\n if (confirmed === true) {\r\n deleteShare(itemUris[0], abortController(true).signal)\r\n .then((success) => {\r\n toastActionResult(success, \"share:action_delete\");\r\n if (success) close();\r\n })\r\n .catch(() => {\r\n toastActionResult(false, \"share:action_delete\");\r\n });\r\n }\r\n });\r\n }, [itemUris, abortController, close, name]);\r\n return (\r\n close(false)}\r\n dialogClassName={styles.modal}\r\n docked\r\n >\r\n \r\n \r\n {\" \"}\r\n {loc.t(\"share:title\", { name })}\r\n \r\n \r\n \r\n {state.loading || state.error ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n \r\n persistIsPersisted(!isPersisted)}\r\n checked={isPersisted}\r\n >\r\n {loc.t(\"share:persist\")}\r\n \r\n close(false)}\r\n bsStyle=\"link\"\r\n className=\"pull-left\"\r\n >\r\n {loc.t(\"cancel\")}\r\n \r\n {!(state.loading || state.error) && (\r\n <>\r\n {isEdit ? (\r\n \r\n {loc.t(\"share:stop\")}\r\n \r\n ) : (\r\n setIsAdvanced(!isAdvanced)}\r\n bsStyle=\"link\"\r\n >\r\n {loc.t(\r\n `share:${\r\n isAdvanced ? \"simple\" : \"advanced\"\r\n }`\r\n )}\r\n \r\n )}\r\n \r\n {isSubmitting && (\r\n \r\n )}{\" \"}\r\n {loc.t(`share:${getActionKey(isEdit)}`)}\r\n \r\n \r\n )}\r\n \r\n \r\n );\r\n};\r\n\r\nShareModal.displayName = \"ShareModal\";\r\nexport const openShareModal = createModal(ShareModal);\r\n","import { openShareModal } from \"components/ShareModal\";\r\nimport { fetchShareAttachment, fetchShareContext } from \"data/api\";\r\nimport {\r\n AllowedShareActionFlags,\r\n ItemStatuses,\r\n type ItemStatusesDTO,\r\n type ShareTypeEnum,\r\n type ShareAttachment,\r\n} from \"data/types\";\r\nimport { toastActionResult } from \"data/toast\";\r\nimport { getEnumIcon } from \"components/ShareModal/Utils\";\r\nimport loc from \"i18next\";\r\n\r\ntype Context = {\r\n itemUri: string,\r\n formatId: number,\r\n name: string,\r\n itemStatus: ItemStatusesDTO,\r\n isDoc: boolean,\r\n isEdit: boolean,\r\n shareType?: ShareTypeEnum,\r\n multiple?: boolean,\r\n items?: Array,\r\n};\r\n\r\nclass share {\r\n constructor() {\r\n this.execute = this.execute.bind(this);\r\n this.getAttachment = this.getAttachment.bind(this);\r\n }\r\n\r\n logger: () => any = toastActionResult;\r\n\r\n async getAttachment(itemUri: string): ShareAttachment {\r\n try {\r\n return await fetchShareAttachment(itemUri);\r\n } catch {\r\n console.error(`Error while fetching document context (${itemUri})`);\r\n return null;\r\n }\r\n }\r\n\r\n getModalProps({ multiple, isDoc, name, items }) {\r\n if (multiple) {\r\n const docCount = items.filter((i) => i.isDoc).length;\r\n const folderCount = items.length - docCount;\r\n const itemKey =\r\n folderCount && docCount\r\n ? \"mixed\"\r\n : docCount\r\n ? \"document\"\r\n : \"folder\";\r\n return {\r\n docCount,\r\n folderCount,\r\n itemKey,\r\n name: loc.t(`share:name.${itemKey}`, {\r\n document: loc.t(`share:name.document`, { count: docCount }),\r\n folder: loc.t(`share:name.folder`, { count: folderCount }),\r\n count: docCount + folderCount,\r\n }),\r\n };\r\n }\r\n return {\r\n docCount: isDoc ? 1 : 0,\r\n folderCount: isDoc ? 0 : 1,\r\n name,\r\n itemKey: isDoc ? \"document\" : \"folder\",\r\n };\r\n }\r\n\r\n /**\r\n * Opens Modal to (update/create) Share for folder/document\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ formatId: number }} { formatId }\r\n * @param {{ name: string }} { name }\r\n * @param {{ itemStatus?: ItemStatusesDTO }} { itemStatus }\r\n * @param {{ isDoc?: bool }} { isDoc }\r\n * @param {{ isEdit?: bool }} { isEdit }\r\n * @param {{ shareType?: ShareTypeEnum }} { shareType }\r\n * @param {{ items?: Array }} { items }\r\n * @param {{ multiple?: bool }} { multiple }\r\n */\r\n async execute({\r\n itemUri,\r\n formatId,\r\n name,\r\n itemStatus = ItemStatuses.Nothing,\r\n isDoc = false,\r\n isEdit = false,\r\n shareType,\r\n items,\r\n multiple,\r\n }: Context) {\r\n const itemUris = [];\r\n const formatIds = [];\r\n let attachments = [];\r\n if (multiple) {\r\n for (let item of items) {\r\n itemUris.push(item.itemUri);\r\n formatIds.push(item.formatId ?? -1);\r\n item.isDoc &&\r\n attachments.push(await this.getAttachment(item.itemUri));\r\n }\r\n } else {\r\n itemUris.push(itemUri);\r\n formatIds.push(formatId ?? -1);\r\n isDoc && attachments.push(await this.getAttachment(itemUri));\r\n }\r\n attachments = attachments.filter((a) => !!a);\r\n const {\r\n allowedActions:\r\n allowedShareActionFlags = AllowedShareActionFlags.Default,\r\n allowedAcl,\r\n shareType: shareTypeFromContext,\r\n } = await fetchShareContext(itemUris, formatIds);\r\n const aclEnumValues = allowedAcl?.map((value) => ({\r\n value,\r\n label: `$share:acl.${value}`,\r\n icon: getEnumIcon(value),\r\n }));\r\n\r\n // bail if no share action is available\r\n /* istanbul ignore else */\r\n if (\r\n !(\r\n (allowedShareActionFlags & AllowedShareActionFlags.Link) > 0 ||\r\n (allowedShareActionFlags & AllowedShareActionFlags.Share) > 0 ||\r\n (allowedShareActionFlags & AllowedShareActionFlags.Attachment) >\r\n 0 ||\r\n (allowedShareActionFlags & AllowedShareActionFlags.Pdf) > 0 ||\r\n (allowedShareActionFlags & AllowedShareActionFlags.Anonym) >\r\n 0 ||\r\n (allowedShareActionFlags & AllowedShareActionFlags.WebShare) > 0\r\n )\r\n ) {\r\n this.logger(false, \"share:action_allowed\", {\r\n name,\r\n });\r\n return;\r\n }\r\n\r\n await openShareModal({\r\n itemUris,\r\n items: items || [{ itemUri, isDoc, name }],\r\n isEdit: isEdit && (itemStatus & ItemStatuses.Share) > 0,\r\n canEdit: (itemStatus & ItemStatuses.Share) > 0,\r\n isDoc,\r\n allowedShareActionFlags,\r\n aclEnumValues,\r\n attachments: attachments.length && attachments,\r\n shareType: shareType || shareTypeFromContext?.toLowerCase(),\r\n ...this.getModalProps({ isDoc, name, items, multiple }),\r\n });\r\n return true;\r\n }\r\n}\r\nexport default share;\r\n","import share from \"./share\";\r\nimport { ShareType } from \"data/types\";\r\n\r\n/**\r\n * opens the share dialog with share type link\r\n */\r\nclass folder_emailAttachment extends share {\r\n execute = (context) =>\r\n super.execute({ ...context, shareType: ShareType.Link });\r\n}\r\nexport default folder_emailAttachment;\r\n","import history from \"data/history\";\r\nimport { getRoute } from \"components/ItemUriLink\";\r\nimport { getFolderUri } from \"data/utils\";\r\n\r\n/**\r\n * opens the folder browse in current or newWindow\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ newWindow?: boolean}} { newWindow }\r\n * @param {{ toggles?: string | Array}} { toggles }\r\n */\r\n\r\ntype Context = {\r\n itemUri: string,\r\n newWindow?: boolean,\r\n toggles?: string | Array,\r\n};\r\n\r\nclass folder_preview {\r\n execute = ({ itemUri, newWindow, toggles }: Context) => {\r\n const folderUri = getFolderUri(itemUri);\r\n if (newWindow) {\r\n window.open(\r\n getRoute(folderUri, true, true, false, toggles),\r\n \"\",\r\n `status=no,location=no,toolbar=no,menubar=no,width=600px,height=640px,top=${\r\n Math.random() * 100\r\n },left=${Math.random() * 100}`\r\n );\r\n } else {\r\n history.push(getRoute(folderUri, false, false, false, toggles));\r\n }\r\n return true;\r\n };\r\n}\r\nexport default folder_preview;\r\n","/**\r\n * execute cancel of current form\r\n */\r\n\r\ntype Props = {\r\n onCancel?: () => void,\r\n};\r\n\r\nclass form_cancel {\r\n execute = ({ onCancel }: Props) => {\r\n if (typeof onCancel !== \"function\") {\r\n return false;\r\n }\r\n onCancel();\r\n return true;\r\n };\r\n}\r\nexport default form_cancel;\r\n","/**\r\n * execute clear of current form\r\n */\r\n\r\ntype Props = {\r\n onClear?: () => void,\r\n};\r\n\r\nclass form_clear {\r\n execute = ({ onClear }: Props) => {\r\n if (typeof onClear !== \"function\") {\r\n return false;\r\n }\r\n onClear();\r\n return true;\r\n };\r\n}\r\nexport default form_clear;\r\n","import * as API from \"data/api\";\r\nimport { SearchItemType, type SearchRequestDTO } from \"data/types\";\r\nimport { toastActionResult } from \"data/toast\";\r\n\r\n/**\r\n * toggles favorite flag for the given search request\r\n *\r\n * @param {{ searchRequest: SearchRequestDTO }} { searchRequest }\r\n */\r\nclass search_favorite {\r\n logger: () => any = toastActionResult;\r\n execute = async ({\r\n searchRequest,\r\n }: {\r\n searchRequest: SearchRequestDTO,\r\n }) => {\r\n const endpoint =\r\n searchRequest.searchType === SearchItemType.Favorite\r\n ? \"delFavoriteLink\"\r\n : \"addSearchFavorite\";\r\n const message =\r\n searchRequest.searchType === SearchItemType.Favorite\r\n ? \"breadcrumb.delfav\"\r\n : \"breadcrumb.addfav\";\r\n const payload =\r\n searchRequest.searchType === SearchItemType.Favorite\r\n ? searchRequest.id\r\n : searchRequest;\r\n try {\r\n const success = await API[endpoint](payload);\r\n this.logger(success, message, {\r\n name: searchRequest.name,\r\n });\r\n return true;\r\n } catch (error) {\r\n this.logger(false, message, { name: searchRequest.name });\r\n return false;\r\n }\r\n };\r\n}\r\nexport default search_favorite;\r\n","import history from \"data/history\";\r\nimport { searchRouteWithItem } from \"components/ItemUriLink\";\r\nimport { type SearchRequestDTO } from \"data/types\";\r\n\r\n/**\r\n * opens preview for the given search request\r\n *\r\n * @param {{ searchRequest: SearchRequestDTO }} { searchRequest }\r\n * @param {{ newWindow: bool}} { newWindow }\r\n */\r\n\r\nclass search_preview {\r\n execute = ({\r\n searchRequest,\r\n newWindow,\r\n }: {\r\n searchRequest: SearchRequestDTO,\r\n newWindow: boolean,\r\n }) => {\r\n const searchResultUrl = searchRouteWithItem(searchRequest);\r\n newWindow\r\n ? window.open(\r\n searchResultUrl,\r\n \"\",\r\n `status=no,location=no,toolbar=no,menubar=no,width=600px,height=640px,top=${\r\n Math.random() * 100\r\n },left=${Math.random() * 100}`\r\n )\r\n : history.push(searchResultUrl);\r\n return true;\r\n };\r\n}\r\nexport default search_preview;\r\n","import { openPickerModal, PickerType } from \"components/PickerModal\";\r\nimport { SearchScope, type SearchScopeEnum } from \"data/types\";\r\nimport loc from \"i18next\";\r\n\r\n/**\r\n * Change scope of current searchForm\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ name: string }} { name }\r\n * @param {{ onSearchScopeChange: function }} { onSearchScopeChange }\r\n */\r\n\r\ntype Context = {\r\n itemUri: string,\r\n name: string,\r\n onSearchScopeChange: (\r\n searchScope: SearchScopeEnum,\r\n itemUri: ?string\r\n ) => void,\r\n};\r\n\r\nclass search_scope {\r\n execute = async ({ itemUri, name, onSearchScopeChange }: Context) => {\r\n // let targetName = name;\r\n const targetItemUri = await openPickerModal({\r\n pickerType: PickerType.Folder,\r\n scopeBreadcrumb: false,\r\n itemUri,\r\n canChangeSite: true,\r\n helpText: loc.t(\"commandAction:search_scope.helpText\", { name }),\r\n selectButton: loc.t(\"commandAction:search_scope.name\"),\r\n });\r\n if (targetItemUri === false) return false;\r\n try {\r\n onSearchScopeChange(SearchScope.CurrentFolder, targetItemUri);\r\n return true;\r\n } catch (error) {\r\n return false;\r\n }\r\n };\r\n}\r\n\r\nexport default search_scope;\r\n","/**\r\n * toggle operators of current form\r\n */\r\n\r\ntype Props = {\r\n showSearchOperators: SettingValueProps,\r\n};\r\n\r\nclass searchForm_operator {\r\n execute = ({ showSearchOperators }: Props) => {\r\n if (showSearchOperators == null) return false;\r\n const { value, setValue } = showSearchOperators;\r\n setValue(!value);\r\n return true;\r\n };\r\n}\r\nexport default searchForm_operator;\r\n","/**\r\n * toggle scope of current form\r\n */\r\n\r\ntype Props = {\r\n showSearchScope: SettingValueProps,\r\n};\r\n\r\nclass searchForm_scope {\r\n execute = ({ showSearchScope }: Props) => {\r\n if (showSearchScope == null) return false;\r\n const { value, setValue } = showSearchScope;\r\n setValue(!value);\r\n return true;\r\n };\r\n}\r\nexport default searchForm_scope;\r\n","import { resetDocFilters } from \"data/actions\";\r\n\r\n/**\r\n * clears current doclist filters\r\n */\r\n\r\nclass doc_resetFilters {\r\n execute = ({ dispatch }) => dispatch(resetDocFilters());\r\n}\r\nexport default doc_resetFilters;\r\n","import { exportDocsToCsvAction } from \"data/actions\";\r\n\r\n/**\r\n * exports current doclist to CSV\r\n */\r\n\r\nclass doc_exportCsv {\r\n execute = ({ dispatch }) => dispatch(exportDocsToCsvAction());\r\n}\r\nexport default doc_exportCsv;\r\n","import { downloadDocUri } from \"data/api\";\r\nimport { toastActionResult } from \"data/toast\";\r\n\r\n/**\r\n * starts a download for the given itemUri\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n */\r\n\r\ntype Context = {\r\n itemUri: string,\r\n};\r\n\r\nexport const downloadFile = (uri, fileName = true) => {\r\n const temporaryDownloadLink = document.createElement(\"a\");\r\n temporaryDownloadLink.style.display = \"none\";\r\n temporaryDownloadLink.setAttribute(\"href\", uri);\r\n temporaryDownloadLink.setAttribute(\"download\", fileName);\r\n document.body.appendChild(temporaryDownloadLink);\r\n temporaryDownloadLink.click();\r\n document.body.removeChild(temporaryDownloadLink);\r\n};\r\n\r\nclass doc_download {\r\n queueMultiple: boolean = true;\r\n logger: () => any = toastActionResult;\r\n execute = async ({ itemUri }: Context): Promise => {\r\n try {\r\n const uri = await downloadDocUri(itemUri);\r\n if (uri == null)\r\n throw new Error(\"Error while creating Download URI (empty)\");\r\n\r\n // HACK: to download multiple files\r\n downloadFile(uri);\r\n\r\n return true;\r\n } catch (err) {\r\n return false;\r\n }\r\n };\r\n report = async (success: boolean, { name }: Context): Promise => {\r\n !success &&\r\n this.logger(success, \"commandAction:doc_download\", { name });\r\n };\r\n}\r\nexport default doc_download;\r\n","// @flow\r\nimport { openProgressModal } from \"components/ProgressModal\";\r\nimport { downloadDocUri } from \"data/api\";\r\nimport { getLocalizedText } from \"data/utils\";\r\nimport { downloadFile } from \"./doc_download\";\r\nimport { toastActionResult } from \"data/toast\";\r\n\r\ntype Context = {\r\n items?: Array,\r\n};\r\n\r\nclass doc_downloadZip {\r\n logger: () => any = toastActionResult;\r\n getFileName = (disposition: string): string => {\r\n const utf8FilenameRegex = /filename\\*=UTF-8''([\\w%-.]+)(?:; ?|$)/i;\r\n const asciiFilenameRegex = /^filename=([\"']?)(.*?[^\\\\])\\1(?:; ?|$)/i;\r\n\r\n let fileName: string = null;\r\n if (utf8FilenameRegex.test(disposition)) {\r\n fileName = decodeURIComponent(\r\n utf8FilenameRegex.exec(disposition)[1]\r\n );\r\n } else {\r\n const filenameStart = disposition\r\n .toLowerCase()\r\n .indexOf(\"filename=\");\r\n if (filenameStart >= 0) {\r\n const partialDisposition = disposition.slice(filenameStart);\r\n const matches = asciiFilenameRegex.exec(partialDisposition);\r\n if (matches != null && matches[2]) {\r\n fileName = matches[2];\r\n }\r\n }\r\n }\r\n return fileName;\r\n };\r\n\r\n execute = async ({ items }: Context): Promise => {\r\n const documents = items?.filter((item) => item.isDoc) || [];\r\n if (!documents.length) {\r\n this.logger(false, \"itemActions:doc_downloadZip\");\r\n return false;\r\n }\r\n const zip = new (\r\n await import(\"jszip\" /* webpackChunkName: \"jszip\" */)\r\n ).default();\r\n\r\n const target = zip;\r\n const name = getLocalizedText(`$multiselection:actionpanel.document`, {\r\n count: documents.length,\r\n });\r\n\r\n await openProgressModal({\r\n icon: \"file-zip-o\",\r\n title: getLocalizedText(\r\n \"$itemActions:doc_downloadZip.compressing\",\r\n {\r\n documents: name,\r\n }\r\n ),\r\n initialProgress: 0,\r\n doWork: async (close, setError, setProgress) => {\r\n const progressPart = 100 / (documents.length + 1);\r\n try {\r\n for (let doc = 0; doc < documents.length; doc++) {\r\n const document = documents[doc];\r\n try {\r\n const uri = await downloadDocUri(document.itemUri);\r\n if (uri == null)\r\n throw new Error(\r\n \"Cannot create download URI for document!\"\r\n );\r\n const response = await fetch(uri);\r\n const buffer = await response.arrayBuffer();\r\n target.file(\r\n this.getFileName(\r\n response.headers.get(\"content-disposition\")\r\n ),\r\n buffer\r\n );\r\n setProgress(progressPart * (doc + 1));\r\n } catch (e) {\r\n console.warn(\r\n `Cannot add ${document.name} to ZIP file`,\r\n e\r\n );\r\n }\r\n }\r\n\r\n const base64 = await zip.generateAsync(\r\n { type: \"base64\" },\r\n (metadata) => {\r\n setProgress(\r\n progressPart * documents.length +\r\n (progressPart / 100) *\r\n metadata.percent.toFixed(0)\r\n );\r\n }\r\n );\r\n downloadFile(\r\n `data:application/zip;base64,${base64}`,\r\n `${name}.zip`\r\n );\r\n //Close delayed to always show 100% progress\r\n setTimeout(close, 800);\r\n } catch (err) {\r\n /* istanbul ignore else */\r\n if (err && err.message) setError(err.message);\r\n console.warn(err);\r\n // notify user\r\n this.logger(false, \"itemActions:doc_downloadZip\");\r\n }\r\n },\r\n });\r\n return true;\r\n };\r\n}\r\n\r\nexport default doc_downloadZip;\r\n","// @flow\r\nimport { openProgressModal } from \"components/ProgressModal\";\r\nimport { downloadDocUri } from \"data/api\";\r\nimport { getLocalizedText } from \"data/utils\";\r\nimport { toastActionResult } from \"data/toast\";\r\n\r\ntype Context = {\r\n items?: Array,\r\n};\r\n\r\nclass doc_downloadFilesAPI {\r\n logger: () => any = toastActionResult;\r\n getFileName = (disposition: string): string => {\r\n const utf8FilenameRegex = /filename\\*=UTF-8''([\\w%-.]+)(?:; ?|$)/i;\r\n const asciiFilenameRegex = /^filename=([\"']?)(.*?[^\\\\])\\1(?:; ?|$)/i;\r\n\r\n let fileName: string = null;\r\n if (utf8FilenameRegex.test(disposition)) {\r\n fileName = decodeURIComponent(\r\n utf8FilenameRegex.exec(disposition)[1]\r\n );\r\n } else {\r\n const filenameStart = disposition\r\n .toLowerCase()\r\n .indexOf(\"filename=\");\r\n if (filenameStart >= 0) {\r\n const partialDisposition = disposition.slice(filenameStart);\r\n const matches = asciiFilenameRegex.exec(partialDisposition);\r\n if (matches != null && matches[2]) {\r\n fileName = matches[2];\r\n }\r\n }\r\n }\r\n return fileName;\r\n };\r\n\r\n execute = async ({ items }: Context): Promise => {\r\n const documents = items?.filter((item) => item.isDoc) || [];\r\n if (!documents.length) {\r\n this.logger(false, \"itemActions:doc_downloadFilesAPI\");\r\n return false;\r\n }\r\n\r\n const directoryHandle = await window.showDirectoryPicker();\r\n if (\r\n !directoryHandle ||\r\n (await directoryHandle.requestPermission({ writable: true })) !==\r\n \"granted\"\r\n ) {\r\n this.logger(false, \"itemActions:doc_downloadFilesAPI\");\r\n return false;\r\n }\r\n\r\n const name = getLocalizedText(`$multiselection:actionpanel.document`, {\r\n count: documents.length,\r\n });\r\n\r\n await openProgressModal({\r\n icon: \"folder-open-o\",\r\n title: getLocalizedText(\r\n \"$itemActions:doc_downloadFilesAPI.downloading\",\r\n {\r\n documents: name,\r\n }\r\n ),\r\n initialProgress: 0,\r\n doWork: async (close, setError, setProgress) => {\r\n const progressPart = 100 / documents.length;\r\n for (let doc = 0; doc < documents.length; doc++) {\r\n const document = documents[doc];\r\n try {\r\n const uri = await downloadDocUri(document.itemUri);\r\n if (uri == null)\r\n throw new Error(\r\n \"Cannot create download URI for document!\"\r\n );\r\n const response = await fetch(uri);\r\n const buffer = await response.arrayBuffer();\r\n const fileHandle = await directoryHandle.getFileHandle(\r\n this.getFileName(\r\n response.headers.get(\"content-disposition\")\r\n ),\r\n { create: true }\r\n );\r\n const writable = await fileHandle.createWritable();\r\n await writable.write(buffer);\r\n await writable.close();\r\n setProgress(progressPart * (doc + 1));\r\n } catch (e) {\r\n console.warn(\r\n `Cannot save ${document.name} to directory`,\r\n e\r\n );\r\n }\r\n }\r\n\r\n //Close delayed to always show 100% progress\r\n setTimeout(close, 800);\r\n },\r\n });\r\n return true;\r\n };\r\n}\r\n\r\nexport default doc_downloadFilesAPI;\r\n","import { openConfirmModal } from \"components/ConfirmModal\";\r\nimport { delItemUri } from \"data/api\";\r\nimport loc from \"i18next\";\r\nimport { toastActionResult } from \"data/toast\";\r\nimport { postMessageTo } from \"hooks/PostMessage/Utils\";\r\nimport { ModalAction } from \"hooks/PostMessage/Actions\";\r\nimport { isMiniView } from \"data/constants\";\r\n\r\ntype Context = {\r\n itemUri: string,\r\n name: string,\r\n items?: Array,\r\n};\r\n\r\nclass doc_delete {\r\n queueMultiple: boolean = true;\r\n logger: () => any = toastActionResult;\r\n shouldRender: boolean = true;\r\n\r\n /**\r\n * renders confirm dialog\r\n *\r\n * @param {{ name: string }} { name }\r\n * @param {{ items?: Array }} { items }\r\n */\r\n render = async ({ name, items }: Context): Promise => {\r\n this.shouldRender = false;\r\n const count = items?.length ?? 1;\r\n return await openConfirmModal({\r\n body: loc.t(\"commandAction:doc_delete.confirmBody\", {\r\n name,\r\n count,\r\n }),\r\n confirmButton: loc.t(\"commandAction:doc_delete.confirmYes\", {\r\n count,\r\n }),\r\n });\r\n };\r\n\r\n /**\r\n * deletes an existing document by itemUri\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n */\r\n execute = async ({ itemUri }: Context): Promise => {\r\n try {\r\n const success = await delItemUri(itemUri);\r\n\r\n if (success) {\r\n if (isMiniView(window.location)) {\r\n window.close();\r\n setTimeout(window.location.reload, 1000);\r\n } else {\r\n postMessageTo(ModalAction.Close, null, window);\r\n }\r\n }\r\n\r\n return success;\r\n } catch (err) {\r\n console.warn(err);\r\n return false;\r\n }\r\n };\r\n\r\n /**\r\n * logs success state\r\n *\r\n * @param { success: boolean } { success }\r\n */\r\n report = async (success: boolean): Promise => {\r\n this.logger(success === true, \"commandAction:doc_delete\");\r\n };\r\n}\r\n\r\nexport default doc_delete;\r\n","// @flow\r\nimport React from \"react\";\r\nimport loc from \"i18next\";\r\n\r\n/** Expand to Fullscreen svg image */\r\nconst ExpandButton = () => (\r\n \r\n \r\n \r\n \r\n \r\n);\r\n\r\n/** Reduce from Fullscreen svg image */\r\nconst CompressButton = () => (\r\n \r\n \r\n \r\n \r\n \r\n);\r\n\r\ntype Props = {\r\n /** whether we are now in Fullscreen mode */\r\n isFullscreen: boolean,\r\n /** callback when user clicked on icon */\r\n onClick: () => void,\r\n};\r\n\r\n/** Renders a Fullscreen button */\r\nconst ModalFullscreenButton = ({ isFullscreen, onClick }: Props) => (\r\n \r\n {isFullscreen ? : }\r\n \r\n {isFullscreen\r\n ? loc.t(\"common:exit_fullscreen\")\r\n : loc.t(\"common:enter_fullscreen\")}\r\n \r\n \r\n);\r\nModalFullscreenButton.displayName = \"ModalFullscreenButton\";\r\nexport default ModalFullscreenButton;\r\n","// @flow\r\nimport React, { useState, useCallback, useMemo } from \"react\";\r\nimport Modal from \"components/Modal\";\r\nimport TopRowExtras from \"./TopRowExtras\";\r\nimport CloseButton from \"@hs/close-button\";\r\nimport FullscreenButton from \"components/ModalFullscreenButton\";\r\nimport styles from \"./DocModal.module.css\";\r\nimport { DocumentWithoutHash } from \"views/document\";\r\nimport { FullScreen, useFullScreenHandle } from \"react-full-screen\";\r\nimport bowser from \"data/bowser\";\r\nimport { createModal } from \"react-modal-promise\";\r\nimport { useModalPostMessageHandler } from \"hooks\";\r\n\r\nexport type DocModalProps = $Shape<{\r\n /** which rowIndex is currently displayed (for back&fwd buttons) */\r\n activeRowIndex: number,\r\n /** how many document exist (for back&fwd buttons) - set to -1 to disable */\r\n totalCount: number,\r\n /** whether to trigger Print */\r\n triggerPrint: boolean,\r\n /** whether to trigger EditMode */\r\n triggerEditMode: boolean,\r\n /** callback when user clicks back or fwd buttons\r\n * @param {number} activeRowIndex new row index\r\n * @param {boolean} isNext if new row index is incremented/decremented\r\n * @return {number} new (modified) row index\r\n */\r\n onSetActiveRowIndex: (activeRowIndex: number, isNext: boolean) => number,\r\n /** callback to get itemUri by activeRowIndex\r\n * @param {number} activeRowIndex new row index\r\n * @return {string} itemUri\r\n */\r\n getActiveRowItemUri: (activeRowIndex: number) => string,\r\n /** (optional) callback to reopen DocModal with same context but differend itemUri\r\n * @param {string} itemUri itemUri to use to reopen DocModal\r\n */\r\n onReopenWith?: (itemUri: string) => void,\r\n}>;\r\n\r\ntype Props = DocModalProps & {\r\n /** document's itemUri to show */\r\n itemUri: string,\r\n /** whether to show modal */\r\n open: boolean,\r\n /** callback when user closes modal */\r\n close: () => void,\r\n /** selected toggles */\r\n toggles?: Array,\r\n /**pdf.js: search terms */\r\n searchTerm?: string,\r\n /** pdf.js: whether trigger browser print */\r\n triggerPrint: boolean,\r\n};\r\n\r\n/**\r\n * DocViewer in Modal window\r\n */\r\nexport const DocModal = ({\r\n totalCount = -1,\r\n onSetActiveRowIndex = (index: number) => index,\r\n getActiveRowItemUri = () => null,\r\n itemUri,\r\n activeRowIndex: activeRowIndexFromProps,\r\n close,\r\n open,\r\n toggles,\r\n onReopenWith,\r\n searchTerm,\r\n triggerPrint,\r\n triggerEditMode,\r\n}: Props) => {\r\n const [activeRowIndex, setActiveRowIndex] = useState(\r\n activeRowIndexFromProps\r\n );\r\n const [minCount, setMinCount] = useState(0);\r\n const [maxCount, setMaxCount] = useState(totalCount);\r\n\r\n const fullScreenHandle = useFullScreenHandle();\r\n\r\n useModalPostMessageHandler(close);\r\n\r\n const isNextDisabled = activeRowIndex + 1 === maxCount;\r\n const isPrevDisabled = activeRowIndex === minCount;\r\n\r\n const handleDeletedWhileOpen = useCallback(\r\n (itemUri, rowIndex, isNext) => {\r\n //Go back until you find a valid itemUri\r\n while (itemUri == null && rowIndex > minCount) {\r\n rowIndex = onSetActiveRowIndex(--rowIndex, isNext);\r\n itemUri = getActiveRowItemUri(rowIndex);\r\n }\r\n if (itemUri != null && typeof onReopenWith === \"function\") {\r\n onReopenWith(itemUri);\r\n }\r\n return close();\r\n },\r\n [\r\n onSetActiveRowIndex,\r\n getActiveRowItemUri,\r\n onReopenWith,\r\n close,\r\n minCount,\r\n ]\r\n );\r\n\r\n const onNext = useCallback(() => {\r\n if (isNextDisabled) return;\r\n const nextRowIndex = onSetActiveRowIndex(activeRowIndex + 1, true);\r\n const itemUri = getActiveRowItemUri(nextRowIndex);\r\n if (itemUri == null) {\r\n return handleDeletedWhileOpen(itemUri, activeRowIndex, true);\r\n }\r\n\r\n setActiveRowIndex(nextRowIndex);\r\n setMaxCount((maxCount) =>\r\n nextRowIndex === activeRowIndex && maxCount === totalCount\r\n ? nextRowIndex + 1\r\n : maxCount\r\n );\r\n }, [\r\n isNextDisabled,\r\n activeRowIndex,\r\n onSetActiveRowIndex,\r\n getActiveRowItemUri,\r\n handleDeletedWhileOpen,\r\n totalCount,\r\n ]);\r\n\r\n const onPrev = useCallback(() => {\r\n if (isPrevDisabled) return;\r\n const prevRowIndex = onSetActiveRowIndex(activeRowIndex - 1, false);\r\n const itemUri = getActiveRowItemUri(prevRowIndex);\r\n if (itemUri == null) {\r\n return handleDeletedWhileOpen(itemUri, prevRowIndex, false);\r\n }\r\n\r\n setActiveRowIndex(prevRowIndex);\r\n setMinCount((minCount) =>\r\n prevRowIndex === activeRowIndex && minCount === 0\r\n ? prevRowIndex\r\n : minCount\r\n );\r\n }, [\r\n isPrevDisabled,\r\n onSetActiveRowIndex,\r\n getActiveRowItemUri,\r\n handleDeletedWhileOpen,\r\n activeRowIndex,\r\n ]);\r\n\r\n const toggleFullscreen = useCallback(() => {\r\n /* istanbul ignore next */ !fullScreenHandle?.active\r\n ? fullScreenHandle.enter()\r\n : fullScreenHandle.exit();\r\n }, [fullScreenHandle]);\r\n\r\n const activeItemUri = useMemo(\r\n () => getActiveRowItemUri(activeRowIndex) || itemUri,\r\n [activeRowIndex, getActiveRowItemUri, itemUri]\r\n );\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n )\r\n }\r\n onPrev={onPrev}\r\n onNext={onNext}\r\n topRowEnd={\r\n <>\r\n {!bowser.is(\"iOS\") && (\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 const openDocModal = createModal(DocModal);\r\n","// @flow\r\nimport { openDocModal, type DocModalProps } from \"components/DocModal\";\r\nimport { docRoute } from \"components/ItemUriLink\";\r\n\r\n/**\r\n * opens document Preview\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ newWindow: boolean}} { newWindow }\r\n * @param {{ setTarget?: () => void}} { setTarget }\r\n * @param {{ toggles?: string | Array}} { toggles }\r\n */\r\n\r\ntype Context = DocModalProps & {\r\n itemUri: string,\r\n newWindow?: boolean,\r\n setTarget?: () => any,\r\n toggles?: string | Array,\r\n};\r\n\r\nclass doc_preview {\r\n execute = async ({\r\n itemUri,\r\n newWindow,\r\n setTarget,\r\n toggles,\r\n ...docModalProps\r\n }: Context): Promise => {\r\n if (newWindow) {\r\n const target = window.open(\r\n docRoute(\r\n itemUri,\r\n true,\r\n true,\r\n toggles,\r\n docModalProps.searchTerm,\r\n docModalProps.triggerPrint\r\n ),\r\n \"\",\r\n `status=no,location=no,toolbar=no,menubar=no,width=600px,height=640px,top=${\r\n Math.random() * 100\r\n },left=${Math.random() * 100}`\r\n //\"scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=600,height=300,left=100,top=100\"\r\n );\r\n // Set target for PostMessage communication\r\n /* istanbul ignore else */\r\n if (typeof setTarget === \"function\") {\r\n setTarget(target);\r\n }\r\n return true;\r\n } else {\r\n await openDocModal({\r\n itemUri,\r\n toggles:\r\n typeof toggles === \"string\" ? toggles.split(\",\") : toggles,\r\n ...docModalProps,\r\n });\r\n return true;\r\n }\r\n };\r\n}\r\nexport default doc_preview;\r\n","// @flow\r\nimport loc from \"i18next\";\r\nimport { openDocModal } from \"components/DocModal\";\r\nimport { fetchRelatedDocs } from \"data/api\";\r\nimport { type ItemLinkTypeEnum } from \"data/types\";\r\nimport { toastActionResult, toastStyled, toastTypes } from \"data/toast\";\r\n\r\n/**\r\n * opens related documents in preview\r\n */\r\n\r\ntype Context = {\r\n itemUri: string,\r\n itemLinkType: ItemLinkTypeEnum,\r\n getSource: ?boolean,\r\n};\r\n\r\nclass doc_related {\r\n /* istanbul ignore next */\r\n logger: () => any = (...args) =>\r\n typeof args[0] === \"boolean\"\r\n ? toastActionResult(...args)\r\n : toastStyled(...args);\r\n\r\n execute = async ({\r\n itemUri,\r\n itemLinkType,\r\n getSource,\r\n ...relatedDocsProps\r\n }: Context): Promise => {\r\n try {\r\n const rows: Array = await fetchRelatedDocs(\r\n itemUri,\r\n itemLinkType,\r\n getSource\r\n );\r\n if (!rows || !rows.length) {\r\n return false;\r\n }\r\n const docModalProps = Object.assign(relatedDocsProps, {\r\n itemUri: rows[0],\r\n activeRowIndex: 0,\r\n totalCount: rows.length > 1 ? rows.length : -1,\r\n getActiveRowItemUri: /* istanbul ignore next */ (rowIndex) =>\r\n rows[rowIndex] || undefined,\r\n });\r\n openDocModal({ ...docModalProps });\r\n return true;\r\n } catch (err) {\r\n this.logger({\r\n message: loc.t(\"itemActions:doc_related.error\"),\r\n ...toastTypes.failure,\r\n });\r\n }\r\n };\r\n\r\n report = async (success: boolean): Promise => {\r\n !success && this.logger(success === true, \"itemActions:doc_related\");\r\n };\r\n}\r\n\r\nexport default doc_related;\r\n","// @flow\r\nimport React, { useCallback } from \"react\";\r\nimport Modal from \"components/Modal\";\r\nimport Upload from \"views/upload\";\r\nimport CloseButton from \"@hs/close-button\";\r\nimport { createModal } from \"react-modal-promise\";\r\nimport { useModalPostMessageHandler } from \"hooks\";\r\nimport uppy from \"data/uppy\";\r\n\r\ntype Props = {\r\n /** whether to show modal */\r\n open: boolean,\r\n /** target folder itemUri */\r\n itemUri: string,\r\n /** callback when user closes Modal */\r\n close: () => void,\r\n};\r\n\r\n/**\r\n * UploadModal\r\n */\r\nconst UploadModal = ({ open, itemUri, formatId, close }: Props) => {\r\n const handleCancel = useCallback(() => {\r\n //#59285 Remove file from queue on Cancel\r\n uppy.reset();\r\n close();\r\n }, [close]);\r\n useModalPostMessageHandler(handleCancel);\r\n return (\r\n \r\n \r\n }\r\n />\r\n \r\n \r\n );\r\n};\r\n\r\nexport default UploadModal;\r\nexport const openUploadModal = createModal(UploadModal);\r\n","import { openUploadModal } from \"components/UploadModal\";\r\n\r\n/**\r\n * opens the upload dialog to the given itemUri\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ formatId: number }} { formatId }\r\n */\r\n\r\nclass doc_upload {\r\n execute = async ({\r\n itemUri,\r\n formatId,\r\n }: {\r\n itemUri: string,\r\n formatId: number,\r\n }) => {\r\n await openUploadModal({ itemUri, formatId });\r\n return true;\r\n };\r\n}\r\n\r\nexport default doc_upload;\r\n","// @flow\r\nimport React, { useEffect, useCallback } from \"react\";\r\nimport Modal from \"components/Modal\";\r\nimport Breadcrumb from \"containers/Breadcrumb\";\r\nimport UploadSelection from \"components/UploadSelection\";\r\nimport Icons from \"@hs/icons\";\r\nimport { useUppy } from \"hooks\";\r\nimport { addUppyEvents, removeUppyEvents, type uppyFile } from \"data/uppy\";\r\nimport { UploadMode } from \"data/types\";\r\nimport { toastStyled, toastTypes } from \"data/toast\";\r\nimport styles from \"./UploadVersionModal.module.css\";\r\nimport { createModal } from \"react-modal-promise\";\r\nimport { type DroppedFile } from \"containers/FileDropHandler\";\r\nimport { useModalPostMessageHandler } from \"hooks\";\r\n\r\ntype Props = {\r\n /** target existing document's itemUri */\r\n itemUri: string,\r\n /** which file(s) to automatically add (used by FileDropHandler.onDrop) */\r\n files?: Array,\r\n /** react-modal-promise: whether to show dialog */\r\n open: boolean,\r\n /** react-modal-promise: callback when user closes Dialog or upload was a success\r\n * @param {boolean} success whether file was successfully upload\r\n */\r\n close: (success: boolean) => void,\r\n};\r\n\r\n/** Uppy properties for UploadVersionModal */\r\nconst uppyProps = {\r\n maxNumberOfFiles: 1,\r\n};\r\n\r\n/**\r\n * Will display a File browser dialog and add a new version to an existing document\r\n */\r\nconst UploadVersionModal = ({ itemUri, files, open, close }: Props) => {\r\n const uppy = useUppy({\r\n uppyId: \"upload-version\",\r\n uppyProps,\r\n });\r\n\r\n const _onClose = useCallback(\r\n (success?: boolean) => {\r\n /* istanbul ignore else */\r\n if (success === true) {\r\n toastStyled(toastTypes.uppyComplete);\r\n }\r\n // all success -> reset uppy, close and refresh\r\n uppy.cancelAll();\r\n close(success === true);\r\n },\r\n [uppy, close]\r\n );\r\n useModalPostMessageHandler(_onClose);\r\n\r\n const _onFileAdded = useCallback(\r\n (file: uppyFile): void => {\r\n /* istanbul ignore else */\r\n if (file.meta.itemUri == null) {\r\n // attach itemUri (managed server-side by TusMiddleware.cs)\r\n uppy.setFileMeta(file.id, {\r\n itemUri,\r\n mode: UploadMode.ModifyDocument,\r\n });\r\n // do it!\r\n uppy.upload();\r\n }\r\n },\r\n [uppy, itemUri]\r\n );\r\n\r\n const _onUploadSuccess = useCallback(\r\n (file: uppyFile, resp: Any, uploadURL: string): void => _onClose(true),\r\n [_onClose]\r\n );\r\n\r\n useEffect(() => {\r\n /* istanbul ignore else */\r\n if (uppy) {\r\n addUppyEvents(\r\n [\r\n { type: \"file-added\", callback: _onFileAdded },\r\n { type: \"upload-success\", callback: _onUploadSuccess },\r\n ],\r\n uppy\r\n );\r\n\r\n // user dropped file with FileDropHandler\r\n if (Array.isArray(files) && files.length > 0) {\r\n try {\r\n uppy.addFile(files[0]);\r\n } catch (err) /* istanbul ignore next */ {\r\n // ... but failed restrictions - close dialog\r\n console.warn(\"UploadVersionModal Cannot addFile: \", err);\r\n _onClose(false);\r\n }\r\n }\r\n\r\n return () => {\r\n removeUppyEvents(\r\n [\r\n { type: \"file-added\", callback: _onFileAdded },\r\n { type: \"upload-success\", callback: _onUploadSuccess },\r\n ],\r\n uppy\r\n );\r\n };\r\n }\r\n }, [uppy, files, _onFileAdded, _onUploadSuccess, _onClose]);\r\n\r\n return (\r\n \r\n \r\n \r\n {\" \"}\r\n \r\n \r\n \r\n {uppy && }\r\n \r\n );\r\n};\r\nexport default UploadVersionModal;\r\nexport const openUploadVersionModal = createModal(UploadVersionModal);\r\n","import { openUploadVersionModal } from \"components/UploadVersionModal\";\r\nimport { type DroppedFile } from \"containers/FileDropHandler\";\r\n\r\n/**\r\n * opens the upload dialog to upload a new document version to the given itemUri\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ files: Array }} { files }\r\n */\r\n\r\ntype Context = {\r\n itemUri: string,\r\n files?: Array,\r\n};\r\nclass doc_uploadVersion {\r\n execute = async ({ itemUri, files }: Context) => {\r\n await openUploadVersionModal({\r\n files,\r\n itemUri,\r\n });\r\n return true;\r\n };\r\n}\r\n\r\nexport default doc_uploadVersion;\r\n","import share from \"./share\";\r\nimport { ShareType } from \"data/types\";\r\n\r\n/**\r\n * opens the share dialog with share type link\r\n */\r\n\r\nclass doc_emailLink extends share {\r\n execute = async (context) =>\r\n super.execute({\r\n ...context,\r\n shareType: ShareType.Link,\r\n });\r\n}\r\nexport default doc_emailLink;\r\n","import share from \"./share\";\r\nimport { ShareType } from \"data/types\";\r\n\r\n/**\r\n * opens the share dialog with share type attachment\r\n */\r\n\r\nclass doc_emailAttachment extends share {\r\n execute = async (context) => {\r\n return super.execute({\r\n ...context,\r\n shareType: ShareType.Attachment,\r\n });\r\n };\r\n}\r\nexport default doc_emailAttachment;\r\n","import { formSetEditModeAction } from \"data/actions\";\r\n\r\n/**\r\n * starts editing the current document\r\n */\r\n\r\nclass doc_editClassification {\r\n execute = ({ dispatch }) => {\r\n dispatch(formSetEditModeAction(\"doc\", true));\r\n return true;\r\n };\r\n}\r\nexport default doc_editClassification;\r\n","import { getWebDavHttpLink } from \"data/api\";\r\nimport { toastActionResult } from \"data/toast\";\r\n\r\n/**\r\n * opens webDav edit http link for a document\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ name: string }} { name }\r\n */\r\n\r\ntype Context = {\r\n itemUri: string,\r\n name: string,\r\n};\r\n\r\nclass doc_editWebDav {\r\n logger: () => any = toastActionResult;\r\n\r\n execute = async ({ itemUri, name }: Context): Promise => {\r\n try {\r\n const webDavUrl = await getWebDavHttpLink(itemUri, name);\r\n if (webDavUrl == null || String(webDavUrl).length === 0) {\r\n throw new Error(`Invalid WebDavURL`);\r\n }\r\n window.location.assign(webDavUrl);\r\n return true;\r\n } catch (err) {\r\n return false;\r\n }\r\n };\r\n\r\n report = async (success: boolean): Promise => {\r\n this.logger(success === true, \"itemActions:doc_editWebDav\");\r\n };\r\n}\r\n\r\nexport default doc_editWebDav;\r\n","import { getCloudInfo } from \"data/api\";\r\nimport { toastActionResult, toastStyled, toastTypes } from \"data/toast\";\r\n\r\n/**\r\n * opens webDav edit http link for a document synced in cloud\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ name: string }} { name }\r\n * @param {{ onlineEditor?: boolean }} { onlineEditor }\r\n */\r\n\r\ntype Context = {\r\n itemUri: string,\r\n name: string,\r\n onlineEditor?: boolean,\r\n};\r\n\r\nconst SupportedExtensions = [\".doc\", \".docx\", \".xls\", \".xlsx\", \".ppt\", \".pptx\"];\r\n\r\nclass doc_editCloud {\r\n logger: () => any = toastActionResult;\r\n\r\n execute = async ({\r\n itemUri,\r\n name,\r\n onlineEditor = false,\r\n ext,\r\n }: Context): Promise => {\r\n const i18n = onlineEditor\r\n ? \"itemActions:doc_editCloud\"\r\n : \"itemActions:doc_editCloudLocal\";\r\n\r\n if (!onlineEditor && !SupportedExtensions.includes(ext)) {\r\n toastStyled({\r\n ...toastTypes.failure,\r\n toastId: \"doc_editCloudLocal\",\r\n message: `$${i18n}.not_supported`,\r\n });\r\n return;\r\n }\r\n\r\n try {\r\n const [webEditUrl, webDavUrl] = await getCloudInfo(itemUri, name);\r\n const args: Array = [];\r\n if (onlineEditor) {\r\n args.push(webEditUrl);\r\n args.push(\"\");\r\n args.push(\r\n `status=no,location=no,toolbar=no,menubar=no,width=600px,height=640px,top=${\r\n Math.random() * 100\r\n },left=${Math.random() * 100}`\r\n );\r\n } else {\r\n args.push(webDavUrl);\r\n }\r\n if (args[0] == null || String(args[0]).length === 0) {\r\n throw new Error(\r\n `Invalid ${onlineEditor ? \"WebEditURL\" : \"WebDavURL\"}`\r\n );\r\n }\r\n window.open(...args);\r\n this.logger(true, i18n);\r\n } catch (err) {\r\n this.logger(false, i18n);\r\n }\r\n };\r\n}\r\n\r\nexport default doc_editCloud;\r\n","import { toggleFavorite } from \"containers/Breadcrumb\";\r\n\r\n/**\r\n * toggles favorite flag for the given itemUri\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ isFav: boolean}} { isFav }\r\n * @param {{ name: string}} { name }\r\n */\r\n\r\ntype Context = {\r\n itemUri: string,\r\n isFav: boolean,\r\n name: string,\r\n};\r\n\r\nclass favorite {\r\n queueMultiple: boolean = true;\r\n execute = ({ itemUri, isFav, name }: Context) =>\r\n toggleFavorite({ isFav, itemUri, name, logger: this.logger });\r\n}\r\nexport default favorite;\r\n","import { openExternalLinkModal } from \"components/ExternalLinkModal\";\r\nimport { uriForFormTokens, withFormTokens } from \"./utils/FormTokens\";\r\nimport { mapValues, tokenize } from \"data/utils\";\r\n\r\n/**\r\n * opens the specified url either in a modal popup or new browser window\r\n * @param {{ asModal?: boolean}} { asModal } whether to open as Modal within inPoint\r\n * @param {{ docked?: boolean}} { docked } whether to open as a Docked Modal (only with asModal=true)\r\n * @param {{ url: string }} { url } supports interpolation with any context properties\r\n * @param {{ title?: string }} { title } Modal or Browser window title\r\n * @param {{ specs?: string }} { specs } Browser window(..., specs) specifications\r\n * @param {{ useFormTokens?: boolean }} { useFormTokens } whether to load all Form fields/attributes for the tokens\r\n */\r\n\r\ntype Context = {\r\n asModal?: boolean,\r\n docked?: boolean,\r\n url: string,\r\n title?: string,\r\n specs?: string,\r\n useFormTokens?: boolean,\r\n context: ?Object,\r\n};\r\n\r\nclass link {\r\n execute = async ({\r\n asModal,\r\n docked,\r\n url,\r\n title,\r\n specs,\r\n useFormTokens,\r\n multiple,\r\n items,\r\n ...context\r\n }: Context): Promise => {\r\n let encodedContext = {};\r\n if (multiple && (items?.length ?? 0)) {\r\n encodedContext.itemUri = items.map((i) =>\r\n encodeURIComponent(i.itemUri)\r\n );\r\n encodedContext.name = items.map((i) => encodeURIComponent(i.name));\r\n } else {\r\n encodedContext = mapValues(context, (value) =>\r\n encodeURIComponent(value)\r\n );\r\n if (useFormTokens === true) {\r\n encodedContext = await withFormTokens(context, encodedContext);\r\n }\r\n }\r\n const tokenizedUrl = tokenize(uriForFormTokens(url), encodedContext);\r\n if (asModal === true) {\r\n openExternalLinkModal({ url: tokenizedUrl, name: title, docked });\r\n } else {\r\n window.open(\r\n tokenizedUrl,\r\n title || \"\",\r\n specs || \"\" // \"width=600px,height=640px\"\r\n //\"scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=600,height=300,left=100,top=100\"\r\n );\r\n }\r\n return true;\r\n };\r\n}\r\nexport default link;\r\n","import { lock as lockApi } from \"data/api\";\r\nimport { toastActionResult } from \"data/toast\";\r\n\r\nclass lock {\r\n queueMultiple: boolean = true;\r\n logger: () => any = toastActionResult;\r\n execute = async ({ itemUri }: { itemUri: string }): Promise => {\r\n try {\r\n return await lockApi(itemUri);\r\n } catch (err) {\r\n return false;\r\n }\r\n };\r\n report = async (success: boolean): Promise => {\r\n this.logger(success === true, \"commandAction:lock\");\r\n };\r\n}\r\n\r\nexport default lock;\r\n","import { unlock as unlockApi } from \"data/api\";\r\nimport { toastActionResult } from \"data/toast\";\r\n\r\nclass unlock {\r\n queueMultiple: boolean = true;\r\n logger: () => any = toastActionResult;\r\n execute = async ({ itemUri }: { itemUri: string }): Promise => {\r\n try {\r\n return await unlockApi(itemUri);\r\n } catch (err) {\r\n return false;\r\n }\r\n };\r\n report = async (success: boolean): Promise => {\r\n this.logger(success === true, \"commandAction:unlock\");\r\n };\r\n}\r\n\r\nexport default unlock;\r\n","import { subscribe as subscribeApi } from \"data/api\";\r\nimport { toastActionResult } from \"data/toast\";\r\n\r\n/**\r\n * Subscribes a given resource by itemUri, with an optional confirm dialog\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ name: string }} { name }\r\n */\r\n\r\nclass subscribe {\r\n queueMultiple: boolean = true;\r\n logger: () => any = toastActionResult;\r\n\r\n execute = async ({ itemUri, name }: { itemUri: string, name: string }) => {\r\n try {\r\n return await subscribeApi(itemUri, name);\r\n } catch (error) {\r\n return false;\r\n }\r\n };\r\n report = (success, { name }: Context) => {\r\n this.logger(success, \"commandAction:subscribe\", {\r\n name,\r\n context: name ? \"name\" : undefined,\r\n });\r\n };\r\n}\r\n\r\nexport default subscribe;\r\n","import * as API from \"data/api\";\r\nimport { toastActionResult } from \"data/toast\";\r\nimport { openConfirmModal } from \"components/ConfirmModal\";\r\nimport loc from \"i18next\";\r\n\r\ntype Context = {\r\n itemUri: string,\r\n name: string,\r\n confirm?: boolean,\r\n};\r\n\r\nclass unsubscribe {\r\n queueMultiple: boolean = true;\r\n logger: () => any = toastActionResult;\r\n /**\r\n * Api call to either unsubscribe by link ID or itemUri\r\n *\r\n * @param {string} api unsubscribe API Endpoint, ByID or ByItemUri\r\n * @param {string | { linkID: number, itemUri: string }} payload API payload, that will be sent.\r\n * @param {string} name webDavName of ressource, for notification purposes.\r\n * @returns {Promise} Promise of the API call\r\n */\r\n handleUnsubscribe = async (\r\n api: string,\r\n payload: string | { linkID: number, itemUri: string },\r\n name: string\r\n ) => {\r\n try {\r\n const success = await API[`unsubscribe${api}`](payload);\r\n this.logger(success, \"commandAction:unsubscribe\", { name });\r\n return true;\r\n } catch (error) {\r\n this.logger(false, \"commandAction:unsubscribe\", { name });\r\n return false;\r\n }\r\n };\r\n\r\n /**\r\n * Unsubscribes a given resource by itemUri, with an optional confirm dialog\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ name: string }} { name }\r\n * @param {{ confirm: bool }} { confirm }\r\n */\r\n execute = async ({ itemUri, name, confirm = false }: Context) => {\r\n if (!confirm) {\r\n return this.handleUnsubscribe(\"ByItemUri\", itemUri, name);\r\n }\r\n try {\r\n const item = await API.isSubscribed(itemUri);\r\n if (!item) {\r\n this.logger(false, \"commandAction:unsubscribe\", { name });\r\n return false;\r\n }\r\n const payload = {\r\n linkID: item.id,\r\n itemUri: item.itemUri,\r\n };\r\n if (item.itemUri === itemUri) {\r\n return this.handleUnsubscribe(\"ById\", payload, name);\r\n }\r\n const confirmed = await openConfirmModal({\r\n body: loc.t(\"commandAction:unsubscribe.confirm\", {\r\n name,\r\n subscription: item.name,\r\n context: /* istanbul ignore next*/ name\r\n ? \"name\"\r\n : undefined,\r\n }),\r\n confirmButton: loc.t(\"commandAction:unsubscribe.name\"),\r\n });\r\n return (\r\n confirmed && this.handleUnsubscribe(\"ById\", payload, item.name)\r\n );\r\n } catch (error) {\r\n /* istanbul ignore next */\r\n return this.logger(false, \"commandAction:unsubscribe\", { name });\r\n }\r\n };\r\n}\r\n\r\nexport default unsubscribe;\r\n","import { toastActionResult } from \"data/toast\";\r\nimport { getRoute } from \"components/ItemUriLink\";\r\nimport { downloadDocUri } from \"data/api\";\r\n\r\ntype Context = {\r\n name: string,\r\n itemUri: string,\r\n isDoc: boolean,\r\n isDocSendByEmailAllowed?: boolean,\r\n isDocDownloadAllowed?: boolean,\r\n};\r\n\r\nclass share_web {\r\n logger: () => any = toastActionResult;\r\n execute = async ({\r\n name,\r\n itemUri,\r\n isDoc,\r\n isDocSendByEmailAllowed,\r\n isDocDownloadAllowed,\r\n }: Context) => {\r\n // double-check (itemAction.shouldBeVisible should already have hasBrowser_webShareApi())\r\n if (navigator.share === undefined) {\r\n return false;\r\n }\r\n const text = \"Your link is ready to be shared.\";\r\n let files = undefined;\r\n if (isDoc && isDocSendByEmailAllowed && isDocDownloadAllowed) {\r\n try {\r\n const uri = await downloadDocUri(itemUri);\r\n const response = await fetch(uri);\r\n if (!response.ok) throw new Error(\"Could not retrieve file\");\r\n // retrieve real filename/mimetype\r\n name = getFileNameFromContentDisposition(\r\n name,\r\n response.headers.get(\"content-disposition\")\r\n );\r\n const blob = await response.blob();\r\n // TODO #44618 eventually support attaching multiple files\r\n files = [new File([blob], name, { type: blob.type })];\r\n\r\n /* istanbul ignore else */\r\n if (files && files.length > 0) {\r\n if (!navigator.canShare || !navigator.canShare({ files })) {\r\n return false;\r\n }\r\n }\r\n } catch (e) {\r\n console.error(\"Error while trying to download/attach file\", e);\r\n return false;\r\n }\r\n }\r\n try {\r\n await navigator.share({\r\n files,\r\n title: name,\r\n text,\r\n url: getRoute(itemUri, true, true, isDoc),\r\n });\r\n return true;\r\n } catch (error) {\r\n console.error(\"Error while trying to share\", error);\r\n return false;\r\n }\r\n };\r\n report = (success) => {\r\n !success && this.logger(success, \"itemActions:share_web\");\r\n };\r\n}\r\n\r\nexport function getFileNameFromContentDisposition(name, contentDisposition) {\r\n const regex = /filename[^;=\\n]*=(UTF-8(['\"]*))?([^;\\s]*)/;\r\n const matches = regex.exec(contentDisposition);\r\n let filename = name;\r\n\r\n if (matches != null && matches[3]) {\r\n filename = matches[3].replace(/['\"]/g, \"\");\r\n }\r\n\r\n return decodeURI(filename);\r\n}\r\n\r\nexport default share_web;\r\n","// @flow\r\nimport React from \"react\";\r\nimport Modal, { ModalSize } from \"components/Modal\";\r\nimport Form from \"react-bootstrap/lib/Form\";\r\nimport FormGroup from \"react-bootstrap/lib/FormGroup\";\r\nimport ClearableInput from \"@hs/clearable-input\";\r\nimport ControlLabel from \"react-bootstrap/lib/ControlLabel\";\r\nimport HelpBlock from \"react-bootstrap/lib/HelpBlock\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport { createModal } from \"react-modal-promise\";\r\n// // import Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\n\r\ntype Props = {\r\n /** react-modal-promise: whether to show dialog */\r\n open: boolean,\r\n /** react-modal-promise: callback when user closes Dialog */\r\n close: () => void,\r\n /** text to show in OK button */\r\n okButton?: string,\r\n /** text to show in Cancel button */\r\n cancelButton?: string,\r\n /** Modal Dialog title */\r\n title?: string,\r\n /** default name to show */\r\n name?: string,\r\n /** text to show for the input text label */\r\n nameLabel?: string,\r\n /** callback to validate name before submitting\r\n * @param {string} newName new value typed by user\r\n */\r\n validation?: (newName: string) => Object,\r\n};\r\n\r\ntype State = {\r\n newName: string,\r\n validationMessage: ?string,\r\n};\r\n\r\n/** presents a (re-)Name dialog to the user\r\n * @returns {string} new name user has chosen, null if cancelled\r\n */\r\nexport class NameModal extends React.PureComponent {\r\n constructor(props: Props) {\r\n super(props);\r\n this.state = {\r\n newName: props.name || \"\",\r\n validationMessage: null,\r\n };\r\n }\r\n\r\n _isValid = () =>\r\n this.state.newName &&\r\n String(this.state.newName).length > 0 &&\r\n this.state.validationMessage == null;\r\n _validationState = () => (this._isValid() ? null : \"error\");\r\n\r\n _onSubmit = async () => {\r\n if (typeof this.props.validation === \"function\") {\r\n var result = await this.props.validation(this.state.newName);\r\n if (result != null) {\r\n this.setState({ validationMessage: result });\r\n return;\r\n }\r\n }\r\n this.props.close(this.state.newName);\r\n };\r\n\r\n _onChange = (newName: string) =>\r\n this.setState({ newName, validationMessage: null });\r\n\r\n render() {\r\n const {\r\n open,\r\n close,\r\n okButton = loc.t(\"confirm.yes\"),\r\n cancelButton = loc.t(\"confirm.cancel\"),\r\n nameLabel,\r\n title,\r\n } = this.props;\r\n return (\r\n close(null)}\r\n // dialogClassName={styles.modal}\r\n >\r\n {title && (\r\n \r\n {title}\r\n \r\n )}\r\n \r\n e.preventDefault()\r\n }\r\n style={{\r\n padding: 50,\r\n // display: \"flex\",\r\n // flexDirection: \"column\",\r\n // height: \"100%\"\r\n }}\r\n >\r\n \r\n {nameLabel && (\r\n {nameLabel}\r\n )}\r\n \r\n {this.state.validationMessage && (\r\n \r\n {this.state.validationMessage}\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n {okButton}\r\n \r\n close(null)}\r\n >\r\n {cancelButton}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport const openNameModal = createModal(NameModal);\r\n","import { openNameModal } from \"components/NameModal\";\r\nimport { openProgressModal } from \"components/ProgressModal\";\r\nimport {\r\n validateForm,\r\n createFolderFromTemplate,\r\n createFolderTemplateGetItemUri,\r\n} from \"data/api\";\r\nimport loc from \"i18next\";\r\nimport { toastActionResult } from \"data/toast\";\r\nimport isEmpty from \"lodash/isEmpty\";\r\nimport history from \"data/history\";\r\nimport { getRoute } from \"components/ItemUriLink\";\r\nimport { getLocalizedText } from \"data/utils\";\r\n\r\n/**\r\n * Will validate the model against the server\r\n * @async\r\n * @returns {Object} containing all localized validation errors per field e.g. {fieldName:error, fieldName:error...}\r\n * @memberof FormContainer\r\n */\r\nexport const ValidateTemplate = async (\r\n template: string,\r\n itemUri: string,\r\n newTargetFolderName: string\r\n): Object => {\r\n // this.abortController = new AbortController();\r\n const validationErrors = await validateForm(\r\n true, //isNew\r\n false, //isDoc\r\n itemUri,\r\n true, //validateWebDavName\r\n { ip: { $NAME$: newTargetFolderName } } // we want to send the {ip:{...}} model\r\n // this.abortController.signal\r\n );\r\n // localize error messages\r\n const locErrors = {};\r\n if (!isEmpty(validationErrors)) {\r\n Object.keys(validationErrors).forEach(\r\n (k) => (locErrors[k] = getLocalizedText(validationErrors[k]))\r\n );\r\n return locErrors[\"ip.Name\"];\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * interval pulling for job status; will redirect once new itemUri received\r\n */\r\nexport const CheckJobStatus = ({\r\n jobId,\r\n close,\r\n logger = toastActionResult,\r\n}: {\r\n jobId: number,\r\n close: () => void,\r\n logger: () => void,\r\n}) => {\r\n let times = 1;\r\n const interval = window.setInterval(async () => {\r\n /* istanbul ignore if */\r\n if (times > 12) {\r\n //one minute? too long, bail user\r\n window.clearInterval(interval);\r\n logger(false, \"folder:action_createFolder_template\");\r\n close();\r\n } else {\r\n try {\r\n const newTargetItemUri = await createFolderTemplateGetItemUri(\r\n jobId\r\n );\r\n /* istanbul ignore else */\r\n if (String(newTargetItemUri).startsWith(\"pam-item://\")) {\r\n window.clearInterval(interval);\r\n close();\r\n history.push(getRoute(newTargetItemUri, false, false));\r\n logger(true, \"folder:action_createFolder_template\");\r\n } else {\r\n times++;\r\n }\r\n } catch (e) {\r\n console.error(e);\r\n window.clearInterval(interval);\r\n logger(false, \"folder:action_createFolder_template\");\r\n close();\r\n }\r\n }\r\n }, 5000);\r\n};\r\n\r\ntype Context = {\r\n itemUri: string,\r\n template: string,\r\n targetFolderName?: string,\r\n};\r\n\r\nclass createFolder_template {\r\n logger: () => any = toastActionResult;\r\n\r\n /**\r\n * will actually create the job for creating the folder template and show a progress modal\r\n */\r\n createFolder = ({\r\n itemUri,\r\n template,\r\n newTargetFolderName,\r\n }: {\r\n itemUri: string,\r\n template: string,\r\n newTargetFolderName?: string,\r\n }) =>\r\n openProgressModal({\r\n icon: \"sitemap\",\r\n title: loc.t(\"folder:action_createFolder_template.creating\", {\r\n name: newTargetFolderName,\r\n }),\r\n doWork: async (close, setError) => {\r\n try {\r\n const jobId = await createFolderFromTemplate(\r\n template,\r\n itemUri,\r\n newTargetFolderName\r\n );\r\n if (jobId == null)\r\n throw new Error(\"Error while creating a JobID\");\r\n CheckJobStatus({ jobId, close, logger: this.logger });\r\n } catch (err) {\r\n /* istanbul ignore next */ if (err && err.message)\r\n setError(err.message);\r\n console.warn(err);\r\n // notify user\r\n this.logger(false, \"folder:action_createFolder_template\");\r\n return null;\r\n }\r\n },\r\n });\r\n\r\n targetFolderName: string = \"\";\r\n shouldRender: boolean = true;\r\n render = async ({\r\n itemUri,\r\n template,\r\n targetFolderName,\r\n }: Context): Promise => {\r\n this.targetFolderName = await openNameModal({\r\n itemUri,\r\n name: targetFolderName,\r\n title: loc.t(\"folder:action_createFolder_template.title\", {\r\n name: template,\r\n }),\r\n nameLabel: loc.t(\"folder:action_createFolder_template.nameLabel\"),\r\n okButton: loc.t(\r\n \"folder:action_createFolder_template.confirmButton\"\r\n ),\r\n validation: /* istanbul ignore next */ (\r\n newTargetFolderName: String\r\n ) => ValidateTemplate(template, itemUri, newTargetFolderName),\r\n });\r\n if (this.targetFolderName == null) return false;\r\n return true;\r\n };\r\n\r\n execute = ({\r\n itemUri,\r\n template,\r\n targetFolderName,\r\n }: Context): Promise => {\r\n this.createFolder({\r\n itemUri,\r\n template,\r\n newTargetFolderName: this.targetFolderName,\r\n });\r\n this.logger(true, \"folder:action_createFolder_template\");\r\n return true;\r\n };\r\n}\r\n\r\nexport default createFolder_template;\r\n","// @flow\r\nimport React from \"react\";\r\nimport { useAsync } from \"hooks\";\r\nimport loc from \"i18next\";\r\nimport { createModal } from \"react-modal-promise\";\r\nimport Modal from \"components/Modal\";\r\nimport Status from \"components/Status\";\r\nimport NoData from \"components/NoData\";\r\nimport Icons from \"@hs/icons\";\r\nimport Constants from \"data/constants\";\r\nimport { fetchNewWorkflows } from \"data/api\";\r\nimport { type WorkflowDTO, WorkflowStartLinkMode } from \"data/types\";\r\nimport { openExternalLinkModal } from \"components/ExternalLinkModal\";\r\nimport ItemActions from \"components/ActionPanel/ItemActions\";\r\n\r\n/**\r\n * shows the Workflow Actions\r\n */\r\nexport const WorkflowActions = ({\r\n onClick,\r\n workflows,\r\n}: {\r\n onClick: (wf: WorkflowDTO) => void,\r\n workflows: Array,\r\n}) => {\r\n const workflowActions = workflows.map((wf) =>\r\n Object.assign({}, wf, {\r\n desc: wf.description,\r\n })\r\n );\r\n return ;\r\n};\r\nWorkflowActions.displayName = \"ListWorkflowsModal.Actions\";\r\n\r\ntype Props = {\r\n /** whether to show modal */\r\n open: boolean,\r\n /** callback when user closes modal */\r\n close: () => void,\r\n /** itemUri to start the Workflow with */\r\n itemUri: string,\r\n};\r\n\r\nexport const ListWorkflowsModal = ({ open, close, itemUri }: Props) => {\r\n const state = useAsync(async () => {\r\n try {\r\n return await fetchNewWorkflows(itemUri);\r\n } catch (err) {\r\n console.warn(\"Error while fetchNewWorkflows\", err);\r\n throw err;\r\n }\r\n }, [itemUri]);\r\n\r\n return (\r\n \r\n \r\n \r\n {\" \"}\r\n {loc.t(\"itemActions:wf_start.name\")}\r\n \r\n \r\n \r\n {state.loading && }\r\n {state.error && }\r\n\r\n {state.value != null &&\r\n Array.isArray(state.value) &&\r\n state.value.length > 0 ? (\r\n {\r\n if (\r\n workflow.startLinkMode ===\r\n WorkflowStartLinkMode.Window\r\n ) {\r\n window.open(\r\n workflow.startLink,\r\n \"\",\r\n \"noopener=yes,noreferrer=yes\"\r\n );\r\n } else {\r\n openExternalLinkModal({\r\n url: workflow.startLink,\r\n name: workflow.name,\r\n docked:\r\n workflow.startLinkMode ===\r\n WorkflowStartLinkMode.Docked,\r\n });\r\n }\r\n close();\r\n }}\r\n />\r\n ) : (\r\n \r\n )}\r\n \r\n \r\n );\r\n};\r\nListWorkflowsModal.displayName = \"ListWorkflowsModal\";\r\n\r\nexport const openListWorkflowsModal = createModal(ListWorkflowsModal);\r\n","// @flow\r\n\r\nimport { openListWorkflowsModal } from \"components/ListWorkflowsModal\";\r\n\r\n/**\r\n * Start Workflow with selected itemUri\r\n *\r\n * @param {{ itemUri: string }} { itemUri to start Workflow with }\r\n */\r\n\r\nclass wf_start {\r\n execute = async ({ itemUri }: { itemUri: string }) => {\r\n await openListWorkflowsModal({ itemUri });\r\n return true;\r\n };\r\n}\r\n\r\nexport default wf_start;\r\n","// @flow\r\nimport React from \"react\";\r\nimport { type ItemFlowConfigDTO } from \"data/types\";\r\nimport Icons from \"@hs/icons\";\r\n\r\nconst FlowCardImage = ({ flow }: { flow: ItemFlowConfigDTO }) => {\r\n if (\r\n flow.icon &&\r\n (flow.icon.startsWith(\"http\") ||\r\n flow.icon.startsWith(\"data:image\") ||\r\n flow.icon.startsWith(\"/\") ||\r\n flow.icon.startsWith(\"./\") ||\r\n flow.icon.startsWith(\"../\"))\r\n )\r\n return \"\";\r\n\r\n switch (flow.commandAction.name) {\r\n case \"itemFlow_folder\":\r\n return ;\r\n case \"itemFlow_docTemplate\":\r\n if (flow.icon.startsWith(\".\")) {\r\n return ;\r\n } else\r\n return (\r\n \r\n );\r\n case \"itemFlow_folderTemplate\":\r\n return ;\r\n\r\n default:\r\n return (\r\n \r\n );\r\n }\r\n};\r\nFlowCardImage.displayName = \"ItemFlowsList.FlowCardImage\";\r\nexport default FlowCardImage;\r\n","import React, { useMemo } from \"react\";\r\nimport {\r\n type ItemFlowConfigDTO,\r\n SiteType,\r\n CardType,\r\n CardItemType,\r\n} from \"data/types\";\r\nimport CardItem from \"components/CardList/CardItem\";\r\nimport \"components/CardList/index.css\";\r\nimport NoData from \"components/NoData\";\r\nimport FlowCardImage from \"./FlowCardImage\";\r\nimport Divider from \"components/Divider\";\r\nimport CountBadge from \"components/CountBadge\";\r\nimport loc from \"i18next\";\r\nimport { getLocalizedText } from \"data/utils\";\r\nimport { removeSpaces } from \"data/integrationTestUtils\";\r\n\r\ntype Props = {\r\n /** current folder's itemUri */\r\n itemUri: string,\r\n /** current filterText */\r\n filterText: string,\r\n /** list of all flows */\r\n flows: Array,\r\n /** currently selected flow */\r\n selectedFlow: ?ItemFlowConfigDTO,\r\n /** callback when user selects a flow\r\n * @param {ItemFlowConfigDTO} flow selected\r\n */\r\n onSelect: (flow: ItemFlowConfigDTO) => void,\r\n};\r\n\r\nconst ItemFlowsList = ({\r\n itemUri,\r\n filterText,\r\n flows = [],\r\n selectedFlow,\r\n onSelect,\r\n}: Props) => {\r\n const suggested = useMemo(\r\n () => flows.filter((flow) => flow.isSuggested),\r\n [flows]\r\n );\r\n const others = useMemo(\r\n () => flows.filter((flow) => !flow.isSuggested),\r\n [flows]\r\n );\r\n if (flows.length === 0) return ;\r\n\r\n const renderCardItem = (flow) => (\r\n }\r\n onClick={() => onSelect(flow)}\r\n dataTest={`flowListItem${removeSpaces(flow.name)}`}\r\n />\r\n );\r\n return (\r\n \r\n {/* TODO \r\n meh\r\n */}\r\n {suggested.length > 0 && (\r\n \r\n {loc.t(\"itemflows:list.isSuggested\")}{\" \"}\r\n \r\n \r\n }\r\n >\r\n \r\n {suggested.map((flow) => renderCardItem(flow))}\r\n \r\n \r\n )}\r\n {others.length > 0 && (\r\n \r\n {loc.t(\"itemflows:list.others\")}{\" \"}\r\n \r\n \r\n }\r\n >\r\n \r\n {others.map((flow) => renderCardItem(flow))}\r\n \r\n \r\n )}\r\n \r\n );\r\n};\r\nItemFlowsList.displayName = \"ItemFlowsList\";\r\nexport default ItemFlowsList;\r\n","// @flow\r\nimport React from \"react\";\r\nimport ToggleButtonGroup from \"react-bootstrap/lib/ToggleButtonGroup\";\r\nimport ToggleButton from \"react-bootstrap/lib/ToggleButton\";\r\nimport Icons from \"@hs/icons\";\r\nimport { type ItemFlowCategory } from \"data/types\";\r\nimport { getLocalizedText } from \"data/utils\";\r\n\r\ntype Props = {\r\n /** currently selected type */\r\n value?: string,\r\n /** flow categories */\r\n categories: Array,\r\n /** callback when user selects a new type to filter\r\n * @param {string} newFilterType new selected filter type\r\n */\r\n onChange: (newFilterType: string) => void,\r\n /** optional CSS style to apply */\r\n style?: Object,\r\n /** optional CSS classname to apply */\r\n className?: string,\r\n};\r\n\r\nconst CategoryFilter = ({\r\n value,\r\n categories,\r\n onChange,\r\n style,\r\n className,\r\n}: Props) => (\r\n \r\n {categories.map((category) => (\r\n \r\n \r\n \r\n ))}\r\n \r\n);\r\nCategoryFilter.displayName = \"ItemFlows.CategoryFilter\";\r\nexport default CategoryFilter;\r\n","import React from \"react\";\r\nimport { useAsyncMemo } from \"hooks\";\r\nimport { mapValues, tokenize } from \"data/utils\";\r\nimport { uriForFormTokens, withFormTokens } from \"../utils/FormTokens\";\r\nimport Status from \"components/Status\";\r\nimport Constants from \"data/constants\";\r\nimport { type Props } from \"./Factory\";\r\n\r\nconst CustomItemFlow = (props: Props) => {\r\n const encodedContext = useAsyncMemo(async () => {\r\n const encodedContext = mapValues(props, (value) =>\r\n encodeURIComponent(value)\r\n );\r\n if (!props.itemUri) {\r\n return encodedContext;\r\n }\r\n return await withFormTokens(props, encodedContext);\r\n }, [props]);\r\n if (encodedContext == null) {\r\n return ;\r\n }\r\n const tokenizedUrl = tokenize(\r\n uriForFormTokens(props.flow.commandAction.props.url),\r\n encodedContext\r\n );\r\n return (\r\n \r\n );\r\n};\r\n\r\nCustomItemFlow.displayName = \"ItemFlowsInput.Custom\";\r\nexport default CustomItemFlow;\r\n","import React, { useState } from \"react\";\r\nimport { useAsync } from \"hooks\";\r\nimport { fetchItemFlowForm } from \"data/api\";\r\nimport {\r\n type NewFormTypeEnum,\r\n type ItemFlowTemplateTypeEnum,\r\n} from \"data/types\";\r\nimport FormContainer from \"containers/Form\";\r\nimport { type Props } from \"./Factory\";\r\nimport Status from \"components/Status\";\r\nimport Constants from \"data/constants\";\r\nimport loc from \"i18next\";\r\nimport produce from \"immer\";\r\nimport { getLocalizedText } from \"data/utils\";\r\nimport { toastActionResult } from \"data/toast\";\r\n\r\ntype FormProps = Props & {\r\n formType: NewFormTypeEnum,\r\n templateType: ItemFlowTemplateTypeEnum,\r\n templateId: string,\r\n};\r\n\r\n// centrally load new form definition required by any NewItemType (since all use /api/item/templates/newform)\r\n// one thing special here: props.onCreate is expected to actually create the item,\r\n// props.onCreated is called by parent to notify NewItemModal that it was actually created\r\n\r\nconst Form = (props: FormProps) => {\r\n // we might need to manipulate defaultValues\r\n const [defaultValues, setDefaultValues] = useState(\r\n props.defaultValues || {}\r\n );\r\n\r\n // get form definition\r\n const state = useAsync(async () => {\r\n try {\r\n const form = await fetchItemFlowForm({\r\n formType: props.formType,\r\n itemUri: props.itemUri,\r\n templateId: props.templateId,\r\n templateType: props.templateType,\r\n });\r\n // in order for WebDavName to be included in Save(model) it needs to be manually added to defaultValues for changeLog to take effect\r\n if (defaultValues == null || defaultValues[\"$NAME$\"] == null) {\r\n const nameField = form.fields.find(\r\n (f) => f.format === \"WebDavName\" && f.name === \"$NAME$\"\r\n );\r\n if (nameField != null) {\r\n setDefaultValues(\r\n produce(defaultValues, (draft) => {\r\n draft[\"$NAME$\"] = nameField.value;\r\n })\r\n );\r\n }\r\n }\r\n return form;\r\n } catch (err) {\r\n console.error(\"Error while fetchItemFlowForm\", err);\r\n props.onCancel();\r\n toastActionResult(false, \"itemflows:form\");\r\n\r\n throw err;\r\n }\r\n }, [props.flow]);\r\n\r\n if (state.loading) return ;\r\n if (state.error) return ;\r\n\r\n return (\r\n \r\n );\r\n};\r\nForm.displayName = \"ItemFlowsInput.Form\";\r\nexport default Form;\r\n","// @flow\r\nimport React from \"react\";\r\nimport { type Props } from \"./Factory\";\r\nimport {\r\n NewFormType,\r\n ItemFlowTemplateType,\r\n type NewItemResultDTO,\r\n} from \"data/types\";\r\nimport Form from \"./Form\";\r\nimport { createFolder } from \"data/api\";\r\nimport history from \"data/history\";\r\nimport { getRoute } from \"components/ItemUriLink\";\r\n\r\nconst Folder = (props: Props) => {\r\n const onCreate = async (model): Promise => {\r\n try {\r\n const result: NewItemResultDTO = await createFolder({\r\n elementType: props.flow.commandAction.props.elementType,\r\n formatId: props.flow.commandAction.props.templateId,\r\n itemUri: props.itemUri,\r\n values: model,\r\n });\r\n if (result) {\r\n if (result.success) {\r\n if (props.previewNewItem === true && result.itemUri) {\r\n history.push(getRoute(result.itemUri));\r\n }\r\n props.onCreated(true, null, result);\r\n return true;\r\n } else {\r\n console.warn(\"Received success=false\");\r\n props.onCreated(false, null);\r\n return false;\r\n }\r\n } else {\r\n throw new Error(\"No Result received\");\r\n }\r\n } catch (err) {\r\n console.warn(err);\r\n props.onCreated(false, err);\r\n return false;\r\n }\r\n };\r\n\r\n return (\r\n \r\n );\r\n};\r\nFolder.displayName = \"ItemFlowsInput.Folder\";\r\nFolder.defaultProps = {\r\n previewNewItem: true,\r\n};\r\nexport default Folder;\r\n","import React, { useRef, useCallback, useEffect, useMemo } from \"react\";\r\nimport { postMessageTo } from \"hooks/PostMessage/Utils\";\r\nimport { usePostMessageHandler } from \"hooks\";\r\nimport { userLanguage } from \"data/storeHelper\";\r\nimport { CustomUploadAction } from \"hooks/PostMessage/Actions\";\r\n\r\ntype Props = {\r\n /** uppy instance reference */\r\n uppy: Object,\r\n /** url to custom page providing file selection */\r\n url: string,\r\n /** callback to close custom panel */\r\n onClose: () => void,\r\n};\r\n\r\nconst CustomUploadSelection = ({ url, uppy, onClose }: Props) => {\r\n const iframeRef = useRef(null);\r\n let iframeTimeout = useRef(null);\r\n\r\n const handleFile = useCallback(\r\n async ({ name, data, url, source = \"Local\" } = {}) => {\r\n clearTimeout(iframeTimeout.current);\r\n let error = false;\r\n if (name == null || (data == null && url == null)) {\r\n console.error(`CustomUploadAction.Start prop missing: name `);\r\n error = true;\r\n }\r\n if (data == null && url == null) {\r\n console.error(\r\n `CustomUploadAction.Start prop missing: data or url`\r\n );\r\n error = true;\r\n }\r\n if (error) {\r\n return;\r\n }\r\n\r\n // Optional fetch url as blob, if data is empty...\r\n if (url && data == null) {\r\n const response = await fetch(url);\r\n data = await response.blob();\r\n }\r\n uppy.addFile({\r\n name,\r\n type: data.type,\r\n data,\r\n source,\r\n isRemote: false,\r\n });\r\n /* istanbul ignore else */\r\n if (typeof onClose === \"function\") onClose();\r\n },\r\n [uppy, onClose]\r\n );\r\n\r\n const setLanguage = useCallback(() => {\r\n clearTimeout(iframeTimeout.current);\r\n postMessageTo(\r\n CustomUploadAction.Language,\r\n userLanguage(),\r\n iframeRef.current.contentWindow\r\n );\r\n }, []);\r\n\r\n usePostMessageHandler(\r\n useMemo(\r\n () => ({\r\n [CustomUploadAction.Ready]: setLanguage,\r\n [CustomUploadAction.File]: handleFile,\r\n }),\r\n [setLanguage, handleFile]\r\n )\r\n );\r\n\r\n // Notify console if custom upload does not trigger CustomUploadAction.Ready\r\n useEffect(() => {\r\n /* istanbul ignore else */\r\n if (iframeTimeout.current == null) {\r\n iframeTimeout.current = setTimeout(\r\n /* istanbul ignore next */ () => {\r\n console.warn(\r\n `Breaking Change: Loaded CustomUploadSelection at ${url} does not communicate with postMessage. See https://serviceportal.hs.ag/docs/inPoint.Web/docs/next/feature-integration-postmessage.html`\r\n );\r\n },\r\n 1000\r\n );\r\n }\r\n return () => {\r\n clearTimeout(iframeTimeout.current);\r\n iframeTimeout.current = null;\r\n };\r\n }, [url]);\r\n\r\n return (\r\n \r\n );\r\n};\r\nCustomUploadSelection.displayName = \"ItemFlows.CustomUploadSelection\";\r\nexport default CustomUploadSelection;\r\n","import React, { useState, useMemo, useCallback } from \"react\";\r\nimport UploadSelection from \"components/UploadSelection\";\r\nimport CustomUploadSelection from \"./CustomUploadSelection\";\r\nimport { useUppy } from \"hooks\";\r\n\r\ntype Props = {\r\n /** reference to Uppy */\r\n uppyRef: { current: null | Node },\r\n /** which uppy ID to use (to separate from other upload queues) */\r\n uppyId: string,\r\n /** callback when user adds a file */\r\n onFileAdded: (file: uppyFile) => void,\r\n /** callback when user removes a file */\r\n onFileRemoved: (file: uppyFile) => void,\r\n /** whether to immediately open File Browse dialog */\r\n openBrowseDialog?: boolean,\r\n /** whether to immediately open Camera dialog */\r\n openCamera?: boolean,\r\n /** whether to use a custom URL for the file selection (instead of Uppy) */\r\n openCustomUrl?: string,\r\n /** current total number of files queued for upload */\r\n numOfFiles: number,\r\n};\r\n\r\nexport const DocumentSelection = ({\r\n uppyRef,\r\n uppyId,\r\n onFileAdded,\r\n onFileRemoved,\r\n openBrowseDialog,\r\n openCamera,\r\n openCustomUrl,\r\n numOfFiles,\r\n}: Props) => {\r\n const [isOpen, setOpen] = useState(false);\r\n const events = useMemo(\r\n () => [\r\n { type: \"file-added\", callback: onFileAdded },\r\n { type: \"file-removed\", callback: onFileRemoved },\r\n ],\r\n [onFileAdded, onFileRemoved]\r\n );\r\n const onAddFile = useCallback(() => setOpen(true), []);\r\n const onClose = useCallback(() => setOpen(false), []);\r\n\r\n uppyRef.current = useUppy({\r\n uppyId,\r\n events,\r\n });\r\n /* istanbul ignore if */\r\n if (uppyRef.current == null) return null;\r\n\r\n if (openCustomUrl)\r\n return (\r\n <>\r\n {(numOfFiles === 0 || isOpen) && (\r\n \r\n )}\r\n {numOfFiles > 0 && !isOpen && (\r\n \r\n )}\r\n \r\n );\r\n else\r\n return (\r\n \r\n );\r\n};\r\n\r\n// we are forwarding the new instanced uppy reference up to our parent since we do not want to handle actual uploads\r\n/* istanbul ignore next */\r\nconst DocumentSelectionWithRef = React.forwardRef((props: Props, uppyRef) => (\r\n \r\n));\r\n\r\nexport default DocumentSelectionWithRef;\r\n","import React, { useState, useRef, useCallback } from \"react\";\r\nimport { useSelector } from \"react-redux\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport { UploadMode, NewFormType, ItemFlowTemplateType } from \"data/types\";\r\nimport DocumentSelection from \"./DocumentSelection\";\r\nimport { type Props } from \"./Factory\";\r\nimport Form from \"./Form\";\r\nimport produce from \"immer\";\r\nimport { replaceFileExtension } from \"data/utils\";\r\nimport Divider from \"components/Divider\";\r\nimport CountBadge from \"components/CountBadge\";\r\nimport loc from \"i18next\";\r\nimport styles from \"./itemFlow_document.module.css\";\r\n\r\nconst Document = (props: Props) => {\r\n const isOnline = useSelector(s.isOnlineSelector);\r\n const [files, setFiles] = useState([]);\r\n // we'll keep a reference to the uppy instance created by \r\n const uppyRef = useRef(null);\r\n\r\n const _updateFiles = useCallback(\r\n () => setFiles(uppyRef.current.getFiles()),\r\n [uppyRef]\r\n );\r\n\r\n /**\r\n * will try to get the first filename available\r\n * @returns {string} filename or null if nothing found\r\n * @memberof Upload\r\n */\r\n const _getWebDavNameHint = () => {\r\n const firstFile = files.find((f) => f.meta && f.meta.itemUri == null);\r\n return firstFile\r\n ? firstFile.meta.name /* istanbul ignore next */\r\n : null;\r\n };\r\n\r\n /**\r\n * will return defaultValues to pass on to form\r\n * @returns defaultValues or null if no filename found\r\n * @memberof Upload\r\n */\r\n const _getDefaultValues = () =>\r\n produce(props.defaultValues || {}, (draft) => {\r\n const WebDavName = _getWebDavNameHint();\r\n /* istanbul ignore else */\r\n if (WebDavName) draft[\"$NAME$\"] = WebDavName;\r\n });\r\n\r\n const _onCreate = async (\r\n model,\r\n keepOriginalFilename: boolean = false,\r\n formatId: number\r\n ) => {\r\n // COPY from views/upload/_onSaveNew()\r\n files.forEach((file) => {\r\n // has itemUri set (from previous failure?)\r\n /* istanbul ignore else */\r\n if (file.meta.itemUri == null) {\r\n // #46997 let's fix the file extension\r\n // HACK\r\n const newModel = produce(model, (draft) => {\r\n draft.ip[\"$NAME$\"] = replaceFileExtension(\r\n model.ip[\"$NAME$\"], // first filename\r\n file.extension // current real extension\r\n );\r\n });\r\n // attach classification form (ip/ea) to each file's metadata (managed server-side by TusMiddleware.cs)\r\n uppyRef.current.setFileMeta(file.id, {\r\n itemUri: props.itemUri,\r\n formatId: formatId,\r\n mode: UploadMode.CreateDocument,\r\n model: JSON.stringify(newModel),\r\n keepOriginalFilename,\r\n });\r\n }\r\n });\r\n uppyRef.current\r\n .upload()\r\n // .catch(err => props.onCreated(false, err))\r\n .then((result) =>\r\n props.onCreated(!isOnline || result.failed.length === 0)\r\n );\r\n };\r\n\r\n return (\r\n <>\r\n \r\n \r\n {loc.t(\"itemflows:toggles.file\")}{\" \"}\r\n {!!files.length && (\r\n \r\n )}\r\n \r\n }\r\n name=\"upload\"\r\n expanded={files.length === 0}\r\n unmountOnExit={false}\r\n mountOnEnter={false}\r\n >\r\n
\r\n \r\n
\r\n \r\n \r\n {files.length > 0 && (\r\n \r\n )}\r\n \r\n );\r\n};\r\nDocument.displayName = \"ItemFlowsInput.Document\";\r\nexport default Document;\r\n","import React from \"react\";\r\nimport { type Props } from \"./Factory\";\r\nimport { saveNewDocFromTemplate } from \"data/api\";\r\nimport { NewFormType, ItemFlowTemplateType } from \"data/types\";\r\nimport Form from \"./Form\";\r\n\r\nconst DocTemplate = (props: Props) => {\r\n const _onCreate = async (model) => {\r\n try {\r\n const result = await saveNewDocFromTemplate({\r\n templateId: props.flow.commandAction.props.templateId,\r\n itemUri: props.itemUri,\r\n values: model,\r\n });\r\n props.onCreated(result === true);\r\n } catch (err) {\r\n // console.warn(err);\r\n props.onCreated(false, err);\r\n }\r\n };\r\n\r\n return (\r\n \r\n );\r\n};\r\nDocTemplate.displayName = \"ItemFlowsInput.DocTemplate\";\r\nexport default DocTemplate;\r\n","import React from \"react\";\r\nimport { type Props } from \"./Factory\";\r\nimport Form from \"./Form\";\r\nimport { NewFormType, ItemFlowTemplateType } from \"data/types\";\r\nimport { createFolderFromTemplate } from \"data/api\";\r\nimport { CheckJobStatus } from \"components/CommandActions/createFolder_template\";\r\n\r\nconst FolderTemplate = (props: Props) => {\r\n const _onCreate = (model) =>\r\n createFolderFromTemplate(\r\n props.flow.commandAction.props.templateId,\r\n props.itemUri,\r\n model.ip[\"$NAME$\"]\r\n )\r\n .catch((err) => {\r\n props.onCreated(false, err);\r\n return null;\r\n })\r\n .then(\r\n /* istanbul ignore next */ (jobId) =>\r\n jobId != null &&\r\n CheckJobStatus({\r\n jobId,\r\n close: () => props.onCreated(true),\r\n })\r\n );\r\n\r\n return (\r\n \r\n );\r\n};\r\nFolderTemplate.displayName = \"ItemFlowsInput.FolderTemplate\";\r\nexport default FolderTemplate;\r\n","// @flow\r\nimport React, { useMemo } from \"react\";\r\nimport { useSelector } from \"react-redux\";\r\nimport { type ItemFlowConfigDTO, type NewItemResultDTO } from \"data/types\";\r\nimport CustomItemFlow from \"./itemFlow_custom\";\r\nimport Folder from \"./itemFlow_folder\";\r\nimport Document from \"./itemFlow_document\";\r\nimport DocTemplate from \"./itemFlow_docTemplate\";\r\nimport FolderTemplate from \"./itemFlow_folderTemplate\";\r\nimport { formDefaultsSelector } from \"data/reducers/selectors\";\r\n\r\nexport type Props = {\r\n /** current flow selected by user */\r\n flow: ItemFlowConfigDTO,\r\n /** current viewName */\r\n viewName: string,\r\n /** target folder itemUri to create item in */\r\n itemUri: string,\r\n /** callback when user cancel */\r\n onCancel: () => void,\r\n /** callback when user wants to create the item\r\n * @async\r\n * @param {object} model the form's values\r\n * @returns {boolean} true if success, false otherwise\r\n */\r\n onCreate?: (model: Object) => Promise,\r\n /** callback when item has been created\r\n * @param {boolean} success true if created successfully\r\n * @param {Object} error error object in case success is false\r\n * @param {NewItemResultDTO} data additional data related to new item\r\n */\r\n onCreated?: (\r\n success: boolean,\r\n error?: Object,\r\n data?: NewItemResultDTO\r\n ) => void,\r\n /** form default values */\r\n defaultValues?: Object,\r\n /** optional whether to preview the newly created item\r\n * @default true\r\n */\r\n previewNewItem?: boolean,\r\n};\r\n\r\nconst flowsMappings = {\r\n itemFlow_custom: CustomItemFlow,\r\n itemFlow_document: Document,\r\n itemFlow_docTemplate: DocTemplate,\r\n itemFlow_folder: Folder,\r\n itemFlow_folderTemplate: FolderTemplate,\r\n};\r\n\r\n/** ItemFLows Type factory\r\n * each component takes care of:\r\n * 1. rendering whatever is required (e.g. Form or Upload)\r\n * 2. handling the creation process\r\n * 3. calling back onCreated with success/failure\r\n */\r\nconst Factory = ({\r\n defaultValues: defaultValuesFromProps,\r\n ...props\r\n}: Props) => {\r\n // get default form values\r\n const defaultValuesFromStore = useSelector(formDefaultsSelector);\r\n const defaultValues = useMemo(\r\n () => ({ ...defaultValuesFromStore, ...defaultValuesFromProps }),\r\n [defaultValuesFromStore, defaultValuesFromProps]\r\n );\r\n const ComponentClass = flowsMappings[props.flow.commandAction.name];\r\n if (ComponentClass == null)\r\n return (\r\n
Unknown itemFlow named {props.flow.commandAction.name}
\r\n );\r\n else return ;\r\n};\r\nFactory.displayName = \"ItemFlows.Factory\";\r\nexport default Factory;\r\n","// @flow\r\n//#region imports\r\nimport React, { PureComponent } from \"react\";\r\nimport { connect, Dispatch } from \"react-redux\";\r\nimport { compose } from \"redux\";\r\nimport isEqual from \"lodash/isEqual\";\r\nimport produce from \"immer\";\r\nimport TogglesHandler from \"containers/TogglesHandler\";\r\nimport \"./index.css\";\r\nimport MainLayout from \"components/MainLayout\";\r\nimport ItemFlowsList from \"components/ItemFlowsList\";\r\nimport {\r\n type ToggleDTO,\r\n type ToggleItemDTO,\r\n type ItemFlowConfigDTO,\r\n type ItemFlowCategory,\r\n type NewItemResultDTO,\r\n} from \"data/types\";\r\nimport SplitPanes from \"containers/SplitPanes\";\r\nimport loc from \"i18next\";\r\nimport CloseButton from \"@hs/close-button\";\r\nimport SearchInput from \"@hs/search-input\";\r\nimport { togglesUpdateCounterAction } from \"data/actions\";\r\nimport Constants from \"data/constants\";\r\nimport CategoryFilter from \"./CategoryFilter\";\r\nimport SettingValue, { type SettingValueProps } from \"containers/SettingValue\";\r\nimport { toastActionResult } from \"data/toast\";\r\nimport {\r\n setCurrentItemAction,\r\n backupCurrentItemAction,\r\n restoreCurrentItemAction,\r\n} from \"data/actions\";\r\nimport { get } from \"data/constants\";\r\nimport { getFolderUri } from \"data/utils\";\r\nimport ItemFlowsFactory from \"components/CommandActions/itemFlows/Factory\";\r\nimport Pane from \"components/SplitPanes/Pane\";\r\nimport { isHandheld } from \"data/bowser\";\r\nimport { inPointAction, inPointActionLink } from \"components/ItemUriLink\";\r\nimport { check_isSyncUpload } from \"containers/ActionPanel/ShouldBeVisible\";\r\n//#endregion\r\n\r\nexport const viewName = \"itemflows\";\r\n\r\ntype Props = {\r\n /** whether shown as Modal */\r\n asModal?: boolean,\r\n /** Redux dispatch */\r\n dispatch: Dispatch,\r\n /** callback when closing Modal dialog */\r\n onClose?: () => void,\r\n /** list of flows to render */\r\n flows: ?Array,\r\n /** list of flow categories */\r\n categories: ?Array,\r\n /** pre-selected flow */\r\n selectedFlow?: ItemFlowConfigDTO,\r\n /** pre-selected category */\r\n selectedCategory?: ItemFlowCategory,\r\n // from TogglesHandler\r\n /** TogglesHandler callback to set toggles */\r\n setToggles: Function,\r\n /** TogglesHandler this view's toggles definitions */\r\n toggles: ?ToggleDTO,\r\n /** current itemUri */\r\n itemUri: string,\r\n // from redux\r\n /** which toggles are currently selected */\r\n selectedToggles: Array,\r\n /** SplitPanes callback to set split sizes */\r\n setSplitSizes: Function,\r\n /** persisted filterType */\r\n filterType: SettingValueProps,\r\n /** optional default attribute values to pass to form */\r\n defaultValues?: Object,\r\n /** optional whether to preview the newly created item\r\n * @default true\r\n */\r\n previewNewItem?: boolean,\r\n /** optional callback when completed\r\n * @param {NewItemResultDTO} data details about the item created\r\n */\r\n onDone?: (data: NewItemResultDTO) => void,\r\n};\r\n\r\ntype State = {\r\n filterText: string,\r\n filterType: string,\r\n filteredFlows: ?Array,\r\n selectedFlow: ?ItemFlowConfigDTO,\r\n};\r\n\r\nexport class ItemFlows extends PureComponent {\r\n constructor(props: Props) {\r\n super(props);\r\n this.state = {\r\n filterText: \"\",\r\n filterType: props.selectedCategory\r\n ? props.selectedCategory.id\r\n : props.filterType.value,\r\n filteredFlows: null,\r\n selectedFlow: props.selectedFlow,\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n const { dispatch, itemUri, selectedFlow } = this.props;\r\n dispatch(backupCurrentItemAction());\r\n dispatch(setCurrentItemAction({ name: viewName, itemUri }));\r\n\r\n this._updateToggles();\r\n this._filterList();\r\n this._updateFormToggle(selectedFlow != null);\r\n }\r\n\r\n componentWillUnmount() {\r\n const { dispatch } = this.props;\r\n this._updateFormToggle(false);\r\n dispatch(restoreCurrentItemAction());\r\n }\r\n\r\n componentDidUpdate(prevProps: Props, prevState: State) {\r\n if (!isEqual(prevState.selectedFlow, this.state.selectedFlow)) {\r\n this._updateFormToggle(this.state.selectedFlow != null);\r\n }\r\n if (\r\n prevState.filterText !== this.state.filterText ||\r\n prevState.filterType !== this.state.filterType\r\n ) {\r\n this._filterList();\r\n }\r\n if (prevState.filteredFlows !== this.state.filteredFlows) {\r\n this._updateToggles();\r\n }\r\n }\r\n\r\n _updateToggles = () =>\r\n this.props.dispatch(\r\n togglesUpdateCounterAction({\r\n name: viewName,\r\n counts: { list: this._getTotalCount() },\r\n status: { list: Constants.OK },\r\n })\r\n );\r\n\r\n _getTotalCount = () =>\r\n this.state.filteredFlows\r\n ? this.state.filteredFlows.length\r\n : this.props.flows.length;\r\n\r\n _filterList = () =>\r\n this.setState({ filteredFlows: this._getFilteredList() });\r\n\r\n _getFilteredList = () =>\r\n this.props.flows == null\r\n ? /* istanbul ignore next */ []\r\n : this.props.flows.filter((t) => {\r\n // filter type\r\n let show =\r\n this.state.filterType === \"all\"\r\n ? true\r\n : t.category.toLowerCase() === this.state.filterType;\r\n if (!show) return false;\r\n\r\n // filter name and/or description\r\n if (this.state.filterText.length > 0)\r\n show =\r\n (\r\n get(t, [\"name\"], \"\").toLowerCase() +\r\n get(t, [\"desc\"], \"\").toLowerCase()\r\n ).indexOf(this.state.filterText.toLowerCase()) >= 0;\r\n if (!show) return false;\r\n\r\n return show;\r\n });\r\n\r\n _onFilterTextChange = (filterText: ?string) =>\r\n this.setState({ filterText: filterText || \"\" });\r\n\r\n _onFilterTypeChange = (filterType: ?string) =>\r\n this.setState({ filterType: filterType || \"all\" }, () => {\r\n this.props.filterType.setValue(filterType || \"all\");\r\n });\r\n\r\n _updateFormToggle = (show: boolean) => {\r\n /* istanbul ignore if */\r\n if (this.props.toggles == null) return;\r\n // form toggles visibility\r\n const toggles = produce(this.props.toggles, (draft) => {\r\n draft.toggles = draft.toggles.map((toggle: ToggleItemDTO) => {\r\n if (toggle.value === \"form\") {\r\n // handle form toggle\r\n toggle.isDisabled = !show;\r\n toggle.isSelected = show;\r\n } else if (isHandheld() && toggle.value === \"list\") {\r\n // handle list toggle (handheld only)\r\n toggle.isSelected = !show;\r\n }\r\n return toggle;\r\n });\r\n });\r\n /* istanbul ignore else */\r\n if (toggles != null) {\r\n this.props.setToggles(toggles);\r\n }\r\n };\r\n\r\n _onSelect = (selectedFlow: ItemFlowConfigDTO) => {\r\n if (selectedFlow.id === \"doc_upload\" && check_isSyncUpload()) {\r\n const win = window.open(\r\n inPointActionLink(inPointAction.archive),\r\n \"_blank\"\r\n );\r\n win.focus();\r\n } else {\r\n this.setState({ selectedFlow });\r\n }\r\n };\r\n\r\n _onFormCancel = () => this.setState({ selectedFlow: null });\r\n\r\n _onCreated = (\r\n success: boolean,\r\n error?: Object,\r\n data?: NewItemResultDTO\r\n ) => {\r\n toastActionResult(success, `${viewName}:created`);\r\n if (typeof this.props.onDone === \"function\") {\r\n this.props.onDone(\r\n Object.assign(\r\n {},\r\n {\r\n success,\r\n },\r\n data\r\n )\r\n );\r\n }\r\n if (success === true) {\r\n /* istanbul ignore else */\r\n if (typeof this.props.onClose === \"function\") this.props.onClose();\r\n } else {\r\n // TODO do we toast itemFlows failure? Do we close?\r\n console.error(error || \"Unknown error happened during creation\");\r\n }\r\n };\r\n\r\n render() {\r\n const { toggles } = this.props;\r\n const itemUri = getFolderUri(this.props.itemUri);\r\n return (\r\n }\r\n >\r\n \r\n {this.props.selectedFlow == null && (\r\n
\r\n \r\n \r\n
\r\n )}\r\n \r\n
\r\n \r\n {this.state.selectedFlow && (\r\n \r\n )}\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default compose(\r\n connect(),\r\n TogglesHandler({\r\n viewName,\r\n }),\r\n SplitPanes({\r\n viewName,\r\n paneIds: [\"#itemFlowsListPanel\", \"#itemFlowsFormPanel\"],\r\n toggleIds: [\"list\", \"form\"],\r\n direction: \"horizontal\",\r\n }),\r\n SettingValue({\r\n name: \"itemFlows.filterType\",\r\n namespace: \"filterType\",\r\n defaultValue: \"all\",\r\n })\r\n)(ItemFlows);\r\n","// @flow\r\nimport React, { useState } from \"react\";\r\nimport { useAsync } from \"hooks\";\r\nimport { fetchItemFlows } from \"data/api\";\r\nimport { isListed } from \"data/utils\";\r\nimport Status from \"components/Status\";\r\nimport ItemFlows from \"views/itemFlows\";\r\nimport Constants from \"data/constants\";\r\nimport {\r\n type ItemFlowsConfigDTO,\r\n type ItemFlowDirectionEnum,\r\n type NewItemResultDTO,\r\n} from \"data/types\";\r\n\r\ntype Props = {\r\n /** current folder's itemUri */\r\n itemUri: string,\r\n /** callback when user closes */\r\n onClose: () => void,\r\n /** flow direction \"in\" vs \"out\" */\r\n direction?: ItemFlowDirectionEnum,\r\n /** optional flow.id to pre-select */\r\n flowId?: string,\r\n /** flow.ids to allow visible */\r\n visibleFlowIds?: Array,\r\n /** optional category.id to pre-select */\r\n categoryId?: string,\r\n /** optional default attribute values to pass to form */\r\n defaultValues?: Object,\r\n /** optional whether to preview the newly created item\r\n * @default true\r\n */\r\n previewNewItem?: boolean,\r\n /** optional callback when completed\r\n * @param {NewItemResultDTO} data details about the item created\r\n */\r\n onDone?: (data: NewItemResultDTO) => void,\r\n};\r\n\r\nconst ItemFlowsContainer = (props: Props) => {\r\n const [selectedFlow, setSelectedFlow] = useState(null);\r\n const [selectedCategory, setSelectedCategory] = useState(null);\r\n // get input item flows\r\n const state = useAsync(async () => {\r\n try {\r\n const cfg: ItemFlowsConfigDTO = await fetchItemFlows(\r\n props.itemUri,\r\n props.direction\r\n );\r\n // filter requested visible flows\r\n // PS: yes I know we could filter them on the server-side, but it would not improve performance just reduce packet size\r\n if (props.visibleFlowIds) {\r\n cfg.flows = cfg.flows.filter((f) =>\r\n isListed(f.id, props.visibleFlowIds)\r\n );\r\n }\r\n // pre-select a specific flow\r\n if (props.flowId || cfg.selectFlowId) {\r\n setSelectedFlow(\r\n cfg.flows.find(\r\n (f) => f.id === (props.flowId || cfg.selectFlowId)\r\n )\r\n );\r\n }\r\n // pre-select a specific category\r\n if (props.categoryId) {\r\n setSelectedCategory(\r\n cfg.categories.find((c) => c.id === props.categoryId)\r\n );\r\n }\r\n return cfg;\r\n } catch (err) {\r\n console.warn(\"Error while fetchItemFlows\", err);\r\n throw err;\r\n }\r\n }, [props.itemUri]);\r\n\r\n if (state.loading) return ;\r\n if (state.error) return ;\r\n\r\n return (\r\n \r\n );\r\n};\r\nItemFlowsContainer.displayName = \"ItemFlowsContainer\";\r\nItemFlowsContainer.defaultProps = {\r\n direction: \"in\",\r\n};\r\nexport default ItemFlowsContainer;\r\n","// @flow\r\nimport React from \"react\";\r\nimport Modal, { ModalSize } from \"components/Modal\";\r\nimport { createModal } from \"react-modal-promise\";\r\nimport styles from \"./ItemFlowsModal.module.css\";\r\nimport ItemFlowsContainer from \"containers/ItemFlows\";\r\nimport { type ItemFlowDirectionEnum, type NewItemResultDTO } from \"data/types\";\r\nimport { useModalPostMessageHandler } from \"hooks\";\r\n\r\ntype Props = {\r\n /** react-modal-promise: whether to show dialog */\r\n open: boolean,\r\n /** react-modal-promise: callback when user closes Dialog */\r\n close: () => void,\r\n /** current folder's itemUri */\r\n itemUri: string,\r\n /** flow direction \"in\" vs \"out\" */\r\n direction?: ItemFlowDirectionEnum,\r\n /** flow.id to pre-select */\r\n flowId?: string,\r\n /** flow.ids to allow visible */\r\n visibleFlowIds?: Array,\r\n /** category.id to pre-select */\r\n categoryId?: string,\r\n /** optional default attribute values to pass to form */\r\n defaultValues?: Object,\r\n /** optional whether to preview the newly created item\r\n * @default true\r\n */\r\n previewNewItem?: boolean,\r\n /** optional callback when completed\r\n * @param {NewItemResultDTO} data details about the item created\r\n */\r\n onDone?: (data: NewItemResultDTO) => void,\r\n};\r\n\r\n/** presents the available item templates to the user */\r\nexport const ItemFlowsModal = ({\r\n open,\r\n close,\r\n itemUri,\r\n direction,\r\n flowId,\r\n visibleFlowIds,\r\n categoryId,\r\n defaultValues,\r\n previewNewItem,\r\n onDone,\r\n}: Props) => {\r\n useModalPostMessageHandler(close);\r\n return (\r\n close(false)}\r\n dialogClassName={styles.itemflows}\r\n headerSize={0}\r\n footerSize={0}\r\n dataTest=\"itemFlowsModal\"\r\n >\r\n \r\n \r\n \r\n \r\n );\r\n};\r\nItemFlowsModal.displayName = \"ItemFlowsModal\";\r\nexport const openItemFlowsModal = createModal(ItemFlowsModal);\r\n","import { openItemFlowsModal } from \"components/ItemFlowsModal\";\r\nimport {\r\n type ItemFlowDirectionEnum,\r\n ItemFlowDirection,\r\n type NewItemResultDTO,\r\n} from \"data/types\";\r\n\r\n/**\r\n * opens the itemFlows input dialog for the given itemUri\r\n *\r\n * @param {{ itemUri: string }} { itemUri } target folder itemUri\r\n * @param {{ direction: ItemFlowDirection }} { direction } \"in\" or \"out\" (defaults to \"in\")\r\n * @param {{ flowId?: string}} { flowId } optional pre-selected flow.id\r\n * @param {{ visibleFlowIds?: Array}} { visibleFlowIds } optional limit which flowIds are at all visible\r\n * @param {{ categoryId?: string}} { categoryId } optional pre-selected category.id\r\n * @param {{ defaultValues?: Object }} { defaultValues } optional default attribute values to pass to form\r\n * @param {{ previewNewItem?: boolean}} { previewNewItem } internal: whether to preview to the newly created item (defaults to false)\r\n * @param {{ onDone?: (data: NewItemResultDTO) => void}} { onDone } internal: callback once complete ({success:boolean, itemUri, name, formatId, elementType, ... })\r\n *\r\n */\r\n\r\ntype Context = {\r\n itemUri: string,\r\n direction?: ItemFlowDirectionEnum,\r\n flowId?: string,\r\n visibleFlowIds?: Array,\r\n categoryId?: string,\r\n defaultValues?: Object,\r\n previewNewItem?: boolean,\r\n onDone?: (data: NewItemResultDTO) => void,\r\n};\r\n\r\nclass itemFlows {\r\n execute = async ({\r\n itemUri,\r\n direction = ItemFlowDirection.in,\r\n flowId,\r\n visibleFlowIds,\r\n categoryId,\r\n defaultValues,\r\n previewNewItem = true,\r\n onDone,\r\n }: Context): Promise => {\r\n await openItemFlowsModal({\r\n itemUri,\r\n direction,\r\n flowId,\r\n visibleFlowIds,\r\n categoryId,\r\n defaultValues,\r\n previewNewItem,\r\n onDone,\r\n });\r\n return true;\r\n };\r\n}\r\n\r\nexport default itemFlows;\r\n","import { transfer as transferApi } from \"data/api\";\r\nimport { getFolderUri } from \"data/utils\";\r\nimport { toastActionResult, toastStyled, toastTypes } from \"data/toast\";\r\nimport { openPickerModal, PickerType } from \"components/PickerModal\";\r\nimport {\r\n NotificationStyle,\r\n TransferType,\r\n type TransferTypeEnum,\r\n type TransferItemRequestDTO,\r\n} from \"data/types\";\r\nimport loc from \"i18next\";\r\n\r\n/**\r\n * Transfer by type a given resource by itemUri\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ name: string }} { name }\r\n * @param {{ type: TransferTypeEnum }} { type }\r\n * @param {{ isDoc: bool }} { isDoc }\r\n */\r\n\r\ntype Context = {\r\n itemUri: string,\r\n name: string,\r\n type: TransferTypeEnum,\r\n isDoc: boolean,\r\n};\r\n\r\nclass transfer {\r\n queueMultiple: boolean = true;\r\n logger: () => any = toastActionResult;\r\n shouldRender: boolean = true;\r\n transferRequest: ?TransferItemRequestDTO = null;\r\n\r\n render = async ({ itemUri, name, type }: Context) => {\r\n this.shouldRender = false;\r\n const folderUri = getFolderUri(itemUri);\r\n let selectButton = loc.t(\"commandAction:transfer.copy.name\");\r\n const additionalActions = [];\r\n const onSelect = (eventKey) => (type = eventKey);\r\n switch (type) {\r\n case TransferType.Copy:\r\n break;\r\n case TransferType.Move:\r\n selectButton = loc.t(\"commandAction:transfer.move.name\");\r\n break;\r\n case TransferType.Link:\r\n selectButton = loc.t(\"commandAction:transfer.link.name\");\r\n break;\r\n default:\r\n additionalActions.push({\r\n label: loc.t(\"commandAction:transfer.move.name\"),\r\n eventKey: TransferType.Move,\r\n });\r\n additionalActions.push({\r\n label: loc.t(\"commandAction:transfer.link.name\"),\r\n eventKey: TransferType.Link,\r\n });\r\n // Set default type\r\n type = type || TransferType.Copy;\r\n break;\r\n }\r\n const targetItemUri = await openPickerModal({\r\n pickerType: PickerType.Folder,\r\n scopeBreadcrumb: false,\r\n itemUri: folderUri,\r\n helpText: loc.t(\"commandAction:transfer.helpText\", { name }),\r\n selectButton,\r\n onSelect,\r\n additionalActions,\r\n });\r\n if (targetItemUri === false) return false;\r\n this.transferRequest = {\r\n type,\r\n targetItemUri,\r\n };\r\n return true;\r\n };\r\n\r\n execute = async ({ itemUri, name, isDoc }: Context): Promise => {\r\n try {\r\n const success = await transferApi({\r\n ...this.transferRequest,\r\n itemUri,\r\n name,\r\n });\r\n if (this.transferRequest?.type === TransferType.Move && !isDoc) {\r\n toastStyled({\r\n ...toastTypes.failure,\r\n icon: \"alert\",\r\n style: NotificationStyle.Warning,\r\n toastId: \"transfer\",\r\n message: `$commandAction:transfer.${this.transferRequest?.type}.warning`,\r\n });\r\n }\r\n return success;\r\n } catch (error) {\r\n return false;\r\n }\r\n };\r\n report = (success: boolean, { name }: Context) => {\r\n this.logger(\r\n success,\r\n `commandAction:transfer.${this.transferRequest?.type}`,\r\n { name }\r\n );\r\n };\r\n}\r\n\r\nexport default transfer;\r\n","import { openConfirmModal } from \"components/ConfirmModal\";\r\nimport { delDefiniteItemUri } from \"data/api\";\r\nimport loc from \"i18next\";\r\nimport { toastActionResult } from \"data/toast\";\r\nimport { postMessageTo } from \"hooks/PostMessage/Utils\";\r\nimport { ModalAction } from \"hooks/PostMessage/Actions\";\r\n\r\n/**\r\n * Permanently deletes a definitely document from the Recycle Bin by itemUri\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ name: string }} { name }\r\n */\r\n\r\ntype Context = {\r\n itemUri: string,\r\n name: string,\r\n};\r\n\r\nclass recyclebin_docClear {\r\n queueMultiple: boolean = true;\r\n logger: () => any = toastActionResult;\r\n shouldRender: boolean = true;\r\n\r\n render = async ({ name }: Context): Promise => {\r\n this.shouldRender = false;\r\n return await openConfirmModal({\r\n body: loc.t(\"commandAction:recyclebin_docClear.confirmBody\", {\r\n name,\r\n }),\r\n confirmButton: loc.t(\r\n \"commandAction:recyclebin_docClear.confirmYes\"\r\n ),\r\n });\r\n };\r\n\r\n execute = async ({ itemUri }: Context): Promise => {\r\n try {\r\n const success = await delDefiniteItemUri(itemUri);\r\n\r\n if (success) {\r\n postMessageTo(ModalAction.Close, null, window);\r\n }\r\n\r\n return success;\r\n } catch (err) {\r\n console.warn(err);\r\n return false;\r\n }\r\n };\r\n\r\n report = async (success: boolean, { name }: Context): Promise => {\r\n this.logger(success === true, \"commandAction:recyclebin_docClear\", {\r\n name,\r\n });\r\n };\r\n}\r\n\r\nexport default recyclebin_docClear;\r\n","import { restoreItemUri } from \"data/api\";\r\nimport { toastActionResult } from \"data/toast\";\r\n\r\n/**\r\n * Restores a document from the Recycle Bin by itemUri\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ name: string }} { name }\r\n */\r\n\r\ntype Context = {\r\n itemUri: string,\r\n name: string,\r\n};\r\n\r\nclass recyclebin_docRestore {\r\n queueMultiple: boolean = true;\r\n logger: () => any = toastActionResult;\r\n\r\n execute = async ({ itemUri }: Context): Promise => {\r\n try {\r\n return await restoreItemUri(itemUri);\r\n } catch (err) {\r\n console.warn(err);\r\n return false;\r\n }\r\n };\r\n\r\n report = async (success: boolean, { name }: Context): Promise => {\r\n this.logger(success === true, \"commandAction:recyclebin_docRestore\", {\r\n name,\r\n });\r\n };\r\n}\r\n\r\nexport default recyclebin_docRestore;\r\n","import { openConfirmModal } from \"components/ConfirmModal\";\r\nimport { delDefiniteItemUri } from \"data/api\";\r\nimport loc from \"i18next\";\r\nimport { toastActionResult } from \"data/toast\";\r\n\r\n/**\r\n * Permanently deletes an folder from the Recycle Bin by itemUri\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ name: string }} { name }\r\n */\r\n\r\ntype Context = {\r\n itemUri: string,\r\n name: string,\r\n};\r\n\r\nclass recyclebin_folderClear {\r\n queueMultiple: boolean = true;\r\n logger: () => any = toastActionResult;\r\n shouldRender: boolean = true;\r\n\r\n render = async ({ name }: Context): Promise => {\r\n this.shouldRender = false;\r\n return await openConfirmModal({\r\n body: loc.t(\"commandAction:recyclebin_folderClear.confirmBody\", {\r\n name,\r\n }),\r\n confirmButton: loc.t(\r\n \"commandAction:recyclebin_folderClear.confirmYes\"\r\n ),\r\n });\r\n };\r\n\r\n execute = async ({ itemUri }: Context): Promise => {\r\n try {\r\n return await delDefiniteItemUri(itemUri);\r\n } catch (err) {\r\n console.warn(err);\r\n return false;\r\n }\r\n };\r\n\r\n report = async (success: boolean, { name }: Context): Promise => {\r\n this.logger(success === true, \"commandAction:recyclebin_folderClear\", {\r\n name,\r\n });\r\n };\r\n}\r\n\r\nexport default recyclebin_folderClear;\r\n","import { restoreItemUri } from \"data/api\";\r\nimport { toastActionResult } from \"data/toast\";\r\n\r\n/**\r\n * Restores a folder from the Recycle Bin by itemUri\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ name: string }} { name }\r\n */\r\n\r\ntype Context = {\r\n itemUri: string,\r\n name: string,\r\n};\r\n\r\nclass recyclebin_folderRestore {\r\n queueMultiple: boolean = true;\r\n logger: () => any = toastActionResult;\r\n\r\n execute = async ({ itemUri }: Context): Promise => {\r\n try {\r\n return await restoreItemUri(itemUri);\r\n } catch (err) {\r\n console.warn(err);\r\n return false;\r\n }\r\n };\r\n\r\n report = async (success: boolean, { name }: Context): Promise => {\r\n this.logger(\r\n success === true,\r\n \"commandAction:recyclebin_folderRestore\",\r\n {\r\n name,\r\n }\r\n );\r\n };\r\n}\r\n\r\nexport default recyclebin_folderRestore;\r\n","// @flow\r\nimport React, { useRef } from \"react\";\r\nimport Modal, { ModalSize } from \"components/Modal\";\r\nimport Form from \"containers/Form\";\r\nimport { createModal } from \"react-modal-promise\";\r\nimport Breadcrumb from \"containers/Breadcrumb\";\r\nimport loc from \"i18next\";\r\nimport styles from \"./FormModal.module.css\";\r\nimport ButtonToolbar from \"react-bootstrap/lib/ButtonToolbar\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport Icons from \"@hs/icons\";\r\nimport Pane from \"components/SplitPanes/Pane\";\r\nimport ItemContextProvider from \"containers/ItemContext/Provider\";\r\n\r\ntype Props = {\r\n /** whether to show modal */\r\n open: boolean,\r\n /** callback when user closes Modal */\r\n close: () => void,\r\n /** target itemUri */\r\n formProps: { itemUri: string, viewName: string } & Object,\r\n};\r\n\r\n/**\r\n * FormModal\r\n */\r\nexport const FormModal = ({ open, close, itemUri, ...formProps }: Props) => {\r\n // used by FormContainer to fill in Save button\r\n const footerRef = useRef(null);\r\n return (\r\n \r\n {(itemContext) => (\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 {!itemContext.isEditAllowed && (\r\n <>\r\n
\r\n \r\n {loc.t(\r\n `${formProps.viewName}:edit_form.notAuthorized`\r\n )}\r\n
\r\n \r\n \r\n {loc.t(\"close\")}\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\nFormModal.displayName = \"FormModal\";\r\nexport default FormModal;\r\nexport const openFormModal = createModal(FormModal);\r\n","// @flow\r\nimport { openFormModal } from \"components/FormModal\";\r\n\r\n/**\r\n * opens FormModal to edit classification\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n */\r\n\r\nclass editClassification {\r\n execute = async ({ itemUri }: { itemUri: string }) => {\r\n await openFormModal({\r\n itemUri,\r\n viewName: \"formmodal\",\r\n });\r\n return true;\r\n };\r\n}\r\n\r\nexport default editClassification;\r\n","import copy from \"copy-to-clipboard\";\r\nimport { toastActionResult } from \"data/toast\";\r\nimport loc from \"i18next\";\r\n\r\n/**\r\n * copies current itemUri to clipboard\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n */\r\n\r\nclass clipboard_copyItemUri {\r\n logger: () => any = toastActionResult;\r\n shouldRender: boolean = false;\r\n execute = async ({ itemUri }: Context): Promise =>\r\n new Promise((resolve) => {\r\n copy(itemUri, {\r\n message: loc.t(\"itemActions:clipboard_copyItemUri.message\"),\r\n format: \"text/plain\",\r\n onCopy: (clipboardData: Object) => resolve(true),\r\n });\r\n });\r\n report = async (success: boolean): Promise => {\r\n this.logger(success === true, \"itemActions:clipboard_copyItemUri\");\r\n };\r\n}\r\nexport default clipboard_copyItemUri;\r\n","import copy from \"copy-to-clipboard\";\r\nimport { getRoute } from \"components/ItemUriLink\";\r\nimport { toastActionResult } from \"data/toast\";\r\nimport loc from \"i18next\";\r\n\r\n/**\r\n * copies a link to a view with the current itemUri to clipboard\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n */\r\n\r\ntype Context = {\r\n itemUri: string,\r\n};\r\n\r\nclass clipboard_copyItemLink {\r\n logger: () => any = toastActionResult;\r\n execute = async ({ itemUri }: Context): Promise =>\r\n new Promise((resolve) => {\r\n copy(window.location.origin + getRoute(itemUri, true, true), {\r\n message: loc.t(\"itemActions:clipboard_copyItemLink.message\"),\r\n format: \"text/plain\",\r\n onCopy: (clipboardData: Object) => resolve(true),\r\n });\r\n });\r\n report = async (success: boolean): Promise => {\r\n this.logger(success === true, \"itemActions:clipboard_copyItemLink\");\r\n };\r\n}\r\nexport default clipboard_copyItemLink;\r\n","import React from \"react\";\r\nimport { type RasterMapLayerDTO } from \"data/types\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport Icons from \"@hs/icons\";\r\nimport CommandActionHandler from \"components/CommandActions\";\r\nimport Thumbnail from \"components/DocListSimple/Thumbnail\";\r\nimport styles from \"./RasterLayer.module.css\";\r\nimport loc from \"i18next\";\r\nimport FormGroup from \"react-bootstrap/lib/FormGroup\";\r\nimport InputGroup from \"react-bootstrap/lib/InputGroup\";\r\nimport FormControl from \"react-bootstrap/lib/FormControl\";\r\n\r\nconst RasterLayer = ({\r\n layer,\r\n onRemove,\r\n onRename,\r\n onMoveUp,\r\n onMoveDown,\r\n}: {\r\n layer: RasterMapLayerDTO,\r\n onRemove: () => void,\r\n onRename: (newName: string) => void,\r\n onMoveUp: () => void,\r\n onMoveDown: () => void,\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 CommandActionHandler(\"doc_preview\", {\r\n itemUri: layer.itemUri,\r\n })\r\n }\r\n />\r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n onRename(e.currentTarget.value)}\r\n className={styles.name}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n\r\n {/* */}\r\n
\r\n);\r\n\r\nRasterLayer.displayName = \"RasterMapManager.RasterLayer\";\r\nexport default RasterLayer;\r\n","import React, { useCallback } from \"react\";\r\nimport RasterLayer from \"./RasterLayer\";\r\nimport styles from \"./LayersEditor.module.css\";\r\nimport immutable from \"object-path-immutable\";\r\nimport { RasterMapLayerEditAction } from \"data/types\";\r\nimport { moveArrayItem } from \"data/utils\";\r\n\r\ntype Props = {\r\n onMapEdit: (map) => void,\r\n map: RasterMapResultDTO,\r\n};\r\n\r\nconst LayersEditor = ({ map, onMapEdit }: Props) => {\r\n const removeLayer = useCallback(\r\n (layer) => {\r\n const idx = map.layers.findIndex((i) => i.id === layer.id);\r\n onMapEdit(\r\n immutable.set(\r\n map,\r\n `layers.${idx}.editAction`,\r\n RasterMapLayerEditAction.delete\r\n )\r\n );\r\n },\r\n [map, onMapEdit]\r\n );\r\n\r\n const renameLayer = useCallback(\r\n (layer, newName) => {\r\n const idx = map.layers.findIndex((i) => i.id === layer.id);\r\n let newMap = immutable.set(map, `layers.${idx}.name`, newName);\r\n // do not change editAction for new .added layers\r\n if (newMap.layers[idx].editAction !== RasterMapLayerEditAction.add)\r\n newMap.layers[idx].editAction = RasterMapLayerEditAction.rename;\r\n onMapEdit(newMap);\r\n },\r\n [map, onMapEdit]\r\n );\r\n\r\n const moveUp = useCallback(\r\n (layer) => {\r\n const idx = map.layers.findIndex((i) => i.id === layer.id);\r\n let target = idx - 1;\r\n if (idx === 0) target = map.layers.length - 1;\r\n onMapEdit(\r\n immutable.set(\r\n map,\r\n \"layers\",\r\n moveArrayItem(map.layers, idx, target)\r\n )\r\n );\r\n },\r\n [map, onMapEdit]\r\n );\r\n\r\n const moveDown = useCallback(\r\n (layer) => {\r\n const idx = map.layers.findIndex((i) => i.id === layer.id);\r\n let target = idx + 1;\r\n if (target === map.layers.length) target = 0;\r\n onMapEdit(\r\n immutable.set(\r\n map,\r\n \"layers\",\r\n moveArrayItem(map.layers, idx, target)\r\n )\r\n );\r\n },\r\n [map, onMapEdit]\r\n );\r\n\r\n return (\r\n
\r\n {map.layers\r\n .filter((m) => m.editAction !== RasterMapLayerEditAction.delete)\r\n .map((layer, i) => (\r\n removeLayer(layer)}\r\n onRename={(newName) => renameLayer(layer, newName)}\r\n onMoveUp={() => moveUp(layer)}\r\n onMoveDown={() => moveDown(layer)}\r\n />\r\n ))}\r\n
\r\n );\r\n};\r\nLayersEditor.displayName = \"RasterMapManager.LayersEditor\";\r\nexport default LayersEditor;\r\n","// @flow\r\nimport React, { useState, useMemo, useCallback } from \"react\";\r\nimport { useAsync } from \"hooks\";\r\nimport { openPickerModal } from \"components/PickerModal\";\r\nimport immutable from \"object-path-immutable\";\r\nimport Modal, { ModalSize } from \"components/Modal\";\r\nimport { createModal } from \"react-modal-promise\";\r\nimport LayersEditor from \"./LayersEditor\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\nimport styles from \"./RasterMapModal.module.css\";\r\nimport { type RasterMapResultDTO, RasterMapLayerEditAction } from \"data/types\";\r\nimport { getGeoRasterProvider } from \"components/MapViewer/providerSupport\";\r\nimport Status from \"components/Status\";\r\nimport Constants from \"data/constants\";\r\nimport { fetchRasterMapLayers, saveRasterMapLayers } from \"data/api\";\r\n\r\ntype Props = {\r\n /** react-modal-promise: whether to show dialog */\r\n open: boolean,\r\n /** react-modal-promise: callback when user closes Dialog */\r\n close: () => void,\r\n /** current formatId */\r\n formatId: number,\r\n /** current itemUri */\r\n itemUri: string,\r\n /** current name */\r\n name: string,\r\n};\r\n\r\n/** presents the available raster layers and allows managing them */\r\nexport const RasterMapManagerModal = ({\r\n open,\r\n close,\r\n formatId,\r\n itemUri,\r\n name,\r\n}: Props) => {\r\n const [map, setMap] = useState();\r\n\r\n // get current mapProvider\r\n const mapProvider = useMemo(\r\n () => getGeoRasterProvider(itemUri, formatId),\r\n [itemUri, formatId]\r\n );\r\n // get current layers\r\n const state = useAsync(async () => {\r\n try {\r\n // retrieve any existing layers (or create appropriately)\r\n const map: RasterMapResultDTO = await fetchRasterMapLayers({\r\n itemUri,\r\n rasterMapIdSelector: mapProvider.rasterMapIdSelector,\r\n create: true,\r\n });\r\n setMap(map);\r\n return map;\r\n } catch (e) {\r\n console.error(e);\r\n throw e;\r\n }\r\n });\r\n\r\n const addLayer = useCallback(async () => {\r\n const selectedItemUri = await openPickerModal({\r\n itemUri,\r\n helpText: loc.t(\"common:raster.pickerText\"),\r\n });\r\n /* istanbul ignore else */\r\n if (selectedItemUri) {\r\n setMap(\r\n immutable.push(map, \"layers\", {\r\n editAction: RasterMapLayerEditAction.add,\r\n name: loc.t(\"common:raster.newLayer\"),\r\n itemUri: selectedItemUri,\r\n })\r\n );\r\n }\r\n }, [itemUri, map]);\r\n\r\n const saveMap = useCallback(async () => {\r\n try {\r\n await saveRasterMapLayers({ map });\r\n window.location.reload(true);\r\n } catch (e) {\r\n console.error(e);\r\n alert(e.message);\r\n }\r\n }, [map]);\r\n\r\n return (\r\n close(false)}\r\n dialogClassName={styles.modal}\r\n >\r\n \r\n \r\n {name}\r\n \r\n \r\n \r\n {state.loading && }\r\n {state.error && }\r\n {state.value && (\r\n \r\n setMap(newMap)\r\n }\r\n />\r\n )}\r\n \r\n \r\n {state.value && (\r\n \r\n {loc.t(\"common:raster.addLayer\")}\r\n \r\n )}\r\n \r\n {loc.t(\"save\")}\r\n \r\n \r\n \r\n );\r\n};\r\nRasterMapManagerModal.displayName = \"RasterMapManagerModal\";\r\nexport const openRasterMapManagerModal = createModal(RasterMapManagerModal);\r\n","import { openRasterMapManagerModal } from \"components/RasterMapManagerModal\";\r\n\r\ntype Context = {\r\n formatId: number,\r\n itemUri: string,\r\n name: string,\r\n};\r\n\r\nclass raster_manage {\r\n /**\r\n * Opens Modal to manage Raster Layers\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ name: string }} { name }\r\n */\r\n execute = async ({ formatId, itemUri, name }: Context) => {\r\n await openRasterMapManagerModal({ formatId, itemUri, name });\r\n return true;\r\n };\r\n}\r\nexport default raster_manage;\r\n","import React, { useCallback, useMemo } from \"react\";\r\nimport AttributeLabel from \"components/ExtraAttributes/AttributeLabel\";\r\nimport ViewerControlBase from \"components/ExtraAttributes/ViewerControl/ViewerControlBase\";\r\nimport Icons from \"@hs/icons\";\r\nimport { type EnumValue } from \"data/types\";\r\nimport { getLocalizedText } from \"data/utils\";\r\nimport styles from \"./EnumViewerControl.module.css\";\r\n\r\ntype Props = {\r\n /** CommonName */\r\n name: string,\r\n /** Label */\r\n header: string,\r\n /** Style for */\r\n style: CSSStyleDeclaration,\r\n /** Enum Value */\r\n value: T,\r\n /** Enum Values */\r\n enum: Array>,\r\n /** Is a required field */\r\n isRequired?: boolean,\r\n /** wheather it is an Enum or and EnumFlag */\r\n isMulti?: boolean,\r\n};\r\n\r\nconst EnumViewerControl = (props: Props) => {\r\n const renderEnumValue = useCallback(\r\n (enumValue: EnumValue) => (\r\n \r\n {enumValue.icon && typeof enumValue.icon === \"string\" ? (\r\n \r\n ) : (\r\n enumValue.icon\r\n )}{\" \"}\r\n {getLocalizedText(enumValue.label)}\r\n \r\n ),\r\n [props.name]\r\n );\r\n const renderedValue = useMemo(\r\n () =>\r\n props.value\r\n ? props.isMulti\r\n ? props.enum\r\n .filter((e) => (props.value & e.value) > 0)\r\n .map((e) => renderEnumValue(e))\r\n : renderEnumValue(\r\n props.enum.find((e) => e.value === props.value)\r\n )\r\n : null,\r\n [renderEnumValue, props.isMulti, props.value, props.enum]\r\n );\r\n return (\r\n \r\n \r\n
\r\n {renderedValue}\r\n
\r\n
\r\n );\r\n};\r\n\r\nEnumViewerControl.displayName = \"EnumViewerControl\";\r\nexport default EnumViewerControl;\r\n","import React, { useCallback, useMemo } from \"react\";\r\nimport Formsy from \"formsy-react\";\r\nimport loc from \"i18next\";\r\nimport DateEditorControl from \"components/ExtraAttributes/EditorControl/DateEditorControl\";\r\nimport PrincipalEditorControl from \"components/ExtraAttributes/EditorControl/PrincipalEditorControl\";\r\nimport EnumEditorControl from \"components/ExtraAttributes/EditorControl/EnumEditorControl\";\r\nimport EnumViewerControl from \"components/ExtraAttributes/ViewerControl/EnumViewerControl\";\r\nimport MemoEditorControl from \"components/ExtraAttributes/EditorControl/MemoEditorControl\";\r\nimport HelpBlock from \"react-bootstrap/lib/HelpBlock\";\r\nimport Icons from \"@hs/icons\";\r\nimport {\r\n DateTimeFormat,\r\n ReminderTypeFlags,\r\n ReminderTypeFlagsEnumValues,\r\n ReminderPriorityEnumValues,\r\n type ReminderDTO,\r\n} from \"data/types\";\r\n\r\ntype Props = {\r\n reminder: ReminderDTO,\r\n autoFocus?: boolean,\r\n allowReminderTypeEdit: boolean,\r\n setCanSubmit: () => void,\r\n handleSave: () => void,\r\n handleChange: () => void,\r\n};\r\n\r\nconst ReminderForm = ({\r\n reminder: { customAction, ...reminder },\r\n autoFocus,\r\n setCanSubmit,\r\n handleSave,\r\n handleChange,\r\n allowReminderTypeEdit,\r\n}: Props) => {\r\n const disableSubmit = useCallback(\r\n () => setCanSubmit(false),\r\n [setCanSubmit]\r\n );\r\n const enableSubmit = useCallback(() => setCanSubmit(true), [setCanSubmit]);\r\n const reminderTypeEnumValues = useMemo(\r\n () =>\r\n customAction == null\r\n ? ReminderTypeFlagsEnumValues.filter(\r\n (r) =>\r\n ![\r\n ReminderTypeFlags.Task,\r\n ReminderTypeFlags.Calendar,\r\n ].includes(r.value)\r\n )\r\n : ReminderTypeFlagsEnumValues.filter(\r\n (r) =>\r\n ![\r\n ReminderTypeFlags.Task,\r\n ReminderTypeFlags.Calendar,\r\n ].includes(r.value)\r\n ).concat({\r\n value: ReminderTypeFlags.CustomAction,\r\n label:\r\n customAction.displayName ||\r\n \"$reminder:type.customAction\",\r\n icon: (\r\n \r\n ),\r\n }),\r\n [customAction]\r\n );\r\n return (\r\n \r\n \r\n new Date(value) - Date.now() > 0,\r\n }}\r\n validationErrors={{\r\n isDefaultRequiredValue: loc.t(\"common:validation.required\"),\r\n isGreaterThanNow: loc.t(\"common:validation.greaterThanNow\"),\r\n }}\r\n />\r\n \r\n \r\n \r\n {allowReminderTypeEdit ? (\r\n \r\n value !== ReminderTypeFlags.NotSet,\r\n }}\r\n validationErrors={{\r\n hasFlag: loc.t(\"common:validation.required\"),\r\n }}\r\n value={reminder.type}\r\n onChange={handleChange}\r\n />\r\n ) : (\r\n \r\n )}\r\n {customAction != null && customAction.error && (\r\n {customAction.error}\r\n )}\r\n \r\n );\r\n};\r\n\r\nReminderForm.displayName = \"ReminderForm\";\r\nexport default ReminderForm;\r\n","import React, { useCallback, useState, useMemo } from \"react\";\r\nimport { useAbortController } from \"hooks\";\r\nimport Modal, { ModalSize } from \"components/Modal\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\nimport styles from \"./ReminderManagerModal.module.css\";\r\nimport { createModal } from \"react-modal-promise\";\r\nimport Constants from \"data/constants\";\r\nimport Status from \"components/Status\";\r\nimport {\r\n LocalDateStringOption,\r\n ReminderPriority,\r\n ReminderTypeFlags,\r\n type ReminderDTO,\r\n} from \"data/types\";\r\nimport { toastActionResult } from \"data/toast\";\r\nimport ReminderForm from \"components/Reminder/ReminderForm\";\r\nimport { upsertReminder } from \"data/api\";\r\nimport { userLanguage } from \"data/storeHelper\";\r\n\r\ntype Props = {\r\n open: boolean,\r\n close: () => void,\r\n itemUri: string,\r\n name: string,\r\n onSave: () => void,\r\n reminder?: ReminderDTO,\r\n};\r\n\r\nconst getReminder = (itemUri): ReminderDTO => ({\r\n id: null,\r\n itemUri,\r\n date: new Date(new Date().setDate(new Date().getDate() + 1)).toLocalJSON(),\r\n creator: null,\r\n recipient: null,\r\n reason: \"\",\r\n priority: ReminderPriority.Normal,\r\n type: ReminderTypeFlags.Mail,\r\n});\r\n\r\nexport const ReminderManagerModal = ({\r\n itemUri,\r\n name,\r\n close,\r\n open,\r\n onSave,\r\n reminder: reminderFromProps = getReminder(itemUri),\r\n}: Props) => {\r\n const [reminder, setReminder] = useState(reminderFromProps);\r\n const [isDirty, setIsDirty] = useState(false);\r\n\r\n const allowReminderTypeEdit = useMemo(\r\n () =>\r\n Object.keys(ReminderTypeFlags).filter(\r\n (k) =>\r\n ReminderTypeFlags[k] === ReminderTypeFlags.Mail ||\r\n (reminderFromProps.type & ReminderTypeFlags[k]) > 1\r\n ).length > 1,\r\n [reminderFromProps]\r\n );\r\n\r\n const [canSubmit, setCanSubmit] = useState(false);\r\n const [isSubmitting, setIsSubmitting] = useState(false);\r\n\r\n const abortController = useAbortController();\r\n\r\n const handleChange = useCallback((name, value) => {\r\n setIsDirty(true);\r\n setReminder((r) => ({ ...r, [name]: value }));\r\n }, []);\r\n\r\n const handleCanSubmit = useCallback(\r\n (canSubmit) => setCanSubmit(canSubmit && isDirty),\r\n [isDirty]\r\n );\r\n\r\n const handleSave = useCallback(() => {\r\n const locContext = {\r\n date: new Date(reminder.date).toLocaleDateString(\r\n userLanguage(),\r\n LocalDateStringOption.DateTime\r\n ),\r\n };\r\n setIsSubmitting(true);\r\n upsertReminder(reminder, abortController(true).signal)\r\n .then((reminderId) => {\r\n const id = parseInt(reminderId, 10);\r\n /* istanbul ignore else */\r\n if (typeof onSave === \"function\") {\r\n onSave(reminder, id);\r\n }\r\n setIsSubmitting(false);\r\n /* istanbul ignore else */\r\n if (id > 0) {\r\n close(false);\r\n }\r\n toastActionResult(id > 0, \"reminder:action_save\", locContext);\r\n return reminderId;\r\n })\r\n .catch((error) => {\r\n console.error(error);\r\n setIsSubmitting(false);\r\n toastActionResult(false, \"reminder:action_save\", locContext);\r\n });\r\n }, [reminder, abortController, onSave, close]);\r\n\r\n return (\r\n close(false)}\r\n dialogClassName={styles.modal}\r\n docked\r\n >\r\n \r\n \r\n \r\n {` ${loc.t(\r\n reminder.id == null ? \"reminder:new\" : \"reminder:edit\"\r\n )} › ${name}`}\r\n \r\n \r\n \r\n \r\n \r\n \r\n close(false)}\r\n bsStyle=\"link\"\r\n className=\"pull-left\"\r\n >\r\n {loc.t(\"cancel\")}\r\n \r\n \r\n {isSubmitting && (\r\n \r\n )}{\" \"}\r\n {loc.t(\r\n `reminder:action_save.${\r\n reminder.id == null ? \"insert\" : \"update\"\r\n }`\r\n )}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nReminderManagerModal.displayName = \"ReminderManagerModal\";\r\nexport const openReminderManagerModal = createModal(ReminderManagerModal);\r\n","import { openReminderManagerModal } from \"components/ReminderManagerModal\";\r\nimport { type ReminderDTO } from \"data/types\";\r\n\r\ntype Context = {\r\n itemUri: string,\r\n name: string,\r\n onSave?: () => void,\r\n reminder?: ReminderDTO,\r\n};\r\n\r\nclass reminder_manage {\r\n /**\r\n * Opens Modal to manage (insert/update) Reminder\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ name: string }} { name }\r\n * @param {{ onSave?: () => void ) }} { onSave }\r\n * @param {{ reminder?: ReminderDTO }} { reminder }\r\n */\r\n execute = async ({\r\n itemUri,\r\n name,\r\n onSave,\r\n reminder,\r\n }: Context): Promise => {\r\n await openReminderManagerModal({ itemUri, name, onSave, reminder });\r\n return true;\r\n };\r\n}\r\nexport default reminder_manage;\r\n","import { addOfflineItem } from \"data/api\";\r\nimport { toastActionResult } from \"data/toast\";\r\nimport {\r\n setOfflineItemSyncStatusAction,\r\n offlineSyncUpdateAction,\r\n} from \"data/actions\";\r\nimport { OfflineSyncStatus } from \"data/types\";\r\nimport { Dispatch } from \"react-redux\";\r\n\r\n/**\r\n * Marks an item to be available offline\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ name: string }} { name }\r\n */\r\n\r\ntype Context = {\r\n itemUri: string,\r\n name: string,\r\n dispatch: Dispatch,\r\n};\r\n\r\nclass offline_add {\r\n queueMultiple: boolean = true;\r\n logger: () => any = toastActionResult;\r\n execute = async ({\r\n itemUri,\r\n name,\r\n dispatch,\r\n }: Context): Promise => {\r\n try {\r\n const id = await addOfflineItem(itemUri);\r\n if (id == null) {\r\n throw new Error(\"Cannot create offline Item (id is null)\");\r\n }\r\n dispatch(\r\n setOfflineItemSyncStatusAction({\r\n item: { id, itemUri },\r\n status: OfflineSyncStatus.Unknown,\r\n })\r\n );\r\n // Request sync update\r\n dispatch(offlineSyncUpdateAction());\r\n return true;\r\n } catch (error) {\r\n return false;\r\n }\r\n };\r\n report = async (success: boolean, { name }: Context): Promise => {\r\n this.logger(success === true, \"commandAction:offline_add\", {\r\n name,\r\n });\r\n };\r\n}\r\n\r\nexport default offline_add;\r\n","import { delOfflineItem } from \"data/api\";\r\nimport { toastActionResult } from \"data/toast\";\r\nimport { offlineSyncUpdateAction } from \"data/actions\";\r\nimport { Dispatch } from \"react-redux\";\r\n\r\n/**\r\n * Removes an item from being available offline\r\n *\r\n * @param {{ itemUri: string }} { itemUri }\r\n * @param {{ name: string }} { name }\r\n */\r\n\r\ntype Context = {\r\n itemUri: string,\r\n name: string,\r\n dispatch: Dispatch,\r\n};\r\n\r\nclass offline_delete {\r\n queueMultiple: boolean = true;\r\n logger: () => any = toastActionResult;\r\n execute = async ({\r\n itemUri,\r\n name,\r\n dispatch,\r\n }: Context): Promise => {\r\n try {\r\n const success = await delOfflineItem(itemUri);\r\n dispatch(offlineSyncUpdateAction());\r\n return success;\r\n } catch (error) {\r\n return false;\r\n }\r\n };\r\n report = async (success: boolean, { name }: Context): Promise => {\r\n this.logger(success === true, \"commandAction:offline_delete\", {\r\n name,\r\n });\r\n };\r\n}\r\n\r\nexport default offline_delete;\r\n","import { setOfflineItemSyncStatusAction } from \"data/actions\";\r\nimport { OfflineSyncStatus } from \"data/types\";\r\n\r\n/**\r\n * re-sync current offlineItem\r\n */\r\nclass offline_syncItem {\r\n execute = ({ dispatch, offlineItem }) =>\r\n dispatch(\r\n setOfflineItemSyncStatusAction({\r\n item: offlineItem,\r\n status: OfflineSyncStatus.Unknown,\r\n })\r\n );\r\n}\r\n\r\nexport default offline_syncItem;\r\n","// @flow\r\nimport { dispatch } from \"data/storeHelper\";\r\nimport { commandActionRequestAction } from \"data/actions\";\r\n\r\nimport ip_archive from \"./ip_archive\";\r\nimport ip_browse from \"./ip_browse\";\r\nimport ip_edit from \"./ip_edit\";\r\nimport ip_properties from \"./ip_properties\";\r\nimport ip_commandAction from \"./ip_commandAction\";\r\n\r\nimport folder_delete from \"./folder_delete\";\r\nimport folder_editClassification from \"./folder_editClassification\";\r\nimport folder_emailLink from \"./folder_emailLink\";\r\nimport folder_preview from \"./folder_preview\";\r\n\r\nimport form_cancel from \"./form_cancel\";\r\nimport form_clear from \"./form_clear\";\r\n\r\nimport search_favorite from \"./search_favorite\";\r\nimport search_preview from \"./search_preview\";\r\nimport search_scope from \"./search_scope\";\r\n\r\nimport searchForm_operator from \"./searchForm_operator\";\r\nimport searchForm_scope from \"./searchForm_scope\";\r\n\r\nimport doclist_resetFilters from \"./doclist_resetFilters\";\r\nimport doclist_exportCsv from \"./doclist_exportCsv\";\r\n\r\nimport doc_download from \"./doc_download\";\r\nimport doc_downloadZip from \"./doc_downloadZip\";\r\nimport doc_downloadFilesAPI from \"./doc_downloadFilesAPI\";\r\nimport doc_delete from \"./doc_delete\";\r\nimport doc_preview from \"./doc_preview\";\r\nimport doc_print from \"./doc_print\";\r\nimport doc_related from \"./doc_related\";\r\nimport doc_upload from \"./doc_upload\";\r\nimport doc_uploadVersion from \"./doc_uploadVersion\";\r\nimport doc_emailLink from \"./doc_emailLink\";\r\nimport doc_emailAttachment from \"./doc_emailAttachment\";\r\nimport doc_editClassification from \"./doc_editClassification\";\r\nimport doc_editWebDav from \"./doc_editWebDav\";\r\nimport doc_editCloud from \"./doc_editCloud\";\r\n\r\nimport favorite from \"./favorite\";\r\n\r\nimport searchResult_form from \"./searchResult_form\";\r\nimport link from \"./link\";\r\nimport lock from \"./lock\";\r\nimport unlock from \"./unlock\";\r\nimport subscribe from \"./subscribe\";\r\nimport unsubscribe from \"./unsubscribe\";\r\nimport share from \"./share\";\r\nimport share_web from \"./share_web\";\r\nimport createFolder_template from \"./createFolder_template\";\r\nimport wf_start from \"./wf_start\";\r\nimport itemFlows from \"./itemFlows\";\r\nimport transfer from \"./transfer\";\r\n\r\nimport recyclebin_docClear from \"./recyclebin_docClear\";\r\nimport recyclebin_docRestore from \"./recyclebin_docRestore\";\r\nimport recyclebin_folderClear from \"./recyclebin_folderClear\";\r\nimport recyclebin_folderRestore from \"./recyclebin_folderRestore\";\r\n\r\nimport editClassification from \"./editClassification\";\r\nimport clipboard_copyItemUri from \"./clipboard_copyItemUri\";\r\nimport clipboard_copyItemLink from \"./clipboard_copyItemLink\";\r\n\r\nimport raster_manage from \"./raster_manage\";\r\nimport reminder_manage from \"./reminder_manage\";\r\n\r\nimport offline_add from \"./offline_add\";\r\nimport offline_delete from \"./offline_delete\";\r\nimport offline_syncItem from \"./offline_syncItem\";\r\n\r\n// steps to add a new custom action -> see README.md\r\nexport const actionMappings = {\r\n ip_archive,\r\n ip_browse,\r\n ip_edit,\r\n ip_properties,\r\n ip_commandAction,\r\n\r\n folder_delete,\r\n folder_editClassification,\r\n folder_emailLink,\r\n folder_preview,\r\n\r\n form_cancel,\r\n form_clear,\r\n\r\n search_favorite,\r\n search_preview,\r\n search_scope,\r\n\r\n searchForm_operator,\r\n searchForm_scope,\r\n\r\n doclist_resetFilters,\r\n doclist_exportCsv,\r\n\r\n doc_download,\r\n doc_downloadZip,\r\n doc_downloadFilesAPI,\r\n doc_delete,\r\n doc_preview,\r\n doc_print,\r\n doc_related,\r\n doc_upload,\r\n doc_uploadVersion,\r\n doc_emailLink,\r\n doc_emailAttachment,\r\n doc_editClassification,\r\n doc_editWebDav,\r\n doc_editCloud,\r\n\r\n favorite,\r\n link,\r\n lock,\r\n unlock,\r\n subscribe,\r\n unsubscribe,\r\n share,\r\n share_web,\r\n searchResult_form,\r\n createFolder_template,\r\n wf_start,\r\n itemFlows,\r\n transfer,\r\n\r\n recyclebin_docClear,\r\n recyclebin_docRestore,\r\n recyclebin_folderClear,\r\n recyclebin_folderRestore,\r\n\r\n editClassification,\r\n clipboard_copyItemUri,\r\n clipboard_copyItemLink,\r\n\r\n raster_manage,\r\n reminder_manage,\r\n\r\n offline_add,\r\n offline_delete,\r\n offline_syncItem,\r\n};\r\n\r\nconst CommandActionHandler = (\r\n actionId: string,\r\n props?: any\r\n): boolean | null => {\r\n const actionHandler = actionMappings[actionId];\r\n if (typeof actionHandler !== \"function\") {\r\n alert(\"Unknown action: \" + actionId);\r\n return false;\r\n }\r\n dispatch(\r\n commandActionRequestAction({\r\n commandAction: actionId,\r\n props,\r\n items: props?.items ?? [\r\n {\r\n name: props?.name,\r\n itemUri: props?.itemUri,\r\n formatId: props?.formatId ?? -1,\r\n isDoc: props?.isDoc ?? false,\r\n },\r\n ],\r\n })\r\n );\r\n // HACK inPoint.Cloud.Azure AppInsights...\r\n /* istanbul ignore next */\r\n if (\"appInsights\" in window) {\r\n window.appInsights.trackEvent({\r\n name: \"CommandAction\",\r\n properties: {\r\n actionId,\r\n ...props,\r\n },\r\n });\r\n }\r\n //return actionHandler({ dispatch: dispatch, ...props });\r\n};\r\nexport default CommandActionHandler;\r\n","import { type Location, type RasterLocation } from \"data/types\";\r\n\r\nexport const TrimLocation = (location: Array): Array =>\r\n location\r\n .map((point) => point.replace(/\\s+/g, \"\"))\r\n .filter((point) => !!point);\r\n\r\nexport /**\r\n * will parse a string like \"63.4234,-18.1232\" into a Location object\r\n *\r\n * @param {string} location in string i.e. \"lat,lang\"\r\n * @returns {Location} in object format i.e. { latitude: number, longitude: number } or null if could not parse\r\n */\r\nconst ParseLocation = (location: string): Location => {\r\n if (\r\n location == null ||\r\n String(location).trim().length === 0 ||\r\n location.indexOf(\",\") === -1\r\n )\r\n return null;\r\n const pos = TrimLocation(location.split(\",\"));\r\n // only Number() will correctly return NaN if any letters are in there\r\n if (isNaN(Number(pos[0])) || isNaN(Number(pos[1]))) return null;\r\n // but only parseFloat() will correctly return the full number (not rounded)\r\n const latitude = parseFloat(pos[0]);\r\n const longitude = parseFloat(pos[1]);\r\n return { latitude, longitude };\r\n};\r\n\r\nexport const ParseRaster = (location: string): RasterLocation => {\r\n if (\r\n location == null ||\r\n String(location).trim().length === 0 ||\r\n location.indexOf(\",\") === -1 ||\r\n location.indexOf(\":\") === -1\r\n )\r\n return null;\r\n const pos = TrimLocation(location.split(\":\"));\r\n const loc = ParseLocation(pos[1]);\r\n if (loc == null) return null;\r\n return {\r\n x: loc.latitude,\r\n y: loc.longitude,\r\n rasterId: pos[0],\r\n };\r\n};\r\n\r\nexport /**\r\n * will parse a string like \"63.4234,-18.1232;63.4234,-18.1232;63.4234,-18.1232\" into a list of Location objects\r\n *\r\n * @param {string} area in string i.e. \"lat,lang;lat,lang;...\"\r\n * @returns {Array} in object format i.e. [{latitude:number, longitude: number}, ...] or null if could not parse\r\n */\r\nconst ParseArea = (area: string): Array => {\r\n if (\r\n area == null ||\r\n String(area).trim().length === 0 ||\r\n area.indexOf(\",\") === -1\r\n )\r\n return null;\r\n return TrimLocation(area.split(\";\")).map((point) => ParseLocation(point));\r\n};\r\n\r\nexport /**\r\n * will parse a string like \"13.45,22.32,5000\" into a Location and Radius\r\n */\r\nconst ParseRadius = (\r\n value: string\r\n): { location: Location, radius: ?number } => {\r\n let location = null,\r\n radius = null;\r\n if (value && String(value).length > 0 && value.indexOf(\",\") > 0) {\r\n const parts = TrimLocation(value.split(\",\"));\r\n /* istanbul ignore else */\r\n if (parts.length >= 2) {\r\n location = ParseLocation(`${parts[0]},${parts[1]}`);\r\n if (parts.length === 3 && !isNaN(Number(parts[2]))) {\r\n radius = parseFloat(parts[2]);\r\n }\r\n }\r\n }\r\n return {\r\n location,\r\n radius,\r\n };\r\n};\r\n\r\nexport /**\r\n * will convert a location with radius into a string\r\n *\r\n * @param {Location} location input location object\r\n * @param {number} radius radius in meters\r\n * @returns {string} string result i.e. \"latitude,longitude,radius\"\r\n */\r\nconst RadiusToString = (location: Location, radius: number) =>\r\n location == null || radius == null\r\n ? \"\"\r\n : LocationToString(location) + \",\" + radius.toFixed(0);\r\n\r\nexport /**\r\n * will convert a Location object into a string\r\n *\r\n * @param {Location} location input location object\r\n * @returns {string} string result comma-separated i.e. \"lat,longitude\"\r\n */\r\nconst LocationToString = (location: Location): string =>\r\n location == null ? \"\" : location.latitude + \",\" + location.longitude;\r\n\r\nexport /**\r\n * will convert an area path into a string\r\n *\r\n * @param {Array} area input area coordinates\r\n * @returns {string} string result comma-separated and semi-colon separated i.e. \"lat,longitude;lat,longitude;...\"\r\n */\r\nconst AreaToString = (area: Array): string =>\r\n area == null\r\n ? \"\"\r\n : area.reduce(\r\n (result, location, index) =>\r\n (result +=\r\n (index > 0 ? \";\" : \"\") + LocationToString(location)),\r\n \"\"\r\n );\r\n\r\nexport /**\r\n * will convert a raster coordinate into a string\r\n *\r\n * @param {RasterLocation} raster input raster coordinates\r\n * @returns {string} string result of raster location, i.e. \"rasterId:x,y\"\r\n */\r\nconst RasterToString = (raster: RasterLocation) =>\r\n raster == null || raster.rasterId == null\r\n ? \"\"\r\n : `${raster.rasterId}:${raster.x},${raster.y}`;\r\n\r\nexport const GeoPointValidationRegex = /^[-+]?([1-8]?\\d(\\.\\d+)?|90(\\.0+)?),\\s*[-+]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?)$/;\r\nexport const GeoAreaValidationRegex = /^([-+]?([1-8]?\\d(\\.\\d+)?|90(\\.0+)?),\\s*[-+]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?)(;)*)*$/;\r\n","import React from \"react\";\r\nimport { getDisplayName } from \"data/constants\";\r\nimport { itemUriSelector } from \"data/reducers/selectors\";\r\n\r\nconst withItemUri = (WrappedComponent: ComponentType) => {\r\n const HOC = (props: Props) => {\r\n const itemUri =\r\n props.itemUri ||\r\n itemUriSelector({\r\n location: props.history?.location ?? window.location,\r\n });\r\n return ;\r\n };\r\n HOC.displayName = `withItemUri(${getDisplayName(WrappedComponent)})`;\r\n return HOC;\r\n};\r\n\r\nexport default withItemUri;\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"toast\":\"NetworkStatus_toast__22kCS\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"row\":\"ItemActions_row__3Mfen\",\"itemView\":\"ItemActions_itemView__2KTgu\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"right\":\"ViewModes_right__tbtY3\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"btn\":\"CommandActionButton_btn__XTTpq\",\"icon\":\"CommandActionButton_icon__1IW_u\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"facePileMore\":\"ValueFacePile_facePileMore__2cTYa\",\"wrapper\":\"ValueFacePile_wrapper__2tjDO\"};","import localForage from \"localforage\";\r\nimport { extendPrototype } from \"localforage-startswith\";\r\n\r\nextendPrototype(localForage);\r\n\r\n// Add n/a fallback StorageDriver #53854\r\nexport function NotAvailable(...args) {\r\n return new Promise((resolve, reject) => {\r\n console.error(\"No StorageDriver is available\", args);\r\n resolve(null);\r\n });\r\n}\r\n\r\nconst NoStorageDriver = {\r\n _driver: \"NOSTORAGE\",\r\n _initStorage: /* istanbul ignore next */ () => {},\r\n setItem: NotAvailable,\r\n getItem: NotAvailable,\r\n removeItem: NotAvailable,\r\n clear: NotAvailable,\r\n length: NotAvailable,\r\n key: NotAvailable,\r\n keys: NotAvailable,\r\n iterate: NotAvailable,\r\n};\r\nlocalForage.defineDriver(NoStorageDriver);\r\n\r\n// configure our local storage for Views (currentItem_*)\r\n// https://github.com/localForage/localForage/issues/191#issuecomment-342793463\r\n/* istanbul ignore next */\r\nexport const viewStorage = localForage.createInstance({\r\n name: \"inPoint.Web\",\r\n driver: [localForage.INDEXEDDB, localForage.LOCALSTORAGE, \"NOSTORAGE\"],\r\n version: 5,\r\n size: 4980736,\r\n storeName: \"views\",\r\n});\r\nviewStorage\r\n .ready()\r\n .catch(\r\n /* istanbul ignore next */ () =>\r\n console.error(\"Cannot load viewStorage\")\r\n );\r\n\r\n// configure our local storage for persist (redux-persist)\r\n/* istanbul ignore next */\r\nexport const persistStorage = localForage.createInstance({\r\n name: \"inPoint.Web\",\r\n driver: [localForage.LOCALSTORAGE, \"NOSTORAGE\"],\r\n version: 5,\r\n size: 4980736,\r\n storeName: \"persist\",\r\n});\r\npersistStorage\r\n .ready()\r\n .catch(\r\n /* istanbul ignore next */ () =>\r\n console.error(\"Cannot load persistStorage\")\r\n );\r\n\r\n/* istanbul ignore next */\r\nexport const cacheStorage = localForage.createInstance({\r\n name: \"inPoint.Web\",\r\n driver: [localForage.LOCALSTORAGE, \"NOSTORAGE\"],\r\n version: 5,\r\n size: 4980736,\r\n storeName: \"cache\",\r\n});\r\n// clear on F5 or Browser Refresh\r\ncacheStorage\r\n .ready()\r\n .then(() => cacheStorage.clear())\r\n .catch(\r\n /* istanbul ignore next */ () =>\r\n console.error(\"Cannot load cacheStorage\")\r\n );\r\n\r\nexport const offlineQueueStorage = localForage.createInstance({\r\n name: \"inPoint.Web\",\r\n driver: [localForage.INDEXEDDB],\r\n version: 5,\r\n size: 4980736,\r\n storeName: \"offline\",\r\n});\r\n\r\nexport async function getStorageEstimate() {\r\n if (\"storage\" in navigator && \"estimate\" in navigator.storage) {\r\n const { usage, quota } = await navigator.storage.estimate();\r\n const percentUsed = Math.round((usage / quota) * 100);\r\n const usageInGb = Math.round(usage / (1024 * 1024) / 954);\r\n const quotaInGb = Math.round(quota / (1024 * 1024) / 954);\r\n\r\n // const usageInMib = Math.round(usage / (1024 * 1024) / 954);\r\n // const quotaInMib = Math.round(quota / (1024 * 1024) / 954);\r\n // const details = `${usageInMib} out of ${quotaInMib} MiB used (${percentUsed}%)`;\r\n\r\n return { usageInGb, quotaInGb, percentUsed };\r\n }\r\n return null;\r\n}\r\n\r\nexport /* istanbul ignore next*/ function getAllItems(db): Promise> {\r\n var accumulator = [];\r\n return db\r\n .iterate(function (value, key /*, iterationNumber*/) {\r\n accumulator.push({ key, value });\r\n })\r\n .then(function () {\r\n return accumulator;\r\n });\r\n}\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"group\":\"UserGroup_group__qwvmB\",\"icon\":\"UserGroup_icon__25Yuf\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"icon\":\"LockInfo_icon__miP0D\",\"pulse\":\"LockInfo_pulse__1kC-k\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"header\":\"ActionCategory_header__2Hh_h\",\"icon\":\"ActionCategory_icon__WCKKA\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"overlay\":\"Error_overlay__1UguQ\",\"message\":\"Error_message__fDSMI\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"avatar\":\"PrincipalEditorControl_avatar__1sUXW\",\"name\":\"PrincipalEditorControl_name__1iaFI\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrapper\":\"Attachments_wrapper__1Qz6t\",\"group\":\"Attachments_group__1jb8T\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"modal\":\"ShareModal_modal__OeMRv\",\"button\":\"ShareModal_button__2zvF6\",\"delete\":\"ShareModal_delete__2g9CF\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"footer\":\"MapModal_footer__EXrf1\",\"btnSet\":\"MapModal_btnSet__oNMCf\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"noIcon\":\"ArchiveTarget_noIcon__1UlJ3\",\"image\":\"ArchiveTarget_image__2xIDS\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"outer\":\"PageStatus_outer__TYodB\",\"animatedBackground\":\"PageStatus_animatedBackground__2q7v0\",\"inner\":\"PageStatus_inner__2xhw7\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"empty\":\"SearchOperators_empty__188C7\",\"select\":\"SearchOperators_select__3RnHA\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"placeholder\":\"SearchResult_placeholder__1a31x\",\"list\":\"SearchResult_list__2JtCF\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"searchResult\":\"ArchiveTargetSearchItem_searchResult__2NwBP\",\"wrapper\":\"ArchiveTargetSearchItem_wrapper__26ZKc\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"divider\":\"itemFlow_document_divider__Ubyke\",\"wrapper\":\"itemFlow_document_wrapper__3fjsn\"};","// @flow\r\nimport { openItemActionPanel } from \"components/ItemActionPanel\";\r\nimport { getLocalizedText } from \"data/utils\";\r\n\r\nexport const openMultiSelectionActionPanel = ({\r\n targetView,\r\n activeRows,\r\n mapper,\r\n folderItemUri,\r\n ...contextProps\r\n}: {\r\n targetView: string,\r\n activeRows: any,\r\n mapper: (row: any) => any,\r\n}) => {\r\n let docCount = 0;\r\n let folderCount = 0;\r\n const items = Object.values(activeRows).map(mapper);\r\n items.forEach((row) => {\r\n row.isDoc ? docCount++ : folderCount++;\r\n });\r\n const itemKey =\r\n docCount && folderCount ? \"mixed\" : docCount ? \"document\" : \"folder\";\r\n return openItemActionPanel({\r\n title: getLocalizedText(`$multiselection:actionpanel.${itemKey}`, {\r\n document: getLocalizedText(`$multiselection:actionpanel.document`, {\r\n count: docCount,\r\n }),\r\n folder: getLocalizedText(`$multiselection:actionpanel.folder`, {\r\n count: folderCount,\r\n }),\r\n count: docCount + folderCount,\r\n }),\r\n contextProps: {\r\n ...contextProps,\r\n items,\r\n multiple: true,\r\n folderItemUri,\r\n },\r\n targetView,\r\n });\r\n};\r\n","// @flow\r\nimport React, { PureComponent, type ComponentType } from \"react\";\r\nimport { connect, Dispatch } from \"react-redux\";\r\nimport Constants, { getDisplayName } from \"data/constants\";\r\nimport { type docsLayoutState } from \"data/reducers/types\";\r\nimport { requestDocsLayoutAction } from \"data/actions\";\r\nimport Status from \"components/Status\";\r\n\r\ntype Props = {\r\n dispatch: Dispatch,\r\n itemUri: string,\r\n layout: docsLayoutState,\r\n showDocs?: boolean,\r\n};\r\n\r\n// will block until docsLayout is OK and pass it on as a layout prop\r\nconst LayoutLoader = (WrappedComponent: ComponentType) => {\r\n class PP extends PureComponent {\r\n static displayName = `LayoutLoader(${getDisplayName(\r\n WrappedComponent\r\n )})`;\r\n\r\n componentDidMount() {\r\n const { dispatch, itemUri, showDocs } = this.props;\r\n dispatch(requestDocsLayoutAction(itemUri, showDocs === false));\r\n }\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n const { dispatch, itemUri, showDocs } = this.props;\r\n if (itemUri !== prevProps.itemUri) {\r\n dispatch(requestDocsLayoutAction(itemUri, showDocs === false));\r\n }\r\n }\r\n\r\n render() {\r\n const { layout, ...rest } = this.props;\r\n if (layout.status === Constants.OK)\r\n return ;\r\n if (layout.status === Constants.ERROR)\r\n return ;\r\n return ;\r\n }\r\n }\r\n\r\n const mapStateToProps = (state, ownProps) => ({\r\n layout: state.docsLayout,\r\n ...ownProps,\r\n });\r\n\r\n return connect(mapStateToProps)(PP);\r\n};\r\n\r\nexport default LayoutLoader;\r\n","// @flow\r\nimport React from \"react\";\r\nimport { connect, Dispatch } from \"react-redux\";\r\n// import LayoutLoader from \"containers/LayoutLoader\";\r\nimport FilterBarContainer from \"containers/FilterBar\";\r\nimport {\r\n DocListFilterOperators,\r\n type DocListLayout,\r\n type SearchBucketDTO,\r\n type SearchFilterDTO,\r\n type SearchValueTypeEnum,\r\n type DocColumnResultDTO,\r\n DocListColumnType,\r\n LocalDateStringOption,\r\n ListViewMode,\r\n type ListViewModeEnum,\r\n SearchValueType,\r\n type DocListFilterRequestDTO,\r\n SORT_BUCKET_NAME,\r\n} from \"data/types\";\r\nimport { type docsResultState } from \"data/reducers/types\";\r\nimport {\r\n resetDocFilters,\r\n setDocListViewModeAction,\r\n setDocFilterByName,\r\n setDocFilterTextAction,\r\n} from \"data/actions\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport { GetDefaults } from \"components/DocListFilterModal/Utils\";\r\nimport { getDefaultsConfig, get } from \"data/constants\";\r\nimport { userLanguage } from \"data/storeHelper\";\r\nimport loc from \"i18next\";\r\n\r\ntype Props = {\r\n /** Redux dispatch */\r\n dispatch: Dispatch,\r\n /** doclist fetch status */\r\n status: ConstantsEnum,\r\n /** doclist fetch result */\r\n result: docsResultState,\r\n /** current docListViewMode */\r\n docListViewMode: ListViewModeEnum,\r\n /** docList layout settings */\r\n layout: DocListLayout,\r\n /** callback to set filtering on a specific column\r\n * @param {string} colName name of column to filter\r\n */\r\n requestShowFilter: (colName: string) => void,\r\n /** callback to set sorting on a specific column\r\n * @param {string} colName name of column to sort\r\n */\r\n setSorting: (colName: string) => void,\r\n /** redux: current itemUri */\r\n itemUri: string,\r\n /** redux: current formatId */\r\n formatId: number,\r\n /** whether doclist filter should be rendered */\r\n renderFilter: ?boolean,\r\n /** whether doclist filter should be disabled */\r\n disableFilter: ?boolen,\r\n};\r\n\r\ntype QuickFilterConfig = {\r\n name: string,\r\n caption?: string,\r\n visible: boolean,\r\n operator: DocListFilterOperatorsEnum,\r\n valueType: SearchValueTypeEnum,\r\n};\r\n\r\ntype State = {\r\n aggregations: Array,\r\n selected: Array,\r\n quickFilter: ?QuickFilterConfig,\r\n};\r\n\r\nexport class DocListFilterBar extends React.PureComponent {\r\n state = {\r\n aggregations: [],\r\n selected: [],\r\n quickFilter: null,\r\n };\r\n\r\n componentDidMount() {\r\n this.setState({\r\n ...this.prepFilters(),\r\n });\r\n }\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n if (\r\n this.props.status !== prevProps.status &&\r\n this.props.result != null\r\n ) {\r\n this.setState({\r\n ...this.prepFilters(),\r\n });\r\n }\r\n }\r\n\r\n prepFilters = () => {\r\n // prep available sorting/filters\r\n const { status, layout, result, formatId } = this.props;\r\n if (status !== Constants.OK || result == null || result.cols == null)\r\n return null;\r\n\r\n // filterBar buckets\r\n let selected = [];\r\n let filterBuckets: Array = [];\r\n const sortBucket = {\r\n visible: true,\r\n icon: \"sort\",\r\n name: SORT_BUCKET_NAME,\r\n caption: loc.t(\"common:filter.SortCaption\"),\r\n valueType: SearchValueType.NotSet,\r\n selected: [\"\"],\r\n buckets: [],\r\n };\r\n\r\n // add sorting\r\n result.cols.forEach((col) => {\r\n if (col.canSort) {\r\n // add sorting\r\n sortBucket.buckets.push({\r\n value: col.name,\r\n caption: col.caption,\r\n });\r\n }\r\n });\r\n // custom sorting set?\r\n sortBucket.selected =\r\n layout && layout.sorts && layout.sorts.length > 0\r\n ? [layout.sorts[0].name]\r\n : [\"\"];\r\n selected.push({\r\n name: SORT_BUCKET_NAME,\r\n value: sortBucket.selected[0],\r\n valueType: SearchValueType.NotSet,\r\n });\r\n\r\n // find current quickFilter defaults settings\r\n const quickFilter = this._getQuickFilterConfig();\r\n const quickFilterCol = this._findCol(quickFilter.name);\r\n if (quickFilterCol) quickFilter.caption = quickFilterCol.caption;\r\n else quickFilter.visible = false;\r\n\r\n // add filters\r\n const defaultFilters = GetDefaults(\r\n result.itemUri,\r\n formatId,\r\n result.cols\r\n ).filters;\r\n const filters =\r\n layout.filters != null && layout.filters.length > 0\r\n ? layout.filters\r\n : defaultFilters;\r\n\r\n filters.forEach((filter) => {\r\n const col = this._findCol(filter.name);\r\n if (col == null || col.canSort === false) return;\r\n // add filter\r\n const dupIdx = filterBuckets.findIndex((b) => b.name === col.name);\r\n // avoid duplicates\r\n /* istanbul ignore else */\r\n if (dupIdx === -1) {\r\n const hasFilter =\r\n filter != null &&\r\n filter.values.filter((f) => f != null && String(f).length)\r\n .length > 0;\r\n const filterCaption = hasFilter\r\n ? this._getFilterDisplay(filter, col)\r\n : null;\r\n if (hasFilter) {\r\n selected.push({\r\n name: col.name,\r\n value: this._getValueOrValues(filter.values),\r\n valueType: SearchValueType.NotSet,\r\n });\r\n }\r\n // add to filterBar\r\n filterBuckets.push({\r\n name: col.name,\r\n caption: col.caption,\r\n valueType: SearchValueType.NotSet,\r\n selected: hasFilter ? filter.values : [],\r\n buckets: hasFilter\r\n ? [\r\n {\r\n value: this._getValueOrValues(filter.values),\r\n caption: filterCaption,\r\n },\r\n ]\r\n : [],\r\n hideMenu: true,\r\n hideName: false,\r\n visible: true,\r\n });\r\n // is it also our quickFilter?\r\n if (\r\n quickFilter &&\r\n quickFilter.visible &&\r\n // this.props.result.filterText == null &&\r\n quickFilter.name.toUpperCase() === col.name.toUpperCase() &&\r\n quickFilter.operator === filter.operator\r\n ) {\r\n this._onFilterTextChange(filter.values, quickFilter);\r\n }\r\n }\r\n });\r\n\r\n // sort always at the end\r\n filterBuckets.push(sortBucket);\r\n\r\n return { aggregations: filterBuckets, selected, quickFilter };\r\n };\r\n\r\n _getValueOrValues = (values: Array): Array | any =>\r\n values.length > 1 ? values : values[0];\r\n\r\n _getFilterDisplay = (\r\n filter: DocListFilterRequestDTO,\r\n col?: DocColumnResultDTO\r\n ): string => {\r\n let values = [...filter.values];\r\n // Convert JSON UTC Date value to localized Date\r\n /* istanbul ignore else */\r\n if (\r\n col &&\r\n col.type === DocListColumnType.DateTimeValue &&\r\n filter.operator !== DocListFilterOperators.DateRelative\r\n ) {\r\n values = values.map((value) =>\r\n value == null\r\n ? \"\"\r\n : new Date(\r\n String(value).replace(\"Z\", \"\")\r\n ).toLocaleDateString(\r\n userLanguage(),\r\n LocalDateStringOption.Date\r\n )\r\n );\r\n }\r\n switch (filter.operator) {\r\n case DocListFilterOperators.DateRelative:\r\n return loc.t(\"common:filter.RelativeDate.\" + values[0]);\r\n case DocListFilterOperators.Equals:\r\n return `${values[0]}`;\r\n case DocListFilterOperators.Between:\r\n return `${loc.t(\r\n \"folder:action_filter.operators.\" + filter.operator\r\n )} ${values[0]}-${values[1]}`;\r\n default:\r\n return `${loc.t(\r\n \"folder:action_filter.operators.\" + filter.operator\r\n )} ${values[0]}`;\r\n }\r\n };\r\n\r\n _findCol = (\r\n name: string,\r\n identifier: string = \"name\"\r\n ): DocColumnResultDTO | null =>\r\n this.props.result &&\r\n this.props.result.cols &&\r\n this.props.result.cols.find(\r\n (c) => c[identifier].toUpperCase() === name.toUpperCase()\r\n );\r\n\r\n _onFilterBarSelect = (\r\n name: string,\r\n valueType: SearchValueTypeEnum,\r\n value: any\r\n ) => {\r\n if (value === null) {\r\n // button item\r\n this.props.requestShowFilter(name);\r\n } else if (name === SORT_BUCKET_NAME) {\r\n // sort\r\n this.props.setSorting(value);\r\n } else {\r\n this.props.dispatch(setDocFilterByName({ name, valueType, value }));\r\n }\r\n };\r\n\r\n _onFilterBarClear = () => this.props.dispatch(resetDocFilters());\r\n\r\n _onViewModeChange = (viewMode: ListViewModeEnum) =>\r\n this.props.dispatch(setDocListViewModeAction(viewMode));\r\n\r\n _getQuickFilterConfig = () => {\r\n // merge default with appsettings defaults\r\n const quickFilter = Object.assign(\r\n {},\r\n {\r\n visible: true,\r\n name: null, //will then search for Name or Dateiname\r\n operator: DocListFilterOperators.Contains,\r\n valueType: SearchValueType.String, // we only really support strings anyways\r\n },\r\n get(\r\n getDefaultsConfig(this.props.itemUri, this.props.formatId),\r\n [\"docList\", \"quickFilter\"],\r\n {}\r\n )\r\n );\r\n // find real name column (unless provided)\r\n const nameCol = quickFilter.name\r\n ? this._findCol(quickFilter.name)\r\n : this._findCol(DocListColumnType.WebDavName, \"type\");\r\n quickFilter.name = (nameCol && nameCol.name) || \"Name\"; // nothing found, fallback to Name\r\n return quickFilter;\r\n };\r\n\r\n _onFilterTextChange = (\r\n filterText?: string,\r\n quickFilter?: QuickFilterConfig\r\n ) =>\r\n this.props.dispatch(\r\n setDocFilterTextAction({\r\n ...(quickFilter || this.state.quickFilter),\r\n value: filterText,\r\n })\r\n );\r\n\r\n render = () => (\r\n \r\n );\r\n}\r\n\r\nconst mapStateToProps = /* istanbul ignore next */ (state, ownProps) => ({\r\n docListViewMode: s.docListViewModeSelector(state),\r\n status: s.docsStatusSelector(state),\r\n result: state.docs,\r\n itemUri: s.breadcrumbItemUriSelector(state, s.currentNameSelector(state)),\r\n formatId: s.breadcrumbFormatIdSelector(state, s.currentNameSelector(state)),\r\n ...ownProps,\r\n});\r\n\r\nexport default connect(mapStateToProps)(DocListFilterBar);\r\n","import React, { useContext, useMemo } from \"react\";\r\nimport { MultiSelectionContext } from \"data/context\";\r\nimport Mark from \"@hs/mark\";\r\nimport Icons from \"@hs/icons\";\r\nimport ItemStatusIcons from \"components/ItemStatusIcons\";\r\nimport { BrowserDragLink } from \"components/ItemUriLink\";\r\nimport ValueFactory from \"components/Attributes/SummaryAttribute/ValueFactory\";\r\nimport { DocListColumnType, GridListConstant } from \"data/types\";\r\nimport withStickyToggle from \"containers/StickyToggle\";\r\nimport StickyToggleStyle from \"containers/StickyToggle/style\";\r\nimport { isHandheld } from \"data/bowser\";\r\nimport styles from \"./CellContent.module.css\";\r\n\r\ntype Props = {\r\n index: number,\r\n col: DocColumnResultDTO,\r\n cell: any,\r\n filterText: any,\r\n onMoreClick: (\r\n e: SyntheticMouseEvent,\r\n itemUri: string,\r\n index: number\r\n ) => void,\r\n actionsDisabled: boolean,\r\n itemUri: string,\r\n};\r\n\r\nexport const CellContent = ({\r\n index,\r\n col,\r\n cell,\r\n filterText,\r\n onMoreClick,\r\n itemUri,\r\n ext,\r\n isHovered,\r\n}: Props): any => {\r\n /* istanbul ignore next */\r\n const { multiple, renderCheckbox } = useContext(MultiSelectionContext) || {\r\n multiple: false,\r\n renderCheckbox: () => null,\r\n };\r\n // Note: Needs to be inside Component to be able to mock isHandheld for jest\r\n const style = useMemo(\r\n () => ({\r\n marginLeft: isHandheld() ? \".5em\" : undefined,\r\n verticalAlign: \"middle\",\r\n }),\r\n []\r\n );\r\n\r\n const { caption: header } = col;\r\n let content = cell;\r\n if (content == null) return null;\r\n if (header === GridListConstant.ExtensionIcon) {\r\n if (multiple && isHandheld()) {\r\n content = renderCheckbox(index, styles.checkbox);\r\n } else {\r\n content = (\r\n <>\r\n {(isHovered || multiple) &&\r\n !isHandheld() &&\r\n renderCheckbox(\r\n index,\r\n `${styles.checkbox} ${styles.desktop}`\r\n )}\r\n \r\n \r\n \r\n \r\n );\r\n }\r\n } else if (header === GridListConstant.IconItemStatus) {\r\n content = (\r\n \r\n );\r\n } else if (Object.prototype.hasOwnProperty.call(content, \"$type\")) {\r\n content = (\r\n \r\n );\r\n }\r\n\r\n if (col.type === DocListColumnType.BooleanValue) {\r\n return (\r\n \r\n );\r\n }\r\n if (header === GridListConstant.IconItemStatus) {\r\n return <>{content};\r\n }\r\n if (\r\n [\r\n DocListColumnType.IntValue,\r\n DocListColumnType.LongValue,\r\n DocListColumnType.FileSize,\r\n DocListColumnType.ShortValue,\r\n DocListColumnType.DoubleValue,\r\n DocListColumnType.DecimalValue,\r\n DocListColumnType.SingleValue,\r\n ].includes(col.type)\r\n ) {\r\n return {content};\r\n }\r\n // #51803 filterText highlighting\r\n if (\r\n filterText &&\r\n filterText.name &&\r\n filterText.name.toUpperCase() === col.name.toUpperCase() &&\r\n filterText.value\r\n ) {\r\n return {content};\r\n }\r\n return <>{content};\r\n};\r\n\r\nconst CellContentWithStickyToggle = withStickyToggle({\r\n getStyle: StickyToggleStyle.GridList,\r\n renderDiv: true,\r\n portalTargetSelector:\r\n \"#docListPanel .ReactVirtualized__Grid__innerScrollContainer\",\r\n // shouldRender: ({ col }) => {\r\n // return !isHandheld() || col.caption === GridListConstant.ExtensionIcon;\r\n // },\r\n})(CellContent);\r\n\r\nexport default CellContentWithStickyToggle;\r\n","// @flow\r\nimport React, { PureComponent, type Node } from \"react\";\r\nimport {\r\n GridListConstant,\r\n SortDirectionOptions,\r\n type DocListLayout,\r\n} from \"data/types\";\r\nimport { type docsResultState } from \"data/reducers/types\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport GridList from \"@hs/grid-list\";\r\nimport ContextMenuHandler from \"components/ContextMenu/Handler\";\r\nimport CellContent from \"./CellContent\";\r\nimport { isHandheld } from \"data/bowser\";\r\nimport isEqual from \"lodash/isEqual\";\r\n\r\ntype Props = {\r\n /** doclist fetch result */\r\n result: docsResultState,\r\n /** current page number */\r\n pageNum: number,\r\n /** total number of documents */\r\n totalCount: number,\r\n /** callback to request loading next page */\r\n loadMoreRows: ({ rowIndex: number }) => Promise,\r\n /** callback to set sorting on a specific column\r\n * @param {string} colName name of column to sort\r\n */\r\n setSorting: (colName: string) => void,\r\n /** docList layout settings */\r\n layout?: DocListLayout,\r\n /** callback to set filtering on a specific column\r\n * @param {string} colName name of column to filter\r\n */\r\n requestShowFilter: (colName: string) => void,\r\n /** which row index is currently selected */\r\n activeRowIndex?: ?number,\r\n /** which row index to bring into view */\r\n scrollToRow?: ?number,\r\n /** which row is the UI currently updating\r\n * @param {number} rowStartIndex row index in result.rows\r\n */\r\n rowStartIndexUpdated: (rowStartIndex: number) => void,\r\n /** callback when user clicks document icon\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n */\r\n onIconClick?: (e: SyntheticMouseEvent<*>) => void,\r\n /** callback when user single clicks the whole row\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n * @param {string} itemUri the row's itemUri\r\n * @param {number} index the row's index\r\n */\r\n onSingleClick?: (\r\n e: SyntheticMouseEvent,\r\n itemUri: string,\r\n index: number\r\n ) => void,\r\n /** callback when user double clicks the whole row\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n * @param {string} itemUri the row's itemUri\r\n * @param {number} index the row's index\r\n */\r\n onDoubleClick?: (\r\n e: SyntheticMouseEvent,\r\n itemUri: string,\r\n index: number\r\n ) => void,\r\n /** callback when user clicks on More... button\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n * @param {string} itemUri the row's itemUri\r\n * @param {number} index the row's index\r\n */\r\n onMoreClick?: (\r\n e: SyntheticMouseEvent,\r\n itemUri: string,\r\n index: number\r\n ) => void,\r\n /** whether to disable the More... button */\r\n actionsDisabled?: boolean,\r\n /** callback when user right clicks the whole row\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n * @param {number} rowIndex the row's index\r\n * @param {number} columnsIndex the column's index\r\n * @param {string} itemUri the row's itemUri\r\n */\r\n onContextClick?: (\r\n e: SyntheticMouseEvent,\r\n rowIndex: number,\r\n columnIndex: number,\r\n itemUri: string\r\n ) => void,\r\n /** React.Node children */\r\n children?: Node,\r\n};\r\n\r\ntype State = {\r\n rows: Object,\r\n pageSize: number,\r\n pagesStatus: Array,\r\n};\r\n\r\n/**\r\n * Renders the Grid documents list\r\n */\r\nexport default class DocList extends PureComponent {\r\n constructor(props: Props) {\r\n super(props);\r\n this.state = {\r\n //first page results loaded by DocListContainer\r\n rows: props.result.rows,\r\n pageSize: props.result.pageSize,\r\n //first page already pre-loaded otherwise we wouldn't be here\r\n pagesStatus: [Constants.OK],\r\n };\r\n }\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n if (!isEqual(this.props.result.rows, this.state.rows)) {\r\n this.setState(({ pagesStatus }) => ({\r\n rows: this.props.result.rows,\r\n pagesStatus: pagesStatus.map((p, i) =>\r\n p === Constants.LOADING\r\n ? i === this.props.pageNum\r\n ? Constants.OK\r\n : null\r\n : p\r\n ),\r\n }));\r\n }\r\n }\r\n\r\n isColumnFiltered = (name: string): boolean => {\r\n const { layout } = this.props;\r\n if (layout?.filters == null) return false;\r\n const filter = layout.filters.find((f) => f.name === name);\r\n /* istanbul ignore next */\r\n if (filter == null) return false;\r\n return (\r\n filter?.values?.length > 0 && String(filter.values[0]).length > 0\r\n );\r\n };\r\n\r\n canColumnFilter = (name: string): boolean => {\r\n const { layout } = this.props;\r\n if (!layout?.filters?.length) return true;\r\n return layout.filters.findIndex((f) => f.name === name) !== -1;\r\n };\r\n\r\n isColumnSorted = (name: string): boolean => {\r\n if (this.props.layout == null) {\r\n return false;\r\n }\r\n const { sorts } = this.props.layout;\r\n return sorts?.some((s) => s.name === name);\r\n };\r\n\r\n getColumnSortDirection = (name: string): SortDirectionEnum => {\r\n if (this.props.layout == null) {\r\n return SortDirectionOptions.Ascending;\r\n }\r\n const { sorts } = this.props.layout;\r\n const sort = sorts?.find((s) => s.name === name);\r\n return sort ? sort.direction : SortDirectionOptions.Ascending;\r\n };\r\n\r\n // #36000 single-click behavior\r\n handleCellClick = (\r\n e: SyntheticMouseEvent<*>,\r\n rowIndex: number,\r\n columnIndex: number,\r\n itemUri: string\r\n ): void => {\r\n if (columnIndex === 0) {\r\n /* istanbul ignore else */\r\n if (typeof this.props.onIconClick === \"function\")\r\n this.props.onIconClick(e, itemUri, rowIndex);\r\n } else {\r\n /* istanbul ignore else */\r\n if (typeof this.props.onSingleClick === \"function\")\r\n this.props.onSingleClick(e, itemUri, rowIndex);\r\n }\r\n };\r\n\r\n parseCellColumnTitle = (caption: string, content: any): string => {\r\n if (caption === GridListConstant.ItemUri) {\r\n return undefined;\r\n } else if (content != null && typeof content !== \"string\") {\r\n return content.value;\r\n }\r\n return content;\r\n };\r\n\r\n handleHeaderFilterClick = (\r\n e: SyntheticMouseEvent<*>,\r\n name: string\r\n ): void => {\r\n e.stopPropagation();\r\n this.props.requestShowFilter(name);\r\n };\r\n\r\n handleHeaderClick = (columnIndex: number, header: string): void => {\r\n const col = this.props.result.cols[columnIndex];\r\n if (col.canSort) this.props.setSorting(col.name);\r\n };\r\n\r\n parseCellHeaderCaption = (rawData: string): string => {\r\n if (\r\n rawData === GridListConstant.ExtensionIcon ||\r\n rawData === GridListConstant.IconItemStatus ||\r\n rawData === GridListConstant.ItemUri\r\n ) {\r\n return \"\";\r\n }\r\n return rawData;\r\n };\r\n\r\n getColumnWidth = ({\r\n index,\r\n col,\r\n }: {\r\n index: number,\r\n col: DocColumnResultDTO,\r\n }): number => {\r\n const header = col.caption;\r\n let width = 0;\r\n if (header === GridListConstant.ExtensionIcon) {\r\n width += isHandheld() ? 35 : 42;\r\n } else if (header === GridListConstant.IconItemStatus) {\r\n /* istanbul ignore next */\r\n width += col.width > 0 ? col.width : 20;\r\n } else {\r\n width += col.width * 1.2 + 15;\r\n }\r\n if (index === this.props.result.cols.length - 1) {\r\n width += 20;\r\n }\r\n return width;\r\n };\r\n\r\n isRowLoaded = ({ rowIndex }: { rowIndex: number }): boolean =>\r\n Object.prototype.hasOwnProperty.call(this.state.rows, rowIndex);\r\n\r\n loadMoreRows = ({ rowIndex }: { rowIndex: number }) => {\r\n const { pageSize, pagesStatus } = this.state;\r\n\r\n // calc page number\r\n let pageNum = 0;\r\n /* istanbul ignore else */\r\n if (rowIndex > 0) {\r\n // specific row index requested? calc page number\r\n pageNum = Math.floor(rowIndex / pageSize);\r\n }\r\n\r\n // page already loaded/requested?\r\n /* istanbul ignore else */\r\n if (pagesStatus[pageNum] != null) return null;\r\n\r\n // fetch\r\n pagesStatus[pageNum] = Constants.LOADING;\r\n this.props.loadMoreRows(pageNum);\r\n };\r\n\r\n sectionRendered = (rowStartIndex: number) =>\r\n this.props.rowStartIndexUpdated(rowStartIndex);\r\n\r\n render() {\r\n const count =\r\n this.props.totalCount === 0\r\n ? this.props.result.rowCount\r\n : this.props.totalCount;\r\n if (this.props.result.cols.length === 0) {\r\n return null;\r\n }\r\n return (\r\n \r\n );\r\n }\r\n}\r\n","// @flow\r\nimport React from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport FormControl from \"react-bootstrap/lib/FormControl\";\r\nimport { DocListFilterOperators, type DocListColumnTypeEnum } from \"data/types\";\r\nimport loc from \"i18next\";\r\n\r\nconst operatorsPerType = {\r\n StringValue: [\r\n DocListFilterOperators.Equals,\r\n DocListFilterOperators.NotEquals,\r\n DocListFilterOperators.Contains,\r\n DocListFilterOperators.DoesNotContain,\r\n DocListFilterOperators.StartsWith,\r\n DocListFilterOperators.DoesNotStartWith,\r\n DocListFilterOperators.EndsWith,\r\n DocListFilterOperators.DoesNotEndWith,\r\n ],\r\n IntValue: [\r\n DocListFilterOperators.Equals,\r\n DocListFilterOperators.NotEquals,\r\n DocListFilterOperators.LessThan,\r\n DocListFilterOperators.LessThanOrEqualsTo,\r\n DocListFilterOperators.GreaterThan,\r\n DocListFilterOperators.GreaterThanOrEqualsTo,\r\n DocListFilterOperators.Between,\r\n ],\r\n BooleanValue: [DocListFilterOperators.None, DocListFilterOperators.Equals],\r\n LongValue: [\r\n DocListFilterOperators.Equals,\r\n DocListFilterOperators.NotEquals,\r\n DocListFilterOperators.LessThan,\r\n DocListFilterOperators.LessThanOrEqualsTo,\r\n DocListFilterOperators.GreaterThan,\r\n DocListFilterOperators.GreaterThanOrEqualsTo,\r\n DocListFilterOperators.Between,\r\n ],\r\n ShortValue: [\r\n DocListFilterOperators.Equals,\r\n DocListFilterOperators.NotEquals,\r\n DocListFilterOperators.LessThan,\r\n DocListFilterOperators.LessThanOrEqualsTo,\r\n DocListFilterOperators.GreaterThan,\r\n DocListFilterOperators.GreaterThanOrEqualsTo,\r\n DocListFilterOperators.Between,\r\n ],\r\n DoubleValue: [\r\n DocListFilterOperators.Equals,\r\n DocListFilterOperators.NotEquals,\r\n DocListFilterOperators.LessThan,\r\n DocListFilterOperators.LessThanOrEqualsTo,\r\n DocListFilterOperators.GreaterThan,\r\n DocListFilterOperators.GreaterThanOrEqualsTo,\r\n DocListFilterOperators.Between,\r\n ],\r\n DecimalValue: [\r\n DocListFilterOperators.Equals,\r\n DocListFilterOperators.NotEquals,\r\n DocListFilterOperators.LessThan,\r\n DocListFilterOperators.LessThanOrEqualsTo,\r\n DocListFilterOperators.GreaterThan,\r\n DocListFilterOperators.GreaterThanOrEqualsTo,\r\n DocListFilterOperators.Between,\r\n ],\r\n SingleValue: [\r\n DocListFilterOperators.Equals,\r\n DocListFilterOperators.NotEquals,\r\n DocListFilterOperators.LessThan,\r\n DocListFilterOperators.LessThanOrEqualsTo,\r\n DocListFilterOperators.GreaterThan,\r\n DocListFilterOperators.GreaterThanOrEqualsTo,\r\n ],\r\n DateTimeValue: [\r\n DocListFilterOperators.DateRelative,\r\n DocListFilterOperators.Equals,\r\n //DocListFilterOperators.NotEquals,\r\n DocListFilterOperators.LessThan,\r\n DocListFilterOperators.LessThanOrEqualsTo,\r\n DocListFilterOperators.GreaterThan,\r\n DocListFilterOperators.GreaterThanOrEqualsTo,\r\n DocListFilterOperators.Between,\r\n //DocListFilterOperators.NotBetween\r\n ],\r\n DateTimeOffsetValue: [DocListFilterOperators.None],\r\n ByteValue: [\r\n DocListFilterOperators.Equals,\r\n DocListFilterOperators.NotEquals,\r\n DocListFilterOperators.LessThan,\r\n DocListFilterOperators.LessThanOrEqualsTo,\r\n DocListFilterOperators.GreaterThan,\r\n DocListFilterOperators.GreaterThanOrEqualsTo,\r\n DocListFilterOperators.Between,\r\n ],\r\n ObjectValue: [DocListFilterOperators.None],\r\n};\r\n\r\noperatorsPerType.WebDavName = operatorsPerType.StringValue;\r\noperatorsPerType.FileSize = operatorsPerType.LongValue;\r\n\r\nconst Operators = ({\r\n index,\r\n type,\r\n value,\r\n onChange,\r\n}: {\r\n index: number,\r\n type: DocListColumnTypeEnum,\r\n value: string,\r\n onChange: Function,\r\n}) => (\r\n \r\n {Array.isArray(operatorsPerType[type]) ? (\r\n operatorsPerType[type].map((opType, index) => (\r\n \r\n ))\r\n ) : (\r\n \r\n )}\r\n \r\n);\r\n\r\nOperators.propTypes = {\r\n index: PropTypes.number.isRequired,\r\n type: PropTypes.string.isRequired,\r\n value: PropTypes.string,\r\n onChange: PropTypes.func.isRequired,\r\n};\r\n\r\nexport default Operators;\r\n","import React, { PureComponent, useRef, useCallback } from \"react\";\r\nimport {\r\n DocListFilterOperators,\r\n type DocListFilterOperatorsEnum,\r\n} from \"data/types\";\r\nimport moment from \"moment\";\r\nimport Moment from \"containers/Moment\";\r\nimport LocaleUtils, { formatDate, parseDate } from \"react-day-picker/moment\";\r\nimport DayPickerInput from \"react-day-picker/DayPickerInput\";\r\nimport { Manager } from \"react-popper\";\r\nimport {\r\n DatePickerReference,\r\n DatePickerPopper,\r\n} from \"components/ExtraAttributes/EditorControl/DateEditorControl\";\r\nimport \"react-day-picker/lib/style.css\";\r\nimport loc from \"i18next\";\r\nimport { userLanguage } from \"data/storeHelper\";\r\n\r\n// range of dates to show in the picker\r\nconst currentYear = () => new Date().getFullYear();\r\nconst fromMonth = () => new Date(currentYear() - 10, 0);\r\nconst toMonth = () => new Date(currentYear() + 10, 11);\r\n\r\nexport function YearMonthForm({\r\n date,\r\n localeUtils,\r\n onChange,\r\n}: {\r\n date?: Date,\r\n localeUtils?: Object,\r\n onChange: Function,\r\n}) {\r\n const month = useRef(null);\r\n const year = useRef(null);\r\n\r\n const handleChange = useCallback(\r\n (e) => {\r\n onChange(new Date(year.current.value, month.current.value));\r\n },\r\n [month, year, onChange]\r\n );\r\n\r\n if (localeUtils === undefined || localeUtils === null) return null;\r\n if (date === undefined || date === null) date = new Date();\r\n const months = localeUtils.getMonths(userLanguage());\r\n\r\n const years = [];\r\n for (\r\n let i = fromMonth().getFullYear();\r\n i <= toMonth().getFullYear();\r\n i += 1\r\n ) {\r\n years.push(i);\r\n }\r\n\r\n return (\r\n
\r\n \r\n {months.map((month, i) => (\r\n \r\n ))}\r\n \r\n \r\n {years.map((year, i) => (\r\n \r\n ))}\r\n \r\n
\r\n );\r\n}\r\n\r\ntype Props = {\r\n autoFocus?: boolean,\r\n index: number,\r\n operator: DocListFilterOperatorsEnum,\r\n values: Array,\r\n valueIndex: number,\r\n onChange: Function,\r\n};\r\n\r\ntype State = {\r\n month: Date,\r\n values: Array,\r\n};\r\n\r\nexport class DatePicker extends PureComponent {\r\n state = {\r\n month: fromMonth(),\r\n values: [],\r\n };\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n this.state = {\r\n month: new Date(),\r\n values:\r\n (Array.isArray(props.values) &&\r\n props.values.map((value) => this.getValueAsDate(value))) ||\r\n [],\r\n };\r\n moment.locale(userLanguage());\r\n }\r\n\r\n handleYearMonthChange = (month: Date) => {\r\n this.setState({ month });\r\n };\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n /* istanbul ignore else */\r\n if (prevProps.values !== this.props.values) {\r\n this.setState({ month: new Date() });\r\n }\r\n }\r\n\r\n getValueAsDate = (value: ?string) =>\r\n value && String(value).length > 0 ? moment(value).format(\"L\") : null;\r\n\r\n handleDayChange = (\r\n day: ?Date,\r\n modifiers: Object,\r\n dayPickerInput: DayPickerInput\r\n ) => {\r\n // hours set to prevent date inconsistencies, when giving manual input\r\n day?.setHours(12);\r\n\r\n const { index, valueIndex, onChange } = this.props;\r\n const input = dayPickerInput.getInput();\r\n let currentValue;\r\n if (day != null) {\r\n currentValue = this.getValueAsDate(day);\r\n onChange(\r\n moment(day).utc().startOf(\"day\").toJSON(),\r\n index,\r\n valueIndex\r\n );\r\n } else {\r\n currentValue = input.value;\r\n onChange(\r\n moment.utc(currentValue, \"L\").toJSON() || \"\",\r\n index,\r\n valueIndex\r\n );\r\n }\r\n const values = [...this.state.values];\r\n values[valueIndex] = currentValue;\r\n this.setState({ values });\r\n };\r\n\r\n render() {\r\n const { autoFocus, valueIndex, values, operator } = this.props;\r\n\r\n const from =\r\n [\r\n DocListFilterOperators.Between,\r\n DocListFilterOperators.NotBetween,\r\n ].includes(operator) &&\r\n values &&\r\n values[0] &&\r\n String(values[0]).length > 0\r\n ? moment(values[0]).toDate()\r\n : null;\r\n\r\n return (\r\n
\r\n \r\n \r\n ),\r\n }}\r\n onDayChange={this.handleDayChange}\r\n value={this.state.values[valueIndex]}\r\n placeholder={moment.localeData().longDateFormat(\"L\")}\r\n format=\"L\"\r\n formatDate={formatDate}\r\n parseDate={parseDate}\r\n component={DatePickerReference}\r\n overlayComponent={DatePickerPopper}\r\n />\r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default Moment(DatePicker);\r\n","// @flow\r\nimport React from \"react\";\r\nimport {\r\n DocListFilterOperators,\r\n type DocListFilterOperatorsEnum,\r\n} from \"data/types\";\r\nimport DatePicker from \"./DatePicker\";\r\nimport RelativeDatePicker from \"./RelativeDatePicker\";\r\n\r\nconst FilterDateValue = ({\r\n autoFocus,\r\n index,\r\n valueIndex,\r\n values,\r\n operator,\r\n onChange,\r\n}: {\r\n autoFocus: boolean,\r\n index: number,\r\n valueIndex: number,\r\n values?: Array,\r\n operator: DocListFilterOperatorsEnum,\r\n onChange: Function,\r\n}) => {\r\n switch (operator) {\r\n case DocListFilterOperators.DateRelative:\r\n return (\r\n \r\n onChange(e, index, valueIndex)\r\n }\r\n />\r\n );\r\n\r\n case DocListFilterOperators.None:\r\n return null;\r\n\r\n default:\r\n return (\r\n \r\n );\r\n }\r\n};\r\n\r\nexport default FilterDateValue;\r\n","// @flow\r\nimport React from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport ToggleButtonGroup from \"react-bootstrap/lib/ToggleButtonGroup\";\r\nimport ToggleButton from \"react-bootstrap/lib/ToggleButton\";\r\nimport loc from \"i18next\";\r\n\r\nconst BoolPicker = ({\r\n index,\r\n value,\r\n onChange,\r\n}: {\r\n index: number,\r\n value?: string,\r\n onChange: Function,\r\n}) => (\r\n \r\n \r\n {loc.t(\"folder:action_filter.Boolean.None\")}\r\n \r\n \r\n {loc.t(\"folder:action_filter.Boolean.True\")}\r\n \r\n \r\n {loc.t(\"folder:action_filter.Boolean.False\")}\r\n \r\n \r\n);\r\n\r\nBoolPicker.propTypes = {\r\n index: PropTypes.number.isRequired,\r\n value: PropTypes.string,\r\n onChange: PropTypes.func.isRequired,\r\n};\r\n\r\nexport default BoolPicker;\r\n","// @flow\r\nimport React from \"react\";\r\nimport FormControl from \"react-bootstrap/lib/FormControl\";\r\nimport {\r\n type DocListColumnTypeEnum,\r\n DocListColumnType,\r\n type DocListFilterOperatorsEnum,\r\n DocListFilterOperators,\r\n} from \"data/types\";\r\nimport FilterDateValue from \"./FilterDateValue\";\r\nimport \"react-day-picker/lib/style.css\";\r\nimport BoolPicker from \"./BoolPicker\";\r\nimport ClearableInput from \"@hs/clearable-input\";\r\n\r\ntype Props = {\r\n autoFocus?: boolean,\r\n index: number,\r\n type: DocListColumnTypeEnum,\r\n operator: DocListFilterOperatorsEnum,\r\n values: Array,\r\n valueIndex: number,\r\n onChange: Function,\r\n};\r\n\r\nconst FilterValue = ({\r\n autoFocus,\r\n index,\r\n valueIndex,\r\n type,\r\n values,\r\n operator,\r\n onChange,\r\n}: Props) => {\r\n const from =\r\n [\r\n DocListFilterOperators.Between,\r\n DocListFilterOperators.NotBetween,\r\n ].includes(operator) &&\r\n values &&\r\n values[0] &&\r\n String(values[0]).length > 0\r\n ? values[0]\r\n : null;\r\n\r\n switch (type) {\r\n case DocListColumnType.BooleanValue:\r\n return (\r\n onChange(e, index)\r\n }\r\n />\r\n );\r\n\r\n case DocListColumnType.DateTimeValue:\r\n return (\r\n \r\n );\r\n\r\n case DocListColumnType.IntValue:\r\n case DocListColumnType.LongValue:\r\n case DocListColumnType.FileSize:\r\n case DocListColumnType.ShortValue:\r\n case DocListColumnType.DoubleValue:\r\n case DocListColumnType.DecimalValue:\r\n case DocListColumnType.SingleValue:\r\n return (\r\n onChange(e, index, valueIndex)\r\n }\r\n />\r\n );\r\n\r\n default:\r\n return (\r\n \r\n onChange(e, index, valueIndex)\r\n }\r\n className=\"form-control\"\r\n />\r\n );\r\n }\r\n};\r\nFilterValue.displayName = \"FilterValue\";\r\nexport default FilterValue;\r\n","// @flow\r\nimport React, { PureComponent } from \"react\";\r\nimport Col from \"react-bootstrap/lib/Col\";\r\nimport Modal from \"components/Modal\";\r\nimport ButtonToolbar from \"react-bootstrap/lib/ButtonToolbar\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport SplitButton from \"react-bootstrap/lib/SplitButton\";\r\nimport MenuItem from \"react-bootstrap/lib/MenuItem\";\r\nimport Form from \"react-bootstrap/lib/Form\";\r\nimport FormGroup from \"react-bootstrap/lib/FormGroup\";\r\nimport ControlLabel from \"react-bootstrap/lib/ControlLabel\";\r\nimport Icons from \"@hs/icons\";\r\nimport Operators from \"./Operators\";\r\nimport FilterValue from \"./FilterValue\";\r\nimport {\r\n type DocListFilterRequestDTO,\r\n DocListFilterOperators,\r\n DocListColumnType,\r\n} from \"data/types\";\r\nimport { type docsResultState } from \"data/reducers/types\";\r\nimport immutable from \"object-path-immutable\";\r\nimport loc from \"i18next\";\r\nimport styles from \"./DocListFilterModal.module.css\";\r\nimport { GetDefaults } from \"./Utils\";\r\n\r\ntype Props = {\r\n /** whether to show modal */\r\n show: boolean,\r\n /** which filter to focus on */\r\n focusOnFilterName: ?string,\r\n /** modal dialog title */\r\n title: string,\r\n /** current result */\r\n result: docsResultState,\r\n /** callback when user closes modal */\r\n onClose: () => void,\r\n /** callback when user wants to set filters\r\n * @param {Array} filters all filters values\r\n */\r\n onFilter: (filters: Array) => void,\r\n /** current filters definitions */\r\n filters: ?Array,\r\n};\r\n\r\ntype State = {\r\n filters: Array,\r\n};\r\n\r\nexport default class DocListFilterModal extends PureComponent {\r\n constructor(props: Props) {\r\n super(props);\r\n if (props.filters == null || props.filters.length === 0) {\r\n if (props.result.itemUri != null)\r\n this.state = {\r\n filters:\r\n GetDefaults(\r\n props.result.itemUri,\r\n props.formatId,\r\n props.result.cols\r\n ).filters /* istanbul ignore next */ || [],\r\n };\r\n else this.state = { filters: [] };\r\n } else {\r\n this.state = {\r\n filters: props.filters,\r\n };\r\n }\r\n }\r\n\r\n _onFilter = () => {\r\n this.props.onFilter(this.state.filters);\r\n };\r\n\r\n _onSubmit = (e: SyntheticInputEvent<*>) => {\r\n e.preventDefault();\r\n this._onFilter();\r\n };\r\n\r\n _onOperatorChange = (e: SyntheticInputEvent<*>): void => {\r\n const index = parseInt(e.currentTarget.name, 10);\r\n const filter = this.state.filters[index];\r\n let newfilters = immutable.set(\r\n this.state.filters,\r\n [String(index), \"operator\"],\r\n e.currentTarget.value\r\n );\r\n // reset value only if not compatible\r\n if (\r\n filter.operator === DocListFilterOperators.DateRelative ||\r\n newfilters[index].operator === DocListFilterOperators.DateRelative\r\n ) {\r\n newfilters = immutable.set(\r\n newfilters,\r\n [String(index), \"values\"],\r\n [\"\"]\r\n );\r\n }\r\n this.setState({\r\n filters: newfilters,\r\n });\r\n };\r\n\r\n _onValueChange = (\r\n e: SyntheticInputEvent<*> | string,\r\n index: number,\r\n valueIndex: ?number\r\n ) => {\r\n let value;\r\n /* istanbul ignore if */\r\n if (typeof e === \"string\") {\r\n value = e;\r\n } else {\r\n value = e.currentTarget.value;\r\n }\r\n this.setState(\r\n {\r\n filters: immutable.set(\r\n this.state.filters,\r\n [\r\n String(index),\r\n \"values\",\r\n valueIndex /* istanbul ignore next */ || 0,\r\n ],\r\n value\r\n ),\r\n },\r\n () => {\r\n if (\r\n valueIndex === 0 &&\r\n this.state.filters[index].operator ===\r\n DocListFilterOperators.Between\r\n )\r\n this.setState({\r\n filters: immutable.set(\r\n this.state.filters,\r\n [String(index), \"values\", 1],\r\n \"\"\r\n ),\r\n });\r\n }\r\n );\r\n };\r\n\r\n _resetValues = () => {\r\n this._resetSelect(\"values\");\r\n };\r\n\r\n _resetSelect = (eventKey: \"all\" | \"values\") => {\r\n if (eventKey === \"all\") {\r\n const { result, formatId } = this.props;\r\n // clear the WHOLE form (operators & values)\r\n /* istanbul ignore else */\r\n if (result.itemUri != null)\r\n this.setState({\r\n filters: GetDefaults(result.itemUri, formatId, result.cols)\r\n .filters,\r\n });\r\n else this.setState({ filters: [] });\r\n } else {\r\n /* istanbul ignore else */\r\n if (eventKey === \"values\") {\r\n this.setState({\r\n filters: this.state.filters.map((filter) =>\r\n immutable.set(filter, \"values\", [\"\"])\r\n ),\r\n });\r\n }\r\n }\r\n };\r\n\r\n // submit form on keyboard Enter\r\n _onKeyPress = (e: SyntheticKeyboardEvent<*>) => {\r\n /* istanbul ignore else */\r\n if (e.which === 13) {\r\n e.preventDefault();\r\n this._onFilter();\r\n }\r\n };\r\n\r\n /*_getValidationState = (\r\n filter: DocListFilterRequestDTO\r\n ): \"success\" | \"warning\" | \"error\" | null => {\r\n if (filter.operator === DocListFilterOperators.Between) {\r\n console.log(\"filter\", filter);\r\n return filter.values.length === 2 &&\r\n String(filter.values[0]).length > 0 &&\r\n String(filter.values[1]).length > 0\r\n ? \"success\"\r\n : \"error\";\r\n }\r\n return null;\r\n };\r\n \r\n validationState={this._getValidationState(\r\n filter\r\n )}\r\n */\r\n\r\n // will return column index to focus on\r\n // if passed in props then return that\r\n // otherwise find first visible field\r\n _getFocusColumnIndex = () => {\r\n const { filters } = this.state;\r\n const { focusOnFilterName, result } = this.props;\r\n if (focusOnFilterName == null) {\r\n const cols = result.cols || [];\r\n // find first field available\r\n const i = filters.findIndex((filter) => {\r\n const col = cols.find((c) => c.name === filter.name);\r\n if (col != null && col.canSort) return true;\r\n return false;\r\n });\r\n return i;\r\n }\r\n\r\n const i = filters.findIndex(\r\n (filter) => filter.name === focusOnFilterName\r\n );\r\n /* istanbul ignore next */\r\n if (i == null) return -1;\r\n return i;\r\n };\r\n\r\n render() {\r\n const { show, onClose, result, title } = this.props;\r\n const { filters } = this.state;\r\n const cols = result.cols || [];\r\n const focusColumnIndex = this._getFocusColumnIndex();\r\n\r\n return (\r\n \r\n
\r\n \r\n {/*\r\n {loc.t(\"folder:action_filter.reset\")}\r\n */}\r\n \r\n \r\n {\" \" +\r\n loc.t(\"folder:action_filter.title\") +\r\n \" \" +\r\n title}\r\n \r\n \r\n \r\n {filters.map((filter, index) => {\r\n const col = cols.find(\r\n (c) => c.name === filter.name\r\n );\r\n if (col == null) {\r\n /* console.warn(\r\n `Cannot find matching col named ${filter.name}; skipping`\r\n ); */\r\n return null;\r\n }\r\n if (!col.canSort) return null;\r\n return (\r\n \r\n \r\n {col.caption}\r\n \r\n {col.type !==\r\n DocListColumnType.BooleanValue && (\r\n \r\n \r\n \r\n )}\r\n {[\r\n DocListFilterOperators.Between,\r\n DocListFilterOperators.NotBetween,\r\n ].includes(filter.operator) ? (\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 {loc.t(\"folder:action_filter.reset_all\")}\r\n \r\n \r\n \r\n \r\n \r\n {loc.t(\"folder:action_filter.filter\")}\r\n \r\n {/**/}\r\n \r\n \r\n
\r\n \r\n );\r\n }\r\n}\r\n","//@flow\r\nimport React, { PureComponent, type ComponentType } from \"react\";\r\nimport { connect } from \"react-redux\";\r\nimport findIndex from \"lodash/findIndex\";\r\nimport { getDisplayName } from \"data/constants\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport { type TrackCurrentRowProps } from \"containers/TrackCurrentRow\";\r\nimport {\r\n type ServerEventMessage,\r\n ServerEventItemType,\r\n ServerEventActionType,\r\n} from \"data/types\";\r\nimport { type docsResultState } from \"data/reducers/types\";\r\n\r\ntype Props = {\r\n /** Current User ID */\r\n userId: number,\r\n /** DocList Container: Result (from API) */\r\n result: docsResultState,\r\n /** DocList Container: Tracker Object */\r\n docTracker: TrackCurrentRowProps,\r\n /** GlobalEventsHandler: Id */\r\n refreshId: number,\r\n /** GlobalEventsHandler: Event */\r\n refreshEvent: ?ServerEventMessage,\r\n};\r\n\r\ntype State = {\r\n refreshId: number,\r\n userId: number,\r\n itemUri: string,\r\n};\r\n\r\nconst UploadHandler = () => (WrappedComponent: ComponentType) => {\r\n class PP extends PureComponent {\r\n static displayName = `UploadHandler(${getDisplayName(\r\n WrappedComponent\r\n )})`;\r\n\r\n state = {\r\n refreshId: -1,\r\n userId: -1,\r\n itemUri: \"\",\r\n };\r\n\r\n static _maybeSetActiveRow(props, state) {\r\n /* istanbul ignore else */\r\n if (!props.result) {\r\n return null;\r\n }\r\n\r\n const rows = props.result.rows;\r\n /* istanbul ignore else */\r\n if (!rows || props.result.rowCount === 0) {\r\n return null;\r\n }\r\n\r\n const itemUriIndex = findIndex(props.result.cols, [\r\n \"name\",\r\n \"ITEMURI\",\r\n ]);\r\n /* istanbul ignore else */\r\n if (itemUriIndex === -1) {\r\n return null;\r\n }\r\n\r\n const activeRowIndex = Object.keys(rows).reduce(\r\n (indexOrUndefined, index) =>\r\n typeof indexOrUndefined === \"undefined\" &&\r\n rows[index][itemUriIndex] === state.itemUri\r\n ? index\r\n : indexOrUndefined,\r\n undefined\r\n );\r\n /* istanbul ignore else */\r\n if (\r\n typeof activeRowIndex !== \"undefined\" &&\r\n props.docTracker &&\r\n props.docTracker.currentRow !== activeRowIndex\r\n ) {\r\n props.docTracker.setCurrentRow(activeRowIndex);\r\n // Reset itemUri and User ID\r\n return {\r\n userId: -1,\r\n itemUri: \"\",\r\n };\r\n }\r\n return null;\r\n }\r\n\r\n static getDerivedStateFromProps(props, state) {\r\n /* istanbul ignore else */\r\n if (!props.refreshEvent) {\r\n return null;\r\n }\r\n\r\n // Did my upload finish? Maybe need to set new active row\r\n /* istanbul ignore else */\r\n if (state.itemUri && state.userId === props.userId) {\r\n const newState = PP._maybeSetActiveRow(props, state);\r\n /* istanbul ignore else */\r\n if (newState) {\r\n return newState;\r\n }\r\n }\r\n\r\n const { item, action, data } = props.refreshEvent;\r\n // Is the refresh event a file upload\r\n /* istanbul ignore else */\r\n if (\r\n item !== ServerEventItemType.document ||\r\n action !== ServerEventActionType.add\r\n ) {\r\n return null;\r\n }\r\n\r\n // Is the upload event mine and new?\r\n /* istanbul ignore else */\r\n if (\r\n props.refreshId !== state.refreshId &&\r\n data.userId === props.userId\r\n ) {\r\n return {\r\n refreshId: props.refreshId,\r\n userId: data.userId,\r\n itemUri: data.itemUri,\r\n };\r\n }\r\n return null;\r\n }\r\n\r\n render() {\r\n // Remove userID property\r\n const { userId, ...props } = this.props;\r\n\r\n return ;\r\n }\r\n }\r\n\r\n const mapStateToProps = (state, ownProps) => ({\r\n userId: s.userIdSelector(state),\r\n ...ownProps,\r\n });\r\n\r\n return connect(mapStateToProps)(PP);\r\n};\r\n\r\nexport default UploadHandler;\r\n","// @flow\r\nimport React, { PureComponent, type Node } from \"react\";\r\nimport { compose } from \"redux\";\r\nimport { connect, Dispatch } from \"react-redux\";\r\nimport loc from \"i18next\";\r\nimport noop from \"lodash/noop\";\r\nimport isEqual from \"lodash/isEqual\";\r\nimport LayoutLoader from \"containers/LayoutLoader\";\r\nimport {\r\n RefreshMode,\r\n type DocListFilterRequestDTO,\r\n type DocListSortRequestDTO,\r\n SortDirectionOptions,\r\n type DocListLayout,\r\n type ListViewModeEnum,\r\n ListViewMode,\r\n ServerEventItemType,\r\n type TrackCurrentRowProps,\r\n} from \"data/types\";\r\nimport { type docsResultState } from \"data/reducers/types\";\r\nimport {\r\n getDocsAction,\r\n togglesUpdateCounterAction,\r\n setDocsLayoutAction,\r\n} from \"data/actions\";\r\nimport DocListFilterBar from \"components/DocListFilterBar\";\r\nimport DocList from \"components/DocList\";\r\nimport DocListSimple from \"components/DocListSimple\";\r\nimport DocListFilterModal from \"components/DocListFilterModal\";\r\nimport {\r\n IsFiltered,\r\n GetDefaultFilters,\r\n} from \"components/DocListFilterModal/Utils\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport GlobalEventsHandler from \"containers/GlobalEventsHandler\";\r\nimport UploadHandler from \"containers/UploadHandler\";\r\nimport Status from \"components/Status\";\r\nimport NoDocs from \"components/NoDocs\";\r\nimport withOfflineHandler from \"containers/OfflineHandler\";\r\nimport { type MultiSelectionProps } from \"containers/MultiSelection\";\r\n\r\ntype Props = {\r\n /** folder itemUri to show */\r\n itemUri: string,\r\n /** whether to popup filter modal */\r\n showFilter: boolean,\r\n /** whether to automatically load and show documents */\r\n showDocs: boolean,\r\n /** whether to show the AddDocument action when NoDocs found\r\n * @default {boolean} true\r\n */\r\n showAddDocument?: boolean,\r\n /** callback when user closes filter modal */\r\n onFilterClose: () => void,\r\n /** callback when user clicks document icon\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n */\r\n onIconClick?: (e: SyntheticMouseEvent) => void,\r\n /** callback when user single clicks the whole row\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n * @param {string} itemUri the row's itemUri\r\n * @param {number} index the row's index\r\n */\r\n onSingleClick?: (\r\n e: SyntheticMouseEvent,\r\n itemUri: string,\r\n index: number\r\n ) => void,\r\n /** callback when user double clicks the whole row\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n * @param {string} itemUri the row's itemUri\r\n * @param {number} index the row's index\r\n */\r\n onDoubleClick?: (\r\n e: SyntheticMouseEvent,\r\n itemUri: string,\r\n index: number\r\n ) => void,\r\n /** callback when user clicks on More... button\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n * @param {string} itemUri the row's itemUri\r\n * @param {number} index the row's index\r\n */\r\n onMoreClick?: (\r\n e: SyntheticMouseEvent,\r\n itemUri: string,\r\n index: number\r\n ) => void,\r\n /** whether doclist filters should be rendered */\r\n renderFilter: ?boolean,\r\n /** whether to disable the More... button */\r\n actionsDisabled?: boolean,\r\n /** callback when user right clicks the whole row\r\n * @param {SyntheticMouseEvent} e HTML click event\r\n * @param {number} rowIndex the row's index\r\n * @param {number} columnsIndex the column's index\r\n * @param {string} itemUri the row's itemUri\r\n */\r\n onContextClick?: (\r\n e: SyntheticMouseEvent,\r\n rowIndex: number,\r\n columnIndex: number,\r\n itemUri: string\r\n ) => void,\r\n activeRowIndex?: number,\r\n scrollToRow?: number,\r\n /** React.Node children */\r\n children?: Node,\r\n\r\n // from redux connect()\r\n layout?: DocListLayout,\r\n /** current viewName */\r\n viewName: ?string,\r\n breadcrumbName: string,\r\n result?: docsResultState,\r\n status: ConstantsEnum,\r\n /** GlobalEventsHandler.refreshId */\r\n refreshId: number,\r\n /** Redux dispatch */\r\n dispatch: Dispatch,\r\n /** current docListViewMode */\r\n docListViewMode: ListViewModeEnum,\r\n /** redux: current formatId */\r\n formatId: number,\r\n /** TrackCurrentRow: tracks current selected document row */\r\n docTracker: ?TrackCurrentRowProps,\r\n /** withMultipleSelection additional props */\r\n multiSelection: MultiSelectionProps,\r\n};\r\n\r\ntype State = {\r\n rowStartIndex: number, //current top row rendered\r\n scrollToRow: number,\r\n focusOnFilterName: ?string,\r\n};\r\n\r\nexport class DocListContainer extends PureComponent {\r\n static defaultProps = {\r\n showFilter: false,\r\n showDocs: true,\r\n onFilterClose: undefined,\r\n status: Constants.LOADING,\r\n dispatch: noop,\r\n };\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n this.state = {\r\n focusOnFilterName: null,\r\n rowStartIndex: 0,\r\n scrollToRow: props.scrollToRow || -1,\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n /* istanbul ignore else */\r\n if (\r\n this.props.showDocs === true ||\r\n this.props.status === Constants.NONE\r\n ) {\r\n this._fetch(this.props.itemUri);\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n // reload data?\r\n /* istanbul ignore else */\r\n if (this.props.showDocs === true && this.props.itemUri !== undefined) {\r\n const prevNotInitialFilters = prevProps.layout?.filters?.length;\r\n\r\n const isLayoutChanged =\r\n prevProps.layout?.filters &&\r\n this.props.layout?.filters &&\r\n !isEqual(prevProps.layout, this.props.layout);\r\n\r\n const notDefaultFilters =\r\n this.props.layout?.filters &&\r\n this.props.result?.cols &&\r\n !isEqual(\r\n this.props.layout.filters,\r\n GetDefaultFilters(this.props.result.cols)\r\n );\r\n\r\n /* istanbul ignore else */\r\n if (\r\n prevProps.showDocs !== this.props.showDocs ||\r\n prevProps.itemUri !== this.props.itemUri ||\r\n (isLayoutChanged &&\r\n (prevNotInitialFilters || notDefaultFilters))\r\n ) {\r\n this.setState(\r\n {\r\n scrollToRow: this.props.activeRowIndex,\r\n rowStartIndex: 0,\r\n },\r\n () => this._fetch(this.props.itemUri)\r\n );\r\n }\r\n\r\n /* istanbul ignore else */\r\n if (\r\n this.props.docTracker &&\r\n isLayoutChanged &&\r\n (prevNotInitialFilters || notDefaultFilters)\r\n ) {\r\n this.props.docTracker.setCurrentRow(-1);\r\n this.setState({ scrollToRow: -1 });\r\n }\r\n }\r\n\r\n if (prevProps.itemUri !== this.props.itemUri) {\r\n this.props.multiSelection?.disable();\r\n }\r\n\r\n // update totalCount\r\n if (\r\n prevProps.result !== this.props.result &&\r\n this.props.result != null &&\r\n this.props.viewName != null\r\n ) {\r\n /* istanbul ignore else */\r\n if (prevProps.result?.rows !== this.props.result.rows)\r\n this._updateToggleCounter(\r\n this.props.result.totalCount,\r\n Constants.OK\r\n );\r\n\r\n // Update multiSelection available Rows\r\n /* istanbul ignore next */\r\n this.props.multiSelection?.setAvailableRows(this.props.result.rows);\r\n\r\n this._updateArrowNavigationRows();\r\n }\r\n\r\n if (\r\n this.props.status === Constants.ERROR &&\r\n prevProps.status !== this.props.status &&\r\n this.props.viewName != null\r\n ) {\r\n this.props.dispatch(\r\n togglesUpdateCounterAction({\r\n name: this.props.viewName,\r\n counts: { doclist: 0 },\r\n status: { doclist: Constants.ERROR },\r\n })\r\n );\r\n }\r\n\r\n // finished uploading? refresh\r\n /* istanbul ignore else */\r\n if (prevProps.refreshId !== this.props.refreshId) {\r\n this._fetch(this.props.itemUri);\r\n this.props.multiSelection?.disable();\r\n }\r\n }\r\n\r\n _updateArrowNavigationRows() {\r\n const { postMessage, multiSelection, result } = this.props;\r\n // Update postMessage rows if applicable\r\n /* istanbul ignore next */\r\n if (result?.totalCount && postMessage?.setRows) {\r\n const documents = {};\r\n Object.keys(result.rows).forEach((i) => {\r\n const index = parseInt(i, 10);\r\n if (\r\n !multiSelection?.multiple ||\r\n multiSelection?.activeRows.hasOwnProperty(i)\r\n ) {\r\n const row = result.rows[i];\r\n documents[index] = row[row.length - 1];\r\n }\r\n });\r\n postMessage.setRows({\r\n ...documents,\r\n length: result.totalCount,\r\n });\r\n }\r\n }\r\n\r\n _updateToggleCounter(count: number, doclist?: ConstantsEnum): void {\r\n const { dispatch, viewName, layout } = this.props;\r\n let status = undefined;\r\n /* istanbul ignore else */\r\n if (layout && layout.filters && IsFiltered(layout.filters)) {\r\n status = {\r\n doclist: doclist !== Constants.LOADING ? \"filter\" : doclist,\r\n };\r\n } else if (doclist != null) {\r\n status = { doclist };\r\n }\r\n /* istanbul ignore else */\r\n if (viewName != null)\r\n dispatch(\r\n togglesUpdateCounterAction({\r\n name: viewName,\r\n counts: { doclist: count },\r\n status,\r\n })\r\n );\r\n }\r\n\r\n // load next page of results\r\n _loadMoreRows = (pageNum: number) => {\r\n /* istanbul ignore else */\r\n if (this.props.itemUri !== undefined && pageNum > 0)\r\n this._fetch(this.props.itemUri, pageNum);\r\n };\r\n\r\n // load first page of documents\r\n _fetch(itemUri: string, pageNum: number = 0) {\r\n const { dispatch, showDocs, layout } = this.props;\r\n if (pageNum === 0 && showDocs)\r\n this._updateToggleCounter(0, Constants.LOADING);\r\n dispatch(\r\n getDocsAction({\r\n pageNum: showDocs ? pageNum : -1,\r\n itemUri,\r\n sorts: layout?.sorts,\r\n filters: layout?.filters,\r\n })\r\n );\r\n }\r\n\r\n _setSorting = (name: string) => {\r\n const { layout } = this.props;\r\n let direction = SortDirectionOptions.Ascending;\r\n if (layout?.sorts?.[0]?.name === name) {\r\n direction =\r\n layout.sorts[0].direction === SortDirectionOptions.Ascending\r\n ? SortDirectionOptions.Descending\r\n : SortDirectionOptions.Ascending;\r\n }\r\n\r\n const sorts: Array = [\r\n {\r\n name,\r\n direction,\r\n },\r\n ];\r\n this.props.dispatch(setDocsLayoutAction({ sorts }));\r\n };\r\n\r\n _onFilter = (filters: Array) => {\r\n this._onFilterClose();\r\n this.props.dispatch(setDocsLayoutAction({ filters }));\r\n };\r\n\r\n _onFilterClose = () => {\r\n this.setState({ focusOnFilterName: null });\r\n /* istanbul ignore else */\r\n if (typeof this.props.onFilterClose === \"function\")\r\n this.props.onFilterClose();\r\n };\r\n\r\n /* istanbul ignore next */ _requestShowFilter = (name) =>\r\n this.setState({\r\n focusOnFilterName: name,\r\n });\r\n\r\n /* istanbul ignore next */ _rowStartIndexUpdated = (rowStartIndex) =>\r\n this.setState({ rowStartIndex });\r\n\r\n _onContextClick = (\r\n e,\r\n rowIndex: number,\r\n columnIndex: number,\r\n itemUri: string\r\n ) => this.props.onMoreClick(e, itemUri, rowIndex, columnIndex);\r\n\r\n _isRowActive = (rowIndex: number, activeState: boolean): boolean => {\r\n return this.props.multiSelection?.multiple\r\n ? this.props.multiSelection?.isSelected(rowIndex)\r\n : activeState;\r\n };\r\n\r\n render() {\r\n const {\r\n status,\r\n showDocs,\r\n showFilter,\r\n renderFilter,\r\n result,\r\n hasFilter,\r\n layout,\r\n breadcrumbName,\r\n docListViewMode,\r\n } = this.props;\r\n if (showDocs) {\r\n return (\r\n \r\n \r\n\r\n {status === Constants.OK && result != null && (\r\n \r\n )}\r\n {status !== Constants.OK &&\r\n (result == null || result.totalCount === 0) && (\r\n \r\n )}\r\n {status === Constants.OK &&\r\n result != null &&\r\n result.totalCount === 0 && (\r\n \r\n )}\r\n {result != null && result.totalCount > 0 && (\r\n <>\r\n {(docListViewMode === ListViewMode.List ||\r\n docListViewMode ===\r\n ListViewMode.Thumbnails) && (\r\n \r\n {this.props.children}\r\n \r\n )}\r\n {docListViewMode === ListViewMode.Grid && (\r\n \r\n {this.props.children}\r\n \r\n )}\r\n \r\n )}\r\n \r\n );\r\n } else if (showFilter || this.state.focusOnFilterName != null) {\r\n if (\r\n status === Constants.OK &&\r\n result != null &&\r\n result.filters != null\r\n ) {\r\n return (\r\n \r\n );\r\n } else return ;\r\n } else\r\n return (\r\n this.props.children || (\r\n \r\n )\r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = /* istanbul ignore next */ (state, ownProps) => ({\r\n viewName: s.currentNameSelector(state), // state.current.name,\r\n breadcrumbName: s.breadcrumbNameSelector(\r\n state,\r\n s.currentNameSelector(state)\r\n ),\r\n status: s.docsStatusSelector(state),\r\n error: s.docsErrorSelector(state),\r\n docListViewMode: s.docListViewModeSelector(state),\r\n formatId: s.breadcrumbFormatIdSelector(state, s.currentNameSelector(state)),\r\n result: state.docs,\r\n pageNum: s.docsPageNumSelector(state),\r\n hasFilter: (s.docsLayoutFiltersSelector(state) || []).filter(\r\n (filter) => filter.values.filter((v) => v).length\r\n ).length,\r\n ...ownProps,\r\n});\r\n\r\nexport default compose(\r\n LayoutLoader,\r\n connect(mapStateToProps),\r\n GlobalEventsHandler({\r\n items: [ServerEventItemType.document],\r\n refreshMode: RefreshMode.Originator,\r\n refreshMessage: loc.t(\"globalEvents:refresh.doclist\"),\r\n }),\r\n UploadHandler(),\r\n withOfflineHandler\r\n)(DocListContainer);\r\n","//@flow\r\nimport React from \"react\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport CountBadge from \"components/CountBadge\";\r\nimport Dropdown from \"@hs/dropdown\";\r\nimport MenuItem from \"react-bootstrap/lib/MenuItem\";\r\nimport { getLocalizedText } from \"data/utils\";\r\nimport isEqual from \"lodash/isEqual\";\r\nimport styles from \"components/FilterBar/SearchBucket/SearchBucket.module.css\";\r\n\r\ntype Props = {\r\n multiple: boolean,\r\n activeRows: Array,\r\n disable: () => void,\r\n handleSelectAll: () => void,\r\n handleDeselectAll: () => void,\r\n handleInvert: () => void,\r\n};\r\n\r\nconst badge = {\r\n marginLeft: 3,\r\n};\r\n\r\nconst Bucket = ({\r\n multiple,\r\n activeRows,\r\n availableRows,\r\n enable,\r\n disable,\r\n handleSelectAll,\r\n handleDeselectAll,\r\n handleInvert,\r\n}: Props) =>\r\n multiple ? (\r\n \r\n \r\n \r\n {getLocalizedText(\"$multiselection:name\")}\r\n \r\n {Object.keys(activeRows).length > 0 && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n {getLocalizedText(\"$multiselection:disable\")}\r\n \r\n {!isEqual(activeRows, availableRows) && (\r\n \r\n {getLocalizedText(\"$multiselection:selectAll\")}\r\n \r\n )}\r\n {Object.keys(activeRows).length > 0 && (\r\n \r\n {getLocalizedText(\"$multiselection:deselectAll\")}\r\n \r\n )}\r\n \r\n {getLocalizedText(\"$multiselection:invert\")}\r\n \r\n \r\n \r\n ) : (\r\n \r\n \r\n {getLocalizedText(\"$multiselection:enable\")}\r\n \r\n \r\n );\r\nBucket.displayName = \"MultiSelection.Bucket\";\r\n\r\nexport default Bucket;\r\n","// @flow\r\nimport React, { useCallback } from \"react\";\r\n\r\ntype Props = {\r\n className: string,\r\n handleToggle: (index: number) => void,\r\n index: number,\r\n activeRows: Array,\r\n};\r\n\r\nconst style = {\r\n height: \"15px\",\r\n width: \"15px\",\r\n padding: 0,\r\n verticalAlign: \"top\",\r\n marginBottom: 0,\r\n marginLeft: 0,\r\n};\r\n\r\nconst input = {\r\n margin: 0,\r\n height: \"15px\",\r\n width: \"15px\",\r\n cursor: \"pointer\",\r\n};\r\n\r\nconst stopPropagation = (e) => {\r\n e.stopPropagation();\r\n};\r\n\r\nconst Checkbox = ({ className, handleToggle, index, isSelected }: Props) => {\r\n const handleChange = useCallback(\r\n (e) => {\r\n handleToggle(index);\r\n },\r\n [handleToggle, index]\r\n );\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nCheckbox.displayName = \"MultiSelection.Checkbox\";\r\n\r\nexport default Checkbox;\r\n","//@flow\r\nimport React, {\r\n useState,\r\n useCallback,\r\n useRef,\r\n useMemo,\r\n useEffect,\r\n} from \"react\";\r\nimport { getDisplayName } from \"data/constants\";\r\nimport { MultiSelectionContext } from \"data/context\";\r\nimport produce from \"immer\";\r\nimport Bucket from \"./Bucket\";\r\nimport Checkbox from \"./Checkbox\";\r\nimport {\r\n MultiSelectionActions,\r\n MultiSelectionHandlers,\r\n MultiSelectionContextProps,\r\n MultiSelectionProps,\r\n} from \"data/types\";\r\n\r\ntype Config = {\r\n delay: number,\r\n};\r\n\r\ntype Props = {};\r\n\r\n/* istanbul ignore next */\r\nconst isTouchEvent = (event) => {\r\n return \"touches\" in event;\r\n};\r\n\r\n/* istanbul ignore next */\r\nconst preventDefault = (event) => {\r\n if (!isTouchEvent(event)) return;\r\n\r\n if (event.touches.length < 2 && event.preventDefault) {\r\n event.preventDefault();\r\n }\r\n};\r\n\r\nconst withMultiSelection =\r\n ({ delay = 300 }: Config) =>\r\n (WrappedComponent: ComponentType) => {\r\n const HOC = (props: Props) => {\r\n const timeout = useRef();\r\n const target = useRef();\r\n const [multiple, setMultiple] = useState(false);\r\n const [activeRows, setActiveRows] = useState({});\r\n const [availableRows, setAvailableRows] = useState({});\r\n const enable = useCallback(() => {\r\n setMultiple(true);\r\n }, []);\r\n const disable = useCallback(() => {\r\n setMultiple(false);\r\n setActiveRows({});\r\n }, []);\r\n\r\n const isSelected = useCallback(\r\n (index) => activeRows.hasOwnProperty(index),\r\n [activeRows]\r\n );\r\n\r\n // Actions\r\n const handleAdd = useCallback(\r\n (id) =>\r\n setActiveRows((activeRows) =>\r\n produce(activeRows, (draft) => {\r\n /* istanbul ignore else */\r\n if (!draft.hasOwnProperty(id)) {\r\n draft[id] = availableRows[id];\r\n setMultiple(true);\r\n }\r\n })\r\n ),\r\n [availableRows]\r\n );\r\n const handleRemove = useCallback(\r\n (id) =>\r\n setActiveRows((activeRows) =>\r\n produce(activeRows, (draft) => {\r\n draft[id] = null;\r\n delete draft[id];\r\n Object.keys(draft).length === 0 &&\r\n setMultiple(false);\r\n })\r\n ),\r\n []\r\n );\r\n const handleToggle = useCallback(\r\n (id) =>\r\n setActiveRows((activeRows) =>\r\n produce(activeRows, (draft) => {\r\n if (draft.hasOwnProperty(id)) {\r\n draft[id] = null;\r\n delete draft[id];\r\n Object.keys(draft).length === 0 &&\r\n setMultiple(false);\r\n } else {\r\n draft[id] = availableRows[id];\r\n setMultiple(true);\r\n }\r\n })\r\n ),\r\n [availableRows]\r\n );\r\n const handleSelectAll = useCallback(\r\n () =>\r\n setActiveRows((activeRows) =>\r\n produce(activeRows, (draft) => {\r\n Object.keys(availableRows).forEach(\r\n /* istanbul ignore next */\r\n (id) => (draft[id] = availableRows[id])\r\n );\r\n })\r\n ),\r\n [availableRows]\r\n );\r\n const handleDeselectAll = useCallback(() => setActiveRows({}), []);\r\n const handleInvert = useCallback(\r\n () =>\r\n setActiveRows((activeRows) =>\r\n produce(activeRows, (draft) => {\r\n Object.keys(availableRows).forEach(\r\n /* istanbul ignore next */ (id) => {\r\n if (draft.hasOwnProperty(id)) {\r\n draft[id] = null;\r\n delete draft[id];\r\n } else {\r\n draft[id] = availableRows[id];\r\n }\r\n }\r\n );\r\n })\r\n ),\r\n [availableRows]\r\n );\r\n\r\n // Handle Longpress\r\n const on = useCallback((e) => {\r\n target.current = e.target;\r\n /* istanbul ignore else */\r\n if (target.current) {\r\n timeout.current = setTimeout(() => {\r\n setMultiple(true);\r\n e.target.addEventListener(\"touchend\", preventDefault, {\r\n passive: false,\r\n });\r\n }, delay);\r\n }\r\n }, []);\r\n\r\n const off = useCallback((e) => {\r\n timeout.current && clearTimeout(timeout.current);\r\n target.current &&\r\n target.current.removeEventListener(\r\n \"touchend\",\r\n preventDefault\r\n );\r\n }, []);\r\n\r\n const handler: MultiSelectionHandlers = useMemo(\r\n () => ({\r\n onTouchEnd: off,\r\n onTouchMove: off,\r\n onTouchStart: on,\r\n }),\r\n [on, off]\r\n );\r\n\r\n // Handle Esc\r\n const handleEsc = useCallback(\r\n (e: SyntheticKeyboardEvent<*>) => {\r\n /* istanbul ignore else */\r\n if (e.keyCode === 27) {\r\n e.preventDefault();\r\n disable();\r\n }\r\n },\r\n [disable]\r\n );\r\n useEffect(() => {\r\n window.document.addEventListener(\"keydown\", handleEsc);\r\n return () => {\r\n window.document.removeEventListener(\"keydown\", handleEsc);\r\n };\r\n }, [handleEsc]);\r\n\r\n // UI for multi selection\r\n const renderedBucket = useMemo(\r\n () => (\r\n \r\n ),\r\n [\r\n enable,\r\n disable,\r\n handleSelectAll,\r\n handleDeselectAll,\r\n handleInvert,\r\n activeRows,\r\n multiple,\r\n availableRows,\r\n ]\r\n );\r\n\r\n // UI for checkbox\r\n const renderCheckbox = useCallback(\r\n (index, className) => (\r\n \r\n ),\r\n [handleToggle, isSelected]\r\n );\r\n\r\n const actions: MultiSelectionActions = useMemo(\r\n () => ({\r\n handleAdd,\r\n handleRemove,\r\n handleToggle,\r\n handleSelectAll,\r\n handleDeselectAll,\r\n handleInvert,\r\n }),\r\n [\r\n handleAdd,\r\n handleRemove,\r\n handleToggle,\r\n handleSelectAll,\r\n handleDeselectAll,\r\n handleInvert,\r\n ]\r\n );\r\n\r\n const context: MultiSelectionContextProps = useMemo(\r\n () => ({\r\n handler,\r\n multiple,\r\n actions,\r\n isSelected,\r\n renderCheckbox,\r\n renderedBucket,\r\n }),\r\n [\r\n handler,\r\n multiple,\r\n actions,\r\n renderCheckbox,\r\n isSelected,\r\n renderedBucket,\r\n ]\r\n );\r\n\r\n const multiSelection: MultiSelectionProps = useMemo(\r\n () => ({\r\n actions,\r\n activeRows,\r\n availableRows,\r\n setAvailableRows,\r\n enable,\r\n disable,\r\n handler,\r\n multiple,\r\n isSelected,\r\n }),\r\n [\r\n handler,\r\n enable,\r\n disable,\r\n actions,\r\n activeRows,\r\n multiple,\r\n availableRows,\r\n isSelected,\r\n ]\r\n );\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n };\r\n HOC.displayName = `withMultiSelection(${getDisplayName(\r\n WrappedComponent\r\n )})`;\r\n return HOC;\r\n };\r\n\r\nexport default withMultiSelection;\r\n","// @flow\r\nimport React, { useCallback } from \"react\";\r\nimport { useEffectOnce } from \"hooks\";\r\nimport { getDisplayName } from \"data/constants\";\r\n\r\ntype Props = {\r\n /** callback when user pressed the left arrow */\r\n onPrev?: () => void,\r\n /** callback when user pressed the right arrow */\r\n onNext?: () => void,\r\n};\r\n\r\n/** used by ImageViewer/InlineViewer to intercept left/right keyboard commands */\r\nconst ViewerKeysHandler = (WrappedComponent: ReactClass): Node => {\r\n const HOC = (props: Props) => {\r\n const { onNext, onPrev } = props;\r\n if (typeof onNext !== \"function\" || typeof onPrev !== \"function\") {\r\n console.warn(\"Missing onNext/onPrev callback\");\r\n }\r\n const handleKeyDown = useCallback(\r\n (e) => {\r\n // #43374 arrow keys during DocForm editing\r\n if (\r\n e.target?.classList?.contains(\"form-control\") ||\r\n e.target?.tagName === \"INPUT\"\r\n )\r\n return;\r\n\r\n const keyCode = e.keyCode || e.which || e.charCode;\r\n switch (keyCode) {\r\n case 39: // key: →\r\n /* istanbul ignore else */\r\n if (typeof onNext === \"function\") {\r\n e.preventDefault();\r\n onNext();\r\n }\r\n break;\r\n case 37: // key: ←\r\n /* istanbul ignore else */\r\n if (typeof onPrev === \"function\") {\r\n e.preventDefault();\r\n onPrev();\r\n }\r\n break;\r\n /* istanbul ignore next */\r\n default:\r\n break;\r\n }\r\n },\r\n [onNext, onPrev]\r\n );\r\n\r\n useEffectOnce(() => {\r\n window.document.addEventListener(\"keydown\", handleKeyDown, false);\r\n return () => {\r\n window.document.removeEventListener(\r\n \"keydown\",\r\n handleKeyDown,\r\n false\r\n );\r\n };\r\n });\r\n return ;\r\n };\r\n HOC.displayName = `ViewerKeysHandler(${getDisplayName(WrappedComponent)})`;\r\n return HOC;\r\n};\r\n\r\nexport default ViewerKeysHandler;\r\n","// @flow\r\nimport React, { useState, useEffect } from \"react\";\r\nimport { useEffectOnce } from \"hooks\";\r\nimport { Location } from \"history\";\r\nimport queryString from \"data/queryString\";\r\nimport { fetchSearchSuggestion } from \"data/api\";\r\nimport {\r\n type ApiError,\r\n type SearchFilterDTO,\r\n SearchValueType,\r\n} from \"data/types\";\r\nimport Constants, { getDisplayName } from \"data/constants\";\r\nimport Status from \"components/Status\";\r\nimport PageStatus from \"components/PageStatus\";\r\nimport loc from \"i18next\";\r\n\r\ntype Props = {\r\n /** React-router history object */\r\n location: Location,\r\n /** Redux-state current itemUri */\r\n itemUri: string,\r\n};\r\n\r\ntype Config = {\r\n /** whether we expect a doc ItemUri */\r\n docSearchProvider: boolean,\r\n};\r\n\r\nexport const isSearchParam = (p: string): boolean => {\r\n if (p == null) return false;\r\n const pSplit = p.split(\".\");\r\n if (pSplit.length === 1) {\r\n if ([\"searchtext\", \"advancedsearchtext\"].includes(p)) return true;\r\n else return false;\r\n }\r\n return [\r\n \"leafnode\",\r\n \"doc\",\r\n \"item\",\r\n \"allnodes\",\r\n \"folder\",\r\n \"itemany\",\r\n ].includes(pSplit[0]);\r\n};\r\n\r\n/**\r\n * HOC to handle searching for an itemUri by fulltext search filters passed as URL query parameters,\r\n * will then pass the result itemUri\r\n * @param {ComponentType} WrappedComponent children to render\r\n */\r\nconst SuggestionHandler =\r\n ({ docSearchProvider = false }: Config) =>\r\n (WrappedComponent: ComponentType) => {\r\n const HOC = ({ location, ...props }: Props) => {\r\n const itemUriFromLocation =\r\n \"pam-item://\" + queryString.parse(location.search).uri;\r\n const [status, setStatus] = useState(Constants.LOADING);\r\n const [errorDetail, setErrorDetail] = useState(null);\r\n const [itemUri, setItemUri] = useState(null);\r\n useEffectOnce(() => {\r\n if (itemUriFromLocation !== \"pam-item://undefined\") {\r\n setStatus(Constants.OK);\r\n setItemUri(itemUriFromLocation);\r\n return;\r\n }\r\n const qs = queryString.parse(location.search);\r\n // any specific provider or use default\r\n let provider = \"\";\r\n /* istanbul ignore else */\r\n if (qs.p) {\r\n provider = qs.p;\r\n delete qs.p;\r\n }\r\n // remove secureParams\r\n /* istanbul ignore else */\r\n if (qs.sp) {\r\n delete qs.sp;\r\n }\r\n // anything else should be a suggestion filter (/parameter)\r\n const filters: Array = Object.keys(qs)\r\n .filter((p) => isSearchParam(p.toLowerCase()))\r\n .map((p) => ({\r\n name: p,\r\n value: qs[p],\r\n valueType: SearchValueType.NotSet,\r\n }));\r\n // should we return a Doc ItemUri or a Folder one?\r\n if (provider.length === 0 && docSearchProvider === true)\r\n provider = \"DocSearchProvider\";\r\n\r\n fetchSearchSuggestion(provider, filters)\r\n .catch((err: ApiError) => {\r\n if (\r\n err.data &&\r\n err.data.eventId &&\r\n err.data.eventId.id ===\r\n 1540 /*SEARCH_SUGGESTION_NOTFOUND*/\r\n ) {\r\n setStatus(Constants.ERROR);\r\n setErrorDetail(\r\n \"Not Found! Please contact your administrator.\"\r\n );\r\n }\r\n return null;\r\n })\r\n .then((itemUri) => {\r\n if (\r\n itemUri !== null &&\r\n String(itemUri).length > 0 &&\r\n String(itemUri).startsWith(\"pam-item://\")\r\n ) {\r\n setStatus(Constants.OK);\r\n setItemUri(itemUri);\r\n } else {\r\n setStatus(Constants.ERROR);\r\n }\r\n });\r\n });\r\n useEffect(() => {\r\n if (\r\n status === Constants.OK &&\r\n itemUri != null &&\r\n itemUriFromLocation !== \"pam-item://undefined\"\r\n ) {\r\n setItemUri(itemUriFromLocation);\r\n }\r\n }, [itemUriFromLocation, itemUri, status]);\r\n switch (status) {\r\n case Constants.OK:\r\n // passthrough overriding with our suggested itemUri\r\n return (\r\n \r\n );\r\n case Constants.ERROR:\r\n return errorDetail == null ? (\r\n \r\n ) : (\r\n \r\n );\r\n default:\r\n return (\r\n \r\n );\r\n }\r\n };\r\n HOC.displayName = `SuggestionHandler(${getDisplayName(\r\n WrappedComponent\r\n )})`;\r\n return HOC;\r\n };\r\n\r\nexport default SuggestionHandler;\r\n","//@flow\r\nimport React from \"react\";\r\nimport styles from \"./Error.module.css\";\r\n\r\ntype Props = {\r\n errorMessage: string,\r\n showValidationBelow: boolean,\r\n};\r\n\r\nexport default ({ errorMessage, showValidationBelow }: Props) => (\r\n <>\r\n \r\n {showValidationBelow && (\r\n

\r\n *{errorMessage}\r\n

\r\n )}\r\n \r\n);\r\n","// @flow\r\nimport React, { type Node } from \"react\";\r\nimport { connect } from \"react-redux\";\r\nimport { compose } from \"redux\";\r\nimport { withFormsy } from \"formsy-react\";\r\nimport FormGroup from \"react-bootstrap/lib/FormGroup\";\r\nimport AttributeLabel from \"components/ExtraAttributes/AttributeLabel.js\";\r\nimport Error from \"components/ExtraAttributes/Error.js\";\r\nimport styles from \"components/ExtraAttributes/AttributeLabel.module.css\";\r\n\r\nexport type FormsyEditorBaseDTO = {\r\n name: string,\r\n value: any,\r\n};\r\n\r\ntype Props = {\r\n /** class attribute for wrapper */\r\n baseClassName: string,\r\n /** label to display */\r\n header: string,\r\n /** unique field name */\r\n name: string,\r\n /** current field's value */\r\n value: string,\r\n /** React component to render after header before value */\r\n afterHeaderComponentClass?: Node,\r\n /** React component to render value */\r\n render: (value: any, changeValue: Function) => Node,\r\n /** Additional react component to render */\r\n additionalRender?: Node,\r\n /** Should Formsy Base render just the child? (No wrapping container) */\r\n isAdditionalRender: boolean,\r\n /** callback when value has been changed\r\n * @param {string} name field's name\r\n * @param {any} value new field's value\r\n */\r\n /** whether to render validation below */\r\n showValidationBelow: boolean,\r\n /** whether form field is required */\r\n isRequired: Boolean,\r\n onChange?: (name: string, value: any) => void,\r\n /** whether to show field's label */\r\n showLabel: boolean,\r\n /** withFormsy(): setValue */\r\n setValue: Function,\r\n /** withFormsy(): isValid */\r\n isValid: boolean,\r\n /** withFormsy(): errorMessage */\r\n errorMessage: ?string,\r\n /** callback when an attribute is edited\r\n * @param {string} name unique name of attribute being changed\r\n * @param {any} value new value\r\n */\r\n onChange: (name: string, value: any) => void,\r\n /** optional key to force refresh */\r\n loadIndex?: any,\r\n /** optional extras */\r\n extras?: any,\r\n};\r\n\r\ntype State = {\r\n /** whether form field is focused */\r\n focused: boolean,\r\n};\r\n\r\nexport class FormsyEditorBase extends React.Component {\r\n static defaultProps = {\r\n showLabel: true,\r\n isAdditionalRender: false,\r\n additionalRender: null,\r\n showValidationBelow: false,\r\n };\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n this.state = {\r\n focused: false,\r\n };\r\n }\r\n\r\n _changeValue = (value: any) => {\r\n this.props.setValue(value);\r\n /* istanbul ignore else */\r\n if (typeof this.props.onChange === \"function\") {\r\n this.props.onChange(this.props.name, value);\r\n }\r\n };\r\n\r\n changeValue = (\r\n changed: SyntheticInputEvent<*> | Array\r\n ) => {\r\n if (\r\n changed &&\r\n Object.prototype.hasOwnProperty.call(changed, \"currentTarget\")\r\n ) {\r\n this._changeValue(changed.currentTarget.value);\r\n } else if (changed && Array.isArray(changed) && changed.length > 0) {\r\n changed.forEach(({ name, value }) => {\r\n if (this.props.name === name) {\r\n this._changeValue(value, true); // HACK: if array of objects, assume lookup and force re-render #51586\r\n } else if (typeof this.props.onChange === \"function\") {\r\n this.props.onChange(name, value);\r\n } else {\r\n console.warn(`Cannot update ${this.props.name}`);\r\n }\r\n });\r\n } else {\r\n console.warn(\r\n `Unknown changed type, cannot update ${this.props.name}`\r\n );\r\n }\r\n };\r\n\r\n /* istanbul ignore next */ _onFocus = () =>\r\n this.setState({ focused: true });\r\n\r\n /* istanbul ignore next */ _onBlur = () => {\r\n this.setState({ focused: true });\r\n };\r\n\r\n _renderField = () => (\r\n <>\r\n {this.props.render(\r\n this.props.value,\r\n this.changeValue,\r\n this.props.isValid\r\n )}\r\n {!this.props.isValid && (\r\n \r\n )}\r\n \r\n );\r\n\r\n render() {\r\n if (this.props.isAdditionalRender) {\r\n return this._renderField();\r\n }\r\n // console.log(this.props.name, this.props);\r\n // console.log(`render ${this.props.name}`, this.props.getValue());\r\n return (\r\n \r\n {this.props.showLabel && (\r\n \r\n )}\r\n {typeof this.props.afterHeaderComponentClass === \"function\" &&\r\n this.props.afterHeaderComponentClass()}\r\n
\r\n {this._renderField()}\r\n {this.props.additionalRender}\r\n
\r\n \r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = /* istanbul ignore next */ (state, ownProps) => ({\r\n showValidationBelow: !state.browser.greaterThanOrEqual.medium,\r\n ...ownProps,\r\n});\r\n\r\nconst FormsyEditorBaseContainer = compose(\r\n withFormsy,\r\n connect(mapStateToProps, null, null, { forwardRef: true })\r\n)(FormsyEditorBase);\r\n\r\nexport default FormsyEditorBaseContainer;\r\n","import React, { useMemo, useCallback } from \"react\";\r\nimport { useEffectOnce, usePersistSetting } from \"hooks\";\r\nimport SearchInput from \"@hs/search-input\";\r\nimport loc from \"i18next\";\r\nimport ToggleButtonGroup from \"react-bootstrap/lib/ToggleButtonGroup\";\r\nimport ToggleButton from \"react-bootstrap/lib/ToggleButton\";\r\nimport Icons from \"@hs/icons\";\r\nimport styles from \"./TreeFilter.module.css\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport { useSelector } from \"react-redux\";\r\n\r\ntype Props = {\r\n /** current text filter */\r\n filter: string,\r\n /** whether to allow subfolders */\r\n allowSubfolders?: boolean,\r\n /** whether to include subfolders */\r\n includeSubfolders: boolean,\r\n /** callback when user changes filter and/or includeSubfolders */\r\n onChange: (filter: string, includeSubfolders: boolean) => void,\r\n};\r\n\r\nconst TreeFilter = ({\r\n filter,\r\n includeSubfolders,\r\n onChange,\r\n allowSubfolders = false,\r\n}: Props) => {\r\n const isOnline = useSelector(s.isOnlineSelector);\r\n const [persisted_includeSubfolders, persisted_setIncludeSubfolders] =\r\n usePersistSetting({\r\n name: \"treeFilter.includeSubfolders\",\r\n default: false,\r\n });\r\n\r\n // onMount make sure we use the persisted value\r\n useEffectOnce(() => {\r\n if (!isOnline) {\r\n onChange(filter, false);\r\n } else {\r\n if (includeSubfolders !== persisted_includeSubfolders) {\r\n onChange(filter, persisted_includeSubfolders);\r\n }\r\n }\r\n });\r\n\r\n const changeFilter = useCallback(\r\n (value: ?string) => onChange(value || \"\", includeSubfolders),\r\n [onChange, includeSubfolders]\r\n );\r\n\r\n const toggleSubfolders = useCallback(() => {\r\n persisted_setIncludeSubfolders(!includeSubfolders);\r\n onChange(filter, !includeSubfolders);\r\n }, [persisted_setIncludeSubfolders, onChange, includeSubfolders, filter]);\r\n\r\n const placeholderText = useMemo(\r\n () =>\r\n includeSubfolders\r\n ? loc.t(\"folder:treefilter.deep.text\")\r\n : loc.t(\"folder:treefilter.shallow.text\"),\r\n [includeSubfolders]\r\n );\r\n const toggleTitle = useMemo(\r\n () =>\r\n includeSubfolders\r\n ? loc.t(\"folder:treefilter.shallow.title\")\r\n : loc.t(\"folder:treefilter.deep.title\"),\r\n [includeSubfolders]\r\n );\r\n\r\n return (\r\n
\r\n {isOnline && allowSubfolders && (\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 TreeFilter;\r\n","// @flow\r\nimport React from \"react\";\r\nimport LinkViewerControl from \"./LinkViewerControl\";\r\n\r\ntype Props = {\r\n name: string,\r\n header?: string,\r\n value: ?string,\r\n width?: number,\r\n isGridCell: boolean,\r\n};\r\n\r\nconst EmailViewerControl = ({\r\n name,\r\n header,\r\n value,\r\n width,\r\n isGridCell,\r\n}: Props) => (\r\n \r\n);\r\nEmailViewerControl.displayName = \"EmailViewerControl\";\r\nexport default EmailViewerControl;\r\n","// @flow\r\nimport React from \"react\";\r\nimport LinkViewerControl from \"./LinkViewerControl\";\r\n\r\ntype Props = {\r\n name: string,\r\n header?: string,\r\n value: ?string,\r\n width?: number,\r\n isGridCell: boolean,\r\n};\r\n\r\nconst TelViewerControl = ({\r\n name,\r\n header,\r\n value,\r\n width,\r\n isGridCell,\r\n}: Props) => (\r\n \r\n);\r\nTelViewerControl.displayName = \"TelViewerControl\";\r\nexport default TelViewerControl;\r\n","import { useRef, useMemo } from \"react\";\r\nimport { useUnmount, usePostMessageHandler } from \"hooks\";\r\nimport { toastStyled, dismissToast, toastTypes, toastId } from \"data/toast\";\r\nimport { PdfSignatureAction } from \"hooks/PostMessage/Actions\";\r\nimport loc from \"i18next\";\r\n\r\n/**\r\n * handles messaging with pdfJs to alert user of invalidated PDF Signature\r\n */\r\nconst useHandleSignedPdf = () => {\r\n const toastRef = useRef(null);\r\n // register callback from pdf.js\r\n usePostMessageHandler(\r\n useMemo(\r\n () => ({\r\n [PdfSignatureAction]: () => {\r\n if (toastRef.current == null) {\r\n toastRef.current = toastStyled({\r\n ...toastTypes.pdfSignature,\r\n message: loc.t(\"docmodal:signedPdf\"),\r\n });\r\n }\r\n },\r\n }),\r\n []\r\n )\r\n );\r\n\r\n // dismiss Toast in case user just closed the DocViewer\r\n useUnmount(() => dismissToast(toastId.PdfJs));\r\n};\r\n\r\nexport default useHandleSignedPdf;\r\n","import { useCallback, useMemo } from \"react\";\r\nimport { usePostMessageHandler } from \"hooks\";\r\nimport doc_print from \"components/CommandActions/doc_print\";\r\nimport { PdfPrintAction } from \"hooks/PostMessage/Actions\";\r\n\r\n/**\r\n * handles messaging with pdfJs to toggle print dialog\r\n */\r\nconst useHandlePdfPrint = (target, triggerPrint) => {\r\n const handleTriggerPrint = useCallback(() => {\r\n if (target == null) {\r\n return;\r\n }\r\n new doc_print().execute({ target });\r\n }, [target]);\r\n usePostMessageHandler(\r\n useMemo(\r\n () => ({\r\n [PdfPrintAction]: handleTriggerPrint,\r\n }),\r\n [handleTriggerPrint]\r\n )\r\n );\r\n if (triggerPrint) {\r\n handleTriggerPrint();\r\n }\r\n};\r\n\r\nexport default useHandlePdfPrint;\r\n","// @flow\r\nimport { useMemo } from \"react\";\r\nimport { downloadDocToken } from \"data/api\";\r\nimport { userLanguage } from \"data/storeHelper\";\r\n\r\ntype Props = {\r\n /** document download token */\r\n token: string,\r\n /** whether document is a PDF file */\r\n isPdf: boolean,\r\n /**pdf.js: search terms */\r\n searchTerm: ?string,\r\n};\r\n\r\n/**\r\n * returns a full ViewerUrl including one-time-access download link\r\n * @param {*} { token, pdf, searchTerm }\r\n * @returns\r\n */\r\nconst useViewerUrl = ({ token, isPdf, searchTerm }: Props) => {\r\n // builds the one-time-download link\r\n const getDocUrl: string = useMemo(\r\n () =>\r\n downloadDocToken(\r\n token,\r\n !isPdf, //this.props.inline\r\n isPdf\r\n ),\r\n [token, isPdf]\r\n );\r\n\r\n // builds the full pdfJs viewer url\r\n const getViewerUrl: string = useMemo(\r\n () =>\r\n isPdf\r\n ? `${\r\n process.env.PUBLIC_URL || \"\"\r\n }/__pdfjs/web/viewer.html?file=${encodeURIComponent(\r\n getDocUrl\r\n )}#locale=${userLanguage()}${\r\n searchTerm != null ? `&search=${searchTerm}` : \"\"\r\n }`\r\n : getDocUrl,\r\n [isPdf, getDocUrl, searchTerm]\r\n );\r\n\r\n return getViewerUrl;\r\n};\r\n\r\nexport default useViewerUrl;\r\n","import { useCallback } from \"react\";\r\n/**\r\n * handles navigating between different documents using keyboard arrows\r\n *\r\n * @param {*} { _iframe, onNext, onPrev, onPdfReady }\r\n * @returns\r\n */\r\nconst usePdfArrowNavigation = ({ iframe, onNext, onPrev, onPdfReady }) => {\r\n // handle onPrev/onNext\r\n const onKeyDown = useCallback(\r\n (e: SyntheticKeyboardEvent<*>) => {\r\n const allowNav =\r\n !iframe.current.contentWindow.PDFViewerApplication.pdfViewer\r\n .isHorizontalScrollbarEnabled;\r\n switch (e.keyCode) {\r\n case 27: //Escape - close\r\n var event = document.createEvent(\"Event\");\r\n event.initEvent(\"keydown\", true, true);\r\n event.keyCode = 27;\r\n document.dispatchEvent(event);\r\n break;\r\n case 39: // right\r\n /* istanbul ignore else */\r\n if (\r\n iframe.current != null &&\r\n typeof onNext === \"function\" &&\r\n allowNav\r\n ) {\r\n onNext();\r\n }\r\n break;\r\n case 37: // left\r\n /* istanbul ignore else */\r\n if (\r\n iframe.current != null &&\r\n typeof onPrev === \"function\" &&\r\n allowNav\r\n ) {\r\n onPrev();\r\n }\r\n break;\r\n /* istanbul ignore next */\r\n default:\r\n break;\r\n }\r\n },\r\n [iframe, onNext, onPrev]\r\n );\r\n\r\n // once iframe loads register our events\r\n const onLoad = useCallback(() => {\r\n /* istanbul ignore else */\r\n if (iframe.current != null) {\r\n iframe.current.contentWindow.addEventListener(\"keydown\", onKeyDown);\r\n iframe.current.contentWindow.document.addEventListener(\r\n \"textlayerrendered\",\r\n onPdfReady,\r\n true\r\n );\r\n }\r\n }, [iframe, onPdfReady, onKeyDown]);\r\n\r\n return { onLoad };\r\n};\r\n\r\nexport default usePdfArrowNavigation;\r\n","// @flow\r\nimport React, { useRef, useCallback } from \"react\";\r\nimport { usePdfHighlight } from \"hooks\";\r\nimport useHandleSignedPdf from \"./HandleSignedPdf\";\r\nimport useHandlePdfPrint from \"./HandlePdfPrint\";\r\nimport useViewerUrl from \"./ViewerUrl\";\r\nimport usePdfArrowNavigation from \"./PdfArrowNavigation\";\r\n\r\ntype Props = {\r\n /** document download token */\r\n token: string,\r\n /** whether document is a PDF file */\r\n pdf: boolean,\r\n /** callback when user click on Prev */\r\n onPrev?: () => void,\r\n /** callback when user click on Next */\r\n onNext?: () => void,\r\n /**pdf.js: search terms */\r\n searchTerm?: string,\r\n /** pdf.js: whether trigger browser print */\r\n triggerPrint: boolean,\r\n};\r\n\r\nconst DocViewer = ({\r\n token,\r\n pdf,\r\n onPrev,\r\n onNext,\r\n searchTerm,\r\n triggerPrint,\r\n}: Props) => {\r\n const iframe = useRef(null);\r\n const [target, setTarget] = usePdfHighlight();\r\n useHandleSignedPdf();\r\n useHandlePdfPrint(target, triggerPrint);\r\n\r\n const viewerUrl = useViewerUrl({ token, isPdf: pdf, searchTerm });\r\n\r\n // setup pdfJs once ready\r\n const onPdfReady = useCallback(() => {\r\n /* istanbul ignore else */\r\n if (iframe.current != null) {\r\n setTarget(iframe.current.contentWindow);\r\n iframe.current.contentWindow.PDFViewerApplication.pdfViewer.focus();\r\n }\r\n }, [iframe, setTarget]);\r\n\r\n const { onLoad } = usePdfArrowNavigation({\r\n iframe,\r\n onNext,\r\n onPrev,\r\n onPdfReady,\r\n });\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default DocViewer;\r\n","// @flow\r\nimport React, { useCallback } from \"react\";\r\nimport { downloadDocUri } from \"data/api\";\r\nimport ViewerKeysHandler from \"containers/ViewerKeysHandler\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\nimport \"./index.css\";\r\n\r\nconst InlineViewer = ({\r\n itemUri,\r\n isDocDownloadAllowed,\r\n}: {\r\n itemUri: string,\r\n isDocDownloadAllowed: boolean,\r\n}) => {\r\n const handleClick = useCallback(\r\n (e) =>\r\n downloadDocUri(itemUri).then((uri) => {\r\n window.location.assign(uri);\r\n }),\r\n [itemUri]\r\n );\r\n return (\r\n
\r\n {loc.t(\"common:noviewer\")}\r\n {isDocDownloadAllowed && (\r\n <>\r\n
\r\n
\r\n \r\n
\r\n
\r\n {loc.t(\"common:download\")}\r\n
\r\n \r\n )}\r\n
\r\n );\r\n};\r\nInlineViewer.displayName = \"InlineViewer\";\r\nexport default ViewerKeysHandler(InlineViewer);\r\n","import React, { useState, useCallback, useContext, useMemo } from \"react\";\r\nimport { getDisplayName } from \"data/constants\";\r\nimport { ItemContext } from \"data/context\";\r\nimport { usePostMessageHandler } from \"hooks\";\r\nimport { HtmlViewerAction } from \"hooks/PostMessage/Actions\";\r\n\r\nconst withContinuousPreview = (WrappedComponent: ComponentType) => {\r\n const HOC = (props: Props) => {\r\n const { isContinuousPreview } = useContext(ItemContext) || {};\r\n\r\n const { onPrev, onNext } = props;\r\n\r\n const [atEnd, setAtEnd] = useState(false);\r\n\r\n const handlePrev = useCallback(\r\n (triggeredByHtmlViewer = false) => {\r\n /* istanbul ignore else */\r\n if (\r\n typeof onPrev === \"function\" &&\r\n (!triggeredByHtmlViewer || isContinuousPreview)\r\n )\r\n onPrev();\r\n setAtEnd(isContinuousPreview);\r\n },\r\n [isContinuousPreview, onPrev, setAtEnd]\r\n );\r\n\r\n const handleNext = useCallback(\r\n (triggeredByHtmlViewer = false) => {\r\n /* istanbul ignore else */\r\n if (\r\n typeof onNext === \"function\" &&\r\n (!triggeredByHtmlViewer || isContinuousPreview)\r\n )\r\n onNext();\r\n setAtEnd(false);\r\n },\r\n [onNext, setAtEnd, isContinuousPreview]\r\n );\r\n\r\n usePostMessageHandler(\r\n useMemo(\r\n () => ({\r\n [HtmlViewerAction.Top]: /* istanbul ignore next */ () =>\r\n handlePrev(true),\r\n [HtmlViewerAction.Bottom]: /* istanbul ignore next */ () =>\r\n handleNext(true),\r\n }),\r\n [handlePrev, handleNext]\r\n )\r\n );\r\n\r\n return (\r\n \r\n );\r\n };\r\n HOC.displayName = `withContinuousPreview(${getDisplayName(\r\n WrappedComponent\r\n )})`;\r\n return HOC;\r\n};\r\n\r\nexport default withContinuousPreview;\r\n","// @flow\r\nimport React, { useEffect, useState } from \"react\";\r\nimport { compose } from \"redux\";\r\nimport DocViewer from \"components/DocViewer\";\r\nimport InlineViewer from \"components/InlineViewer\";\r\nimport LoadingIframe from \"components/LoadingIframe\";\r\nimport { fetchDownloadToken } from \"data/api\";\r\nimport {\r\n LoadingType,\r\n ServerEventActionType,\r\n ServerEventItemType,\r\n ItemContextKey,\r\n} from \"data/types\";\r\nimport Status from \"components/Status\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport GlobalEventsHandler from \"containers/GlobalEventsHandler\";\r\nimport Loader from \"components/Loader\";\r\nimport withOfflineHandler from \"containers/OfflineHandler\";\r\nimport withItemContext from \"containers/ItemContext\";\r\nimport withContinuousPreview from \"containers/ContinuousPreview\";\r\n\r\n/* istanbul ignore next */\r\nconst MediaViewer = Loader(\r\n {\r\n loader: () =>\r\n import(\r\n \"components/MediaViewer\" /* webpackChunkName: \"component-MediaViewer\" */\r\n ),\r\n },\r\n LoadingType.Status\r\n);\r\n\r\n/* istanbul ignore next */\r\nconst ImageViewer = Loader(\r\n {\r\n loader: () =>\r\n import(\r\n \"components/ImageViewer\" /* webpackChunkName: \"component-ImageViewer\" */\r\n ),\r\n },\r\n LoadingType.Status\r\n);\r\n\r\n/* istanbul ignore next */\r\nconst HtmlViewer = Loader(\r\n {\r\n loader: () =>\r\n import(\r\n \"containers/HtmlViewer\" /* webpackChunkName: \"containers-HtmlViewer\" */\r\n ),\r\n },\r\n LoadingType.Status\r\n);\r\n\r\ntype Props = {\r\n /** current itemUri to display */\r\n itemUri?: ?string,\r\n /** callback when user clicks left arrow */\r\n onPrev?: () => void,\r\n /** callback when user clicks right arrow */\r\n onNext?: () => void,\r\n /** GlobalEventsHandler.refreshId */\r\n refreshId: number,\r\n /**pdf.js: search terms */\r\n searchTerm?: string,\r\n /** pdf.js: whether trigger browser print */\r\n triggerPrint: boolean,\r\n /** withContinuousPreview: whether to render html from top or not */\r\n atEnd: boolean,\r\n};\r\n\r\nexport const DocViewerContainer = ({\r\n itemUri,\r\n token: tokenFromProps,\r\n onPrev,\r\n onNext,\r\n refreshId,\r\n searchTerm,\r\n triggerPrint,\r\n offlineHandler,\r\n isPdf,\r\n hasPdf,\r\n canPdf,\r\n ext,\r\n name,\r\n isDocDownloadAllowed,\r\n customViewerUrl,\r\n atEnd,\r\n}: Props) => {\r\n const [status: ConstantsEnum, setStatus] = useState(\r\n tokenFromProps ? Constants.OK : Constants.LOADING\r\n );\r\n const [viewer: ?string, setViewer] = useState(null);\r\n const [token: ?string, setToken] = useState(tokenFromProps);\r\n const { factory: offlineHandlerFactory } = offlineHandler;\r\n\r\n useEffect(() => {\r\n if (itemUri == null || refreshId == null) return;\r\n setToken(null);\r\n setStatus(Constants.LOADING);\r\n (async () => {\r\n try {\r\n const token = await offlineHandlerFactory(fetchDownloadToken)(\r\n itemUri\r\n );\r\n setStatus(Constants.OK);\r\n setToken(token);\r\n } catch (e) {\r\n setStatus(Constants.ERROR);\r\n }\r\n })();\r\n }, [itemUri, refreshId, offlineHandlerFactory]);\r\n\r\n useEffect(() => {\r\n if (name == null) return;\r\n if (customViewerUrl != null) {\r\n setViewer(\"customViewerUrl\");\r\n return;\r\n }\r\n\r\n if (\r\n window.CONFIG.general.htmlViewerExtensions.includes(\r\n String(ext).toLowerCase()\r\n )\r\n ) {\r\n setViewer(\"html\");\r\n return;\r\n }\r\n // #42627 integrated image viewer\r\n if (\r\n window.CONFIG.general.imageViewerExtensions.includes(\r\n String(ext).toLowerCase()\r\n )\r\n ) {\r\n setViewer(\"image\");\r\n return;\r\n }\r\n\r\n if (\r\n window.CONFIG.general.mediaViewerExtensions.includes(\r\n String(ext).toLowerCase()\r\n )\r\n ) {\r\n setViewer(\"media\");\r\n return;\r\n }\r\n\r\n if (isPdf || hasPdf || canPdf) {\r\n setViewer(\"pdfJs\");\r\n return;\r\n }\r\n\r\n console.warn(`is/has/canPdf is false for ${name})`);\r\n setViewer(\"inline\");\r\n }, [name, isPdf, hasPdf, canPdf, ext, customViewerUrl]);\r\n if (token == null || viewer == null || status !== Constants.OK) {\r\n return ;\r\n }\r\n\r\n /* istanbul ignore next */\r\n switch (viewer) {\r\n case \"customViewerUrl\":\r\n return (\r\n \r\n );\r\n case \"image\":\r\n return (\r\n \r\n );\r\n case \"media\":\r\n return (\r\n \r\n );\r\n case \"html\":\r\n return (\r\n \r\n );\r\n case \"inline\":\r\n return (\r\n \r\n );\r\n case \"pdfJs\":\r\n return (\r\n \r\n );\r\n default:\r\n alert(`Unknown docViewer: ${window.CONFIG.general.docViewer} !`);\r\n return null;\r\n }\r\n};\r\n\r\nexport default compose(\r\n GlobalEventsHandler({\r\n actions: [\r\n ServerEventActionType.modify,\r\n ServerEventActionType.edit,\r\n ServerEventActionType.refresh,\r\n ],\r\n items: [ServerEventItemType.document],\r\n }),\r\n withOfflineHandler,\r\n withItemContext({\r\n asProps: [\r\n ItemContextKey.IsPdf,\r\n ItemContextKey.HasPdf,\r\n ItemContextKey.CanPdf,\r\n ItemContextKey.Extension,\r\n ItemContextKey.WebDavName,\r\n ItemContextKey.IsDocDownloadAllowed,\r\n ItemContextKey.ViewerUrl,\r\n ],\r\n }),\r\n withContinuousPreview\r\n)(DocViewerContainer);\r\n","// @flow\r\nimport React from \"react\";\r\nimport { useToggle } from \"hooks\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport Icons from \"@hs/icons\";\r\nimport { getClassNames } from \"data/utils\";\r\n\r\ntype Props = {\r\n /** title to show on hover */\r\n title: string,\r\n /** whether the narrow state is disabled */\r\n toggled: boolean,\r\n /** icon to show instead of components */\r\n icon: string,\r\n /** label to show next to icon */\r\n label: string,\r\n /** whether to render narrow layout (icon only, input on focus) */\r\n narrow: boolean,\r\n /** react component to render icon in, defaults to Bootstrap Button */\r\n Component: ?any,\r\n};\r\n\r\nconst NarrowToggle = ({\r\n className,\r\n title,\r\n toggled,\r\n icon,\r\n label,\r\n narrow,\r\n children,\r\n Component = Button,\r\n}: Props) => {\r\n const [isToggled, setIsToggled] = useToggle(toggled);\r\n return narrow && !isToggled ? (\r\n setIsToggled(true)}\r\n >\r\n {\" \"}\r\n {label}\r\n \r\n ) : (\r\n <>\r\n {children}\r\n {narrow && (\r\n setIsToggled(false)}\r\n >\r\n \r\n \r\n )}\r\n \r\n );\r\n};\r\n\r\nexport default NarrowToggle;\r\n","// @flow\r\nimport React from \"react\";\r\nimport Dropdown from \"@hs/dropdown\";\r\nimport MenuItem from \"react-bootstrap/lib/MenuItem\";\r\nimport SearchBucket from \"./SearchBucket\";\r\nimport loc from \"i18next\";\r\n// // import Icons from \"@hs/icons\";\r\n\r\ntype Props = {\r\n buckets: Array,\r\n onSelect: (name: string, value: Object) => void,\r\n isDisabled: boolean,\r\n};\r\n\r\nconst CombinedFiltersMenu = ({ buckets, onSelect, isDisabled }: Props) => {\r\n if (buckets.length === 0) return null;\r\n return (\r\n \r\n \r\n {loc.t(\"actionCategory:filter.name\")}\r\n \r\n \r\n {buckets.map((bucket, i) => (\r\n \r\n onSelect({\r\n name: bucket.name,\r\n value: null,\r\n })\r\n }\r\n >\r\n \r\n \r\n ))}\r\n \r\n \r\n );\r\n};\r\nCombinedFiltersMenu.displayName = \"FilterBar.CombinedFiltersMenu\";\r\n\r\nexport default CombinedFiltersMenu;\r\n","// @flow\r\nimport React, { useState, useEffect, useContext } from \"react\";\r\nimport { useToggle } from \"hooks\";\r\nimport { PaneSizeContext, MultiSelectionContext } from \"data/context\";\r\nimport {\r\n type SearchBucketDTO,\r\n type ListViewModeEnum,\r\n ListViewMode,\r\n} from \"data/types\";\r\nimport { connect } from \"react-redux\";\r\nimport ButtonToolbar from \"react-bootstrap/lib/ButtonToolbar\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport Icons from \"@hs/icons\";\r\nimport \"./index.css\";\r\nimport loc from \"i18next\";\r\nimport Measure from \"react-measure\";\r\nimport NarrowToggle from \"components/NarrowToggle\";\r\nimport SearchBucket from \"./SearchBucket\";\r\nimport CombinedFiltersMenu from \"./CombinedFiltersMenu\";\r\nimport ViewModes from \"./ViewModes\";\r\nimport SearchInput from \"@hs/search-input\";\r\nimport { getClassNames } from \"data/utils\";\r\n\r\ntype Props = {\r\n className?: string,\r\n /** list of filters (and if any possible values) to show */\r\n buckets: Array,\r\n /** callback when user selects a filter\r\n * @param {string} name field's common name\r\n * @param {Object} value the actual value selected\r\n */\r\n onSelect: ({\r\n name: string,\r\n value: Object,\r\n }) => void,\r\n /** current filterText value */\r\n filterText: ?string,\r\n /** callback when user wants to quickly filter by text */\r\n onFilterTextChange?: (value: ?string) => void,\r\n /** placeholder text to display on quick text filter */\r\n filterTextPlaceholder?: string,\r\n /** callback when user wants to clear/reset all filter values */\r\n onClear?: () => void,\r\n /** whether to show the clear/reset button */\r\n showClear?: boolean,\r\n /** current viewMode */\r\n viewMode: ListViewModeEnum,\r\n /** which view modes to show/allow */\r\n viewModes?: Array,\r\n /** callback when user changes viewMode\r\n * @param {ListViewModeEnum} viewMode the viewMode the user chose\r\n */\r\n onViewModeChange: (viewMode: ListViewModeEnum) => void,\r\n /** whether filter should be rendered */\r\n renderFilter: ?boolean,\r\n /** whether filter should be disabled */\r\n disableFilter: ?boolen,\r\n /** maxHeight allowed for FilteBar, before toggeling narrow mode, defaults to 41 pixels */\r\n maxHeight: ?number,\r\n};\r\n\r\nconst FilterBar = ({\r\n className,\r\n buckets,\r\n onSelect,\r\n onClear,\r\n showClear,\r\n filterText,\r\n onFilterTextChange,\r\n filterTextPlaceholder,\r\n viewMode = ListViewMode.List,\r\n viewModes,\r\n onViewModeChange,\r\n browser,\r\n renderFilter = true,\r\n disableFilter = false,\r\n maxHeight = 42,\r\n}: Props) => {\r\n // Fallback if context is not set.\r\n const dimensions = useContext(PaneSizeContext) || { width: 0, height: 0 };\r\n /* istanbul ignore next */\r\n const { multiple, renderedBucket } = useContext(MultiSelectionContext) || {\r\n multiple: false,\r\n renderedBucket: null,\r\n };\r\n const [height, setHeight] = useState(0);\r\n const [maxWidth, setMaxWidth] = useState(0);\r\n const [isNarrow, setIsNarrow] = useToggle(false);\r\n useEffect(() => {\r\n if (maxWidth > 0 && dimensions.width <= maxWidth) {\r\n // dimensions reach maxwidth\r\n setIsNarrow(true);\r\n } else if (maxWidth === 0 && height > maxHeight) {\r\n // onMeasure could have been called before dimensions where ready\r\n setIsNarrow(true);\r\n setMaxWidth(dimensions.width);\r\n } else if (!browser.greaterThanOrEqual.medium) {\r\n // mobile always render narrow\r\n setIsNarrow(true);\r\n } else {\r\n // default is not narrow\r\n setIsNarrow(false);\r\n }\r\n }, [\r\n browser.greaterThanOrEqual.medium,\r\n maxWidth,\r\n dimensions.width,\r\n height,\r\n maxHeight,\r\n setIsNarrow,\r\n ]);\r\n return (\r\n {\r\n if (measure.height > maxHeight) {\r\n setIsNarrow(true);\r\n setMaxWidth(dimensions.width);\r\n }\r\n setHeight(measure.height);\r\n }}\r\n >\r\n {({ measureRef }) => (\r\n \r\n \r\n {renderFilter && (\r\n <>\r\n {typeof onFilterTextChange === \"function\" && (\r\n \r\n )}\r\n \r\n \r\n item.visible !== false &&\r\n item.hideMenu === true &&\r\n item.selected.length === 0\r\n )}\r\n />\r\n {typeof onClear === \"function\" &&\r\n showClear === true && (\r\n \r\n \r\n \r\n )}\r\n {buckets\r\n .filter(\r\n (item) =>\r\n item.visible !== false &&\r\n (item.hideMenu !== true ||\r\n item.selected.length > 0)\r\n )\r\n .map((item, i) => (\r\n \r\n ))}\r\n {!disableFilter && renderedBucket}\r\n \r\n \r\n )}\r\n {viewModes && (\r\n \r\n )}\r\n \r\n \r\n )}\r\n \r\n );\r\n};\r\n\r\nFilterBar.displayName = \"FilterBar\";\r\n\r\nexport { FilterBar };\r\n\r\nconst mapStateToProps = /* istanbul ignore next */ (state, ownProps) => ({\r\n browser: state.browser,\r\n ...ownProps,\r\n});\r\n\r\nexport default connect(mapStateToProps)(FilterBar);\r\n","// @flow\r\nimport React, { useCallback, useMemo } from \"react\";\r\nimport Badge from \"react-bootstrap/lib/Badge\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\nimport Mark from \"@hs/mark\";\r\nimport { type TreeItemDTO } from \"data/types\";\r\nimport Tree from \"components/Tree\";\r\nimport styles from \"./FolderTree.module.css\";\r\nimport { BrowserDragLink } from \"components/ItemUriLink\";\r\nimport { getLocalizedText, isValidItemUri } from \"data/utils\";\r\nimport { getClassNames } from \"data/utils\";\r\n\r\ntype Props = {\r\n /** current node id to mark as active */\r\n activeTreeNodeId: number,\r\n /** tree items */\r\n tree: Array,\r\n /** callback when user clicks a tree item\r\n * @param {TreeItemDTO} treeItem tree item's object the user clicked\r\n * @param {SyntheticMouseEvent<*>} e HTML event object\r\n */\r\n onClick: (treeItem: TreeItemDTO, e: SyntheticMouseEvent<*>) => void,\r\n /** callback when user double-click a tree item\r\n * @param {TreeItemDTO} treeItem tree item's object the user clicked\r\n */\r\n onDoubleClick: (treeItem: TreeItemDTO) => void,\r\n /** callback when user expands a tree item\r\n * @param {TreeItemDTO} treeItem tree item's object the user clicked\r\n * @param {SyntheticMouseEvent<*>} e HTML event object\r\n */\r\n onExpand: (treeItem: TreeItemDTO, e: SyntheticMouseEvent<*>) => void,\r\n /** callback when user wants to load more results */\r\n onLoadMore: () => void,\r\n /** filter text currently applied */\r\n filter?: string,\r\n /** optional NoData Content Component */\r\n NoDataContent: Element,\r\n /** total number of results available */\r\n totalCount: number,\r\n /** whether list is currently focused\r\n * @default {boolean} true\r\n */\r\n focused?: boolean,\r\n};\r\n\r\nconst FolderTree = ({\r\n activeTreeNodeId,\r\n tree,\r\n onClick,\r\n onDoubleClick,\r\n onExpand,\r\n onLoadMore,\r\n filter,\r\n NoDataContent,\r\n totalCount,\r\n focused = true,\r\n}: Props) => {\r\n const _hasMore = useMemo(\r\n () => tree && totalCount > tree.length,\r\n [totalCount, tree]\r\n );\r\n\r\n const _renderRow = useCallback(\r\n ({\r\n key, // Unique key within array of rows\r\n index, // Index of row within collection\r\n isScrolling, // The List is currently being scrolled\r\n isVisible, // This row is visible within the List (eg it is not an overscanned row)\r\n style, // Style object to be applied to row (to position it)\r\n }: {\r\n key: number,\r\n index: number,\r\n isScrolling: boolean,\r\n isVisible: boolean,\r\n style: StyleSheet,\r\n }) => {\r\n if (_hasMore && index === tree.length) {\r\n return (\r\n \r\n {loc.t(\"folder:treefilter.loadmore\")}\r\n {\" \"}\r\n \r\n \r\n );\r\n }\r\n const treeItem = tree[index];\r\n /* istanbul ignore next */\r\n const localizedWebDavName = isValidItemUri(treeItem.itemUri)\r\n ? treeItem.webDavName\r\n : getLocalizedText(treeItem.webDavName);\r\n return (\r\n \r\n onDoubleClick(treeItem, e)\r\n }\r\n onClick={\r\n /* istanbul ignore next */ (e) => onClick(treeItem, e)\r\n }\r\n data-test=\"folderTreeRow\"\r\n >\r\n \r\n onExpand(treeItem, e)\r\n }\r\n >\r\n {treeItem.numberOfChildren > 0 && (\r\n \r\n )}\r\n {treeItem.numberOfChildren === 0 && (\r\n \r\n )}\r\n \r\n \r\n \r\n
\r\n \r\n {localizedWebDavName}\r\n \r\n {treeItem.numberOfChildren > 0 && (\r\n \r\n {loc.format(treeItem.numberOfChildren, \"pretty\")}\r\n \r\n )}\r\n \r\n );\r\n },\r\n [\r\n tree,\r\n onClick,\r\n onDoubleClick,\r\n onExpand,\r\n onLoadMore,\r\n filter,\r\n activeTreeNodeId,\r\n _hasMore,\r\n ]\r\n );\r\n\r\n const _getActiveTreeNodeIndex = useCallback(\r\n () =>\r\n tree ? tree.findIndex((row) => row.id === activeTreeNodeId) : -1,\r\n [tree, activeTreeNodeId]\r\n );\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default FolderTree;\r\n","// @flow\r\nimport React, { useState, useEffect, useCallback, type Element } from \"react\";\r\nimport { useSelector, useDispatch } from \"react-redux\";\r\nimport { compose } from \"redux\";\r\nimport FolderTree from \"components/FolderTree\";\r\nimport { isValidItemUri } from \"data/utils\";\r\nimport { getTreeAction, togglesUpdateCounterAction } from \"data/actions\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport {\r\n ServerEventActionType,\r\n ServerEventItemType,\r\n type TreeItemDTO,\r\n} from \"data/types\";\r\nimport Constants from \"data/constants\";\r\nimport Status from \"components/Status\";\r\nimport GlobalEventsHandler from \"containers/GlobalEventsHandler\";\r\nimport NoData from \"components/NoData\";\r\nimport loc from \"i18next\";\r\n\r\ntype Props = {\r\n /** current itemUri */\r\n itemUri: string,\r\n /** current selected tree node's id */\r\n activeTreeNodeId: number,\r\n /** text filtering */\r\n filter: ?string,\r\n /** whether to include subfolders when text filtering */\r\n includeSubfolders: boolean,\r\n /** callback when a tree item is clicked\r\n * @param {string} itemUri tree node's itemUri * @param {number} nodeId tree node's id\r\n */\r\n onClick: (itemUri: string, nodeId: number) => void,\r\n /** callback when a tree item is expanded\r\n * @param {string} itemUri tree node's itemUri\r\n */\r\n onExpand: (itemUri: string) => void,\r\n /** callback when tree is being scrolled */\r\n onScroll?: () => void,\r\n /** GlobalEventsHandler.refreshId */\r\n refreshId: number,\r\n /** optional NoData Content Component */\r\n NoDataContent: Element,\r\n /** whether list is currently focused\r\n * @default {boolean} true\r\n */\r\n focused?: boolean,\r\n};\r\n\r\nexport const FolderTreeContainer = ({\r\n itemUri,\r\n viewName = \"folder\",\r\n activeTreeNodeId,\r\n filter,\r\n includeSubfolders,\r\n onClick,\r\n onExpand,\r\n onScroll,\r\n refreshId,\r\n NoDataContent,\r\n focused = true,\r\n}: Props) => {\r\n const dispatch = useDispatch();\r\n // redux state\r\n const status = useSelector(s.treeStatusSelector);\r\n const error = useSelector(s.treeErrorSelector);\r\n const treeNodes = useSelector(s.treeNodesSelector);\r\n const totalCount = useSelector(s.treeTotalCountSelector);\r\n const isBrowsable = useSelector(s.treeIsBrowsableSelector);\r\n\r\n const [all, setAll] = useState(false);\r\n\r\n const _updateToggleCounter = useCallback(\r\n (count: number, loading?: boolean, status?: string): void =>\r\n dispatch(\r\n togglesUpdateCounterAction({\r\n name: viewName,\r\n counts: { tree: count },\r\n status: {\r\n tree: loading === true ? Constants.LOADING : status,\r\n },\r\n })\r\n ),\r\n [dispatch, viewName /*, treeNodes, totalCount, filter*/]\r\n );\r\n\r\n useEffect(() => {\r\n /* istanbul ignore else */\r\n if (itemUri && isValidItemUri(itemUri)) {\r\n // fetch results\r\n dispatch(\r\n getTreeAction({\r\n itemUri,\r\n filter,\r\n deep: includeSubfolders,\r\n all: false,\r\n })\r\n );\r\n setAll(false);\r\n }\r\n }, [\r\n dispatch,\r\n itemUri,\r\n filter,\r\n includeSubfolders,\r\n refreshId,\r\n _updateToggleCounter,\r\n ]);\r\n\r\n // update tree toggle:\r\n // show totalCount of results,\r\n // show if results are filtered,\r\n // show if there are more results available\r\n useEffect(() => {\r\n if (status === Constants.OK)\r\n _updateToggleCounter(\r\n totalCount,\r\n false,\r\n filter && String(filter).length > 0\r\n ? \"filter\"\r\n : treeNodes && treeNodes.length < totalCount\r\n ? \"step-forward\"\r\n : null\r\n );\r\n else if (status === Constants.LOADING)\r\n // start loading icon\r\n _updateToggleCounter(0, true);\r\n }, [_updateToggleCounter, totalCount, status, treeNodes, filter]);\r\n\r\n // user clicks a tree node\r\n const _onClick = useCallback(\r\n (treeNode: TreeItemDTO, e?: SyntheticMouseEvent<*>) => {\r\n /* istanbul ignore next */\r\n if (e) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n }\r\n onClick(treeNode.itemUri, treeNode.id);\r\n },\r\n [onClick]\r\n );\r\n\r\n // user expands a tree node\r\n const _onExpand = (treeNode: TreeItemDTO, e?: SyntheticMouseEvent<*>) => {\r\n /* istanbul ignore else */\r\n if (!isValidItemUri(treeNode.itemUri)) {\r\n return;\r\n }\r\n /* istanbul ignore next */\r\n if (e) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n }\r\n onExpand(treeNode.itemUri);\r\n };\r\n\r\n const _onLoadMore = useCallback(() => {\r\n // start loading icon\r\n _updateToggleCounter(0, true);\r\n // fetch results\r\n dispatch(\r\n getTreeAction({\r\n itemUri,\r\n filter,\r\n deep: includeSubfolders,\r\n all: true,\r\n })\r\n );\r\n setAll(true);\r\n }, [dispatch, _updateToggleCounter, itemUri, filter, includeSubfolders]);\r\n\r\n // #56492 Handle folders that are not on initial Tree payload\r\n useEffect(() => {\r\n if (\r\n filter ||\r\n !treeNodes ||\r\n treeNodes.length === 0 ||\r\n activeTreeNodeId == null ||\r\n treeNodes.some((node) => node.id === activeTreeNodeId)\r\n ) {\r\n return;\r\n }\r\n if (totalCount === treeNodes.length) {\r\n // Item does not exist (anymore), select first element\r\n onClick(treeNodes[0].itemUri, treeNodes[0].id);\r\n return;\r\n }\r\n if (!all) _onLoadMore();\r\n }, [\r\n _onLoadMore,\r\n totalCount,\r\n treeNodes,\r\n activeTreeNodeId,\r\n all,\r\n onClick,\r\n filter,\r\n ]);\r\n\r\n if (status !== Constants.OK) {\r\n return ;\r\n }\r\n\r\n // do not render further if this folder is non-browsable!\r\n if (isBrowsable === false) {\r\n return (\r\n \r\n
{loc.t(\"folder:nonBrowsable\")}
\r\n
\r\n );\r\n } else {\r\n return (\r\n \r\n );\r\n }\r\n};\r\n\r\nexport default compose(\r\n GlobalEventsHandler({\r\n actions: [\r\n ServerEventActionType.add,\r\n ServerEventActionType.modify,\r\n ServerEventActionType.refresh,\r\n ServerEventActionType.delete,\r\n ],\r\n items: [ServerEventItemType.folder],\r\n })\r\n)(FolderTreeContainer);\r\n","import { get, getDefaultsConfig } from \"data/constants\";\r\n\r\nexport const SupportGeoMapViewer = () =>\r\n get(window.CONFIG, [\"general\", \"geo\", \"map\", \"enabled\"], false) !== false;\r\n\r\nexport const getGeoMapViewerProvider = () =>\r\n get(window.CONFIG, [\"general\", \"geo\", \"map\"]);\r\n\r\nexport /** whether support for GeoCoding is enabled */ const SupportGeoPlaceInput = () =>\r\n get(window.CONFIG, [\"general\", \"geo\", \"places\", \"enabled\"], false) !==\r\n false;\r\n\r\nexport const getGeoPlacesProvider = () =>\r\n get(window.CONFIG, [\"general\", \"geo\", \"places\"]);\r\n\r\nexport /** whether support for editing a marker on a map is enabled */ const SupportGeoPointEdit = () =>\r\n get(window.CONFIG, [\"general\", \"geo\", \"pointEdit\", \"enabled\"], false) !==\r\n false;\r\n\r\nexport const getGeoPointProvider = () =>\r\n get(window.CONFIG, [\"general\", \"geo\", \"pointEdit\"]);\r\n\r\nexport /** whether support for editing radius on a map is enabled */ const SupportGeoRadiusEdit = () =>\r\n get(window.CONFIG, [\"general\", \"geo\", \"radius\", \"enabled\"], false) !==\r\n false;\r\n\r\nexport const getGeoRadiusProvider = () =>\r\n get(window.CONFIG, [\"general\", \"geo\", \"radius\"]);\r\n\r\nexport /** whether support for editing areas on a map is enabled */ const SupportGeoAreaEdit = () =>\r\n get(window.CONFIG, [\"general\", \"geo\", \"areaEdit\", \"enabled\"], false) !==\r\n false;\r\n\r\nexport const getGeoAreaProvider = () =>\r\n get(window.CONFIG, [\"general\", \"geo\", \"areaEdit\"]);\r\n\r\nexport const getGeoRasterProvider = (itemUri: string, formatId: number) => {\r\n const config = getDefaultsConfig(itemUri, formatId);\r\n return config ? config.map : null;\r\n};\r\n","// @flow\r\nimport { Plugin } from \"@uppy/core\";\r\n//import { type uppyFile } from \"data/uppy\";\r\nimport isEmpty from \"lodash/isEmpty\";\r\nimport parser from \"exif-parser\";\r\n\r\ntype uppyFileMetadata = {\r\n type: string,\r\n};\r\n\r\nexport type uppyFile = {\r\n id: string, // 'uppyteamkongjpg1501851828779'\r\n name: string, // 'nature.jpg'\r\n extension: string, // '.jpg'\r\n type: string, // 'image/jpeg'\r\n data: Object, // the Blob object\r\n size: number | string, // 3947642 (returns 'N/A' if size cannot be determined)\r\n preview: string, // value that can be used to populate \"src\" attribute of an \"img\" tag,\r\n meta: uppyFileMetadata,\r\n};\r\n\r\n/* istanbul ignore next */\r\nexport default class UppyExif extends Plugin {\r\n constructor(uppy: Object, opts: Object) {\r\n super(uppy, opts);\r\n this.uppy = uppy;\r\n this.type = \"exif\";\r\n this.id = \"Exif\";\r\n this.title = \"uppy-exif\";\r\n\r\n // set default options\r\n const defaultOptions = {\r\n prefix: \"exif_\",\r\n tags: [],\r\n };\r\n\r\n // merge default options with the ones set by user\r\n this.opts = Object.assign({}, defaultOptions, opts);\r\n }\r\n\r\n install() {\r\n this.uppy.log(\"[Exif] Installing UppyExif Plugin\");\r\n this.uppy.on(\"file-added\", this.extractExif);\r\n }\r\n\r\n uninstall() {\r\n this.uppy.log(\"[Exif] Removing UppyExif Plugin\");\r\n this.uppy.off(\"file-added\", this.extractExif);\r\n }\r\n\r\n extractExif = (file: uppyFile) => {\r\n // NOTE: EXIF only supported on jpeg files!\r\n if (file.meta.type !== \"image/jpeg\") {\r\n this.uppy.log(\r\n `[Exif] mime type: ${file.meta.type} does not support EXIF tags`\r\n );\r\n return;\r\n }\r\n\r\n this.uppy.log(`[Exif] Extracting tags from ${file.name}`);\r\n const reader = new FileReader();\r\n reader.addEventListener(\"loadend\", () => {\r\n // DONE?\r\n /* istanbul ignore else */\r\n if (reader.readyState === 2) {\r\n try {\r\n let buffer = parser.create(reader.result);\r\n // get Exif Tags\r\n const result = buffer.parse();\r\n const metadata = {};\r\n // any requested tags?\r\n if (this.opts.tags.length === 0) {\r\n // no, return them all\r\n Object.keys(result.tags).forEach((tagName) => {\r\n metadata[this.opts.prefix + tagName] =\r\n result.tags[tagName];\r\n });\r\n } else {\r\n // yes, return only those\r\n this.opts.tags.forEach((tagName) => {\r\n const tag = result.tags[tagName];\r\n /* istanbul ignore else */\r\n if (tag != null) {\r\n metadata[this.opts.prefix + tagName] = tag;\r\n }\r\n });\r\n }\r\n // any tags found?\r\n if (!isEmpty(metadata)) {\r\n this.uppy.setFileMeta(file.id, metadata);\r\n this.uppy.log(\r\n `[Exif] Found tags for ${file.name} and added to metadata with prefix: ${this.opts.prefix}`\r\n );\r\n } else {\r\n this.uppy.log(\r\n `[Exif] None of the requested tags found for ${file.name}`\r\n );\r\n }\r\n } catch (err) {\r\n // console.log(err);\r\n // got invalid data, handle error\r\n this.uppy.log(\r\n `[Exif] Cannot analyse tags for ${file.name}`,\r\n err.message\r\n );\r\n }\r\n } else {\r\n this.uppy.log(\r\n `[Exif] Cannot load file ${file.name}: ${reader.error.message}`\r\n );\r\n }\r\n });\r\n\r\n // convert from Blob to ArrayBuffer\r\n reader.readAsArrayBuffer(file.data);\r\n };\r\n}\r\n","// @flow\r\nimport Uppy from \"@uppy/core\";\r\nimport \"@uppy/core/dist/style.css\";\r\nimport Tus from \"@uppy/tus\";\r\nimport Webcam from \"@uppy/webcam\";\r\nimport \"@uppy/webcam/dist/style.css\";\r\nimport ThumbnailGenerator from \"@uppy/thumbnail-generator\";\r\nimport GoldenRetriever from \"@uppy/golden-retriever\";\r\nimport { accessToken, userLanguage, correlationId } from \"data/storeHelper\";\r\nimport uppyRedux from \"@uppy/store-redux\";\r\nimport store from \"data/store\";\r\nimport isEmpty from \"lodash/isEmpty\";\r\nimport UppyExif from \"components/uppy-exif\";\r\nimport UppyMsg from \"@hs/uppy-msg\";\r\nimport UppyLexmark from \"@wegener-it/uppy-plugin-lexmark\";\r\nimport UppyRestrictions from \"components/uppy-restrictions\";\r\nimport { isFeatureOn, Feature, get, isMiniView } from \"data/constants\";\r\nimport { CustomHttpHeader } from \"data/types\";\r\nimport { JL } from \"data/logging\";\r\nimport { isOnline } from \"data/storeHelper\";\r\nimport { OfflineQueueItemType } from \"data/types\";\r\nimport {\r\n addToOfflineQueue,\r\n anyPendingChanges,\r\n} from \"data/offline/offlineQueue\";\r\nimport { postMessageTo } from \"hooks/PostMessage/Utils\";\r\nimport { ModalAction } from \"hooks/PostMessage/Actions\";\r\nimport { toastStyled, toastTypes } from \"data/toast\";\r\nimport loc from \"i18next\";\r\n\r\nconst DEFAULT_UPPY_ID = \"upload\";\r\n\r\nexport type uppyFile = {\r\n id: string, // 'uppyteamkongjpg1501851828779'\r\n name: string, // 'nature.jpg'\r\n extension: string, // '.jpg'\r\n type: string, // 'image/jpeg'\r\n data: Object, // the Blob object\r\n size: number | string, // 3947642 (returns 'N/A' if size cannot be determined)\r\n preview: string, // value that can be used to populate \"src\" attribute of an \"img\" tag\r\n};\r\n\r\nexport const uppyPendingUploadsCountSelector = (\r\n state: Object,\r\n id: string /* istanbul ignore next */ = DEFAULT_UPPY_ID\r\n) => {\r\n let pendingCount = 0;\r\n if (\r\n state &&\r\n state.uppy &&\r\n state.uppy[id] &&\r\n state.uppy[id].files &&\r\n !isEmpty(state.uppy[id].files)\r\n ) {\r\n Object.keys(state.uppy[id].files).forEach((fileId) => {\r\n const file = state.uppy[id].files[fileId];\r\n if (file.progress.uploadComplete !== true) {\r\n pendingCount++;\r\n }\r\n });\r\n }\r\n return pendingCount;\r\n};\r\n\r\nexport const uppyHasPendingUploadsSelector = (\r\n state: Object,\r\n id: string = DEFAULT_UPPY_ID\r\n) => uppyPendingUploadsCountSelector(state, id) > 0;\r\n\r\nexport const uppyIsResumingUploadsSelector = (\r\n state: Object,\r\n id: string = DEFAULT_UPPY_ID\r\n) =>\r\n state &&\r\n state.uppy &&\r\n state.uppy[id] &&\r\n state.uppy[id].currentUploads &&\r\n !isEmpty(state.uppy[id].currentUploads);\r\n\r\n// returns metadata of queued pending files (not uploaded nor started)\r\nexport const uppyPendingFilesMetaSelector = (\r\n state: Object,\r\n id: string = DEFAULT_UPPY_ID\r\n) => {\r\n if (\r\n state &&\r\n state.uppy &&\r\n state.uppy[id] &&\r\n state.uppy[id].files &&\r\n !isEmpty(state.uppy[id].files)\r\n ) {\r\n let result = [];\r\n Object.keys(state.uppy[id].files).forEach((fileId) => {\r\n const file = state.uppy[id].files[fileId];\r\n if (\r\n file.progress.uploadStarted === null &&\r\n file.progress.uploadComplete === false\r\n ) {\r\n result.push(\r\n Object.assign(\r\n {},\r\n { id: file.id, preview: file.preview },\r\n file.meta\r\n )\r\n );\r\n }\r\n });\r\n return result;\r\n } else {\r\n return null;\r\n }\r\n};\r\n\r\n/* istanbul ignore next */\r\nexport const getUppyLocale = async () => {\r\n const locale = mapToUppyLocale[userLanguage()] || \"en_US\";\r\n const i18n = await import(\r\n `__i18n/uppy/${locale}` /* webpackChunkName: \"uppy-[request]\" */\r\n );\r\n return {\r\n locale,\r\n i18n,\r\n };\r\n};\r\n\r\nexport const mapToUppyLocale: Object = {\r\n bg: \"bg_BG\",\r\n cs: \"cs_CZ\",\r\n de: \"de_DE\",\r\n \"de-AT\": \"de_DE\",\r\n \"de-CH\": \"de_DE\",\r\n \"de-DE\": \"de_DE\",\r\n en: \"en_US\",\r\n \"en-GB\": \"en_US\",\r\n \"en-US\": \"en_US\",\r\n es: \"es_ES\",\r\n fr: \"fr_FR\",\r\n hr: \"hr_HR\",\r\n hu: \"hu_HU\",\r\n it: \"it_IT\",\r\n ru: \"ru_RU\",\r\n sk: \"sk_SK\",\r\n sl: \"sl_SL\",\r\n uk: \"ru_RU\", //\"uk_UA\", //NOT SUPPORTED\r\n lt: \"en_US\", //\"lt_LT\", //NOT SUPPORTED\r\n};\r\n\r\nexport const createUppy = ({\r\n id = DEFAULT_UPPY_ID,\r\n maxNumberOfFiles,\r\n maxFileSize,\r\n allowedFileTypes,\r\n deniedFileTypes,\r\n metadata,\r\n}: {\r\n id?: string,\r\n maxNumberOfFiles?: number,\r\n maxFileSize?: number,\r\n allowedFileTypes?: Array,\r\n deniedFileTypes?: Array,\r\n metadata?: Object,\r\n}) =>\r\n new Uppy({\r\n store: uppyRedux({\r\n store,\r\n id,\r\n }),\r\n autoProceed: false,\r\n restrictions: {\r\n maxNumberOfFiles,\r\n maxFileSize,\r\n allowedFileTypes,\r\n deniedFileTypes, // custom option handled by our own components/uppy-restrictions\r\n },\r\n meta: metadata,\r\n allowMultipleUploads: false,\r\n debug:\r\n process.env.NODE_ENV !== \"production\" /* istanbul ignore next */ ||\r\n get(window.CONFIG, [\"general\", \"browserLoggingLevel\"], 4000) < 3000,\r\n logger: JL(\"Uppy\"),\r\n });\r\n\r\n// #48012: Load uppy plugins when token is available\r\nexport const addUppyPlugins = (_uppy = uppy) => {\r\n const headers = {\r\n [CustomHttpHeader.CorrelationId]: correlationId(),\r\n [CustomHttpHeader.SecureParams]: get(\r\n window.CONFIG,\r\n [\"general\", \"secure_params\"],\r\n undefined\r\n ),\r\n [CustomHttpHeader.MiniView]: /* istanbul ignore next */ isMiniView(\r\n window.location\r\n )\r\n ? \"1\"\r\n : \"0\",\r\n };\r\n /* istanbul ignore next */\r\n if (get(window.CONFIG, [\"auth\", \"useCustomAuthHeader\"], false)) {\r\n headers[\"X-inPoint-Auth\"] = accessToken();\r\n } else {\r\n headers.authorization = `Bearer ${accessToken()}`;\r\n }\r\n /* istanbul ignore next */\r\n if (!_uppy.getPlugin(\"Tus\")) {\r\n _uppy = _uppy.use(Tus, {\r\n endpoint:\r\n (window.CONFIG.host.bridge || window.CONFIG.host.basename) +\r\n \"/__up\",\r\n withCredentials: true,\r\n headers,\r\n resume: false,\r\n autoRetry: true,\r\n chunkSize: 10000000, // 10mb limit imposed by Azure otherwise HTTP 413: https://uppy.io/docs/tus/#chunkSize-Infinity\r\n limit: 1, //only one concurrent upload at a time - to avoid filename collisions\r\n retryDelays: [0, 1000, 3000, 5000],\r\n removeFingerprintOnSuccess: true,\r\n });\r\n }\r\n /* istanbul ignore next */\r\n try {\r\n if (!_uppy.getPlugin(\"Webcam\")) {\r\n _uppy = _uppy.use(Webcam, {\r\n facingMode: \"environment\",\r\n countdown: false,\r\n modes: [\"video-audio\", \"video-only\", \"audio-only\", \"picture\"],\r\n mirror: false,\r\n title: \"Camera\",\r\n });\r\n }\r\n } catch (e) {\r\n _uppy.log(\"[Webcam] Cannot load Plugin...\");\r\n }\r\n /* istanbul ignore next */\r\n if (!_uppy.getPlugin(\"Lexmark\") && isFeatureOn(Feature.uppyLexmark)) {\r\n const { UppyLexmark: Lexmark } = UppyLexmark;\r\n _uppy = _uppy.use(Lexmark, {\r\n id: \"Lexmark\",\r\n });\r\n }\r\n /* istanbul ignore next */\r\n if (!_uppy.getPlugin(\"ThumbnailGenerator\")) {\r\n _uppy = _uppy.use(ThumbnailGenerator, { thumbnailWidth: 280 });\r\n }\r\n /* istanbul ignore next */\r\n try {\r\n if (!_uppy.getPlugin(\"GoldenRetriever\") && window.localStorage) {\r\n // NOTE: https://github.com/transloadit/uppy/pull/268\r\n // GoldenRetriever restores ALL files from ANY queue (uppy.id)\r\n _uppy = _uppy\r\n // only now (after Thumbnail-generator has been registered) include Golden-Retriever!\r\n .use(GoldenRetriever, { serviceWorker: true });\r\n }\r\n } catch (e) {\r\n if (e instanceof DOMException && e.name === \"SecurityError\")\r\n console.error(\r\n \"Cannot load Uppy Plugin GoldenRetriever (disabled Local Storage)\"\r\n );\r\n }\r\n /* istanbul ignore next */\r\n if (!_uppy.getPlugin(\"Exif\")) {\r\n _uppy = _uppy.use(UppyExif, {\r\n tags: [\"GPSLatitude\", \"GPSLongitude\", \"GPSDOP\", \"Orientation\"],\r\n });\r\n }\r\n /* istanbul ignore next */\r\n if (!_uppy.getPlugin(\"Msg\")) {\r\n _uppy = _uppy.use(UppyMsg, {\r\n tags: [\"senderName\", \"senderEmail\", \"senderDomain\", \"subject\"],\r\n });\r\n }\r\n /* istanbul ignore next */\r\n if (!_uppy.getPlugin(\"Restrictions\")) {\r\n _uppy = _uppy.use(UppyRestrictions, {});\r\n }\r\n\r\n // standard upload-error handling (including offline queueing)\r\n _uppy.on(\"upload-error\", (file: uppyFile, error: any) => {\r\n console.warn(\"[Uppy] upload-error\", file, error);\r\n // upload completely started offline?\r\n // otherwise let Uppy's GolderRetriever plugin take care of it\r\n if (\r\n error &&\r\n error.isNetworkError &&\r\n !isOnline() &&\r\n file &&\r\n file.progress &&\r\n file.progress.uploadStarted === null &&\r\n file.progress.uploadComplete === false\r\n ) {\r\n const key = file.meta.itemUri + \"_\" + file.id; // to identify pending changes on target folder\r\n anyPendingChanges(key).then((exists) => {\r\n if (!exists) {\r\n addToOfflineQueue({\r\n type: OfflineQueueItemType.UppyFile,\r\n key,\r\n name: file.name,\r\n params: file,\r\n }).then(() => {\r\n _uppy.removeFile(file.id);\r\n postMessageTo(ModalAction.Close);\r\n toastStyled(toastTypes.swOfflineQueueAddFile);\r\n });\r\n }\r\n });\r\n } else {\r\n toastStyled({\r\n ...toastTypes.uppyError,\r\n message: loc.t(\"upload:error\", { file: file.name }),\r\n });\r\n }\r\n });\r\n\r\n return _uppy;\r\n};\r\n\r\nexport type UppyEvent = {\r\n type: string,\r\n callback: Function,\r\n};\r\n\r\nexport const addUppyEvents = (events: Array, _uppy = uppy) => {\r\n events.forEach((event) => _uppy.on(event.type, event.callback));\r\n return _uppy;\r\n};\r\n\r\nexport const removeUppyEvents = (events: Array, _uppy = uppy) => {\r\n events.forEach((event) => _uppy.off(event.type, event.callback));\r\n return _uppy;\r\n};\r\n\r\n/** our global uppy handler instance */\r\nconst uppy = createUppy({});\r\nexport default uppy;\r\n","// @flow\r\nimport React from \"react\";\r\nimport Modal, { ModalSize } from \"components/Modal\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport { createModal } from \"react-modal-promise\";\r\nimport styles from \"./ConfirmModal.module.css\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\n\r\ntype Props = {\r\n /** react-modal-promise: whether to show dialog */\r\n open: boolean,\r\n /** react-modal-promise: callback when user closes Dialog */\r\n close: () => void,\r\n /** text to show in Confirm button */\r\n confirmButton?: string,\r\n /** confirm button bsStyle\r\n * @default {string} danger\r\n */\r\n confirmStyle?: string,\r\n /** text to show in Cancel button */\r\n cancelButton?: string,\r\n /** Modal Dialog title */\r\n title?: string,\r\n /** text to show in body of Modal dialog */\r\n body: string,\r\n /** FontAwesome icon to show above title\r\n * @default {string} \"exclamation-triangle\"\r\n */\r\n icon: ?string,\r\n /** whether escape closes the window calling close(false) */\r\n requireSelection?: boolean,\r\n};\r\n\r\n/** presents a Confirm dialog to the user\r\n * @returns {boolean} true if user confirmed, null/undefined otherwise\r\n */\r\nexport const ConfirmModal = ({\r\n open,\r\n close,\r\n body,\r\n confirmButton = loc.t(\"common:confirm.yes\"),\r\n confirmStyle = \"danger\",\r\n cancelButton = loc.t(\"common:confirm.cancel\"),\r\n title = loc.t(\"common:confirm.title\"),\r\n icon = \"exclamation-triangle\",\r\n requireSelection = false,\r\n}: Props) => (\r\n \r\n requireSelection !== true && close(false)\r\n }\r\n dialogClassName={styles.modal}\r\n dataTest=\"confirmModal\"\r\n >\r\n {title && (\r\n \r\n {icon && (\r\n \r\n )}\r\n {title}\r\n \r\n )}\r\n \r\n

{body}

\r\n
\r\n \r\n close(true)}\r\n data-test=\"confirmModalConfirmButton\"\r\n >\r\n {confirmButton}\r\n \r\n close(false)}\r\n data-test=\"confirmModalCancelButton\"\r\n >\r\n {cancelButton}\r\n \r\n \r\n \r\n);\r\nConfirmModal.displayName = \"ConfirmModal\";\r\nexport const openConfirmModal = createModal(ConfirmModal);\r\n","import { getDefaultsConfig } from \"data/constants\";\r\nimport immutable from \"object-path-immutable\";\r\nimport {\r\n type DocListFilterRequestDTO,\r\n DocListFilterOperators,\r\n type DocListFilterOperatorsEnum,\r\n DocListColumnType,\r\n type DocListColumnTypeEnum,\r\n type DocColumnResultDTO,\r\n type DocListLayout,\r\n} from \"data/types\";\r\nimport { getValue } from \"data/utils\";\r\n\r\nexport function GetDefaults(\r\n itemUri: string,\r\n formatId: number,\r\n cols?: Array\r\n): DocListLayout {\r\n const defaults = getDefaultsConfig(itemUri, formatId);\r\n if (defaults != null && defaults.filters != null) {\r\n let filters: Array = [];\r\n for (let i = 0, len = defaults.filters.length; i < len; i++) {\r\n const filterDef = defaults.filters[i];\r\n filters.push(Object.assign({}, filterDef, {}));\r\n }\r\n return { filters, sorts: defaults.sorts };\r\n }\r\n if (cols != null)\r\n return {\r\n filters: GetDefaultFilters(cols),\r\n sorts: [],\r\n };\r\n return { filters: [], sorts: [] };\r\n}\r\n\r\n// creates the filters array for first use\r\nexport function GetDefaultFilters(\r\n cols: Array\r\n): Array {\r\n let filters: Array = [];\r\n\r\n for (let i = 0, len = cols.length; i < len; i++) {\r\n filters.push({\r\n operator: GetDefaultOperatorForType(cols[i].type),\r\n name: cols[i].name,\r\n values: [\"\"],\r\n });\r\n }\r\n return filters;\r\n}\r\n\r\nexport function GetDefaultOperatorForType(\r\n type: DocListColumnTypeEnum\r\n): DocListFilterOperatorsEnum {\r\n switch (type) {\r\n case DocListColumnType.BooleanValue:\r\n return DocListFilterOperators.None;\r\n case DocListColumnType.StringValue:\r\n case DocListColumnType.WebDavName:\r\n return DocListFilterOperators.Contains;\r\n case DocListColumnType.DateTimeValue:\r\n return DocListFilterOperators.DateRelative;\r\n default:\r\n return DocListFilterOperators.Equals;\r\n }\r\n}\r\n\r\n// returns the filters with cleared values\r\nexport function ResetFilters(\r\n itemUri: string,\r\n formatId: number,\r\n filters?: Array,\r\n cols?: Array\r\n): ?Array {\r\n // none yet? return default list\r\n if (filters == null || filters.length === 0) {\r\n return GetDefaults(itemUri, formatId, cols).filters;\r\n }\r\n\r\n // reset values ONLY (operators stay as they are)\r\n // TODO should actually re-use docListFilter/resetValues()\r\n return filters.map((filter) => immutable.set(filter, \"values\", [\"\"]));\r\n}\r\n\r\nexport const IsFiltered = (filters: ?Array): boolean =>\r\n filters &&\r\n filters.some(\r\n (f) => f.values && f.values.length > 0 && String(f.values[0]).length > 0\r\n );\r\n\r\nexport const GetFilterValueAsString = (\r\n value: string | (SummaryAttributeValue & { value: string }) = \"\"\r\n): string => {\r\n // Handle Objects with prop rawValue or value\r\n const v = getValue(value, \"rawValue\");\r\n // Handle non-string values\r\n return typeof v === \"string\" ? v : \"\";\r\n};\r\n","const actions = {\r\n TOGGLES_PERSIST: \"toggles/PERSIST\",\r\n TOGGLES_CHANGE: \"toggles/CHANGE\",\r\n TOGGLES_UPDATECOUNTER: \"toggles/UPDATECOUNTER\",\r\n\r\n USER_FETCH_REQUESTED: \"user/FETCH_REQUESTED\",\r\n USER_FETCH_RESULT: \"user/FETCH_RESULT\",\r\n\r\n USER_SITES_RESULT: \"user/SITES_RESULT\",\r\n\r\n LOGIN_RESULT: \"login/RESULT\",\r\n LOGIN_SIGNOUT: \"login/SIGNOUT\",\r\n\r\n FAVORITES_FETCH_REQUEST: \"favorites/FETCH_REQUEST\",\r\n FAVORITES_FETCH_RESULT: \"favorites/FETCH_RESULT\",\r\n\r\n CARDS_FETCH_REQUESTED: \"cards/FETCH_REQUESTED\",\r\n CARDS_FETCH_RESULT: \"cards/FETCH_RESULT\",\r\n CARDS_FETCH_ENTITY_REQUESTED: \"cards/FETCH_ENTITY_REQUESTED\",\r\n CARDS_FETCH_ENTITY_RESULT: \"cards/FETCH_ENTITY_RESULT\",\r\n\r\n WF_FETCH_REQUESTED: \"wf/FETCH_REQUEST\",\r\n WF_FETCH_RESULT: \"wf/FETCH_RESULT\",\r\n\r\n WF_PROVIDERS_FETCH_REQUESTED: \"wf_providers/FETCH_REQUEST\",\r\n WF_PROVIDERS_FETCH_RESULT: \"wf_providers/FETCH_RESULT\",\r\n\r\n TREE_SET_STATUS: \"tree/SET_STATUS\",\r\n TREE_FETCH_REQUEST: \"tree/FETCH_REQUEST\",\r\n TREE_FETCH_RESULT: \"tree/FETCH_RESULT\",\r\n\r\n DOCS_FETCH_REQUEST: \"docs/FETCH_REQUEST\",\r\n DOCS_FETCH_RESULT: \"docs/FETCH_RESULT\",\r\n DOCS_EXPORT_CSV: \"docs/EXPORT_CSV\",\r\n\r\n DOCS_LAYOUT_REQUEST: \"docs/LAYOUT_REQUEST\",\r\n DOCS_LAYOUT_SET: \"docs/LAYOUT_SET\",\r\n\r\n DOCS_FILTERS_RESET: \"docs/FILTER_RESET\",\r\n DOCS_FILTERS_SETBYREF: \"docs/FILTER_SETBYREF\",\r\n DOCS_FILTERS_SETBYNAME: \"docs/FILTER_SETBYNAME\",\r\n DOCS_FILTERTEXT_SET: \"docs/FILTERTEXT\",\r\n\r\n DOCS_THUMBNAIL_REQUEST: \"docs/THUMBNAIL_REQUEST\",\r\n DOCS_THUMBNAIL_RESULT: \"docs/THUMBNAIL_RESULT\",\r\n\r\n SEARCH_RESET: \"search/RESET\",\r\n SEARCH_FETCH_REQUEST: \"search/FETCH_REQUEST\",\r\n SEARCH_FETCH_RESULT: \"search/FETCH_RESULT\",\r\n SEARCH_FAVRENAME_REQUEST: \"search/FAVRENAME_REQUEST\",\r\n SEARCH_FAVRENAME_RESULT: \"search/FAVRENAME_RESULT\",\r\n SEARCH_ITEM_SAVE: \"search/ITEM_SAVE\",\r\n SEARCH_COUNT_REQUEST: \"search/AGGR_REQUEST\",\r\n SEARCH_COUNT_RESULT: \"search/AGGR_RESULT\",\r\n\r\n SEARCH_FORM_FETCH_REQUEST: \"search/FORM_FETCH_REQUEST\",\r\n SEARCH_FORM_FETCH_RESULT: \"search/FORM_FETCH_RESULT\",\r\n SEARCH_FORM_CHANGES: \"search/FORM_CHANGES\",\r\n SEARCH_FORM_RESET: \"search/FORM_RESET\",\r\n\r\n SEARCH_FORM_LIST_FETCH_REQUEST: \"search/FORM_LIST_FETCH_REQUEST\",\r\n SEARCH_FORM_LIST_FETCH_RESULT: \"search/FORM_LIST_FETCH_RESULT\",\r\n\r\n SPLITPANES_PERSIST: \"splitPanes/PERSIST\",\r\n SPLITPANES_SET: \"splitPanes/SET\",\r\n\r\n SETTINGS_SIDEBAR_MINI: \"settings/SIDEBAR_MINI\",\r\n SETTINGS_DOCLIST_VIEWMODE: \"settings/DOCLIST_VIEWMODE\",\r\n SETTINGS_SET: \"settings/SET\",\r\n\r\n GLOBALDEFAULTSEARCH_FETCH_REQUEST: \"globalDefaultSearch/FETCH_REQUEST\",\r\n GLOBALDEFAULTSEARCH_FETCH_RESULT: \"globalDefaultSearch/FETCH_RESULT\",\r\n\r\n CURRENT_BREADCRUMB: \"current/BREADCRUMB\",\r\n\r\n CURRENTITEM_SET: \"currentItem/SET\",\r\n CURRENTITEM_BAK: \"currentItem/BACKUP\",\r\n CURRENTITEM_RESTORE: \"currentItem/RESTORE\",\r\n CURRENTITEM_SAVE: \"currentItem/SAVE\",\r\n CURRENTITEM_LOADED: \"currentItem/LOADED\",\r\n\r\n EA_CLEAR: \"EA/CLEAR\",\r\n EA_DETAILVIEW_SET: \"EA/DETAILVIEW_SET\",\r\n EA_GRID_CURRENTROW: \"EA/GRID_CURRENTROW\",\r\n EA_FIELD_SET: \"EA/FIELD_SET\",\r\n EA_AUDITLOG_UPDATE: \"EA/AUDITLOG_UPDATE\",\r\n EA_AUDITLOG_CLEAR: \"EA/AUDITLOG_CLEAR\",\r\n EA_AUDITLOG_INSERT: \"EA/AUDITLOG_INSERT\",\r\n EA_AUDITLOG_DEL: \"EA/AUDITLOG_DEL\",\r\n EA_TABINDEX_SET: \"EA/TABINDEX_SET\",\r\n FORM_DEFAULTS_SET: \"form/DEFAULTS_SET\",\r\n FORM_EDITMODE_SET: \"form/EDITMODE_SET\",\r\n\r\n GLOBALEVENTS_SERVER: \"GLOBALEVENTS/SERVER\",\r\n\r\n OFFLINE_SYNC_REQUEST: \"offline/SYNC_REQUEST\",\r\n OFFLINE_SYNC_STARTED: \"offline/SYNC_STARTED\",\r\n OFFLINE_SYNC_DONE: \"offline/SYNC_DONE\",\r\n OFFLINE_SYNC_UPDATE: \"offline/SYNC_UPDATE\",\r\n OFFLINEITEM_SYNC_STATUS: \"offlineItem/STATUS\",\r\n OFFLINEITEM_REMOVE: \"offlineItem/REMOVE\",\r\n OFFLINEITEM_DEPSMAP_REQUEST: \"offlineItem/DEPSMAP_REQUEST\",\r\n OFFLINEITEM_DEPSMAP_RESULT: \"offlineItem/DEPSMAP_RESULT\",\r\n // EVENT_REFRESH_TASKS: \"EVENT/REFRESH_TASKS\" source: client/server, lastUpdateDate:xxx\r\n\r\n SW_INIT: \"sw/INIT\",\r\n SW_UPDATE: \"sw/UPDATE\",\r\n\r\n NOTIFICATION_TOAST: \"notification/TOAST\",\r\n NOTIFICATION_UPSERT: \"notification/UPSERT\",\r\n NOTIFICATION_DEL: \"notification/DEL\",\r\n NOTIFICATION_CLEAR: \"notification/CLEAR\",\r\n NOTIFICATION_STATUS: \"notification/STATUS\",\r\n\r\n COMMANDACTION_REQUEST: \"commandAction/REQUEST\",\r\n COMMANDACTION_QUEUE_ADD: \"commandAction/QUEUE_ADD\",\r\n COMMANDACTION_QUEUE_REMOVE: \"commandAction/QUEUE_REMOVE\",\r\n COMMANDACTION_QUEUE_START: \"commandAction/QUEUE_START\",\r\n COMMANDACTION_QUEUE_PAUSE: \"commandAction/QUEUE_PAUSE\",\r\n COMMANDACTION_ABORT: \"commandAction/ABORT\",\r\n COMMANDACTION_REMOVE: \"commandAction/REMOVE\",\r\n COMMANDACTION_LOG: \"commandAction/LOG\",\r\n COMMANDACTION_STATUS: \"commandAction/STATUS\",\r\n COMMANDACTION_ITEM_STATUS: \"commandAction/ITEM_STATUS\",\r\n\r\n PERSIST_PURGE: \"persist/PURGE\",\r\n};\r\nexport default actions;\r\n","// @flow\r\nimport React from \"react\";\r\nimport Badge from \"react-bootstrap/lib/Badge\";\r\nimport loc from \"i18next\";\r\n\r\ntype Props = {\r\n /** CSS class to apply */\r\n className?: string,\r\n /** number to show (null or <0 will not render) */\r\n count?: number,\r\n /** title to show, defaults to count */\r\n title?: string,\r\n};\r\n\r\n// https://stackoverflow.com/questions/2685911/is-there-a-way-to-round-numbers-into-a-reader-friendly-format-e-g-1-1k\r\nfunction abbrNum(number, decPlaces) {\r\n // 2 decimal places => 100, 3 => 1000, etc\r\n decPlaces = Math.pow(10, decPlaces);\r\n\r\n // Enumerate number abbreviations\r\n var abbrev = [\"k\", \"m\", \"b\", \"t\"];\r\n\r\n // Go through the array backwards, so we do the largest first\r\n for (var i = abbrev.length - 1; i >= 0; i--) {\r\n // Convert array index to \"1000\", \"1000000\", etc\r\n var size = Math.pow(10, (i + 1) * 3);\r\n\r\n // If the number is bigger or equal do the abbreviation\r\n if (size <= number) {\r\n // Here, we multiply by decPlaces, round, and then divide by decPlaces.\r\n // This gives us nice rounding to a particular decimal place.\r\n number = Math.round((number * decPlaces) / size) / decPlaces;\r\n\r\n // Handle special case where we round up to the next abbreviation\r\n /* istanbul ignore next */\r\n if (number === 1000 && i < abbrev.length - 1) {\r\n number = 1;\r\n i++;\r\n }\r\n\r\n // Add the letter for the abbreviation\r\n number = loc.format(number, \"pretty\") + abbrev[i];\r\n\r\n // We are done... stop\r\n break;\r\n }\r\n }\r\n\r\n return number;\r\n}\r\n\r\n/** renders a normalized localized count number in a Badge */\r\nconst CountBadge = ({ className, count, title }: Props) => {\r\n if (count == null || count < 0) return null;\r\n return (\r\n \r\n {abbrNum(count, 1)}\r\n \r\n );\r\n};\r\nCountBadge.displayName = \"CountBadge\";\r\nexport default CountBadge;\r\n","// @flow\r\nimport React, { useRef, useEffect, type Element } from \"react\";\r\nimport ListGroup from \"react-bootstrap/lib/ListGroup\";\r\nimport List from \"react-virtualized/dist/commonjs/List\";\r\nimport \"react-virtualized/styles.css\"; // only needs to be imported once\r\nimport Measure from \"react-measure\";\r\nimport NoData from \"components/NoData\";\r\nimport { getClassNames } from \"data/utils\";\r\nimport styles from \"./Tree.module.css\";\r\n\r\ntype Props = {\r\n /** function called to render one item\r\n * @param {string} key Unique key within array of rows\r\n * @param {number} index Index of row within collection\r\n * @param {boolean} isScrolling The List is currently being scrolled\r\n * @param {boolean} isVisible This row is visible within the List (eg it is not an overscanned row)\r\n * @param {CSStyle} style Style object to be applied to row (to position it)\r\n */\r\n renderRow: (\r\n key: string,\r\n index: number,\r\n isScrolling: boolean,\r\n isVisible: boolean,\r\n style: CSSStyle\r\n ) => React.Node,\r\n /** current node index to scroll to */\r\n scrollToIndex: number,\r\n /** current node id to mark as active */\r\n activeTreeNodeId: number,\r\n /** total number items to render */\r\n totalItems: number,\r\n /** callback when user scrolls the tree */\r\n onScroll: () => void,\r\n /** localization context (e.g. for nodata) */\r\n locContext: string,\r\n /** optional NoData Content Component */\r\n NoDataContent: Element,\r\n /** filter text currently applied */\r\n filter?: string,\r\n /** optional classname to apply to root ListGroup */\r\n className?: string,\r\n};\r\n\r\nconst Tree = ({\r\n renderRow,\r\n scrollToIndex,\r\n activeTreeNodeId,\r\n totalItems,\r\n onScroll,\r\n locContext,\r\n NoDataContent,\r\n filter,\r\n className,\r\n}: Props) => {\r\n const list: List = useRef(null); // internal ref to rendered virtualized List Component\r\n\r\n useEffect(() => {\r\n /* istanbul ignore next */ list.current &&\r\n list.current.forceUpdateGrid();\r\n }, [activeTreeNodeId, filter]);\r\n\r\n if (totalItems === 0)\r\n return (\r\n \r\n {NoDataContent && }\r\n \r\n );\r\n\r\n return (\r\n \r\n {\r\n /* istanbul ignore next */ (dimensions) => (\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 Tree;\r\n","import React from \"react\";\r\nimport { useLocalStore } from \"hooks\";\r\nimport { Provider } from \"react-redux\";\r\nimport { getDisplayName } from \"data/constants\";\r\n\r\ntype Props = {\r\n name?: string,\r\n childres?: any,\r\n};\r\n\r\nconst LocalStore = ({ name = \"LocalStore\", children }: Props) => {\r\n const localStore = useLocalStore(name);\r\n return {children};\r\n};\r\n\r\ntype Config = {\r\n name?: string,\r\n};\r\n\r\nexport const LocalStoreHandler = ({\r\n name = \"LocalStore\",\r\n}: Config = {}): Node => (WrappedComponent: ReactClass) => {\r\n const HOC = (props) => (\r\n \r\n \r\n \r\n );\r\n HOC.displayName = `LocalStoreHandler(${getDisplayName(WrappedComponent)})`;\r\n return HOC;\r\n};\r\n\r\nexport default LocalStore;\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"row\":\"RowResult_row__2wnkq\",\"multi\":\"RowResult_multi__Xisw1\",\"checkbox\":\"RowResult_checkbox__3t--4\",\"active\":\"RowResult_active__bg-6W\",\"hovered\":\"RowResult_hovered__3P9Sl\",\"bc\":\"RowResult_bc__3DMv6\",\"article\":\"RowResult_article__fMUtY\",\"header\":\"RowResult_header__1YNyV\",\"icon\":\"RowResult_icon__15Eyg\",\"footer\":\"RowResult_footer__3m6Qz\"};","// @flow\r\nimport React from \"react\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport ButtonGroup from \"react-bootstrap/lib/ButtonGroup\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\n\r\nexport const PrevDocButton = ({\r\n onClick,\r\n disabled,\r\n}: {\r\n onClick: Function,\r\n disabled: boolean,\r\n}) => (\r\n \r\n \r\n \r\n);\r\n\r\nexport const NextDocButton = ({\r\n onClick,\r\n disabled,\r\n}: {\r\n onClick: Function,\r\n disabled: boolean,\r\n}) => (\r\n \r\n \r\n \r\n);\r\n\r\nconst TopRowExtras = ({\r\n onNext,\r\n nextDisabled,\r\n onPrev,\r\n prevDisabled,\r\n onFullscreen,\r\n}: {\r\n onNext: Function,\r\n nextDisabled: boolean,\r\n onPrev: Function,\r\n prevDisabled: boolean,\r\n onFullscreen: Function,\r\n}) => (\r\n \r\n \r\n \r\n \r\n);\r\nexport default TopRowExtras;\r\n","// @flow\r\nimport React, { useContext, useMemo } from \"react\";\r\nimport AttributeLabel from \"components/ExtraAttributes/AttributeLabel\";\r\nimport MapButton from \"components/MapButton\";\r\nimport ViewerControlBase from \"components/ExtraAttributes/ViewerControl/ViewerControlBase\";\r\nimport { type MarkerDTO } from \"data/types\";\r\nimport { PaneSizeContext, LabelSizeContext } from \"data/context\";\r\n\r\ntype Props = {\r\n /** Common Name */\r\n name: string,\r\n /** Display Name*/\r\n header?: string,\r\n /** Coordinates for Geo Area/Point */\r\n value: any | string,\r\n /** optional width of button */\r\n width?: number,\r\n /** optional (custom) location marker icon */\r\n marker?: MarkerDTO,\r\n};\r\n\r\nconst LocationViewerControl = ({\r\n name,\r\n header,\r\n value,\r\n width,\r\n marker,\r\n}: Props) => {\r\n const { width: maxWidth } = useContext(PaneSizeContext);\r\n const labelWidth = useContext(LabelSizeContext);\r\n // $FlowFixMe\r\n const style: CSSStyleDeclaration = useMemo(() => {\r\n const style: CSSStyleDeclaration = {\r\n flexShrink: 1,\r\n };\r\n if (width && width > 0) style.width = width + \"px\";\r\n else style.minWidth = \"100px\";\r\n return style;\r\n }, [width]);\r\n\r\n const margins = 45;\r\n const labelMargins = 15;\r\n const wrapperStyle: CSSStyleDeclaration = useMemo(\r\n () => ({\r\n display: \"flex\",\r\n justifyContent: \"space-between\",\r\n maxWidth: maxWidth - labelWidth - margins - labelMargins,\r\n }),\r\n [maxWidth, labelWidth, margins, labelMargins]\r\n );\r\n\r\n return (\r\n \r\n \r\n {String(value || \"\").length > 0 ? (\r\n
\r\n \r\n {value}\r\n \r\n\r\n \r\n
\r\n ) : (\r\n

\r\n )}\r\n \r\n );\r\n};\r\n\r\nLocationViewerControl.displayName = \"LocationViewerControl\";\r\nexport default LocationViewerControl;\r\n","// @flow\r\nimport React, { useContext, useMemo } from \"react\";\r\nimport AttributeLabel from \"components/ExtraAttributes/AttributeLabel\";\r\nimport MapButton from \"components/MapButton\";\r\nimport ViewerControlBase from \"components/ExtraAttributes/ViewerControl/ViewerControlBase\";\r\nimport { PaneSizeContext, LabelSizeContext } from \"data/context\";\r\nimport { type MarkerDTO } from \"data/types\";\r\n\r\ntype Props = {\r\n itemUri: string,\r\n formatId: number,\r\n name: string,\r\n header?: string,\r\n value: any | string,\r\n width?: number,\r\n /** optional (custom) location marker icon */\r\n marker?: MarkerDTO,\r\n};\r\n\r\nconst GeoRasterViewerControl = ({\r\n itemUri,\r\n formatId,\r\n name,\r\n header,\r\n value,\r\n width,\r\n marker,\r\n}: Props) => {\r\n const { width: maxWidth } = useContext(PaneSizeContext);\r\n const labelWidth = useContext(LabelSizeContext);\r\n // $FlowFixMe\r\n const style: CSSStyleDeclaration = useMemo(() => {\r\n const style: CSSStyleDeclaration = {\r\n flexShrink: 1,\r\n };\r\n if (width && width > 0) style.width = width + \"px\";\r\n else style.minWidth = \"100px\";\r\n return style;\r\n }, [width]);\r\n\r\n const margins = 45;\r\n const labelMargins = 15;\r\n const wrapperStyle: CSSStyleDeclaration = useMemo(\r\n () => ({\r\n display: \"flex\",\r\n justifyContent: \"space-between\",\r\n maxWidth: maxWidth - labelWidth - margins - labelMargins,\r\n }),\r\n [maxWidth, labelWidth, margins, labelMargins]\r\n );\r\n\r\n return (\r\n \r\n \r\n

\r\n \r\n {value}\r\n \r\n {value && String(value).length > 0 && (\r\n \r\n )}\r\n
\r\n
\r\n );\r\n};\r\n\r\nGeoRasterViewerControl.displayName = \"GeoRasterViewerControl\";\r\nexport default GeoRasterViewerControl;\r\n","/* istanbul ignore file */\r\n\r\nimport Loader from \"components/Loader\";\r\nimport { LoadingType } from \"data/types\";\r\n\r\nexport default Loader(\r\n {\r\n loader: () =>\r\n import(\r\n \"./GeoPointEditorControl\" /* webpackChunkName: \"component-GeoPointEditorControl\" */\r\n ),\r\n },\r\n LoadingType.Status\r\n);\r\n","// @flow\r\nimport React from \"react\";\r\nimport GeoPointInput from \"components/GeoPointInput\";\r\nimport DropdownButton from \"react-bootstrap/lib/DropdownButton\";\r\nimport InputGroup from \"react-bootstrap/lib/InputGroup\";\r\nimport MenuItem from \"react-bootstrap/lib/MenuItem\";\r\nimport Icons from \"@hs/icons\";\r\nimport styles from \"./GeoRadiusInput.module.css\";\r\nimport {\r\n ParseLocation,\r\n LocationToString,\r\n ParseRadius,\r\n RadiusToString,\r\n} from \"components/MapViewer/utils\";\r\nimport SettingValue, { type SettingValueProps } from \"containers/SettingValue\";\r\nimport loc from \"i18next\";\r\nimport { type Location, type MapEditLocationResult } from \"data/types\";\r\n\r\ntype Props = {\r\n /** displayName of field */\r\n label: ?string,\r\n /** location:radius in string format */\r\n value: string,\r\n /** callback when user sets location\r\n * @param {string} locationWithRadius new location in string format\r\n */\r\n onChange: (locationWithRadius: string) => void,\r\n /** callback when user sets location by map\r\n * @param {string} locationWithRadius string format of location:radius\r\n */\r\n onManualLocation: (locationWithRadius: string) => void,\r\n /** persisted search radius */\r\n radius: SettingValueProps,\r\n /** placeholder text to display when @see {value} is empty */\r\n placeholder?: string,\r\n};\r\n\r\ntype State = {\r\n location: ?Location,\r\n radius: number,\r\n};\r\n\r\nexport class GeoRadiusInput extends React.PureComponent {\r\n constructor(props: Props) {\r\n super(props);\r\n this.state = this._parseFromString(props.value, props.radius.value);\r\n }\r\n\r\n _parseFromString = (\r\n value: string,\r\n radiusIn: ?number\r\n ): { location: string, radius: number } => {\r\n const locRadius = ParseRadius(value);\r\n return {\r\n location: locRadius.location,\r\n radius: locRadius.radius || radiusIn || 500,\r\n };\r\n };\r\n\r\n UNSAFE_componentWillReceiveProps(nextProps: Props) {\r\n /* istanbul ignore else */\r\n if (this.props.value !== nextProps.value) {\r\n this.setState(\r\n this._parseFromString(nextProps.value, nextProps.radius.value)\r\n );\r\n }\r\n }\r\n\r\n _displayUnit = (meter: number) =>\r\n meter < 1000 ? `${meter}m` : `${(meter / 1000).toFixed(0)} km`;\r\n\r\n _fireChangedValue = () =>\r\n this.props.onChange(\r\n RadiusToString(this.state.location, this.state.radius)\r\n );\r\n\r\n _onChange = (location: string) =>\r\n this.setState(\r\n { location: ParseLocation(location) },\r\n this._fireChangedValue\r\n );\r\n\r\n _onRadiusChange = (radius: number) =>\r\n this.setState({ radius }, () => {\r\n if (this.state.location != null) this._fireChangedValue();\r\n this.props.radius.setValue(radius);\r\n });\r\n\r\n _onManualLocation = (editLocationResult: MapEditLocationResult) =>\r\n this.setState(\r\n {\r\n location: editLocationResult.location,\r\n radius: editLocationResult.radius,\r\n },\r\n () =>\r\n this.props.onManualLocation(\r\n RadiusToString(\r\n editLocationResult.location,\r\n editLocationResult.radius\r\n )\r\n )\r\n );\r\n\r\n render = () => (\r\n \r\n e.stopPropagation()}\r\n componentClass={InputGroup.Button}\r\n title={\r\n <>\r\n \r\n {this._displayUnit(this.state.radius)}\r\n \r\n \r\n \r\n }\r\n >\r\n {window.CONFIG.general.geo.radius.searchRadius.map((r) => (\r\n \r\n this._onRadiusChange(r)\r\n }\r\n >\r\n {this._displayUnit(r)}\r\n \r\n ))}\r\n \r\n \r\n );\r\n}\r\nexport default SettingValue({ name: \"geoSearchRadius\", namespace: \"radius\" })(\r\n GeoRadiusInput\r\n);\r\n","// @flow\r\nimport React, { type ElementRef } from \"react\";\r\nimport NativeSelect from \"components/NativeSelect\";\r\nimport {\r\n type SearchValueTypeEnum,\r\n SearchValueType,\r\n SearchOperator,\r\n type SearchOperatorEnum,\r\n} from \"data/types\";\r\nimport styles from \"./SearchOperators.module.css\";\r\nimport loc from \"i18next\";\r\n\r\n/** map which SearchOperators are available for which Search SearchValueType */\r\nexport const SearchValueTypeOperatorsMapping = {\r\n [SearchValueType.NotSet]: [\"Equals\"], // special $FREETEXT$ field\r\n [SearchValueType.ItemType]: [\"Equals\"],\r\n [SearchValueType.IUID]: [\"Equals\"],\r\n [SearchValueType.FileSize]: [\"Equals\"],\r\n [SearchValueType.String]: [\r\n \"Contextor\",\r\n \"ContextorContains\",\r\n \"Contains\",\r\n \"Equals\",\r\n \"StartsWith\",\r\n \"EndsWith\",\r\n ],\r\n [SearchValueType.Link]: [],\r\n [SearchValueType.StringFieldOnly]: [\r\n \"Contextor\",\r\n \"ContextorContains\",\r\n \"Contains\",\r\n \"Equals\",\r\n \"StartsWith\",\r\n \"EndsWith\",\r\n ],\r\n [SearchValueType.RelativeDate]: [\r\n \"Contextor\",\r\n \"From\",\r\n \"FromWithTime\",\r\n \"To\",\r\n \"ToWithTime\",\r\n // TODO \"FromTo\",\r\n // TODO \"FromToWithTime\",\r\n \"Equals\",\r\n \"EqualsWithTime\",\r\n \"RelativeDate\",\r\n // #46483 remove not working date searchform Operators\r\n // \"FromRelativeTo\",\r\n // \"FromRelativeToWithTime\",\r\n // \"FromToRelative\",\r\n // \"FromWithTimeToRelative\",\r\n \"FromRelative\",\r\n \"ToRelative\",\r\n ],\r\n [SearchValueType.DateTime]: [\r\n \"Contextor\",\r\n \"From\",\r\n \"FromWithTime\",\r\n \"To\",\r\n \"ToWithTime\",\r\n \"FromTo\",\r\n \"FromToWithTime\",\r\n \"Equals\",\r\n \"EqualsWithTime\",\r\n \"RelativeDate\",\r\n // #46483 remove not working date searchform Operators\r\n // \"FromRelativeTo\",\r\n // \"FromRelativeToWithTime\",\r\n // \"FromToRelative\",\r\n // \"FromWithTimeToRelative\",\r\n \"FromRelative\",\r\n \"ToRelative\",\r\n ],\r\n [SearchValueType.Decimal]: [\"Contextor\", \"From\", \"To\", \"FromTo\", \"Equals\"],\r\n [SearchValueType.DecimalFieldOnly]: [\r\n \"Contextor\",\r\n \"From\",\r\n \"To\",\r\n \"FromTo\",\r\n \"Equals\",\r\n ],\r\n [SearchValueType.GeoPoint]: [\"GeoRadius\", \"GeoArea\"],\r\n [SearchValueType.GeoArea]: [\r\n \"GeoRadiusIntersect\",\r\n \"GeoRadiusWithin\",\r\n \"GeoAreaIntersect\",\r\n \"GeoAreaWithin\",\r\n \"GeoAreaPoint\",\r\n ],\r\n};\r\n\r\n/** get localized searchOperators */\r\nconst getOperatorsForField = (valueType: SearchValueTypeEnum) =>\r\n SearchValueTypeOperatorsMapping[valueType].map((K) => ({\r\n // special handling for those that have only Contextor (and no Contextor.StartsWith/Contains)\r\n T:\r\n K === \"Contextor\" &&\r\n (valueType === SearchValueType.DateTime ||\r\n valueType === SearchValueType.Decimal ||\r\n valueType === SearchValueType.DecimalFieldOnly)\r\n ? loc.t(\"search:form.op.Choose\")\r\n : loc.t(\"search:form.op.\" + K),\r\n K: SearchOperator[K],\r\n }));\r\n\r\ntype Props = {\r\n /** React.createRef to assign to NativeSelect element */\r\n selectRef?: ElementRef<*>,\r\n /** search field type */\r\n valueType: SearchValueTypeEnum,\r\n /** current seach operator */\r\n value: SearchOperatorEnum,\r\n /** callback when user changes the search operator\r\n * @param {SearchOperatorEnum} op new searchOperator key chosen\r\n */\r\n onChange: (op: SearchOperatorEnum) => void,\r\n};\r\n\r\n/** render SearchOperators dropdown */\r\nexport default class SearchOperators extends React.PureComponent {\r\n render() {\r\n const { selectRef, valueType, value, onChange } = this.props;\r\n const operators = getOperatorsForField(valueType);\r\n if (valueType === SearchValueType.NotSet)\r\n return
;\r\n else\r\n return (\r\n o.K === value) || operators[0]}\r\n onChange={(o) => onChange(o.K)}\r\n />\r\n );\r\n }\r\n}\r\n","// @flow\r\nimport React, { PureComponent, type ComponentType } from \"react\";\r\nimport { getDisplayName } from \"data/constants\";\r\nimport SearchOperators from \"components/SearchOperators\";\r\nimport { type SearchOperatorEnum, type SearchValueTypeEnum } from \"data/types\";\r\n\r\ntype Props = {\r\n /** currently selected searchOperator */\r\n searchOperator: SearchOperatorEnum,\r\n /** callback when value has been changed\r\n * @param {string} name field's name\r\n * @param {any} value new field's value\r\n */\r\n onChange: (name: string, value: any) => void,\r\n /** current value */\r\n value: any,\r\n /** current name */\r\n name: string,\r\n /** current valueType */\r\n valueType: SearchValueTypeEnum,\r\n};\r\n\r\ntype State = {\r\n /** currently selected searchOperator */\r\n op: SearchOperatorEnum,\r\n /** current value */\r\n value: any,\r\n};\r\n\r\n/** wraps *EditorControls to add Search Operators and handling */\r\nconst toSearchEditor = (WrappedComponent: ComponentType) =>\r\n class PP extends PureComponent {\r\n upstreamOnChange: (name: string, value: any) => void;\r\n // opRef: ElementRef<*>;\r\n\r\n static displayName = `toSearchEditor(${getDisplayName(\r\n WrappedComponent\r\n )})`;\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n this.state = {\r\n op: props.searchOperator,\r\n value: props.value,\r\n };\r\n this.upstreamOnChange = this.props.onChange;\r\n // this.opRef = React.createRef();\r\n }\r\n\r\n _onChange = () => {\r\n this.upstreamOnChange(this.props.name, {\r\n op: this.state.op,\r\n val: this.state.value,\r\n });\r\n };\r\n\r\n _onChangeValue = (name: string, value: any) =>\r\n this.setState({ value }, this._onChange);\r\n\r\n _onChangeOperator = (op: SearchOperatorEnum) =>\r\n this.setState({ op, value: null }, this._onChange);\r\n\r\n // _focusNextInput = (node: React.Element) => {\r\n // if (this.opRef == null || this.opRef.current == null) return null;\r\n // const input = this.opRef.current.parentNode.querySelector(\"input\");\r\n // if (input != null) input.focus();\r\n // };\r\n\r\n render = () => (\r\n (\r\n \r\n )\r\n }\r\n />\r\n );\r\n };\r\n\r\nexport default toSearchEditor;\r\n","// @flow\r\nimport React, { PureComponent, type ComponentType } from \"react\";\r\nimport { getDisplayName } from \"data/constants\";\r\nimport loc from \"i18next\";\r\n\r\ntype Props = {\r\n /** callback when value has been changed\r\n * @param {string} name field's name\r\n * @param {any} value new field's value\r\n */\r\n onChange: (name: string, value: any) => void,\r\n /** current value */\r\n value: ?Array,\r\n};\r\n\r\ntype State = {\r\n value1: ?any,\r\n value2: ?any,\r\n};\r\n\r\n/** wraps *EditorControls to allow FromTo operator */\r\nconst toBetweenEditor = (\r\n WrappedComponent1: ComponentType,\r\n WrappedComponent2: ComponentType\r\n) =>\r\n class PP extends PureComponent {\r\n upstreamOnChange: (name: string, value: any) => void;\r\n // opRef: ElementRef<*>;\r\n\r\n static displayName = `toBetweenEditor(${getDisplayName(\r\n WrappedComponent1\r\n )},${getDisplayName(WrappedComponent2)})`;\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n this.state = {\r\n value1: Array.isArray(props.value) ? props.value[0] : null,\r\n value2: Array.isArray(props.value) ? props.value[1] : null,\r\n };\r\n this.upstreamOnChange = this.props.onChange;\r\n }\r\n\r\n componentDidUpdate(prevProps) {\r\n const newState = {};\r\n if (prevProps.value?.[0] !== this.props.value?.[0]) {\r\n newState.value1 = this.props.value?.[0];\r\n }\r\n if (prevProps.value?.[1] !== this.props.value?.[1]) {\r\n newState.value2 = this.props.value?.[1];\r\n }\r\n if (Object.keys(newState).length) {\r\n this.setState(newState);\r\n }\r\n }\r\n\r\n _onChange = () => {\r\n this.upstreamOnChange(this.props.name, [\r\n this.state.value1,\r\n this.state.value2,\r\n ]);\r\n };\r\n\r\n _onChangeValue1 = (name: string, value1: any) =>\r\n this.setState({ value1 }, this._onChange);\r\n\r\n _onChangeValue2 = (name: string, value2: any) =>\r\n this.setState({ value2 }, this._onChange);\r\n\r\n render = () => (\r\n \r\n }\r\n />\r\n );\r\n };\r\n\r\nexport default toBetweenEditor;\r\n","// @flow\r\nimport React from \"react\";\r\nimport FormsyEditorBase from \"components/ExtraAttributes/EditorControl/FormsyEditorBase\";\r\nimport GeoRadiusInput from \"components/GeoRadiusInput\";\r\n\r\ntype Props = {\r\n /** current value */\r\n value?: string,\r\n /** CSS classname to apply */\r\n className?: string,\r\n /** placeholder text to display when @see {value} is empty */\r\n placeholder?: string,\r\n};\r\n\r\nconst GeoRadiusEditorControl = (props: Props) => (\r\n (\r\n \r\n changeValue({ currentTarget: { value } })\r\n }\r\n onManualLocation={\r\n /* istanbul ignore next */ (value) =>\r\n changeValue({ currentTarget: { value } })\r\n }\r\n // style={props.style}\r\n className={props.className}\r\n placeholder={props.placeholder}\r\n />\r\n )}\r\n {...props}\r\n />\r\n);\r\nGeoRadiusEditorControl.displayName = \"GeoRadiusEditorControl\";\r\nexport default GeoRadiusEditorControl;\r\n","import React from \"react\";\r\nimport FormsyEditorBase from \"components/ExtraAttributes/EditorControl/FormsyEditorBase\";\r\nimport RelativeDatePicker from \"components/DocListFilterModal/RelativeDatePicker\";\r\n\r\nconst RelativeDateEditorControl = (props) => (\r\n (\r\n {\r\n if (e.currentTarget.value === \"NotSet\")\r\n changeValue({ currentTarget: { value: null } });\r\n else changeValue(e);\r\n }\r\n }\r\n style={props.style}\r\n className={props.className}\r\n />\r\n )}\r\n {...props}\r\n />\r\n);\r\nRelativeDateEditorControl.displayName = \"RelativeDateEditorControl\";\r\nexport default RelativeDateEditorControl;\r\n","// @flow\r\nimport React from \"react\";\r\nimport { type SearchFieldDefinitionDTO, FormLookupType } from \"data/types\";\r\nimport toSearchEditor from \"./toSearchEditor\";\r\nimport toBetweenEditor from \"./toBetweenEditor\";\r\n\r\n// import CheckboxEditorControl from \"components/ExtraAttributes/EditorControl/CheckboxEditorControl\";\r\nimport TextEditorControl from \"components/ExtraAttributes/EditorControl/TextEditorControl\";\r\n// import MemoEditorControl from \"components/ExtraAttributes/EditorControl/MemoEditorControl\";\r\nimport NumberEditorControl from \"components/ExtraAttributes/EditorControl/NumberEditorControl\";\r\nimport DateEditorControl from \"components/ExtraAttributes/EditorControl/DateEditorControl\";\r\n// import RadioEditorControl from \"components/ExtraAttributes/EditorControl/RadioEditorControl\";\r\nimport LookupEditorControl from \"components/ExtraAttributes/EditorControl/LookupEditorControl\";\r\n\r\nimport GeoAreaEditorControl from \"components/ExtraAttributes/EditorControl/GeoAreaEditorControl\";\r\nimport GeoRadiusEditorControl from \"./GeoRadiusEditorControl\";\r\nimport RelativeDateEditorControl from \"./RelativeDateEditorControl\";\r\nimport { SearchValueType, SearchOperator, DateTimeFormat } from \"data/types\";\r\nimport styles from \"./AttributeSearch.module.css\";\r\n// import * as s from \"data/reducers/selectors\";\r\nimport loc from \"i18next\";\r\n\r\ntype Props = {\r\n /** current itemUri */\r\n itemUri: string,\r\n /** current attribute definition */\r\n attribute?: SearchFieldDefinitionDTO,\r\n /** list of all attributes */\r\n attributes: Array,\r\n /** custom width */\r\n width?: number,\r\n /** callback when an attribute is edited\r\n * @param {string} name unique name of attribute being changed\r\n * @param {any} value new value\r\n */\r\n onChange: (name: string, value: any) => void,\r\n /** whether to show field's label */\r\n showLabel: boolean,\r\n};\r\n\r\nconst formPrefix = \"sf.\";\r\nconst SearchLookupEditorControl = toSearchEditor(LookupEditorControl);\r\nconst SearchTextEditorControl = toSearchEditor(TextEditorControl);\r\nconst SearchNumberEditorControl = toSearchEditor(NumberEditorControl);\r\nconst SearchDateEditorControl = toSearchEditor(DateEditorControl);\r\nconst RelativeDateSearchControl = toSearchEditor(RelativeDateEditorControl);\r\nconst GeoSearchRadiusEditorControl = toSearchEditor(GeoRadiusEditorControl);\r\nconst GeoSearchAreaEditorControl = toSearchEditor(GeoAreaEditorControl);\r\nconst SearchBetweenNumberEditorControl = toSearchEditor(\r\n toBetweenEditor(NumberEditorControl, NumberEditorControl)\r\n);\r\nconst SearchBetweenDateEditorControl = toSearchEditor(\r\n toBetweenEditor(DateEditorControl, DateEditorControl)\r\n);\r\n\r\nclass AttributeSearch extends React.Component {\r\n /** re-render only when value or searchOperator changes! */\r\n /* istanbul ignore next*/ shouldComponentUpdate = (nextProps: Props) =>\r\n nextProps.attribute == null ||\r\n this.props.attribute == null ||\r\n nextProps.attribute.id !== this.props.attribute.id ||\r\n nextProps.attribute.value !== this.props.attribute.value ||\r\n nextProps.itemUri !== this.props.itemUri ||\r\n nextProps.attribute.op !== this.props.attribute.op;\r\n\r\n render() {\r\n const { itemUri, attribute, attributes, onChange, showLabel } =\r\n this.props;\r\n // if no attributeDefinition found then render nothing\r\n if (attribute == null) return null;\r\n\r\n //console.log('Attribute', attribute);\r\n // TODO header converter from name like CurionLib does\r\n const header = attribute.header || attribute.name;\r\n const value = attribute.value;\r\n\r\n switch (attribute.op) {\r\n case SearchOperator.Contextor:\r\n case SearchOperator.ContextorContains:\r\n return (\r\n \r\n );\r\n\r\n case SearchOperator.FromTo:\r\n case SearchOperator.FromToWithTime:\r\n switch (attribute.valueType) {\r\n case SearchValueType.Decimal:\r\n case SearchValueType.DecimalFieldOnly:\r\n return (\r\n \r\n );\r\n\r\n case SearchValueType.DateTime:\r\n return (\r\n \r\n );\r\n default:\r\n return null;\r\n }\r\n\r\n // case SearchOperator.FromRelativeTo:\r\n // case SearchOperator.FromToRelative:\r\n // case SearchOperator.FromWithTimeToRelative:\r\n // return
TODO: from-to relative date
;\r\n\r\n case SearchOperator.RelativeDate:\r\n case SearchOperator.FromRelative:\r\n case SearchOperator.ToRelative:\r\n return (\r\n \r\n );\r\n\r\n case SearchOperator.Equals:\r\n case SearchOperator.Contains:\r\n case SearchOperator.StartsWith:\r\n case SearchOperator.EndsWith:\r\n case SearchOperator.From:\r\n case SearchOperator.FromWithTime:\r\n case SearchOperator.To:\r\n case SearchOperator.ToWithTime:\r\n case SearchOperator.EqualsWithTime:\r\n switch (attribute.valueType) {\r\n case SearchValueType.Decimal:\r\n case SearchValueType.DecimalFieldOnly:\r\n return (\r\n \r\n );\r\n case SearchValueType.DateTime:\r\n return (\r\n \r\n );\r\n case SearchValueType.NotSet:\r\n case SearchValueType.String:\r\n case SearchValueType.StringFieldOnly:\r\n return (\r\n \r\n );\r\n default:\r\n return null;\r\n }\r\n\r\n case SearchOperator.GeoRadius:\r\n case SearchOperator.GeoRadiusIntersect:\r\n case SearchOperator.GeoRadiusWithin:\r\n return (\r\n \r\n );\r\n case SearchOperator.GeoArea:\r\n case SearchOperator.GeoAreaIntersect:\r\n case SearchOperator.GeoAreaWithin:\r\n case SearchOperator.GeoAreaPoint:\r\n return (\r\n \r\n );\r\n\r\n case SearchOperator.NotSet:\r\n // special Freetext attribute?\r\n if (\r\n attribute.valueType === SearchValueType.NotSet &&\r\n attribute.name === \"$SEARCHTEXT$\"\r\n ) {\r\n return (\r\n \r\n );\r\n }\r\n //lint -fallthrough\r\n default:\r\n console.warn(\r\n `TODO for SearchValueType: ${attribute.valueType}, SearchOperator: ${attribute.op}`\r\n );\r\n return null;\r\n }\r\n }\r\n}\r\nexport default AttributeSearch;\r\n","// @flow\r\nimport React, { useState, useCallback } from \"react\";\r\nimport ButtonToolbar from \"react-bootstrap/lib/ButtonToolbar\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport EAForm from \"components/ExtraAttributes/EAForm\";\r\nimport Formsy, { addValidationRule } from \"formsy-react\";\r\nimport { type SearchFormResultDTO } from \"data/types\";\r\nimport AttributeSearch from \"./AttributeSearch\";\r\nimport \"components/Form/index.css\";\r\nimport \"./index.css\";\r\nimport { getClassNames } from \"data/utils\";\r\nimport { LabelSizeContext } from \"data/context\";\r\nimport { useEffectOnce } from \"react-use\";\r\n\r\nconst EASearchForm = (props) => (\r\n \r\n);\r\n\r\ntype Props = {\r\n /** searchForm definition */\r\n form: SearchFormResultDTO,\r\n /** Search button label */\r\n searchLabel: string,\r\n /** whether the Search button should be enabled */\r\n searchEnabled?: boolean,\r\n /** whether to show search operators */\r\n showSearchOperators?: boolean,\r\n // /** callback when user clicks the Cancel button */\r\n // onCancel: () => void,\r\n /** callback when user clicks the Search button */\r\n onSearch: (model: Object) => void,\r\n /** callback when an attribute is edited\r\n * @param {string} name unique name of attribute being changed\r\n * @param {any} value new value\r\n */\r\n onChange: (name: string, value: any) => void,\r\n /** callback when a validation is finished on the form (could be valid or invalid) */\r\n onValidated?: (isValid: boolean) => void,\r\n};\r\n\r\nconst SearchForm = React.forwardRef((props: Props, ref) => {\r\n const [isValid, setIsValid] = useState(true);\r\n const [isChanged, setIsChanged] = useState(true);\r\n\r\n useEffectOnce(() => {\r\n /* istanbul ignore next */\r\n addValidationRule(\r\n \"isNotInvalid\",\r\n (values, value) =>\r\n value == null || !String(value).startsWith(\"__INVALID__\")\r\n );\r\n });\r\n\r\n const _onValidChanged = useCallback(\r\n (valid: boolean) => {\r\n setIsValid(valid);\r\n isChanged && props.onValidated && props.onValidated(valid);\r\n },\r\n [setIsValid, isChanged, props]\r\n );\r\n\r\n /* istanbul ignore next */\r\n const _onChange = useCallback(\r\n (currentValues, changed) => changed && !isChanged && setIsChanged(true),\r\n [isChanged, setIsChanged]\r\n );\r\n\r\n return (\r\n _onValidChanged(true)}\r\n onInvalid={/* istanbul ignore next */ () => _onValidChanged(false)}\r\n onChange={_onChange}\r\n >\r\n \r\n \r\n \r\n\r\n \r\n \r\n {props.searchLabel}\r\n \r\n \r\n \r\n );\r\n});\r\nSearchForm.displayName = \"SearchForm\";\r\n\r\nexport default SearchForm;\r\n","// @flow\r\nimport React, { PureComponent } from \"react\";\r\nimport { connect, Dispatch } from \"react-redux\";\r\nimport SearchForm from \"components/SearchForm\";\r\nimport Status from \"components/Status\";\r\nimport { getSearchFormAction, setSearchFormChangesAction } from \"data/actions\";\r\nimport {\r\n type SearchFormResultDTO,\r\n type SearchItemDTO,\r\n type SearchFilterDTO,\r\n SearchItemType,\r\n FormLookupValue,\r\n} from \"data/types\";\r\nimport Constants, {\r\n isFeatureOn,\r\n Feature,\r\n type ConstantsEnum,\r\n} from \"data/constants\";\r\nimport produce from \"immer\";\r\nimport isEqual from \"lodash/isEqual\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport FormBarFactory from \"components/FormBar/Factory\";\r\nimport { FormBarView } from \"data/types\";\r\n\r\ntype Props = {\r\n /** search form id to render */\r\n id: number,\r\n /** optional extra filters to set on searchRequest */\r\n extraFilters?: Array,\r\n /** current itemUri */\r\n itemUri: string,\r\n /** label to show on Search button */\r\n searchLabel: string,\r\n /** callback when user clicks the Search button\r\n * @param {SearchItemDTO} searchItem searchItem containing query\r\n */\r\n onSearch: (searchItem: SearchItemDTO) => void,\r\n /** callback when user clicks the Cancel button */\r\n onCancel: () => void,\r\n /** Redux dispatch */\r\n dispatch: Dispatch,\r\n /** the search form itself */\r\n form: ?SearchFormResultDTO,\r\n /** search form fetch status */\r\n status: ConstantsEnum,\r\n /** whether to enable the search button */\r\n searchEnabled?: boolean,\r\n /** whether to show search operators */\r\n showSearchOperators?: boolean,\r\n};\r\n\r\ntype State = {\r\n changed: Object,\r\n form: ?SearchFormResultDTO,\r\n};\r\n\r\nconst views = [FormBarView.Search, FormBarView.SearchScope];\r\n\r\nexport class SearchFormContainer extends PureComponent {\r\n state = {\r\n changed: {},\r\n form: undefined,\r\n };\r\n\r\n static defaultProps = {\r\n searchEnabled: true,\r\n showSearchOperators: false,\r\n };\r\n\r\n constructor(props) {\r\n super(props);\r\n this.form = React.createRef();\r\n }\r\n\r\n componentDidMount = () => this._fetch(this.props.id);\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n /* istanbul ignore else */\r\n if (\r\n prevProps.itemUri !== this.props.itemUri ||\r\n prevProps.id !== this.props.id\r\n ) {\r\n this._fetch(this.props.id);\r\n }\r\n /* istanbul ignore else */\r\n if (\r\n prevProps.form !== this.props.form &&\r\n this.props.form != null &&\r\n this.props.form.attributes != null\r\n ) {\r\n this.resetForm(prevProps, this.props.changes);\r\n }\r\n }\r\n\r\n resetForm = (prevProps, changes = {}) => {\r\n const { changed, form, formsy } = produce(\r\n { form: this.props.form },\r\n (draft) => {\r\n draft.changed = {};\r\n draft.formsy = {};\r\n draft.form.attributes = draft.form.attributes.map((attr) => {\r\n let { value: val, op } = attr;\r\n // prefill free text search with value from store...\r\n if (\r\n (prevProps.form == null ||\r\n prevProps.form.name === this.props.form.name ||\r\n attr.name === \"$SEARCHTEXT$\") &&\r\n changes[attr.name]\r\n ) {\r\n val = changes[attr.name].val;\r\n op = changes[attr.name].op;\r\n }\r\n attr.op = op;\r\n attr.value = val;\r\n draft.changed[attr.name] = {\r\n val,\r\n op,\r\n };\r\n if (Array.isArray(val)) {\r\n val.forEach(\r\n (v, i) =>\r\n (draft.formsy[`sf.${attr.name}[${i}]`] = v)\r\n );\r\n } else {\r\n draft.formsy[`sf.${attr.name}`] = val;\r\n }\r\n return attr;\r\n });\r\n if (\r\n this.props.extraFilters != null &&\r\n this.props.extraFilters.length > 0\r\n ) {\r\n let customId = -50;\r\n this.props.extraFilters.forEach((filter) => {\r\n // add to form definition\r\n draft.form.attributes.splice(0, 0, {\r\n hidden: true,\r\n id: customId--,\r\n header: filter.name,\r\n name: filter.name,\r\n value: filter.value,\r\n valueType: filter.valueType,\r\n op: filter.op,\r\n nodeType: filter.nodeType,\r\n });\r\n // add values\r\n draft.changed[filter.name] = {\r\n val: filter.value,\r\n op: filter.op,\r\n };\r\n });\r\n }\r\n draft.form.name = this.props.name || draft.form.name;\r\n }\r\n );\r\n this.setState(\r\n {\r\n changed,\r\n form,\r\n },\r\n () => {\r\n this.form.current?.updateInputsWithValue(formsy);\r\n this.props.dispatch(setSearchFormChangesAction(changed));\r\n if (isFeatureOn(Feature.searchAsYouType)) this._onSearch();\r\n }\r\n );\r\n };\r\n\r\n _fetch = (id: number): void => {\r\n this.props.dispatch(\r\n getSearchFormAction({\r\n id,\r\n model: this.state.changed,\r\n })\r\n );\r\n };\r\n\r\n _hasChanged = () =>\r\n (this.state.form?.itemUri != null &&\r\n this.state.form?.itemUri !== this.props.form?.itemUri) ||\r\n (this.state.form?.scope != null &&\r\n this.state.form?.scope !== this.props.form?.scope) ||\r\n this.state?.form?.attributes?.some((attr, ind) => {\r\n // Operator changed?\r\n if (this.props.form?.attributes?.[ind]?.op !== attr.op) return true;\r\n // Value changed?\r\n const defaultValue = this.props.form?.attributes?.[ind]?.value;\r\n const currentValue = attr.value;\r\n if (Array.isArray(currentValue) && !defaultValue) {\r\n return currentValue.some((v) => !!v);\r\n }\r\n if (defaultValue == null) return !!currentValue;\r\n return !isEqual(defaultValue, currentValue);\r\n });\r\n\r\n _onValidated = (isValid: boolean) => {\r\n if (isValid && isFeatureOn(Feature.searchAsYouType)) this._onSearch();\r\n };\r\n\r\n _onChange = (name: string, value: any) => {\r\n const splittedName = name.split(\".\");\r\n if (\r\n value == null &&\r\n !Object.prototype.hasOwnProperty.call(\r\n this.state.changed,\r\n splittedName[1]\r\n )\r\n ) {\r\n return;\r\n }\r\n const oldValue = this.state.changed[splittedName[1]];\r\n // console.log(\"containers/searchForm onChange\", name, oldValue, value);\r\n if (\r\n oldValue != null &&\r\n value != null &&\r\n (oldValue.val !== value.val || oldValue.op !== value.op)\r\n ) {\r\n // console.log(\"containers/searchForm doChange!\");\r\n const { changed, form } = produce(this.state, (draft) => {\r\n const idx = this.state.form.attributes.findIndex(\r\n (a) => a.name === splittedName[1]\r\n );\r\n // set operator\r\n draft.form.attributes[idx].op = value.op;\r\n // set value\r\n draft.form.attributes[idx].value = value.val;\r\n draft.changed[splittedName[1]] = value;\r\n });\r\n // update local state\r\n this.setState(\r\n {\r\n changed,\r\n form,\r\n },\r\n () => {\r\n this.props.dispatch(setSearchFormChangesAction(changed));\r\n }\r\n );\r\n }\r\n };\r\n\r\n handleClearForm = () => {\r\n this.resetForm(this.props);\r\n };\r\n\r\n _toFilterValue = (value: string | FormLookupValue) =>\r\n value && (value.T || value);\r\n\r\n // send our search model with searchOperators\r\n _onSearch = () => {\r\n const { changed, form } = this.state;\r\n // console.log(\"searchForm\", searchForm);\r\n // console.log(\"model\", model);\r\n\r\n // convert model into filters\r\n const filters = [];\r\n let searchText = null;\r\n form.attributes.forEach((attr) => {\r\n const changedField = changed[attr.name];\r\n /* istanbul ignore else */\r\n if (changedField != null) {\r\n filters.push({\r\n name: attr.name,\r\n op: changedField.op,\r\n value: this._toFilterValue(changedField.val),\r\n valueType: attr.valueType,\r\n nodeType: attr.nodeType,\r\n keywordField: attr.keywordField,\r\n });\r\n // keep special searchText for highlighting\r\n if (attr.name === \"$SEARCHTEXT$\")\r\n searchText = this._toFilterValue(changedField.val);\r\n }\r\n });\r\n\r\n // build searchItem\r\n const searchItem: SearchItemDTO = {\r\n id: this.props.id,\r\n name: this.props.form.name,\r\n itemUri: this.props.itemUri ?? form.itemUri,\r\n scope: form.scope,\r\n searchType: SearchItemType.Form,\r\n searchText,\r\n filters,\r\n sorts: this.props.form.sorts,\r\n };\r\n\r\n /* istanbul ignore else */\r\n if (typeof this.props.onSearch === \"function\")\r\n this.props.onSearch(searchItem);\r\n };\r\n\r\n _handleSearchScopeChange = (scope, itemUri) =>\r\n this.setState((state) => ({\r\n form: produce(state.form, (draft) => {\r\n draft.scope = scope;\r\n draft.itemUri = itemUri;\r\n }),\r\n }));\r\n\r\n render = () => (\r\n <>\r\n \r\n {this.props.status !== Constants.OK && (\r\n \r\n )}\r\n {this.props.status === Constants.OK && this.state.form == null && (\r\n \r\n )}\r\n {this.props.status === Constants.OK && this.state.form != null && (\r\n \r\n )}\r\n \r\n );\r\n}\r\n\r\nconst mapStateToProps = /* istanbul ignore next */ (state, ownProps) => ({\r\n status: s.searchFormStatusSelector(state),\r\n form: s.searchFormResultSelector(state),\r\n showSearchOperators: s.settingValueSelector(\"showSearchOperators\", state),\r\n changes: s.searchFormChangesSelector(state),\r\n ...ownProps,\r\n});\r\n\r\nexport default connect(mapStateToProps)(SearchFormContainer);\r\n","/* istanbul ignore next */\r\nfunction getRadianAngle(degreeValue) {\r\n return (degreeValue * Math.PI) / 180;\r\n}\r\n\r\n/* istanbul ignore next */\r\nexport const createImage = (url) =>\r\n new Promise((resolve, reject) => {\r\n const image = new Image();\r\n image.addEventListener(\"load\", () => resolve(image));\r\n image.addEventListener(\"error\", (error) => reject(error));\r\n image.setAttribute(\"crossOrigin\", \"anonymous\"); // needed to avoid cross-origin issues\r\n image.src = url;\r\n });\r\n\r\n/**\r\n * This function was adapted from the one in the ReadMe of https://github.com/DominicTobias/react-image-crop\r\n * @param {File} image - Image File url\r\n * @param {Object} pixelCrop - pixelCrop Object provided by react-easy-crop\r\n * @param {number} rotation - optional rotation parameter\r\n */\r\n/* istanbul ignore next */\r\nexport default async function getCroppedImg(imageSrc, pixelCrop, rotation = 0) {\r\n // First, calculate the bounding box size:\r\n const image = await createImage(imageSrc);\r\n\r\n const rotRad = getRadianAngle(rotation);\r\n const bBoxWidth =\r\n Math.abs(Math.cos(rotRad) * image.width) +\r\n Math.abs(Math.sin(rotRad) * image.height);\r\n const bBoxHeight =\r\n Math.abs(Math.sin(rotRad) * image.width) +\r\n Math.abs(Math.cos(rotRad) * image.height);\r\n\r\n // Second, create a canvas element with the size of the bounding box:\r\n const canvas = document.createElement(\"canvas\");\r\n\r\n canvas.width = bBoxWidth;\r\n canvas.height = bBoxHeight;\r\n\r\n // Then, rotate the canvas context around the center of the canvas:\r\n const ctx = canvas.getContext(\"2d\");\r\n\r\n ctx.translate(bBoxWidth / 2, bBoxHeight / 2);\r\n ctx.rotate(rotRad);\r\n\r\n // Set context to point to the top-left corner of the rotated image:\r\n ctx.translate(-image.width / 2, -image.height / 2);\r\n\r\n // Draw the image onto the rotated context:\r\n ctx.drawImage(image, 0, 0);\r\n\r\n // What we have in the canvas at this point is a rotated image inside its bounding box.\r\n // Now, we just need to extract the result using croppedAreaPixels and repaint it on a canvas with the size of the final image:\r\n\r\n const data = ctx.getImageData(\r\n pixelCrop.x,\r\n pixelCrop.y,\r\n pixelCrop.width,\r\n pixelCrop.height\r\n );\r\n\r\n // set the canvas size to the final image size - this will clear existing context\r\n canvas.width = pixelCrop.width;\r\n canvas.height = pixelCrop.height;\r\n\r\n // paste the extracted image at the top left corner\r\n ctx.putImageData(data, 0, 0);\r\n\r\n // As Base64 string\r\n return canvas.toDataURL(\"image/jpeg\");\r\n}\r\n","import React from \"react\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport ButtonGroup from \"react-bootstrap/lib/ButtonGroup\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\nimport { clampInRange } from \"./clampInRange\";\r\n\r\nconst degrees = [0, 90, 180, 270];\r\n\r\nconst Rotation = ({\r\n value = 0,\r\n onRotate,\r\n}: {\r\n value: number,\r\n onRotate: (degrees: number) => void,\r\n}) => {\r\n const setRotation = clampInRange(\r\n degrees,\r\n degrees.findIndex((v) => v === value)\r\n );\r\n\r\n return (\r\n \r\n onRotate(setRotation.prev())}\r\n >\r\n \r\n \r\n\r\n onRotate(setRotation.next())}\r\n >\r\n \r\n \r\n \r\n );\r\n};\r\nRotation.displayName = \"ImageEditor.Rotation\";\r\nexport default Rotation;\r\n","// idea extended from https://github.com/watson/roundround/blob/master/index.js\r\nexport function clampInRange(array, index) {\r\n index = index || 0;\r\n\r\n /* istanbul ignore next */\r\n if (array == null || !Array.isArray(array))\r\n throw new Error(\"Expecting argument to RoundRound to be an Array\");\r\n\r\n return {\r\n prev: () => {\r\n if (index <= 0) index = array.length;\r\n return array[--index];\r\n },\r\n next: () => {\r\n if (index >= array.length - 1) index = -1;\r\n return array[++index];\r\n },\r\n };\r\n}\r\n","import React from \"react\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport ButtonGroup from \"react-bootstrap/lib/ButtonGroup\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\n\r\nconst Zoom = ({\r\n value,\r\n maxZoom,\r\n onZoom,\r\n}: {\r\n value: number,\r\n maxZoom: number,\r\n onZoom: (zoom: number) => void,\r\n}) => (\r\n \r\n onZoom(value + 1)}\r\n >\r\n \r\n \r\n\r\n onZoom(value - 1)}\r\n >\r\n \r\n \r\n \r\n);\r\n\r\nZoom.displayName = \"ImageEditor.Zoom\";\r\nexport default Zoom;\r\n","// @flow\r\nimport React from \"react\";\r\nimport Modal, { ModalSize } from \"components/Modal\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport ButtonToolbar from \"react-bootstrap/lib/ButtonToolbar\";\r\nimport { createModal } from \"react-modal-promise\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\nimport styles from \"./ImageEditorModal.module.css\";\r\nimport Cropper from \"react-easy-crop\";\r\nimport getCroppedImg from \"./cropImage\";\r\nimport Rotation from \"./rotation\";\r\nimport Zoom from \"./zoom\";\r\n\r\nconst MAX_ZOOM = 10;\r\n\r\ntype Props = {\r\n /** react-modal-promise: whether to show dialog */\r\n open: boolean,\r\n /** react-modal-promise: callback when user closes Dialog\r\n * @param {{croppedImage : string}} croppedImage new image after editing\r\n */\r\n close: ({ croppedImage: string }) => void,\r\n /** Modal Dialog title */\r\n title?: string,\r\n /** dataURL (base64) encoded image */\r\n src: string,\r\n /** requested image height */\r\n height: number,\r\n /** requested image width */\r\n width: number,\r\n};\r\n\r\ntype State = {\r\n crop: ?Object,\r\n zoom: number,\r\n aspect: Number,\r\n rotation: number,\r\n croppedAreaPixels: ?Object,\r\n};\r\n\r\n/** presents a simple image editor (rotate, crop, ...) dialog to the user\r\n */\r\nexport class ImageEditorModal extends React.PureComponent {\r\n constructor(props: Props) {\r\n super(props);\r\n this.state = {\r\n crop: { x: 0, y: 0 },\r\n zoom: 1,\r\n aspect: 4 / 3,\r\n rotation: 0,\r\n croppedAreaPixels: null,\r\n };\r\n }\r\n\r\n _onDone = async () => {\r\n const croppedImage = await getCroppedImg(\r\n this.props.src,\r\n this.state.croppedAreaPixels,\r\n this.state.rotation\r\n );\r\n this.props.close({ croppedImage });\r\n };\r\n\r\n _onCropChange = (crop) => this.setState({ crop });\r\n\r\n _onCropComplete = (croppedArea, croppedAreaPixels) =>\r\n this.setState({ croppedAreaPixels });\r\n\r\n _onZoomChange = (zoom) => this.setState({ zoom });\r\n\r\n _onRotationChange = (rotation) => this.setState({ rotation });\r\n\r\n render() {\r\n const { open, close, title } = this.props;\r\n return (\r\n close()}\r\n dialogClassName={styles.modal}\r\n >\r\n \r\n \r\n {title}\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.state.legacy && (\r\n \r\n )} */}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n}\r\nexport const openImageEditorModal = createModal(ImageEditorModal);\r\n","import React from \"react\";\r\nimport ImageViewerControl from \"components/ExtraAttributes/ViewerControl/ImageViewerControl\";\r\nimport FileDropHandler, { type DroppedFile } from \"containers/FileDropHandler\";\r\nimport styles from \"./UploadImage.module.css\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport Icons from \"@hs/icons\";\r\nimport { getFileExtension } from \"data/utils\";\r\nimport { openImageEditorModal } from \"./ImageEditorModal\";\r\nimport loc from \"i18next\";\r\nimport { toastStyled, toastTypes } from \"data/toast\";\r\nimport { defaultFallbackImage } from \"components/ExtraAttributes/ViewerControl/ImageViewerControl\";\r\nimport { type ImageResultDTO } from \"data/types\";\r\n\r\ntype Props = {\r\n /** relativePath for upload queue (e.g. while offline) */\r\n relativePath: string,\r\n /** unique attribute name */\r\n name: string,\r\n /** current image blob */\r\n value: ?string | ImageResultDTO,\r\n /** optional pixel width */\r\n width?: number,\r\n /** optional pixel height */\r\n height?: number,\r\n /** whether to allow editing */\r\n isReadonly?: boolean,\r\n /** CSV list of image file extensions (with .) to accept\r\n * @default \".png,.jpg,.jpeg,.jfif,.gif\"\r\n */\r\n accept?: string,\r\n /** callback when user chose file to upload\r\n * @param {string} base64 image encoded as base64\r\n */\r\n onDone: (base64: string) => void,\r\n};\r\n\r\n// https://github.com/GrillWork/react-file-reader/blob/master/ReactFileReader.js\r\nexport default class UploadImage extends React.PureComponent {\r\n _input: HTMLInputElement | null;\r\n\r\n static defaultProps = {\r\n isReadonly: false,\r\n accept: \".png,.jpg,.jpeg,.jfif,.gif\",\r\n };\r\n\r\n _onDrop = (files: Array) => {\r\n if (files.length !== 1) {\r\n toastStyled({\r\n message: loc.t(\"upload:image.onlyOne\"),\r\n ...toastTypes.failure,\r\n });\r\n return;\r\n }\r\n const file = files[0].data;\r\n if (this._validateFile(file)) this._processFile(file);\r\n };\r\n\r\n _onBrowse = (e) => this._input && this._input.click();\r\n\r\n _onBrowseChange = (e) => {\r\n // get the files\r\n let files = e.target.files;\r\n /* istanbul ignore next */\r\n if (files.length !== 1) return;\r\n e.persist();\r\n\r\n // Process single first file\r\n let file = files[0];\r\n if (this._validateFile(file))\r\n this._processFile(file, () => {\r\n // We clear the input after a file is selected, because otherwise\r\n // change event is not fired in Chrome and Safari when a file\r\n // with the same name is selected.\r\n // ___Why not use value=\"\" on instead?\r\n // Because if we use that method of clearing the input,\r\n // Chrome will not trigger change if we drop the same file twice (Issue #768).\r\n e.target.value = null;\r\n });\r\n };\r\n\r\n _validateFile = (file: Blob): boolean => {\r\n const ext = getFileExtension(file.name);\r\n if (this.props.accept.indexOf(ext) === -1) {\r\n toastStyled({\r\n message: loc.t(\"upload:image.invalidFile\", {\r\n valid: this.props.accept,\r\n }),\r\n ...toastTypes.failure,\r\n });\r\n return false;\r\n }\r\n return true;\r\n };\r\n\r\n _processFile = (file: Blob, cb?: Function) => {\r\n // Make new FileReader\r\n const reader = new FileReader();\r\n reader.addEventListener(\"loadend\", () => {\r\n /* istanbul ignore else */\r\n if (reader.readyState === 2) {\r\n /* istanbul ignore else */\r\n if (typeof this.props.onDone === \"function\")\r\n this.props.onDone(reader.result);\r\n } else {\r\n console.warn(\r\n `UploadImage Cannot load file ${file.name}: ${reader.error.message}`\r\n );\r\n }\r\n /* istanbul ignore else */\r\n if (typeof cb === \"function\") cb();\r\n });\r\n\r\n // Convert the file to base64 text\r\n reader.readAsDataURL(file);\r\n };\r\n\r\n _onEdit = () => {\r\n const { src } = this._parseValueAsImageResultDTO();\r\n openImageEditorModal({\r\n title: loc.t(\"upload:image.title\", { name: this.props.name }),\r\n src,\r\n width: this.props.width,\r\n height: this.props.height,\r\n }).then((result) => result && this.props.onDone(result.croppedImage));\r\n };\r\n\r\n _parseValueAsImageResultDTO = () => {\r\n const { value } = this.props;\r\n if (!value) {\r\n return {\r\n src: defaultFallbackImage,\r\n fallback: true,\r\n };\r\n } else if (typeof value === \"string\") {\r\n return {\r\n src: value,\r\n fallback: false,\r\n };\r\n } else {\r\n return this.props.value;\r\n }\r\n };\r\n\r\n render() {\r\n const { src, fallback: hideEdit } = this._parseValueAsImageResultDTO();\r\n\r\n const viewer = (\r\n \r\n );\r\n\r\n if (this.props.isReadonly)\r\n return (\r\n
\r\n {viewer}\r\n
\r\n );\r\n else\r\n return (\r\n \r\n {src && viewer}\r\n
\r\n (this._input = ref)}\r\n />\r\n \r\n \r\n

{loc.t(\"upload:image.upload.button\")}

\r\n \r\n {!hideEdit && (\r\n \r\n \r\n

{loc.t(\"upload:image.edit.button\")}

\r\n \r\n )}\r\n
\r\n \r\n );\r\n }\r\n}\r\n","// @flow\r\nimport React from \"react\";\r\nimport FormsyEditorBase from \"./FormsyEditorBase\";\r\nimport UploadImage from \"components/UploadImage\";\r\n\r\ntype Props = {\r\n itemUri: string,\r\n name: string,\r\n header: string,\r\n value: Object,\r\n width?: number,\r\n height?: number,\r\n isReadonly?: boolean,\r\n isRequired?: boolean,\r\n};\r\n\r\nconst ImageEditorControl = (props: Props) => (\r\n (\r\n \r\n changeValue({ currentTarget: { value } })\r\n }\r\n />\r\n )}\r\n {...props}\r\n />\r\n);\r\nImageEditorControl.displayName = \"ImageEditorControl\";\r\nexport default ImageEditorControl;\r\n","var _path;\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nfunction SvgTarget(_ref, svgRef) {\n let title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n xmlnsXlink: \"http://www.w3.org/1999/xlink\",\n style: {\n enableBackground: \"new 0 0 469.333 469.333\"\n },\n viewBox: \"0 0 469.333 469.333\",\n xmlSpace: \"preserve\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M234.667,149.333c-47.147,0-85.333,38.187-85.333,85.333S187.52,320,234.667,320S320,281.813,320,234.667 S281.813,149.333,234.667,149.333z M425.387,213.333C415.573,124.373,344.96,53.76,256,43.947V0h-42.667v43.947 C124.373,53.76,53.76,124.373,43.947,213.333H0V256h43.947c9.813,88.96,80.427,159.573,169.387,169.387v43.947H256v-43.947 C344.96,415.573,415.573,344.96,425.387,256h43.947v-42.667H425.387L425.387,213.333z M234.667,384 c-82.453,0-149.333-66.88-149.333-149.333s66.88-149.333,149.333-149.333S384,152.213,384,234.667S317.12,384,234.667,384z\"\n })));\n}\n\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgTarget);\nexport default __webpack_public_path__ + \"static/media/target.9129153c.svg\";\nexport { ForwardRef as ReactComponent };","import React from \"react\";\r\nimport geoLocatorOptions from \"./geoLocatorOptions\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport { type Location } from \"data/types\";\r\nimport { ReactComponent as TargetIcon } from \"./target.svg\";\r\n\r\ntype Props = {\r\n /** callback when location received\r\n * @param {Location} location new location object\r\n */\r\n onSetLocation: (location: Location) => void,\r\n /** CSS class to apply to button */\r\n className?: string,\r\n /** fallback to IP if Geolocation fails or rejected */\r\n fallbackToIP: boolean,\r\n};\r\n\r\ntype State = {\r\n status: ConstantsEnum,\r\n};\r\n\r\nclass LocatorButton extends React.PureComponent {\r\n state = {\r\n status: Constants.OK,\r\n };\r\n static defaultProps = {\r\n fallbackToIP: true,\r\n };\r\n\r\n /** Locate location by GPS */\r\n locate = () =>\r\n this.setState({ status: Constants.LOADING }, async () => {\r\n const geolocator = await import(\"geolocator\");\r\n geolocator.default.locate(\r\n geoLocatorOptions({ fallbackToIP: this.props.fallbackToIP }),\r\n (err, location) => {\r\n if (err) {\r\n /* istanbul ignore next */\r\n if (err.message != null) alert(err.message);\r\n console.warn(err);\r\n this.setState({ status: Constants.ERROR });\r\n } else {\r\n this.setState({ status: Constants.OK });\r\n // console.log(location);\r\n this.props.onSetLocation(location.coords);\r\n }\r\n }\r\n );\r\n });\r\n\r\n _buttonStatus = () => {\r\n switch (this.state.status) {\r\n case Constants.LOADING:\r\n return ;\r\n\r\n case Constants.OK:\r\n return ;\r\n\r\n default:\r\n return (\r\n \r\n );\r\n }\r\n };\r\n\r\n render = () => (\r\n \r\n {this._buttonStatus()}\r\n \r\n );\r\n}\r\n\r\nexport default LocatorButton;\r\n","// @flow\r\nimport React from \"react\";\r\nimport InputGroup from \"react-bootstrap/lib/InputGroup\";\r\nimport FormControl from \"react-bootstrap/lib/FormControl\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport LocatorButton from \"components/LocatorButton\";\r\nimport { ParseLocation, LocationToString } from \"components/MapViewer/utils\";\r\nimport {\r\n type Location,\r\n type MapEditLocationResult,\r\n type MarkerDTO,\r\n} from \"data/types\";\r\nimport { openMapModal } from \"components/MapModal\";\r\nimport styles from \"./GeoPointInput.module.css\";\r\nimport GeoPlaceInput from \"components/GeoPlaceInput\";\r\nimport {\r\n SupportGeoPlaceInput,\r\n SupportGeoPointEdit,\r\n SupportGeoRadiusEdit,\r\n getGeoPointProvider,\r\n getGeoRadiusProvider,\r\n} from \"components/MapViewer/providerSupport\";\r\n\r\ntype Props = {\r\n /** displayName of field */\r\n label: ?string,\r\n /** current location in string format */\r\n value: ?string,\r\n /** whether to show an icon before the text field */\r\n showIcon: boolean,\r\n /** callback when user sets location\r\n * @param {string} value new location in string format\r\n */\r\n onChange: (value: string) => void,\r\n /** optional callback when user wants to manually set location on map\r\n * if defined this needs to take of calling openMapModal!\r\n */\r\n onSetLocationManually?: () => void,\r\n /** callback when user sets location by map\r\n * only needed if onSetLocationManually is not defined\r\n * @param {MapEditLocationResult} editLocationResult location set\r\n */\r\n onManualLocation?: (editLocationResult: MapEditLocationResult) => void,\r\n /** callback when user wants to triangulate - when not set then\r\n * button not visible\r\n */\r\n onTriangulate?: () => void,\r\n /** circle radius */\r\n radius?: number,\r\n /** optional CSS class to apply to root element */\r\n className?: string,\r\n /** placeholder text to display when @see {value} is empty */\r\n placeholder?: string,\r\n /** optional (custom) location marker icon */\r\n marker?: MarkerDTO,\r\n};\r\n\r\ntype State = {\r\n value: ?string,\r\n};\r\n\r\nclass GeoPointInput extends React.PureComponent {\r\n static defaultProps = {\r\n showIcon: true,\r\n };\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n this.state = {\r\n value: props.value,\r\n };\r\n }\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n if (prevProps.value !== this.props.value) {\r\n this.setState({ value: this.props.value });\r\n }\r\n }\r\n\r\n /** change location input text value */\r\n changeValue = (e) =>\r\n this.setState({ value: e.target.value }, () =>\r\n this.props.onChange(this.state.value)\r\n );\r\n\r\n changeValueFromPlace = (value: string) =>\r\n this.changeValue({ target: { value } });\r\n\r\n /** retrieve location from current GPS position */\r\n _setCurrentLocation = (location: Location): void =>\r\n this.setState({ value: LocationToString(location) }, () =>\r\n this.props.onChange(this.state.value)\r\n );\r\n\r\n /** show map and allow user to change marker's location */\r\n _setLocationManually = () => {\r\n // if (this.state.value.length === 0)\r\n // this._setCurrentLocation({ longitude: 0, latitude: 0 });\r\n openMapModal({\r\n mapProvider:\r\n this.props.radius == null\r\n ? getGeoPointProvider()\r\n : getGeoRadiusProvider(),\r\n useMarker: true,\r\n radius: this.props.radius,\r\n locations: [\r\n Object.assign(\r\n {},\r\n ParseLocation(\r\n this.state.value != null &&\r\n String(this.state.value).length > 0\r\n ? this.state.value\r\n : \"0,0\"\r\n ),\r\n {\r\n label: /* istanbul ignore next*/ this.props.label || \"\",\r\n icon:\r\n /* istanbul ignore next*/ this.props.radius == null\r\n ? this.props.marker\r\n : undefined,\r\n }\r\n ),\r\n ],\r\n // onSet: this._setCurrentLocation\r\n onSet: (editLocationResult: MapEditLocationResult) =>\r\n this.props.onManualLocation(editLocationResult),\r\n });\r\n };\r\n\r\n _supportGeoPointEdit = () =>\r\n this.props.radius == null\r\n ? SupportGeoPointEdit()\r\n : SupportGeoRadiusEdit();\r\n\r\n render = () => (\r\n \r\n {this.props.showIcon && (\r\n \r\n \r\n \r\n )}\r\n {SupportGeoPlaceInput() && (\r\n \r\n )}\r\n {!SupportGeoPlaceInput() && (\r\n \r\n )}\r\n \r\n {this.props.onTriangulate && (\r\n \r\n \r\n \r\n )}\r\n \r\n {this._supportGeoPointEdit() && (\r\n \r\n \r\n \r\n )}\r\n \r\n {this.props.children}\r\n \r\n );\r\n}\r\nexport default GeoPointInput;\r\n","import React from \"react\";\r\nimport { getDisplayName } from \"data/constants\";\r\n\r\ntype Config = {\r\n mapper: () => string,\r\n};\r\n\r\nconst withViewName =\r\n ({ mapper }: Config) =>\r\n (WrappedComponent: ComponentType) => {\r\n const HOC = (props: Props) => {\r\n const viewName = mapper(props);\r\n return ;\r\n };\r\n HOC.displayName = `withViewName(${getDisplayName(WrappedComponent)})`;\r\n return HOC;\r\n };\r\n\r\nexport default withViewName;\r\n","// @flow\r\n//#region imports\r\nimport React, {\r\n useState,\r\n useCallback,\r\n useEffect,\r\n useMemo,\r\n type Node,\r\n} from \"react\";\r\nimport { useEffectOnce, usePrevious, useRecycleBin } from \"hooks\";\r\nimport { History } from \"history\";\r\nimport { withRouter } from \"react-router\";\r\nimport TogglesHandler from \"containers/TogglesHandler\";\r\nimport styles from \"./document.module.css\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { compose } from \"redux\";\r\nimport produce from \"immer\";\r\nimport queryString from \"data/queryString\";\r\nimport MainLayout from \"components/MainLayout\";\r\nimport FormContainer from \"containers/Form\";\r\nimport DocViewerContainer from \"containers/DocViewer\";\r\nimport ActivitiesContainer from \"containers/Activities\";\r\nimport {\r\n setCurrentItemAction,\r\n setCurrentBreadcrumb,\r\n backupCurrentItemAction,\r\n restoreCurrentItemAction,\r\n formSetEditModeAction,\r\n} from \"data/actions\";\r\nimport {\r\n RefreshMode,\r\n ServerEventItemType,\r\n ServerEventActionType,\r\n ItemContextKey,\r\n type ToggleDTO,\r\n type ToggleItemDTO,\r\n} from \"data/types\";\r\nimport GlobalEventsHandler from \"containers/GlobalEventsHandler\";\r\nimport CommandActionHandler from \"components/CommandActions\";\r\nimport Constants, { isMiniView } from \"data/constants\";\r\nimport SplitPanes from \"containers/SplitPanes\";\r\nimport loc from \"i18next\";\r\n// import FloatingBarList from \"components/FloatingBar/FloatingBarList\";\r\nimport FileDropHandler, { type DroppedFile } from \"containers/FileDropHandler\";\r\nimport { toastStyled, toastTypes } from \"data/toast\";\r\nimport {\r\n check_isSyncUpload,\r\n check_licenseAllowEdit,\r\n} from \"containers/ActionPanel/ShouldBeVisible\";\r\n\r\nimport SuggestionHandler from \"containers/SuggestionHandler\";\r\nimport Pane from \"components/SplitPanes/Pane\";\r\nimport Status from \"components/Status\";\r\nimport withItemContext from \"containers/ItemContext\";\r\nimport withItemUri from \"containers/ItemUri\";\r\nimport withViewName from \"containers/ViewName\";\r\nimport ItemContextProvider from \"containers/ItemContext/Provider\";\r\nimport {\r\n breadcrumbVersionSelector,\r\n formIsEditModeSelector,\r\n breadcrumbFormatIdSelector,\r\n} from \"data/reducers/selectors\";\r\n//#endregion\r\n\r\n//#region flow types\r\ntype Props = {\r\n /** React-router History */\r\n history: History,\r\n /** withItemUri: either prop or by location */\r\n itemUri: string,\r\n /** whether shown as Modal */\r\n asModal?: boolean,\r\n /** React Node to show before toolbar */\r\n topRowBefore?: Node,\r\n /** React Node to show after toolbar */\r\n topRowEnd?: Node,\r\n /** callback when user wants to see previous doc */\r\n onPrev?: Function,\r\n /** callback when user wants to see next doc */\r\n onNext?: Function,\r\n // from TogglesHandler\r\n /** TogglesHandler: set current toggles */\r\n setToggles: Function,\r\n /** TogglesHandler: current toggles */\r\n toggles: ?ToggleDTO,\r\n /** Redux: current itemUri */\r\n itemUri: string,\r\n /** Redux: breadcrumb itemUri version */\r\n version?: number,\r\n /** whether current document is a favorite */\r\n isFav: boolean,\r\n /** current document name */\r\n docName: string,\r\n /** current viewName */\r\n viewName: string,\r\n /** whether running under Windows OS */\r\n onWindows: boolean,\r\n /** whether trigger edit mode on mount */\r\n triggerEditMode: boolean,\r\n /** TogglesHandler: currently selected toggles' names */\r\n selectedToggles: Array,\r\n /** SplitPanes callback to set split sizes */\r\n setSplitSizes: Function,\r\n /**pdf.js: search terms */\r\n searchTerm?: string,\r\n /** pdf.js: whether trigger browser print */\r\n triggerPrint: boolean,\r\n};\r\n//#endregion\r\n\r\nexport const Document = ({\r\n viewName,\r\n itemUri,\r\n refreshId,\r\n isDocClassificationEditAllowed,\r\n isEditMode,\r\n triggerEditMode: triggerEditModeFromProps,\r\n isFlatAU,\r\n itemStatus: itemStatusFromProps,\r\n toggles,\r\n setToggles,\r\n setSplitSizes,\r\n searchTerm: searchTermFromProps,\r\n triggerPrint: triggerPrintFromProps,\r\n asModal,\r\n topRowBefore,\r\n topRowEnd,\r\n onPrev,\r\n onNext,\r\n history: { location },\r\n}: Props) => {\r\n const [triggerEditMode, setTriggerEditMode] = useState(\r\n !!triggerEditModeFromProps\r\n );\r\n const formatId = useSelector((state) =>\r\n breadcrumbFormatIdSelector(state, viewName)\r\n );\r\n const versionFromStore = useSelector((state) =>\r\n breadcrumbVersionSelector(state, viewName)\r\n );\r\n const isMini = isMiniView(location);\r\n const formInEditMode = useSelector((state) =>\r\n formIsEditModeSelector(state, viewName)\r\n );\r\n const [version, setVersion] = useState(versionFromStore || 0);\r\n const [versionedItemUri, setVersionedItemUri] = useState(null);\r\n\r\n const qs = queryString.parse(location.search);\r\n\r\n const searchTerm = useMemo(\r\n () => (qs.mark != null ? qs.mark : searchTermFromProps),\r\n [searchTermFromProps, qs.mark]\r\n );\r\n\r\n const triggerPrint = useMemo(\r\n () => (qs.print ? true : triggerPrintFromProps),\r\n [triggerPrintFromProps, qs.print]\r\n );\r\n\r\n const dispatch = useDispatch();\r\n\r\n useEffectOnce(() => {\r\n dispatch(backupCurrentItemAction());\r\n return () => {\r\n dispatch(setCurrentBreadcrumb({ breadcrumb: {}, viewName }));\r\n dispatch(formSetEditModeAction(\"doc\", false));\r\n dispatch(restoreCurrentItemAction());\r\n };\r\n });\r\n\r\n // Trigger Edit\r\n const prevIsDocClassificationEditAllowed = usePrevious(\r\n isDocClassificationEditAllowed\r\n );\r\n if (\r\n prevIsDocClassificationEditAllowed !== isDocClassificationEditAllowed &&\r\n triggerEditMode\r\n ) {\r\n if (isDocClassificationEditAllowed) {\r\n /* istanbul ignore else */\r\n if (!isEditMode) {\r\n dispatch(formSetEditModeAction(\"doc\", true));\r\n setTriggerEditMode(false);\r\n }\r\n } else {\r\n toastStyled({\r\n message: loc.t(\"document:edit_form.notAuthorized\"),\r\n ...toastTypes.failure,\r\n });\r\n }\r\n }\r\n\r\n // FlatAU Toggles\r\n useEffect(() => {\r\n if (!isFlatAU) return;\r\n /* istanbul ignore if */\r\n if (toggles?.toggles?.length === 1) return;\r\n setToggles(\r\n produce(toggles, (draft) => {\r\n draft.toggles = draft.toggles\r\n .filter(\r\n (toggle: ToggleItemDTO) => toggle.value === \"viewer\"\r\n )\r\n .map((toggle: ToggleItemDTO) => {\r\n toggle.isSelected = true;\r\n toggle.isDisabled = true;\r\n return toggle;\r\n });\r\n }),\r\n false\r\n );\r\n }, [viewName, isFlatAU, toggles, setToggles]);\r\n\r\n useEffect(() => {\r\n setVersion(versionFromStore);\r\n }, [versionFromStore]);\r\n\r\n useEffect(() => {\r\n setVersion(0);\r\n setVersionedItemUri(null);\r\n setTriggerEditMode(!!triggerEditModeFromProps);\r\n dispatch(formSetEditModeAction(\"doc\", false));\r\n dispatch(\r\n setCurrentItemAction({\r\n name: viewName,\r\n itemUri,\r\n })\r\n );\r\n }, [viewName, itemUri, refreshId, triggerEditModeFromProps, dispatch]);\r\n useEffect(() => {\r\n dispatch(\r\n setCurrentItemAction({\r\n name: viewName,\r\n itemUri,\r\n })\r\n );\r\n }, [viewName, itemUri, dispatch]);\r\n\r\n const handleDrop = useCallback(\r\n (files?: Array) => {\r\n CommandActionHandler(\"doc_uploadVersion\", {\r\n files,\r\n itemUri,\r\n });\r\n },\r\n [itemUri]\r\n );\r\n\r\n const handleCancelForm = useCallback(\r\n () => dispatch(formSetEditModeAction(\"doc\", false)),\r\n [dispatch]\r\n );\r\n\r\n const handleShowVersion = useCallback(\r\n (version: number, itemUri: string) => {\r\n setVersion(version);\r\n setVersionedItemUri(itemUri);\r\n },\r\n []\r\n );\r\n\r\n const [, checkIfDeleted, checkIfAnyParentDeleted, checkIfInRecycleBin] =\r\n useRecycleBin(itemUri, itemStatusFromProps);\r\n\r\n const itemUriWithVersion = versionedItemUri || itemUri;\r\n if (isMini && checkIfInRecycleBin()) {\r\n return (\r\n \r\n );\r\n }\r\n return (\r\n \r\n {(itemContext) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n {itemContext.isFlatAU === false && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n {itemContext.isFlatAU === false && (\r\n \r\n )}\r\n \r\n
\r\n \r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport const mapViewerName = ({ asModal }: Props) =>\r\n asModal ? \"docmodal\" : \"document\";\r\n\r\nexport const DocumentWithoutHash = compose(\r\n withRouter,\r\n withViewName({\r\n mapper: mapViewerName,\r\n }),\r\n withItemUri,\r\n TogglesHandler({}),\r\n GlobalEventsHandler({\r\n items: [ServerEventItemType.document],\r\n actions: [ServerEventActionType.delete],\r\n refreshMode: RefreshMode.Originator,\r\n refreshMessage: loc.t(\"globalEvents:document.delete\"),\r\n refreshRoute: false,\r\n }),\r\n SplitPanes({\r\n paneIds: [\r\n \"#viewerPanel\",\r\n \"#drightPanel\",\r\n \"#docformPanel\",\r\n \"#docActivityPanel\",\r\n ],\r\n toggleIds: [\"viewer\", \"form\", \"act\"],\r\n }),\r\n withItemContext({\r\n asProps: [\r\n ItemContextKey.IsFlatAU,\r\n ItemContextKey.ItemStatus,\r\n ItemContextKey.IsDocClassificationEditAllowed,\r\n ],\r\n })\r\n)(Document);\r\n\r\nexport default compose(\r\n withRouter,\r\n withViewName({\r\n mapper: mapViewerName,\r\n }),\r\n withItemUri,\r\n SuggestionHandler({ docSearchProvider: true }),\r\n TogglesHandler({}),\r\n GlobalEventsHandler({\r\n items: [ServerEventItemType.document],\r\n actions: [ServerEventActionType.delete],\r\n refreshMode: RefreshMode.Originator,\r\n refreshMessage: loc.t(\"globalEvents:document.delete\"),\r\n refreshRoute: false,\r\n }),\r\n SplitPanes({\r\n paneIds: [\r\n \"#viewerPanel\",\r\n \"#drightPanel\",\r\n \"#docformPanel\",\r\n \"#docActivityPanel\",\r\n ],\r\n toggleIds: [\"viewer\", \"form\", \"act\"],\r\n }),\r\n withItemContext({\r\n asProps: [\r\n ItemContextKey.IsFlatAU,\r\n ItemContextKey.ItemStatus,\r\n ItemContextKey.IsDocClassificationEditAllowed,\r\n ],\r\n })\r\n)(Document);\r\n","import React, { useEffect } from \"react\";\r\nimport { useAsyncMemo } from \"hooks\";\r\nimport { useSelector, useDispatch, type Dispatch } from \"react-redux\";\r\nimport { type CardItemResultDTO, CardType, CardItemType } from \"data/types\";\r\nimport { getCardsByEntityAction } from \"data/actions\";\r\nimport Constants, { type ConstantsEnum } from \"data/constants\";\r\nimport Status from \"components/Status\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport Dropdown from \"@hs/dropdown\";\r\nimport MenuItem from \"react-bootstrap/lib/MenuItem\";\r\nimport Icons from \"@hs/icons\";\r\nimport styles from \"./RecentFolderSelect.module.css\";\r\nimport NativeSelect from \"components/NativeSelect\";\r\nimport bowser from \"data/bowser\";\r\nimport { fetchBreadcrumb } from \"data/api\";\r\nimport { maybeLocalizeBreadcrumb } from \"data/utils\";\r\n\r\ntype Props = {\r\n /** callback with first itemUri after loading recents */\r\n onLoad: (itemUri: string) => void,\r\n /** which itemUri to pre-select */\r\n defaultItemUri: ?string,\r\n /** callback when user changes selection\r\n * @param {string} itemUri new selected itemUri\r\n */\r\n onChange: (itemUri: string) => void,\r\n /** CSS Classname to apply */\r\n className?: string,\r\n};\r\n\r\n/** localize the siteName in the breadcrumb text */\r\nexport const FolderRow = ({\r\n label,\r\n siteType,\r\n className,\r\n}: {\r\n label?: string,\r\n siteType: SiteTypeEnum,\r\n className?: string,\r\n}) => {\r\n return (\r\n
\r\n \r\n \r\n {label}\r\n \r\n
\r\n );\r\n};\r\nFolderRow.displayName = \"FolderRow\";\r\n\r\n/** renders a dropdown with recent folders */\r\nexport const RecentFolderSelect = ({\r\n onLoad,\r\n defaultItemUri,\r\n onChange,\r\n className,\r\n}: Props) => {\r\n const status: ConstantsEnum = useSelector(s.cardsStatusSelector);\r\n const cards: Array = useSelector(s.cardsCardsSelector);\r\n const dispatch: Dispatch = useDispatch();\r\n useEffect(() => {\r\n if (status === Constants.NONE) {\r\n dispatch(\r\n getCardsByEntityAction(\r\n [CardType.Rec],\r\n [CardItemType.Folder],\r\n Constants.LOADING\r\n )\r\n );\r\n }\r\n }, [status, dispatch]);\r\n\r\n const [selectedCard, filteredCards] = useAsyncMemo(\r\n async () => {\r\n const filteredCards =\r\n cards == null\r\n ? []\r\n : cards.filter(\r\n (card) =>\r\n card.type === CardType.Rec &&\r\n card.itemtype === CardItemType.Folder\r\n );\r\n if (filteredCards.length === 0) return [null, []];\r\n if (defaultItemUri) {\r\n let card = filteredCards.find(\r\n (card) => card.uri === defaultItemUri\r\n );\r\n if (card) return [card, filteredCards];\r\n card = await fetchBreadcrumb(defaultItemUri).then((bc) => ({\r\n uri: defaultItemUri,\r\n bcText: bc.text,\r\n siteType: bc.siteType,\r\n }));\r\n return [card, [card, ...filteredCards]];\r\n }\r\n\r\n /* istanbul ignore else */\r\n if (filteredCards.length > 0 && typeof onLoad === \"function\") {\r\n onLoad(filteredCards[0].uri);\r\n }\r\n return [null, filteredCards];\r\n },\r\n [cards, defaultItemUri, onLoad],\r\n [null, []]\r\n );\r\n\r\n if ([Constants.NONE, Constants.LOADING].includes(status)) {\r\n return ;\r\n }\r\n\r\n if (bowser.is(\"iOS\") || bowser.is(\"mobile\"))\r\n return (\r\n onChange(option.K)\r\n }\r\n defaultValue={{ K: defaultItemUri }}\r\n value={{ K: defaultItemUri }}\r\n options={filteredCards.map((card, index) => ({\r\n K: card.uri,\r\n T: maybeLocalizeBreadcrumb(card),\r\n }))}\r\n valueKey=\"K\"\r\n labelKey=\"T\"\r\n />\r\n );\r\n else\r\n return (\r\n \r\n \r\n {selectedCard && (\r\n \r\n )}\r\n \r\n \r\n {filteredCards.map((card, index) => (\r\n \r\n onChange(card.uri)\r\n }\r\n >\r\n \r\n \r\n ))}\r\n \r\n \r\n );\r\n};\r\nRecentFolderSelect.displayName = \"RecentFolderSelect\";\r\nexport default RecentFolderSelect;\r\n","import React, { useState, useCallback, useEffect } from \"react\";\r\nimport { usePrevious } from \"hooks\";\r\nimport Radio from \"react-bootstrap/lib/Radio\";\r\nimport SiteSelect from \"components/SiteSelect\";\r\nimport RecentFolderSelect from \"components/RecentFolderSelect\";\r\nimport CommandActionButton from \"components/CommandActions/CommandActionButton\";\r\nimport loc from \"i18next\";\r\nimport { SearchScope, type SearchScopeEnum } from \"data/types\";\r\n\r\ntype Props = {\r\n className?: string,\r\n radioClassName?: string,\r\n selectClassName?: string,\r\n actionClassName?: string,\r\n searchScope: SearchScopeEnum,\r\n itemUri: string,\r\n onChange: (scope: SearchScopeEnum, itemUri?: string) => void,\r\n renderAction: boolean,\r\n};\r\n\r\nconst SearchScopeSelect = ({\r\n className,\r\n radioClassName,\r\n selectClassName,\r\n actionClassName,\r\n itemUri,\r\n searchScope,\r\n onChange,\r\n renderAction = true,\r\n}: Props) => {\r\n const [folderItemUri, setFolderItemUri] = useState();\r\n const [siteItemUri, setSiteItemUri] = useState();\r\n\r\n const prevSearchScope = usePrevious(searchScope);\r\n const prevItemUri = usePrevious(itemUri);\r\n const prevFolderItemUri = usePrevious(folderItemUri);\r\n const prevSiteItemUri = usePrevious(siteItemUri);\r\n useEffect(() => {\r\n if (prevSearchScope === searchScope && prevItemUri === itemUri) return;\r\n switch (searchScope) {\r\n case SearchScope.AllFolders:\r\n siteItemUri !== itemUri && setSiteItemUri(itemUri);\r\n break;\r\n case SearchScope.CurrentFolder:\r\n folderItemUri !== itemUri && setFolderItemUri(itemUri);\r\n break;\r\n default:\r\n }\r\n }, [\r\n itemUri,\r\n prevItemUri,\r\n searchScope,\r\n prevSearchScope,\r\n folderItemUri,\r\n siteItemUri,\r\n ]);\r\n\r\n useEffect(() => {\r\n if (prevFolderItemUri != null && prevFolderItemUri !== folderItemUri)\r\n onChange(SearchScope.CurrentFolder, folderItemUri);\r\n }, [onChange, folderItemUri, prevFolderItemUri]);\r\n\r\n useEffect(() => {\r\n if (prevSiteItemUri != null && prevSiteItemUri !== siteItemUri)\r\n onChange(SearchScope.AllFolders, siteItemUri);\r\n }, [onChange, siteItemUri, prevSiteItemUri]);\r\n\r\n const handleScopeChange = useCallback(\r\n (e) => {\r\n const searchScope = SearchScope[e.target.name];\r\n let itemUri = null;\r\n if (searchScope === SearchScope.AllFolders) itemUri = siteItemUri;\r\n if (searchScope === SearchScope.CurrentFolder)\r\n itemUri = folderItemUri;\r\n return onChange(searchScope, itemUri);\r\n },\r\n [onChange, siteItemUri, folderItemUri]\r\n );\r\n const handleFolderPickerChange = useCallback(\r\n (scope: SearchScopeEnum, itemUri?: string) => {\r\n onChange(scope, itemUri);\r\n },\r\n [onChange]\r\n );\r\n return (\r\n
\r\n \r\n {loc.t(\"search:scope.prefix_AllSites\")}\r\n \r\n \r\n {loc.t(\"search:scope.prefix_AllFolders\")}{\" \"}\r\n \r\n \r\n \r\n {loc.t(\"search:scope.prefix_CurrentFolder\")}{\" \"}\r\n \r\n {renderAction && (\r\n \r\n )}\r\n \r\n
\r\n );\r\n};\r\n\r\nexport default SearchScopeSelect;\r\n","// @flow\r\nimport React, { PureComponent, type ComponentType } from \"react\";\r\nimport { connect } from \"react-redux\";\r\nimport { getDisplayName, isMiniView } from \"data/constants\";\r\nimport { toastStyled, toastTypes } from \"data/toast\";\r\nimport * as s from \"data/reducers/selectors\";\r\nimport { getRoute } from \"components/ItemUriLink\";\r\nimport {\r\n RefreshMode,\r\n type RefreshModeEnum,\r\n type ServerEventMessage,\r\n type ServerEventItemEnum,\r\n type ServerEventActionEnum,\r\n} from \"data/types\";\r\n\r\ntype Config = {\r\n actions?: Array,\r\n items?: Array,\r\n /** Whom do we want to auto refresh */\r\n refreshMode?: RefreshModeEnum,\r\n /** Message, if not auto refresh */\r\n refreshMessage?: string,\r\n /** Refresh Route (e.g. if itemUri was deleted) */\r\n refreshRoute?: boolean,\r\n};\r\n\r\ntype Props = {\r\n /** current globalEvents from store */\r\n globalEvents: ?ServerEventMessage,\r\n /** current users Id */\r\n userId: number,\r\n /** current itemUri */\r\n itemUri?: string,\r\n /** React-router History */\r\n history?: History,\r\n /** is in mini view */\r\n isMini?: boolean,\r\n};\r\n\r\ntype State = {\r\n refreshId: number,\r\n refreshEvent: ?ServerEventMessage,\r\n};\r\n\r\n/**\r\n * will intercept globalEvents changes and provide a refreshId property\r\n */\r\nconst GlobalEventsHandler =\r\n ({\r\n actions = [],\r\n items = [],\r\n refreshMode = RefreshMode.All,\r\n refreshMessage = \"\",\r\n refreshRoute = false,\r\n }: Config) =>\r\n (WrappedComponent: ComponentType) => {\r\n class PP extends PureComponent {\r\n static displayName = `GlobalEventsHandler(${getDisplayName(\r\n WrappedComponent\r\n )})`;\r\n\r\n state = {\r\n refreshId: 0,\r\n refreshEvent: null,\r\n };\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n // console.log(prevProps.globalEvents.id, this.props.globalEvents.id);\r\n\r\n // new event?\r\n let doRefresh =\r\n prevProps.globalEvents.id !== this.props.globalEvents.id &&\r\n this.props.globalEvents.data != null;\r\n if (!doRefresh) return;\r\n\r\n // specific itemUri?\r\n doRefresh =\r\n this.props.itemUri == null\r\n ? true\r\n : // is this the one we are currently displaying?\r\n this.props.globalEvents.data.itemUri ===\r\n this.props.itemUri ||\r\n this.props.globalEvents.data.parentItemUri ===\r\n this.props.itemUri;\r\n if (!doRefresh) return;\r\n\r\n if (\r\n actions.length > 0 &&\r\n !actions.includes(this.props.globalEvents.action)\r\n )\r\n return;\r\n if (\r\n items.length > 0 &&\r\n !items.includes(this.props.globalEvents.item)\r\n )\r\n return;\r\n const refresh: string =\r\n refreshRoute && this.props.globalEvents.data.parentItemUri\r\n ? \"_refreshRoute\"\r\n : \"_refreshId\";\r\n if (refreshMode === RefreshMode.Self) {\r\n /* istanbul ignore else */\r\n if (\r\n this.props.globalEvents.data.userId ===\r\n this.props.userId\r\n ) {\r\n this[refresh]();\r\n }\r\n } else if (\r\n refreshMode === RefreshMode.Originator &&\r\n this.props.globalEvents.data.userId !== this.props.userId\r\n ) {\r\n toastStyled({\r\n ...toastTypes.refresh,\r\n message: refreshMessage,\r\n handleClick: this[refresh],\r\n });\r\n } else {\r\n this[refresh]();\r\n }\r\n }\r\n\r\n _refreshId = (): void => {\r\n this.setState((prevState: State) => ({\r\n refreshId: prevState.refreshId + 1,\r\n refreshEvent: this.props.globalEvents,\r\n }));\r\n };\r\n\r\n _refreshRoute = (): void => {\r\n const { history, isMini } = this.props;\r\n if (typeof history === \"undefined\") {\r\n console.error(\r\n \"Refreshing routes is not possible without props history and isMini\"\r\n );\r\n return;\r\n }\r\n history.push(\r\n getRoute(this.props.globalEvents.data.parentItemUri, isMini)\r\n );\r\n };\r\n\r\n render() {\r\n const { globalEvents, userId, ...rest } = this.props;\r\n return (\r\n \r\n );\r\n }\r\n }\r\n\r\n const mapStateToProps = (state, ownProps) => ({\r\n globalEvents: state.globalEvents,\r\n userId: s.userIdSelector(state),\r\n // We might not have a history prop => fallback\r\n isMini:\r\n ownProps.isMini ||\r\n (ownProps.history\r\n ? isMiniView(ownProps.history.location)\r\n : false),\r\n ...ownProps,\r\n });\r\n\r\n return connect(mapStateToProps)(PP);\r\n };\r\n\r\nexport default GlobalEventsHandler;\r\n","// @flow\r\nimport React from \"react\";\r\nimport FormGroup from \"react-bootstrap/lib/FormGroup\";\r\nimport InputGroup from \"react-bootstrap/lib/InputGroup\";\r\nimport FormControl from \"react-bootstrap/lib/FormControl\";\r\nimport Icons from \"@hs/icons\";\r\nimport loc from \"i18next\";\r\nimport Button from \"react-bootstrap/lib/Button\";\r\nimport { ParseRaster } from \"components/MapViewer/utils\";\r\nimport { openMapModal } from \"components/MapModal\";\r\nimport styles from \"./GeoRasterInput.module.css\";\r\nimport { getGeoRasterProvider } from \"components/MapViewer/providerSupport\";\r\nimport { type MarkerDTO } from \"data/types\";\r\nimport { getClassNames } from \"data/utils\";\r\n\r\ntype Props = {\r\n /** current itemUri */\r\n itemUri: string,\r\n /** current formatId */\r\n formatId: number,\r\n /** displayName of field */\r\n label: ?string,\r\n /** current location in string format */\r\n value: ?string,\r\n /** whether to show an icon before the text field */\r\n showIcon: boolean,\r\n /** callback when user sets location\r\n * @param {string} value new location in string format\r\n */\r\n onChange: (value: string) => void,\r\n /** optional callback when user wants to manually set location on map\r\n * if defined this needs to take of calling openMapModal!\r\n */\r\n onSetLocationManually?: () => void,\r\n /** callback when user sets location by map\r\n * only needed if onSetLocationManually is not defined\r\n * @param {string} editLocationResult location set\r\n */\r\n onManualLocation?: (editLocationResult: string) => void,\r\n /** optional CSS class to apply to root element */\r\n className?: string,\r\n /** placeholder text to display when @see {value} is empty */\r\n placeholder?: string,\r\n /** optional (custom) location marker icon */\r\n marker?: MarkerDTO,\r\n};\r\n\r\ntype State = {\r\n value: ?string,\r\n};\r\n\r\nclass GeoRasterInput extends React.PureComponent {\r\n static defaultProps = {\r\n showIcon: true,\r\n };\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n this.state = {\r\n value: props.value,\r\n };\r\n }\r\n\r\n componentDidUpdate(prevProps: Props) {\r\n if (prevProps.value !== this.props.value) {\r\n this.setState({ value: this.props.value });\r\n }\r\n }\r\n\r\n /** change location input text value */\r\n changeValue = (e) =>\r\n this.setState({ value: e.target.value }, () =>\r\n this.props.onChange(this.state.value)\r\n );\r\n\r\n /** show map and allow user to change marker's location */\r\n _setLocationManually = () => {\r\n const mapProvider = getGeoRasterProvider(\r\n this.props.itemUri,\r\n this.props.formatId\r\n );\r\n /* istanbul ignore next */\r\n if (mapProvider == null || mapProvider.isRaster !== true) {\r\n alert(\r\n \"Missing Raster configuration - do not know which Raster map to display!\"\r\n );\r\n return;\r\n }\r\n openMapModal({\r\n itemUri: this.props.itemUri,\r\n title: this.props.label,\r\n usePlaceInput: false,\r\n mapProvider,\r\n useMarker: true,\r\n locations: [\r\n Object.assign(\r\n {},\r\n ParseRaster(\r\n this.state.value != null &&\r\n String(this.state.value).length > 0\r\n ? this.state.value\r\n : \"\" // only MapViewer knows the real layer ids\r\n ),\r\n {\r\n label: /* istanbul ignore next*/ this.props.label || \"\",\r\n icon: this.props.marker,\r\n }\r\n ),\r\n ],\r\n onSet: (editLocationResult: string) =>\r\n this.props.onManualLocation(editLocationResult),\r\n });\r\n };\r\n\r\n render = () => (\r\n \r\n \r\n {this.props.showIcon && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {this.props.children}\r\n \r\n \r\n );\r\n}\r\nexport default GeoRasterInput;\r\n","import React from \"react\";\r\nimport FormsyEditorBase from \"./FormsyEditorBase\";\r\nimport GeoRasterInput from \"components/GeoRasterInput\";\r\n\r\nconst GeoRasterEditorControl = (props) => (\r\n (\r\n \r\n changeValue({ currentTarget: { value } })\r\n }\r\n onManualLocation={\r\n /* istanbul ignore next */ (value: string) =>\r\n changeValue({ currentTarget: { value } })\r\n }\r\n placeholder={props.placeholder}\r\n />\r\n )}\r\n {...props}\r\n />\r\n);\r\nGeoRasterEditorControl.displayName = \"GeoRasterEditorControl\";\r\nexport default GeoRasterEditorControl;\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"overlay\":\"Overlay_overlay__3F_R_\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"modal\":\"ConfirmModal_modal__Z7-B_\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"nodata\":\"NoData_nodata__3up7l\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrapper\":\"NoDocs_wrapper__2w2Vf\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"placeholder\":\"DocListSimple_placeholder__vwjcC\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"avatar\":\"Avatar_avatar__1dKRK\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"progress\":\"ValueProgress_progress__1DGPE\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrapper\":\"ValueEnum_wrapper__uW7dS\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"nolink\":\"LinkViewer_nolink__16Yhn\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"thumbnail\":\"Thumbnail_thumbnail__1L6K-\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"menu\":\"ActionsMenu_menu__3RmT7\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"canClick\":\"Breadcrumb_canClick__3cwNb\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"group\":\"ToggleBar_group__uw21L\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"list\":\"Tree_list__1gcde\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"modal\":\"DocListFilterModal_modal__g0_qf\"};"],"sourceRoot":""}