Ga naar hoofdinhoud

CnEndpointNotice

CnEndpointNotice is what an endpoint-fed widget shows when its read did not answer in full. It takes the error, refused and truncated refs that useEndpointSource returns.

  • Refused (the endpoint answered 401 or 403): the server's own sentence, as a warning. A reader outside a report's audience learns why the widget is empty.

  • Failed: the server's message, as an error.

  • Truncated (the response body carried truncated: true): an info note that the figures may be incomplete, because the endpoint stopped reading at a limit.

  • Waiting to be asked (loadOn: "request"): a button (requestLabel, default "Show") with an optional requestHint above it; pressing it emits request.

It renders nothing when the read succeeded in full. CnWidgetObjectTable and CnChartWidget render it for their endpointSource; an app widget can do the same.

<template>
<div>
<CnEndpointNotice error="This report covers every case, so it is for the controller and beheerder roles." :refused="true" />
<CnEndpointNotice error="Report generation failed" />
<CnEndpointNotice :truncated="true" />
</div>
</template>

Props​

PropTypeDefaultMeaning
errorString''The read's error message; for a refusal, the server's sentence
refusedBooleanfalseThe read was refused rather than failing
truncatedBooleanfalseThe answer declared itself short
truncatedTextString''Replaces the default truncation sentence
awaitingRequestBooleanfalseThe source waits for the reader to ask
requestLabelString''The button label, already translated (default "Show")
requestHintString''A sentence above the button, already translated
requestDisabledBooleanfalseDisables the button, such as while a required token is unset

Events​

EventPayloadMeaning
requestnoneThe reader pressed the request button