import { AppStore } from '../states/app.state' ; import { createSelector } from '@ngrx/store' ; export const selectApp = ( state ) => state . app ; export const getHeaderColor = createSelector ( selectApp , ( state ) => state . headerColor ) ; export const getHeaderTextColor = createSelector ( selectApp , ( state ) => state . headerTextColor ) ; export const getAppName = createSelector ( selectApp , ( state ) => state . appName ) ; export const getLogoPath = createSelector ( selectApp , ( state ) => state . logoPath ) ; export const getHeaderImagePath = createSelector ( selectApp , ( state ) => state . headerImagePath ) ; export const getUserProfile = createSelector ( selectApp , ( state ) => state . user ) ; export const getCurrentFolder = createSelector ( selectApp , ( state ) => state . navigation . currentFolder ) ; export const getCurrentVersion = createSelector ( selectApp , ( state ) => state . currentNodeVersion ) ; export const getAppSelection = createSelector ( selectApp , ( state ) => state . selection ) ; export const getSharedUrl = createSelector ( selectApp , ( state ) => state . sharedUrl ) ; export const getNavigationState = createSelector ( selectApp , ( state ) => state . navigation ) ; export const isInfoDrawerOpened = createSelector ( selectApp , ( state ) => state . infoDrawerOpened ) ; export const infoDrawerPreview = createSelector ( selectApp , ( state ) => state . infoDrawerPreview ) ; export const showFacetFilter = createSelector ( selectApp , ( state ) => state . showFacetFilter ) ; export const getDocumentDisplayMode = createSelector ( selectApp , ( state ) => state . documentDisplayMode ) ; export const getRepositoryStatus = createSelector ( selectApp , ( state ) => state . repository ) ; export const isQuickShareEnabled = createSelector ( getRepositoryStatus , ( info ) => info . status . isQuickShareEnabled ) ; export const isAdmin = createSelector ( selectApp , ( state ) => state . user . isAdmin ) ; export const getFileUploadingDialog = createSelector ( selectApp , ( state ) => state . fileUploadingDialog ) ; export const getSideNavState = createSelector ( getAppSelection , getNavigationState , ( selection , navigation ) => { return { selection , navigation } ; } ) ; export const getRuleContext = createSelector ( getAppSelection , getNavigationState , getUserProfile , getRepositoryStatus , ( selection , navigation , profile , repository ) => { return { selection , navigation , profile , repository } ; } ) ; export const infoDrawerMetadataAspect = createSelector ( selectApp , ( state ) => state . infoDrawerMetadataAspect ) ;