Skip to main content

lensUnavailableText

Turns personal-lens reports into the short explanation a list shows instead of its generic empty text, when a lens could not answer. CnIndexPage and CnDataTable use it for their empty states.

Signature​

import { lensUnavailableText, readLensReports } from '@conduction/nextcloud-vue'

const text = lensUnavailableText(readLensReports(body), {
'recent.audit-trail-disabled': t('dossiq', 'This server does not keep track of which cases you open.'),
})
ArgumentTypeDescription
reportsobject | nullThe reports, see readLensReports.
overridesobject | nullApp text keyed <lens>.<reason> or <reason>. Optional.

Returns the text for the first lens with available: false and a reason there is text for, or '' when there is none. On '' the caller keeps its own empty text.

Text​

App text wins over the built-in text, and <lens>.<reason> wins over <reason>. The built-in text exists for the recent lens only and is object-neutral:

ReasonEnglishDutch
audit-trail-disabledThis server does not keep track of what you open.Deze server houdt niet bij welke items je opent.
anonymousLog in to see what you opened recently.Log in om te zien wat je onlangs opende.
read-history-unavailableYour recent items are not available right now.Je recente items zijn nu niet beschikbaar.

An unknown reason, or a lens without text, gives ''. Another lens (watching) that starts reporting needs only text in overrides.