From 79fab93351b4d33fb91df3c3c05c45cf10556016 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 23 Mar 2022 13:42:12 -0600 Subject: [PATCH] Fix missing button labels from legacy dialog --- api/js/etemplate/et2_widget_dialog.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/api/js/etemplate/et2_widget_dialog.ts b/api/js/etemplate/et2_widget_dialog.ts index f260d0a636..c12bf2763c 100644 --- a/api/js/etemplate/et2_widget_dialog.ts +++ b/api/js/etemplate/et2_widget_dialog.ts @@ -71,6 +71,23 @@ export class et2_dialog extends Et2Dialog super.template = value; } + _getButtons() : any + { + if(Array.isArray(this.buttons) && this.buttons[0].text) + { + console.warn("Button definitions should follow DialogButton interface", this, this.buttons); + return this.buttons.map((button) => + { + if(button.text) + { + button.label = button.text; + } + return button; + }); + } + return super._getButtons(); + } + /** * @deprecated * @returns {any}