Replace ButtonDialogComponent
In OneCX v6, replace ButtonDialogComponent with DialogInlineComponent for inline dialogs with configurable buttons and dynamic content.
Code Changes
-
Remove
ButtonDialogComponentfrom@onecx/portal-integration-angular. -
Add
DialogInlineComponentfrom@onecx/angular-accelerator. -
Replace tag
<ocx-button-dialog>with<ocx-dialog-inline>. -
Migrate input properties and output events as per the mapping table below.
Example
Before
<ocx-button-dialog
[config]="dialogConfig"
(resultEmitter)="onDialogResult($event)">
<p>Dialog Content to display</p>
</ocx-button-dialog>
export class ExampleComponent {
dialogConfig = {
primaryButtonDetails: { key: 'OCX_BUTTON_DIALOG.CONFIRM' },
secondaryButtonIncluded: true,
secondaryButtonDetails: { key: 'OCX_BUTTON_DIALOG.CANCEL' },
customButtons: [{ id: 'help', label: 'Help', alignment: 'left' }],
autoFocusButton: 'primary'
}
onDialogResult(result: any) {
console.log('Dialog result (inline):', result);
}
}
After
<ocx-dialog-inline
[config]="dialogConfig"
(resultEmitter)="onDialogResult($event)">
<p>Dialog Content to display</p>
</ocx-dialog-inline>
export class ExampleComponent {
dialogConfig = {
primaryButtonDetails: { key: 'OCX_BUTTON_DIALOG.CONFIRM' },
secondaryButtonIncluded: true,
secondaryButtonDetails: { key: 'OCX_BUTTON_DIALOG.CANCEL' },
customButtons: [{ id: 'help', label: 'Help', alignment: 'left' }],
autoFocusButton: 'primary'
}
onDialogResult(result: any) {
console.log('Dialog result (inline):', result);
}
}
Properties Mapping
ButtonDialogComponent |
DialogInlineComponent |
Notes |
|---|---|---|
config |
config |
|
ButtonDialogComponent |
DialogInlineComponent |
Notes |
|---|---|---|
resultEmitter |
resultEmitter |
Emits the type of button clicked (e.g. |