libs/core/schemas/src/file-schemas/pages-json-parts.schema.ts
Provide different images to the stage header visible on every page.
Properties |
|
| endImage (Optional) | |
| Type |
string
|
|
Description
|
The image on the end side of the horizontal axis (right-hand when LTR) |
| headline (Optional) | |
| Type |
string
|
|
Description
|
The headline is displayed inside the stage. This value will be translatable. |
| hideBackLink (Optional) | |
| Type |
boolean
|
|
Description
|
Flag that allows to hide the back link for specific pages, in case being displayed for the generated app |
| narrowImage (Optional) | |
| Type |
string
|
|
Description
|
Replacement when the screen estate is limited like on the mobile layout. |
| startImage (Optional) | |
| Type |
string
|
|
Description
|
The image on the start side of the horizontal axis (left-hand when LTR) |
| subHeadline (Optional) | |
| Type |
string
|
|
Description
|
Usually co-located to the headline. This value will be translatable. |
import type {
NavServiceActivatorConfig,
PfeActionConfig,
PfeBaseActionConfig
} from '@allianz/ngx-pfe';
import { JsonValue } from '@angular-devkit/core';
/**
* Configuration for Frame Parts (Navigation, Footer etc)
* @additionalProperties false
*/
export interface Frame {
/**
* Set to true to generate an application without header and footer. Defaults to false.
* @default false
*/
chromeless?: boolean;
footer?: FooterConfiguration;
header?: HeaderConfiguration;
stage?: StageConfiguration;
navigation?: FrameNavigationConfig;
content?: FrameContentConfiguration;
/**
* Set to true to use the spinner provided by TALY Frame. Spinner will block the entire
* frame whenever the application is busy with network requests.
* @default false
*/
spinner?: boolean;
/**
* Configuration for displaying the offer code below the action buttons.
*/
offerCode?: OfferCodeConfiguration;
}
/**
* Provide copyright text & links to be shown in the footer
* @additionalProperties false
*/
export interface FooterConfiguration {
/**
* Copyright Text
* @examples ["©️ Allianz 2022"]
*/
copyright?: string;
/**
* Array of links to be shown in footer
*/
links?: FooterLink[];
}
/**
* Provide the label & path for the footer link
* @additionalProperties false
*/
export interface FooterLink {
/**
* Is this an internal router path or external url?
*/
external?: boolean;
/**
* Unique id for the footer link. If provided, this will be used as part of the i18n key
*/
id?: string;
/**
* Text to be shown to the user
*/
label?: string;
/**
* The url or the router path for the link
*/
path?: string;
}
/**
* Provide additional configuration for the frame header.
* @additionalProperties false
*/
export interface HeaderConfiguration {
/**
* Provide a list of configurations for Building Blocks. They will show up as
* nx-header-actions within the NDBX header. The resources configured for these Building
* Blocks must only contain static values. PFE_STORE_QUERY or similar storage engines are
* not supported here.
*/
actions?: BuildingBlockConfiguration[];
}
/**
* Provide additional configuration for the frame content.
* @additionalProperties false
*/
export interface FrameContentConfiguration {
/**
* Whether the content should be centered in the available space. Only applies to Expert journeys.
*/
centered?: boolean;
}
export interface OfferCodeConfiguration {
/**
* The PFE state location where an offer code is stored
* @examples ["$.offerCode"]
*/
stateKey?: string;
}
/**
* Describe the configuration of your Building Block. This is required for generation and
* runtime.
* @additionalProperties false
*/
export interface BuildingBlockConfiguration {
/**
* Provide the acl identifier. Optional, the id will be used as the default fallback.
* @examples ["some-building-block"]
*/
aclTag?: string;
buildingBlockStyle?: BuildingBlockStyle;
/**
* Provide a mapping from an emitted business event (key) to a PFE service activator or a PFE action (value).
* @examples [{ "request-offers": "fetch-offers" }, { "request-offers": { "handlerType": "PFE_SERVICE_ACTIVATOR", "config": { "path": "offers" } } }, { "button-clicked": { "handlerType": "PFE_ACTION", "config": { "type": "DO_SOMETHING_INTERESTING" } } }]
*/
businessEvents?: { [key: string]: BusinessEventConfig };
/**
* Provide any type of data that you want to offer as the example state to be assigned when
* being used together with a Building Block debugger
*/
exampleState?: unknown;
/**
* Identify a Building Block on a page. Used as the PFE Store namespace and to identify a
* resource within an ACL rule. The Id must be unique on a single and usually should be
* unique across your application.
* @examples ["some-building-block"]
*/
id: string;
/**
* Provide the name of the module which provides the Building Block. Will be imported from
* the described package. Secondary entry points are not yet supported.
* @examples ["PolicyClientInformationModule"]
*/
module: string;
/**
* Provide a mapping from an internal navigation event (key) to an actual page id (value). Instead of a page id you can also use implicit navigation to go back ("NAVIGATE_BACK"), forward ("NAVIGATE_NEXT") or home ("NAVIGATE_HOME").
* @examples [{ "home": "NAVIGATE_HOME", "payment": "payment-page", "back": "NAVIGATE_BACK" }]
*/
navigation?: { [key: string]: string };
/**
* Provide the package name where this Building Block was published before.
* @examples ["@allianz/building-blocks"]
*/
package: string;
/**
* When a list of panels (on #/definitions/page) is given, use this value to refer to one
* panel. This will only affect the generation output.
* @examples ["some-panel"]
*/
panel?: string;
resources?: ResourcesConfiguration;
/**
* Optionally provide a section Id for this Building Block. A Building Block without a
* section will be treated as its own section.
*/
section?: string;
/**
* Selector of the given Building Block to output it on the given page.
* @examples ["bb-some-building-block"]
*/
selector: string;
/**
* Should this building block be shown in the sidebar? This only affects expert applications.
*/
sidebar?: boolean;
validators?: ValidationRule[];
}
/**
* Apply styling options to this Building Block.
*/
export type BuildingBlockStyle = BaseBuildingBlockStyle | CompactBuildingBlock;
/**
* @additionalProperties false
*/
interface BaseBuildingBlockStyle {
/**
* This Building Block will stick to the top of the screen.
* @default false
*/
sticky?: boolean;
/**
* The Building Block will have a background color that spans the full browser width.
* @default "transparent"
*/
backgroundColor?: string;
/**
* This Building Block will have less vertical paddings (16px in retail and 8px in expert).
* Only applicable when `backgroundColor` is set.
* @default false
*/
compact?: false;
}
/**
* @additionalProperties false
*/
interface CompactBuildingBlock extends Omit<BaseBuildingBlockStyle, 'compact'> {
/**
* The Building Block will have a background color that spans the full browser width.
* @default "transparent"
*/
backgroundColor: string;
/**
* This Building Block will have less vertical paddings (16px in retail and 8px in expert).
* Only applicable when `backgroundColor` is set.
* @default false
*/
compact: true;
/**
* This Building Block will stick to the top of the screen.
* @default false
*/
sticky?: false;
}
export interface ResourcesConfiguration {
[key: string]: ResourceObject | StaticResource;
}
export type StaticResource = boolean | number | string | object | unknown[] | null;
/**
* @additionalProperties false
*/
export interface ResourceObject {
/**
* For the PFE Store use a 'State Key Expression'
*/
query: string;
/**
* Use one of the supported Storage engines.
*/
type: StorageType;
}
/**
* Use one of the supported Storage engines.
*/
export const enum StorageType {
PfeStoreQuery = 'PFE_STORE_QUERY'
}
export type NotificationContext = 'info' | 'error' | 'success' | 'warning';
/**
* @additionalProperties false
*/
export interface BaseNotificationConfig {
/**
* The title of the notification. It can be fully static or a string containing a jsonPath expression. The static content will be translatable.
* @examples ["My Title", "Note about postal addresses in {$.country}"]
*/
title?: string;
/**
* The message of the notification. It can be fully static or a string containing a jsonPath expression. The static content will be translatable. Use Markdown for formatting.
* @examples [
* "My Message",
* "First name: {$['bb-pgr-simple'].person.firstName}. Full name: {$['bb-pgr-simple'].person.firstName} {$['bb-pgr-simple'].person.lastName}.",
* "text with [link](http://example.com) and list\n- item 1\n- [list link](http://example.com). Also supports dynamic data like: {$['bb-pgr-simple'].person.firstName}"
* ]
*/
message: string;
/**
* The type of the notification
*/
context: Exclude<NotificationContext, 'error'>;
/**
* Whether the notification can be closed by the user
*/
closable?: boolean;
/**
* An optional jsonPath expression or PFE_EXPRESSION condition that dictates whether this notification will be visible
* @examples ["$.section1.visible", "{$.bb1.person.firstName} == {$.bb2.person.firstName}"]
*/
visibleIf?: string;
}
/**
* @additionalProperties false
*/
export interface ErrorNotificationConfig
extends Omit<BaseNotificationConfig, 'closable' | 'context'> {
/**
* The type of the notification
*/
context: Extract<NotificationContext, 'error'>;
}
export type NotificationConfig = BaseNotificationConfig | ErrorNotificationConfig;
/**
* Business event configuration for a PFE service activator.
* Either a PFE service activator id or an object containing a service activator configuration.
*
* @additionalProperties false
*/
export type BusinessEventServiceActivator =
| string
| {
handlerType: 'PFE_SERVICE_ACTIVATOR';
config: BusinessEventServiceActivatorConfig;
};
/**
* PFE service activator configuration in business event object with "handlerType" 'PFE_SERVICE_ACTIVATOR'.
*/
export type BusinessEventServiceActivatorConfig = NavServiceActivatorConfig;
/**
* Business event configuration for a PFE Action.
*
* @additionalProperties false
*/
export interface BusinessEventAction {
handlerType: 'PFE_ACTION';
config: BusinessEventPfeActionConfig;
}
/**
* PFE action configuration in business event object with "handlerType" 'PFE_ACTION'
*/
export type BusinessEventPfeActionConfig = PfeActionConfig | PfeBaseActionConfig;
/**
* Business event configuration. The business event can run either a PFE service activator
* or a PFE action
*/
export type BusinessEventConfig = BusinessEventServiceActivator | BusinessEventAction;
/**
* Validation Rule to be evaluated during runtime.
* @examples [{ "id": "myControl", "type": "REQUIRED" }]
*/
export type ValidationRule =
| BasicValidationRule
| CustomValidationRule
| MinValidatorRule
| DynamicMinValidatorRule
| MaxValidatorRule
| DynamicMaxValidatorRule
| MinDateValidatorRule
| MaxDateValidatorRule
| MinLengthValidatorRule
| MaxLengthValidatorRule
| PatternValidatorRule;
/**
* @additionalProperties false
*/
export interface BasicValidationRule {
/**
* Optional error message to be shown. If provided it will be the default translation for the error message, otherwise a default for the given validation type is used.
*/
errorMessage?: string;
/**
* This value depends on the implementation of the given Building Block and usually refers to a form control path or name.
* @examples ["myControl", "someFormGroup.field"]
*/
id: string;
/**
* The type of validator to use. Can be any of the built-in validators as well as validators from plugins.
* See the documentation for details: https://itmp-bb-library.frameworks.allianz.io/my-viewer/guides/integration-guide#building-blocks-needs-some-validation-config
* @examples ["REQUIRED", "MIN_DATE", "PLUGIN_POSTCODE_VALIDATOR"]
*/
type: string;
}
/**
* @additionalProperties false
*/
export interface CustomValidationRule extends BasicValidationRule {
/**
* A validation parameter to be consumed by the validation function of the plugin validator.
*/
validationParam?: ValidationParam;
}
/**
* @additionalProperties false
*/
export interface MinValidatorRule extends BasicValidationRule {
/**
* The type of validator to use.
*/
type: 'MIN';
/**
* Minimal value number
*/
min: number;
}
/**
* @additionalProperties false
*/
export interface DynamicMinValidatorRule extends BasicValidationRule {
/**
* The type of validator to use.
*/
type: 'DYNAMIC_MIN';
/**
* PFE_STORE_QUERY object to fetch minimal value number
* @examples [{"type": "PFE_STORE_QUERY", "query": "$.minValue"}]
*/
min: ResourceObject;
}
/**
* @additionalProperties false
*/
export interface MaxValidatorRule extends BasicValidationRule {
/**
* The type of validator to use.
*/
type: 'MAX';
/**
* Maximum value number
*/
max: number;
}
/**
* @additionalProperties false
*/
export interface DynamicMaxValidatorRule extends BasicValidationRule {
/**
* The type of validator to use.
*/
type: 'DYNAMIC_MAX';
/**
* PFE_STORE_QUERY object to fetch maximum value number
* @examples [{"type": "PFE_STORE_QUERY", "query": "$.maxValue"}]
*/
max: ResourceObject;
}
/**
* @additionalProperties false
*/
export interface MinDateValidatorRule extends BasicValidationRule {
/**
* The type of validator to use.
*/
type: 'MIN_DATE';
/**
* RFC-3339 string (i.e. 'yyyy-mm-dd') or a natural date string (e.g. 'today+2days')
*/
minDate: string;
}
/**
* @additionalProperties false
*/
export interface MaxDateValidatorRule extends BasicValidationRule {
/**
* The type of validator to use.
*/
type: 'MAX_DATE';
/**
* RFC-3339 string (i.e. 'yyyy-mm-dd') or a natural date string (e.g. 'today+2days').
*/
maxDate: string;
}
/**
* @additionalProperties false
*/
export interface MinLengthValidatorRule extends BasicValidationRule {
/**
* The type of validator to use.
*/
type: 'MIN_LENGTH';
/**
* Minimal length of characters
*/
minLength: number;
}
/**
* @additionalProperties false
*/
export interface MaxLengthValidatorRule extends BasicValidationRule {
/**
* The type of validator to use.
*/
type: 'MAX_LENGTH';
/**
* Maximum length of characters
*/
maxLength: number;
}
/**
* @additionalProperties false
*/
export interface PatternValidatorRule extends BasicValidationRule {
/**
* Regex pattern.
*/
pattern: string;
}
export type ValidationParam = JsonValue | { [key: string]: unknown } | unknown[];
/**
* Configuration for the Taly frame stage
* @additionalProperties false
*/
export interface StageConfiguration {
backLink?: BackLink;
}
/**
* Configuration for back link in the stage
* @additionalProperties false
*/
export interface BackLink {
onClickServiceActivator?: string;
}
/**
* Configuration for navigation stepper
* @additionalProperties false
*/
export interface FrameNavigationConfig {
/**
* This can be used to combine pages into sections. The navigation stepper will show one
* step for each section. If you omit the sections each page will be shown as a separate
* step.
* @maxItems 7
* @default []
*/
sections?: SectionConfiguration[];
/**
* Set to true to disable the next button if the page is invalid.
* By default, the next button is always enabled
* @default false
*/
nextButtonDisabledWhenPageInvalid?: boolean;
}
/**
* Configuration for a section that consists of an id, a label to be used in the navigation,
* and a list of pages that this section contains.
* @additionalProperties false
*/
export interface SectionConfiguration {
/**
* The ID of this section. Must be unique across an app
* @examples ["section-a", "first-section", "introduction"]
*/
id: string;
/**
* The label for this section. This will be used to represent this section in the navigation
* stepper.
* @examples ["Section A", "First Section", "Introduction"]
*/
label: string;
/**
* A list of page-ids that belong to this section. When a user is on one of these pages the
* respective section will be marked as active.
* @examples [["page-a", "page-b", "page-c"], ["my-first-page"]]
*/
pages: string[];
/**
* An optional jsonPath expression or PFE_EXPRESSION condition that dictates whether this section will be visible
* @examples ["$.section1.visible", "{$.bb1.person.firstName} == {$.bb2.person.firstName}"]
*/
visibleIf?: string;
}
/**
* @additionalProperties false
*/
export interface LibraryConfiguration {
/**
* Name of the package
*/
package: string;
/**
* Version of the used package. You can use any semver compatible format as it's placed 'as
* is' in the package.json.
* @examples ["^1.0.0", "next", "10.0.0-beta.8"]
*/
version: string;
}
/**
* The page configuration usually consists of an id, list of Building Blocks and an optional
* set of Panels. Technically only the Id & Title are required values.
* @additionalProperties false
*/
export interface PageConfiguration {
/**
* Provide a list of configurations for Building Blocks. This is required for generation to
* determine which Building Block needs to be output. This configuration is used during
* runtime too.
* @default []
*/
blocks?: BuildingBlockConfiguration[];
/**
* The page id is used to determine the filename of the generated page. The page Id must
* also match the page id in the PFE configuration otherwise the setup during runtime will
* fail.
* @examples ["my-page"]
*/
id: string;
pageData?: PageData;
/**
* List of available panels to group other content into.
*/
panels?: PanelDefinition[];
/**
* List of available sections to group other content into.
* @default []
*/
sections?: PageSectionDefinition[];
/**
* The given title will be shown on top of the page above all building blocks. This is used
* as the label for the navigation steps when the Taly Frame navigation sections are not
* configured.
* @examples ["My Page"]
*/
title?: string;
/**
* Optional list of small print paragraphs that should be shown on this page. Use Markdown for formatting.
* @default []
* @examples [["This is my legal text\n with a [link](http://example.com)", "Other legal text with a list:\n - item 1\n - item 2"]]
*/
smallPrint?: string[];
/**
* Optional list of notifications that should be shown on this page.
* @default []
* @examples [[{"context": "info", "message": "This is an info message", "closable": false}, {"context": "error", "title": "Error title", "message": "This is an error message"}]]
*/
notifications?: NotificationConfig[];
}
/**
* @additionalProperties false
*/
export interface PageData {
navigation?: Navigation;
pageActionConfig?: PageActionConfig;
/**
* Provide different images to the stage header visible on every page.
*/
stage?: Stage;
}
/**
* @additionalProperties false
*/
export interface Navigation {
/**
* Hide the navigation when the user is on this particular page.
*/
hidden?: boolean;
/**
* Disable navigation by clicking on the navigation menu
*/
preventClickNavigation?: boolean;
}
/**
* @additionalProperties false
*/
export interface PageActionConfig {
/**
* Hide the "NEXT" button on this page.
*/
nextButtonHidden?: boolean;
/**
* Hide the "BACK" button on this page.
*/
backButtonHidden?: boolean;
/**
* Provide a customized text for the page (default is 'Back'). This value will be
* translatable.
*/
backButtonLabel?: string;
/**
* Override the default styling for the back button in the page, making it a "tertiary" button.
* Only applies for Expert journeys.
*/
backButtonUseTertiaryStyle?: boolean;
/**
* Provide a customized text for the page (default is 'Next'). This value will be
* translatable.
*/
nextButtonLabel?: string;
/**
* Provide a customized text for the cancel button (default is 'Cancel'). This value will be
* translatable.
*/
cancelButtonLabel?: string;
/**
* Configure additional buttons that will be shown along the Next and the Back button.
* @default []
* @examples [["SAVE_OFFER"]]
*/
extraActions?: ExtraPageAction[];
}
/**
* Available types of additional action buttons
*/
// Developer's note: add new page actions via unions (e.g. `'TYPE' | 'TYPE2'`).
// If we turn this list of actions into an enum we run into problems in generated
// apps that use `strict` compilation because of the way we "render" page data.
export type ExtraPageAction = 'SAVE_OFFER' | 'CANCEL_OPERATION';
/**
* Provide different images to the stage header visible on every page.
* @additionalProperties false
*/
export interface Stage {
/**
* The image on the end side of the horizontal axis (right-hand when LTR)
*/
endImage?: string;
/**
* The headline is displayed inside the stage. This value will be translatable.
*/
headline?: string;
/**
* Replacement when the screen estate is limited like on the mobile layout.
*/
narrowImage?: string;
/**
* The image on the start side of the horizontal axis (left-hand when LTR)
*/
startImage?: string;
/**
* Usually co-located to the headline. This value will be translatable.
*/
subHeadline?: string;
/**
* Flag that allows to hide the back link for specific pages, in case being displayed for the generated app
*/
hideBackLink?: boolean;
}
/**
* During the generation process this data is read to output Expansion Panels. Building
* Blocks can refer to the given Panel Id to be grouped with it.
* @additionalProperties false
*/
export interface PanelDefinition {
/**
* Set to true if this panel should be collapsed initially. By default the panel is expanded.
* @default false
*/
collapsed?: boolean;
/**
* Unique ID for the Panel to be referred to by Building Blocks.
*/
id: string;
/**
* Choose the style for the panel. Default is 'REGULAR' for expert journeys and 'LIGHT' for
* retail journeys. There is also 'EXTRA-LIGHT'.
*/
style?: StyleOfThePanel;
/**
* The given value is used as the default title for the generated panel. i18n needs to be
* supported by the generated application and will use this value as the default translation.
*/
title?: string;
}
/**
* Choose the style for the panel. Default is 'REGULAR' for expert journeys and 'LIGHT' for
* retail journeys. There is also 'EXTRA-LIGHT'.
*/
export const enum StyleOfThePanel {
ExtraLight = 'EXTRA-LIGHT',
Light = 'LIGHT',
Regular = 'REGULAR'
}
/**
* Page Sections can be used to group Building Blocks into visually connected sections.
* Building Blocks can refer to the given Section Id to be grouped within it.
* @additionalProperties false
*/
export interface PageSectionDefinition {
/**
* Unique ID for the Page Section to be referred to by Building Blocks.
*/
id: string;
/**
* The provided title will appear at the top of the section.
* @examples ["My Section"]
*/
title?: string;
/**
* Set to true if you want to add a divider line below this section.
* By default, the section does not contain a divider line.
* @default false
*/
dividerLineBelow?: boolean;
}
/**
* Configuration for a plugin that specifies a package and the modules from that package to
* be used, with optional options per module
* @additionalProperties false
*/
export interface PluginConfiguration {
modules: Module[];
package: string;
}
export interface Module {
name: string;
options?: { [key: string]: unknown };
}
/**
* Configuration for generating a webcomponent out of this application
* @additionalProperties false
*/
export interface WebcomponentConfiguration {
inputs?: WebcomponentInput[];
}
/**
* List of inputs that this webcomponent accepts. Each input will be placed into the store
* for later access.
* @additionalProperties false
*/
export interface WebcomponentInput {
/**
* The name of this input. This will be used as the HTML attribute that can be used to
* specify this input. HTML attributes only allow kebap-case so if you specify an input in
* camelCase, e.g. 'policyId', you need to pass it to the web component as 'policy-id="..."'.
* @examples ["policyId", "auth-token"]
*/
name: string;
/**
* The json expression at which the value of this input will be placed in the store.
* @examples ["$.inputs.policyId", "$.auth.token"]
*/
storeExpression: string;
}