Dashboard
When embedded in an application, this widget enables complete dashboard management for tenant end-users in embedded scenarios.
Embeddable Script
<!-- Tag -->
<qrvey-builders settings="config"></qrvey-builders>
<!-- Config -->
<script>
var config = {
"apiKey": "<YOUR_PRIVATE_API_KEY>",
"domain": "<DOMAIN>",
"appId": "<APP_ID>",
"userId": "<USER_ID>",
"dashboardId": "<DASHBOARD_ID>",
"clientId": "<CLIENT_ID>",
"orgId": "<ORG_ID>",
"customization": {
"views": {
"design": {
"remove": ["downloadModal.qSubscribeOption"]
}
}
}
};
</script>
<!-- Launcher -->
<!-- Widget's Launcher -->
<script type="module" src="https://integration-test.az.mp.qrveyapp.com/qrvey-dashboard/qrvey-dashboard/qrvey-dashboard.esm.js"></script>
Configuration Object
Property | Type | Required | QVToken Support | Description |
---|---|---|---|---|
domain | String | Required | No | Qrvey instance URL. |
qvToken | String | Optional | No | Encrypted string securing the widget config. Required if no apiKey is provided. Cannot be used of apiKey . |
apiKey | String | Required, if qvToken is not provided | No | Secret identification token for accessing the application. Required if no qvToken is provided. Cannot be used with qvToken . |
appId | String | Required | Yes, and must be passed via qvToken during production. | ID of the Qrvey application. |
userId | String | Required | Yes, and must be passed via qvToken during production. | User ID of the application owner. |
dashboardId | String | Optional | Yes | ID of a specific dashboard to embed. If omitted, the widget will present the "browse dashboards" page. |
clientId | String | Required | Yes, and must be passed via qvToken during production. | Unique identifier for the tenant end user. The clientId must be set to a unique value for each tenant end user. |
roles | Array<string> | Optional | Only | Used for setting Column Level Security as well as access/permissions when sharing. |
orgId | String | Required | Yes | Organization ID for the end user. Required for widget access and sharing. |
orgs | Object Array | Optional | Only | The orgs object to list users and roles per organization for Sharing. The provided list of users and roles, defined per organization, will be displayed in the Share and Subscribe modals. Note: The orgs object is ignored when the widget's orgId is set to "org:0" . |
userFilters | Object | Optional | Yes | Collection of custom filters that the system will apply to the visualized data. For more information, see Working With Filters in Embedded Scenarios. |
timezone | String | Optional | Yes | Timezone offset applied to dates. For more information, see Configuring Time Zone Settings. |
i18n | Object | Optional | No | Defines the language to be displayed in the static text of the widget as well as the dataset columns. For details, please see The i18n Object. |
themeId | String | Optional | No | Theme ID to use in the component. For more details, please see Accessing a Theme Programmatically. |
styles | JSON | Optional | No | Key-value JSON with style variables. See the Dashboard Styles documentation. |
defaultMode | "design" or "interact" | Optional | No | Sets the dashboard's default mode, so it opens in either design or interact mode. Defaults to interact mode. |
customTokens | Custom Tokens | Optional | No | Sets custom threshold values in Bullet and Dial charts, tokens in Flows, etc. For more information, see Using Custom Tokens. |
permissions | JSON | Optional | Only | Record-level security permissions object. |
asset_permissions | Asset Permissions | Optional | Only | The asset permissions object. |
String | Optional, but Required in order to enable scheduling and subscriptions. | Only | Email of the clientId user. When passed in the qvToken, enables scheduling of exports and subscriptions. | |
customization | JSON | Optional | No | The Dashboard customization object. |
Orgs
Property | Type | Description |
---|---|---|
orgId | String | The ID of the organization to which the roles and users will be defined next. Should correspond to the user in session's orgId if you want the roles and users to be listed in sharing and subscribe. |
orgRoles | Array | The roles available to share the dashboard with inside the organization defined with orgId . |
users | Array | An object/array of users to be listed in the sharing and subscribe modals. This is not for the current user. Adjust clientId and email accordingly. |
users.clientId | String | clientId of the user. |
users.email | String | Email address of the user. |
const orgs = [
{
orgId: 'ORG_ID',
orgRoles: [ '<ROLE1>', '<ROLE2>' ],
users: [
{
clientId: 'CLIENT_ID',
email: 'EMAIL'
},
{
clientId: 'CLIENT_ID2',
email: 'EMAIL2'
}
]
}
]
i18n
For more information, please see Internationalization, Step by Step.
Property | Type | Required | Value |
---|---|---|---|
lang | String | Required | The language to use for the UI. Example: "es" . |
locale | String | Optional | The locale code to use for date and number formatting. Example: "es-ES" . |
Methods
The widget supports custom events to update keys of the configuration. You can dispatch an event using your own user interface to modify the behavior.
// Enables changes to the userFilters property.
const dashboardComponent = document.querySelector("qrvey-dashboard");
dashboardComponent.setUserFilters(filters);