diff --git a/components/template/template-form-builder-angularjs/src/main/resources/META-INF/dirigible/template-form-builder-angularjs/ui/controller.js.template b/components/template/template-form-builder-angularjs/src/main/resources/META-INF/dirigible/template-form-builder-angularjs/ui/controller.js.template index 4195b33dd33..afd2bc9798a 100644 --- a/components/template/template-form-builder-angularjs/src/main/resources/META-INF/dirigible/template-form-builder-angularjs/ui/controller.js.template +++ b/components/template/template-form-builder-angularjs/src/main/resources/META-INF/dirigible/template-form-builder-angularjs/ui/controller.js.template @@ -56,14 +56,6 @@ angular.module('forms', ['blimpKit', 'platformView', 'platformLocale', 'platform }; #end -#foreach($feed in $feeds) - ${dollar}http.get('$feed.url').then(response => { - $scope.$feed.name = response.data; - }).catch(e => { - console.error(e); - }); - -#end $scope.model = {}; #macro(formWidgets $elements) #foreach($element in $elements) @@ -118,5 +110,33 @@ angular.module('forms', ['blimpKit', 'platformView', 'platformLocale', 'platform $code +#end +#foreach($feed in $feeds) + ${dollar}http.get(`$feed.url`).then(response => { + #if($feed.func) + #if($feed.name == 'model') + Object.assign($scope.model, ${feed.func}(response.data)); + #else + $scope.$feed.name = ${feed.func}(response.data); + #end + #else + #if($feed.name == 'model') + Object.assign($scope.model, response.data); + #else + $scope.$feed.name = response.data; + #end + #end + }, error => { + console.error('$feed.name', error); + const errorData = JSON.stringify(error); + LocaleService.onInit(() => { + Dialogs.showAlert({ + title: LocaleService.t('$projectName:${tprefix}.dialogs.feedErrorTitle', 'Feed request failed'), + message: errorData && errorData !== '{}' ? errorData : LocaleService.t('$projectName:${tprefix}.dialogs.feedError', { feed: '$feed.name' }, "Could not retrive data from the feed '$feed.name'. See console for more information."), + type: AlertTypes.Error, + preformatted: false, + }); + }); + }); #end }); \ No newline at end of file diff --git a/components/template/template-form-builder-angularjs/src/main/resources/META-INF/dirigible/template-form-builder-angularjs/ui/translations.json.template b/components/template/template-form-builder-angularjs/src/main/resources/META-INF/dirigible/template-form-builder-angularjs/ui/translations.json.template index 76db25022e6..86fdba51a30 100644 --- a/components/template/template-form-builder-angularjs/src/main/resources/META-INF/dirigible/template-form-builder-angularjs/ui/translations.json.template +++ b/components/template/template-form-builder-angularjs/src/main/resources/META-INF/dirigible/template-form-builder-angularjs/ui/translations.json.template @@ -9,6 +9,8 @@ "dialogs": { "successTitle": "Submited", "errorTitle": "Submit failed", + "feedErrorTitle": "Feed request failed", + "feedError": "Could not retrive data from feed '{{feed}}'. See console for more information.", "successMsg": "Form submited successfully!" }, "t": {} diff --git a/components/ui/editor-form-builder/src/main/resources/META-INF/dirigible/editor-form-builder/configs/help-window.js b/components/ui/editor-form-builder/src/main/resources/META-INF/dirigible/editor-form-builder/configs/help-window.js new file mode 100644 index 00000000000..c774b048885 --- /dev/null +++ b/components/ui/editor-form-builder/src/main/resources/META-INF/dirigible/editor-form-builder/configs/help-window.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2026 Eclipse Dirigible contributors + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * SPDX-FileCopyrightText: Eclipse Dirigible contributors + * SPDX-License-Identifier: EPL-2.0 + */ +const viewData = { + id: 'formBuilderHelp', + label: 'Feeds Help', + path: '/services/web/editor-form-builder/dialogs/help.html', + maxWidth: '540px', + closeButton: true +}; +if (typeof exports !== 'undefined') { + exports.getView = () => viewData; +} \ No newline at end of file diff --git a/components/ui/editor-form-builder/src/main/resources/META-INF/dirigible/editor-form-builder/dialogs/help.html b/components/ui/editor-form-builder/src/main/resources/META-INF/dirigible/editor-form-builder/dialogs/help.html new file mode 100644 index 00000000000..11930b6e3ed --- /dev/null +++ b/components/ui/editor-form-builder/src/main/resources/META-INF/dirigible/editor-form-builder/dialogs/help.html @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + +

Name

+

The feed name determines the scope variable to which the response value is assigned. +

For example, if the feed name is extraData, the corresponding variable will be available as $scope.extraData. + Within the Designer tab, this variable can be referenced without the $scope. prefix.

+

To assign the response data directly to the model, set the feed name to model.

+ +

URL

+

This field specifies the URL of your back-end service. If the URL is dynamic, you can use a template literal (${}) to interpolate variable values or invoke + functions.

+

For example, if the URL is defined as:

+ /path/to/service/${someId}/ +

and a variable is declared in the Code tab as:

+ const someId = '1'; +

then the resulting request URL will be:

+ /path/to/service/1/ + +

Function

+

Specifying a function name is optional.

+

If you need to modify the response data before it is assigned to the target variable, you can provide a function name here. Then, define a corresponding function in the Code tab. This function must accept + the response data as its first parameter, apply any necessary transformations, and return the updated result for assignment.

+

For example, if the function name is set to:

+ printResponse +

the function should be defined as:

+
function printResponse(data) {
+    console.log(data);
+    return data;
+}
+ + + + + + diff --git a/components/ui/editor-form-builder/src/main/resources/META-INF/dirigible/editor-form-builder/editor.html b/components/ui/editor-form-builder/src/main/resources/META-INF/dirigible/editor-form-builder/editor.html index 3789af5b869..5d21882a6c3 100644 --- a/components/ui/editor-form-builder/src/main/resources/META-INF/dirigible/editor-form-builder/editor.html +++ b/components/ui/editor-form-builder/src/main/resources/META-INF/dirigible/editor-form-builder/editor.html @@ -174,6 +174,7 @@

+ @@ -181,6 +182,7 @@

+ @@ -191,6 +193,7 @@

+
Name URLFunction
{{feed.name}} {{feed.url}}{{feed.func}} diff --git a/components/ui/editor-form-builder/src/main/resources/META-INF/dirigible/editor-form-builder/extensions/help-window.extension b/components/ui/editor-form-builder/src/main/resources/META-INF/dirigible/editor-form-builder/extensions/help-window.extension new file mode 100644 index 00000000000..90f1a406be4 --- /dev/null +++ b/components/ui/editor-form-builder/src/main/resources/META-INF/dirigible/editor-form-builder/extensions/help-window.extension @@ -0,0 +1,5 @@ +{ + "module": "editor-form-builder/configs/help-window.js", + "extensionPoint": "platform-windows", + "description": "Feeds help window" +} \ No newline at end of file diff --git a/components/ui/editor-form-builder/src/main/resources/META-INF/dirigible/editor-form-builder/js/editor.js b/components/ui/editor-form-builder/src/main/resources/META-INF/dirigible/editor-form-builder/js/editor.js index 4c68fa86341..5dc993603e8 100644 --- a/components/ui/editor-form-builder/src/main/resources/META-INF/dirigible/editor-form-builder/js/editor.js +++ b/components/ui/editor-form-builder/src/main/resources/META-INF/dirigible/editor-form-builder/js/editor.js @@ -1871,6 +1871,14 @@ editorView.controller('DesignerController', ($scope, $window, $document, $timeou minlength: 1, required: true }, + 'afFunc': { + label: 'Function Name', + controlType: 'input', + placeholder: '', + type: 'text', + minlength: 1, + required: false + }, }, submitLabel: 'Add', cancelLabel: 'Cancel' @@ -1879,7 +1887,8 @@ editorView.controller('DesignerController', ($scope, $window, $document, $timeou $scope.$evalAsync(() => { $scope.formData.feeds.push({ name: form['afName'], - url: form['afUrl'] + url: form['afUrl'], + func: form['afFunc'] }); $scope.fileChanged(); }); @@ -1918,6 +1927,15 @@ editorView.controller('DesignerController', ($scope, $window, $document, $timeou value: feed.url, required: true }, + 'afFunc': { + label: 'Function Name', + controlType: 'input', + placeholder: '', + type: 'text', + minlength: 1, + value: feed.func, + required: false + }, }, submitLabel: 'Save', cancelLabel: 'Cancel' @@ -1926,6 +1944,7 @@ editorView.controller('DesignerController', ($scope, $window, $document, $timeou $scope.$evalAsync(() => { feed.name = form['afName']; feed.url = form['afUrl']; + feed.func = form['afFunc']; $scope.fileChanged(); }); } @@ -2059,6 +2078,12 @@ editorView.controller('DesignerController', ($scope, $window, $document, $timeou $scope.selectedTab = tabId; }; + $scope.feedHelp = () => { + dialogHub.showWindow({ + id: 'formBuilderHelp' + }); + }; + const createDomFromJson = (model, containerId) => { for (let i = 0; i < model.length; i++) { let control; diff --git a/components/ui/editor-monaco/src/main/resources/META-INF/dirigible/editor-monaco/css/embeddable.css b/components/ui/editor-monaco/src/main/resources/META-INF/dirigible/editor-monaco/css/embeddable.css index e600c97ed81..76518d090e2 100644 --- a/components/ui/editor-monaco/src/main/resources/META-INF/dirigible/editor-monaco/css/embeddable.css +++ b/components/ui/editor-monaco/src/main/resources/META-INF/dirigible/editor-monaco/css/embeddable.css @@ -2,4 +2,9 @@ font-family: codicon; font-display: block; src: url("/webjars/monaco-editor/min/vs/base/browser/ui/codicons/codicon/codicon.ttf") format("truetype"); +} + +.monaco-editor, +.monaco-editor * { + font-family: "Droid Sans Mono", "Consolas", "Menlo", "Monaco", "Liberation Mono", "Courier New", "monospace", monospace; } \ No newline at end of file diff --git a/components/ui/editor-monaco/src/main/resources/META-INF/dirigible/editor-monaco/embeddable/editor.js b/components/ui/editor-monaco/src/main/resources/META-INF/dirigible/editor-monaco/embeddable/editor.js index 3dbf16046a1..28c98cb8ccf 100644 --- a/components/ui/editor-monaco/src/main/resources/META-INF/dirigible/editor-monaco/embeddable/editor.js +++ b/components/ui/editor-monaco/src/main/resources/META-INF/dirigible/editor-monaco/embeddable/editor.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Eclipse Dirigible contributors + * Copyright (c) 2026 Eclipse Dirigible contributors * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 @@ -101,6 +101,8 @@ angular.module('codeEditor', ['platformTheming']).directive('codeEditor', (Theme automaticLayout: true, language: scope.codeLang || 'javascript', readOnly: scope.readOnly ? true : false, + fontFamily: 'Droid Sans Mono, Consolas, Menlo, Monaco, Liberation Mono, Courier New, monospace', + fontSize: 14, }); const model = codeEditor.getModel(); diff --git a/components/ui/editor-monaco/src/main/resources/META-INF/dirigible/editor-monaco/js/editor.js b/components/ui/editor-monaco/src/main/resources/META-INF/dirigible/editor-monaco/js/editor.js index 3af96a63128..ee5c7919b3e 100644 --- a/components/ui/editor-monaco/src/main/resources/META-INF/dirigible/editor-monaco/js/editor.js +++ b/components/ui/editor-monaco/src/main/resources/META-INF/dirigible/editor-monaco/js/editor.js @@ -1,3 +1,14 @@ +/* + * Copyright (c) 2026 Eclipse Dirigible contributors + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v20.html + * + * SPDX-FileCopyrightText: Eclipse Dirigible contributors + * SPDX-License-Identifier: EPL-2.0 + */ const WORKSPACE_API = "/services/ide/workspaces"; const REPOSITORY_API = "/services/core/repository"; const REGISTRY_API = "/services/core/repository/registry/public"; @@ -624,6 +635,8 @@ class DirigibleEditor { value: '', automaticLayout: true, readOnly: readOnly, + fontFamily: 'Droid Sans Mono, Consolas, Menlo, Monaco, Liberation Mono, Courier New, monospace', + fontSize: 14, autoClosingBrackets: DirigibleEditor.isAutoBracketsEnabled(), renderWhitespace: DirigibleEditor.getRenderWhitespace(), wordWrap: DirigibleEditor.getWordWrap(), diff --git a/components/ui/view-artefacts/src/main/resources/META-INF/dirigible/view-artefacts/artefacts.html b/components/ui/view-artefacts/src/main/resources/META-INF/dirigible/view-artefacts/artefacts.html index 02ed1eb0582..bb8ec75520d 100644 --- a/components/ui/view-artefacts/src/main/resources/META-INF/dirigible/view-artefacts/artefacts.html +++ b/components/ui/view-artefacts/src/main/resources/META-INF/dirigible/view-artefacts/artefacts.html @@ -1,6 +1,6 @@ - 1.8.10 + 1.8.11 11.18.2 4.4.3 1.15.7