UNPKG

@c8y/ngx-components

Version:

Angular modules for Cumulocity IoT applications

75 lines 3.56 kB
import { FormlyFieldConfig } from '@ngx-formly/core'; import { NavigatorNodeData } from '../../navigator'; import { TabWithTemplate } from '../../tabs'; import { ProviderProperties } from './provider-properties.model'; /** * Allows you to fully configure a provider configuration page. */ export interface DynamicProviderConfig { /** Allows you to configure routing and navigator properties for the provider page. */ navigation: DynamicProviderNavigationConfig; /** Allows you to configure tabs for the provider page. */ tab?: DynamicProviderTabsConfig; /** Allows you to configure page title, field and button labels, messages, etc. */ layout: DynamicProviderLayoutConfig; /** Allows you to configure necessary service endpoints. */ endpoint: DynamicProviderEndpointConfig; } export type DynamicProviderTabsConfig = TabWithTemplate<string> & { canActivate?: any[]; }; export type DynamicProviderNavigationConfig = NavigatorNodeData & { canActivate?: any[]; }; export interface DynamicProviderLayoutConfig { /** The title displayed on the page header */ pageTitle: string; /** The title displayed on the card header */ cardTitle: string; /** Optional explanatory text displayed before the form */ description?: string; /** The label to use for the provider selection dropdown */ providerName: string; /** The placeholder text to use for the provider selection dropdown */ providerNamePlaceholder: string; /** Message to display if user input does not match any of the available dropdown options */ providerNameNoMatchesHint: string; /** Roles required for user to delete configuration */ deleteRoles?: string[]; /** Label to use for the delete button */ deleteBtnLabel: string; /** Roles required for user to save configuration */ saveRoles?: string[]; /** Label to use for the save button */ saveBtnLabel: string; /** Function to call before configuration is saved */ beforeSaveHook?: (model: ProviderProperties, fields: FormlyFieldConfig[]) => Promise<ProviderProperties> | ProviderProperties; /** Message text to display after successful save/update of the configuration */ configurationUpdatedSuccessMsg: string; /** The title displayed on the header of the modal for deletion confirmation */ deleteConfigurationModalTitle: string; /** The text displayed in the body of the modal for deletion confirmation */ deleteConfigurationModalBody: string; /** The label used for the OK button in the modal for deletion confirmation */ deleteConfigurationModalOkBtnLabel?: string; /** The label used for the cancel button in the modal for deletion confirmation */ deleteConfigurationModalCancelBtnLabel?: string; /** Message text to display after successful delete of the configuration */ configurationDeletedSuccessMsg: string; } export interface DynamicProviderEndpointConfig { /** Service endpoint that provides provider definitions */ definitionsEndpoint: Endpoint; /** Service endpoint for configuration CRUD operations */ configurationEndpoint: Endpoint; } /** * Used to define an enpoint by providing a base and list part of a URL. */ export interface Endpoint { /** Base part of your endpoint URL, e.g. <code>/services/notifications/providers</code> */ baseUrl: string; /** Entity part of your endpoint URL, e.g. <code>definitions</code> or <code>configuration</code> */ listUrl: string; } //# sourceMappingURL=dynamic-provider-config.model.d.ts.map