Skip to content

Stores ​

collage-admin uses Pinia with the Options Store syntax (defineStore('id', { state, getters, actions })). All stores live in app/stores/ and are auto-imported throughout the app. State mutation happens only inside actions — components never write to store properties directly.


useDamStore — app/stores/dam.ts ​

The main application store. Manages the DAM instance, folder/collection trees, asset lists, storage info, upload queue, search state, filter state, branding, and file download orchestration.

State ​

FieldTypeDescription
currentWorkspaceIdnumberWorkspace ID of the currently loaded DAM instance
foldersLoadingbooleanTrue while the folder list is being fetched
fetchingInstancesbooleanTrue while the DAM instance API call is in flight
folderListFolder[]Full folder tree for the active workspace
damInstanceDamInstanceThe loaded DAM instance object
companyNamestringCompany name returned with the DAM instance
collectionListCollection[]List of collages (collections) for the workspace
collectionLoadingbooleanTrue while the collection list is being fetched
assetListAsset[][]Columnar/paginated asset grid
storageStorageInfoBreakdown: image, audio, video, document, used, available, total, percentage
notificationsRecord<string, Notification>Keyed map of workspace notifications
uploadsUploadItem[]Active upload and download queue
brandingDetailsBrandingDetails | nullWhite-label branding config for the active workspace
leftMenuClosedbooleanSidebar collapsed state
allFilterListFilterItem[]Global applied filter list
searchKeystringActive search query string
searchMenuOptnSearchMenuOption | nullActive search scope selection
popularSearchDataPopularSearchData | nullPopular search data for the global search page
workspaceIdnumber | nullActive workspace ID (nullable; set before instance fetch)
userAgentAndLocationUserAgentAndLocationClient browser agent and location metadata
popularCollageSearchDataPopularSearchData | nullPopular search data scoped to the collage page
popularFolderSearchDataPopularSearchData | nullPopular search data scoped to the folder page
tagsFilterItemsFilterItem[]Tag filter options
folderPageFilterListFilterItem[]Active filters on the folder page
collagePageFilterListFilterItem[]Active filters on the collage page
currentFolderFolder | nullCurrently selected/viewed folder
workspaceAccessVerifiedbooleanGate that blocks workspace-scoped API calls until access is confirmed

Getters ​

GetterReturnsDescription
storageFullbooleanTrue when storage.percentage >= 100
storageUsedPercentagenumber(used / available) * 100, rounded to 2 decimal places
hasDamInstancebooleanTrue when not fetching and damInstance.id exists
getWorkspaceIdnumber | nullCurrent workspaceId from state
getInstanceIdunknowndamInstance.id

Actions ​

ActionDescription
setWorkspaceId(wpId)Sets workspaceId if the new value differs from the current one
setWorkspaceAccessVerified(value)Toggles the workspace access gate
shouldResetDamState()Returns true if the route workspace ID differs from currentWorkspaceId
getInstances(workspace_id?, routeParam?)Fetches the DAM instance; de-dupes concurrent calls per workspace on the client
_fetchInstances(wpId, $api, snackbar)Internal: calls the API, updates companyName, damInstance, storage, currentWorkspaceId
updateStorage()Refreshes the storage breakdown from the API
setBranding(data)Sets brandingDetails directly
setBrandingDetails(details)Direct mutator for brandingDetails
fetchWorkspaceBranding(workspaceId)POSTs to get-branding and updates brandingDetails; non-critical, swallows errors
fetchCheckBranding()GETs check-branding using the Host header; client-side fallback for branding resolution
setFolderName({oldFolder, newName})Renames a folder in folderList (re-sorts alphabetically) and patches matching entries in assetList
updateFolderPermission({folder, permission})Updates visibility and instance_visibility on a folder and its matching entries in assetList
setFolderList(folderList)Replaces folderList wholesale
appendFolders(folders)Pushes additional folders onto folderList
setFoldersLoading(val)Sets foldersLoading
setDamInstance(payload)Replaces damInstance; pass {} to reset
setCurrentFolder(folder)Sets currentFolder
setCollectionName({oldCollection, newName})Renames a collection in collectionList
addNewCollection(newCollection)Prepends a new collection to collectionList
setFolderItem(item)Inserts or updates a folder node in the tree, maintaining parent sub_category_data
resetState()Resets all state fields to their initial values
addNewUploads({items})Adds upload items to the queue, generating a random uploadId for each
updateUpload({uploadId, mutations})Patches an upload item in the queue by its ID
removeUpload({uploadId})Removes an upload item from the queue
clearAllUploads()Empties the upload queue
setLeftMenuState(newState)Sets sidebar open/closed state
setAllFilterList(newState)Replaces allFilterList
setSearchKey(newState)Sets searchKey
setSearchMenuOptn(newState)Sets searchMenuOptn
setPopularSearchData(newState)Sets popularSearchData
recentUpload()Fetches the count of recently uploaded assets for the active workspace
downloadMultipleFiles({files, folders, collection_id, download_name})Generates a zip via API and streams it to disk using StreamSaver; falls back to email notification
downloadMultipleSharedFiles({files, folders, collection_id, shareId, download_name, shareWorkspaceId})Same as above for shared-link downloads; includes a 60-second stall timeout guard
downloadFile({id, url, name, ...})Downloads a single asset file; handles both direct link and blob fetch paths
getNotifications(payload?)Fetches workspace notifications and stores them in notifications
uploadsAdd({items})Filters hidden files (names starting with .) then calls addNewUploads
uploadsUpdate({uploadId, mutations})Validates upload exists before delegating to updateUpload
updateCollageField(collage)Patches a collection object in collectionList by ID
updatePopularCollageSearchData(newState)Sets popularCollageSearchData
updateCollagePageFilterList(newState)Sets collagePageFilterList
saveTagsFilterItems(newState)Sets tagsFilterItems
updateFolderPageFilterList(newState)Sets folderPageFilterList
updatePopularFolderSearchData(newState)Sets popularFolderSearchData
updateAllFilterList(newState)Sets allFilterList
updateSearchKey(newState)Sets searchKey
updateSearchMenuOptn(newState)Sets searchMenuOptn
updatePopularSearchData(newState)Sets popularSearchData
setFileName({oldFile, newName})Updates display_file_name on a file in assetList
renameFiles({oldFile, newName})Alias for setFileName
renameFolders({oldFolder, newName})Alias for setFolderName
removeFolderFromList(item)Removes a folder from folderList; handles nested folders by updating the parent's sub_category_data
moveAssets({indexOfOwnParent, fileIds})Removes moved assets from their origin column in assetList

useAnalyticStore — app/stores/analytics.ts ​

Holds date-range, status, and modal state for the analytics section, plus shared insights data and client metadata.

State ​

FieldTypeDescription
lastDatestringNumber of days in the selected date range (default '29')
statusstringActive status filter value
dStartDatestringFilter start date in YYYY-MM-DD format (defaults to today)
dEndDatestringFilter end date in YYYY-MM-DD format (defaults to today)
activeDatestringCurrently focused date in YYYY-MM-DD format (defaults to today)
statusListunknown[]List of available status filter options
getEmailstringEmail address for export or notification flows
isMoveModalbooleanWhether the move-asset modal is open
isCopyModalbooleanWhether the copy-asset modal is open
isMoveFolderModalbooleanWhether the move-folder modal is open
isNewFolderModalbooleanWhether the new-folder modal is open
InsightsTransactionRecord<string, unknown>Insights transaction data
InsightsTransactionShareRecord<string, unknown>Shared insights transaction data
userAgentAndLocationRecord<string, unknown>Client browser agent and geographic location

Actions ​

ActionDescription
setLastDate(payload)Sets lastDate
setStartDate(payload)Sets dStartDate
setEndDate(payload)Sets dEndDate
setStatus(payload)Sets status
setStatusList(payload)Sets statusList
setActiveDate(payload)Sets activeDate
setEmail(payload)Sets getEmail
setMoveModal(payload)Sets isMoveModal
setCopyModal(payload)Sets isCopyModal
setMoveFolderModal(payload)Sets isMoveFolderModal
setNewFolderModal(payload)Sets isNewFolderModal
setUserAgentAndLocation(payload)Sets userAgentAndLocation; no-op if payload is null

useDialogStore — app/stores/dialog.ts ​

Centralises open/closed state and the selected entity for every confirmation and action dialog in the app — folder, collage, and asset dialogs, plus bulk selections and the download queue.

State ​

FieldTypeDescription
folder.createbooleanCreate-folder dialog open
folder.renamebooleanRename-folder dialog open
folder.deletebooleanDelete-folder dialog open
folder.movebooleanMove-folder dialog open
folder.permissionbooleanFolder permissions dialog open
folder.sharebooleanShare-folder dialog open
collage.createbooleanCreate-collage dialog open
collage.renamebooleanRename-collage dialog open
collage.deletebooleanDelete-collage dialog open
collage.permissionbooleanCollage permissions dialog open
collage.sharebooleanShare-collage dialog open
asset.renamebooleanRename-asset dialog open
asset.deletebooleanDelete-asset dialog open
asset.permissionbooleanAsset permissions dialog open
asset.sharebooleanShare-asset dialog open
asset.movebooleanMove-asset dialog open
asset.duplicatebooleanDuplicate-asset dialog open
selectedFolderFolder | nullFolder targeted by the active folder dialog
selectedCollageCollection | nullCollage targeted by the active collage dialog
selectedAssetFolderDetailFile | nullAsset targeted by the active asset dialog
selectedFoldersFolder[]Bulk folder selection
selectedCollagesCollection[]Bulk collage selection
selectedAssetsFolderDetailFile[]Bulk asset selection
selectedDownloadItemsunknown[]Items queued for download

Actions ​

ActionDescription
toggleFolderDialog(type, value, folder?)Opens or closes a folder dialog by type key; optionally sets selectedFolder
toggleCollageDialog(type, value, collage?)Opens or closes a collage dialog by type key; optionally sets selectedCollage
toggleAssetDialog(type, value, asset?)Opens or closes an asset dialog by type key; optionally sets selectedAsset
setBulkFolders(folders)Sets selectedFolders for bulk operations
clearSelectedFolder()Clears selectedFolder
setBulkCollages(collages)Sets selectedCollages for bulk operations
setBulkAssets(assets)Sets selectedAssets for bulk operations
setDownloadItems(items)Sets selectedDownloadItems
closeAll()Resets every dialog flag to false and clears all selected items

useLoadingStore — app/stores/loading.ts ​

Lightweight store for two independent loading indicators: a general full-page overlay and a counter-based overlay for long-running API requests.

State ​

FieldTypeDescription
apiLongRunningCountnumberCount of in-flight long-running API requests
isLoadingbooleanGeneral overlay loading state
loadingTextstringText shown in the general overlay (default 'Loading')

Getters ​

GetterReturnsDescription
showApiLongRunningOverlaybooleanTrue when apiLongRunningCount > 0

Actions ​

ActionDescription
incrementApiLongRunning()Increments apiLongRunningCount when a long-running request starts
decrementApiLongRunning()Decrements apiLongRunningCount (floor at 0) when a request completes
startOverlay(loadingText?)Sets isLoading = true and updates overlay text (defaults to 'Loading')
stopOverlay()Sets isLoading = false