From 4ebf20aef66fde8bfa094317d7ab379cc84b1d14 Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Sat, 29 Mar 2025 23:39:52 +0200 Subject: [PATCH 01/76] #2407 Initial support for IPre/PostAction JavaScript imports. Continuing to move from old-style imports to rigid ES6-style imports, we need to support custom imports in IPre/PostActions for generated from Java actions. This will be required for FileSaverPostAction and likely will be used in other Pre/PostActions (e.g. OpenLinkPostAction). This commit contains support for main menu actions. --- .../resources/webui/AbstractWebUiConfig.java | 28 ++++++- .../api/actions/EntityActionConfig.java | 25 +++++- .../web/menu/impl/MainMenuBuilder.java | 8 ++ .../platform/web/menu/impl/WebMainMenu.java | 22 ++++-- .../fielden/platform/web/minijs/JsImport.java | 79 +++++++++++++++++++ .../minijs/exceptions/JsCodeException.java | 21 +++++ .../web/view/master/api/actions/IAction.java | 10 +++ .../platform/web/app/tg-app-template.js | 9 ++- 8 files changed, 186 insertions(+), 16 deletions(-) create mode 100644 platform-web-ui/src/main/java/ua/com/fielden/platform/web/minijs/JsImport.java create mode 100644 platform-web-ui/src/main/java/ua/com/fielden/platform/web/minijs/exceptions/JsCodeException.java diff --git a/platform-web-resources/src/main/java/ua/com/fielden/platform/web/resources/webui/AbstractWebUiConfig.java b/platform-web-resources/src/main/java/ua/com/fielden/platform/web/resources/webui/AbstractWebUiConfig.java index 652d55ee16a..009a64fcefc 100644 --- a/platform-web-resources/src/main/java/ua/com/fielden/platform/web/resources/webui/AbstractWebUiConfig.java +++ b/platform-web-resources/src/main/java/ua/com/fielden/platform/web/resources/webui/AbstractWebUiConfig.java @@ -17,7 +17,6 @@ import ua.com.fielden.platform.types.tuples.T2; import ua.com.fielden.platform.ui.menu.MiWithConfigurationSupport; import ua.com.fielden.platform.utils.IDates; -import ua.com.fielden.platform.utils.ResourceLoader; import ua.com.fielden.platform.web.action.CentreConfigurationWebUiConfig; import ua.com.fielden.platform.web.action.StandardMastersWebUiConfig; import ua.com.fielden.platform.web.app.IWebUiConfig; @@ -33,6 +32,7 @@ import ua.com.fielden.platform.web.menu.IMainMenuBuilder; import ua.com.fielden.platform.web.menu.impl.MainMenuBuilder; import ua.com.fielden.platform.web.minijs.JsCode; +import ua.com.fielden.platform.web.minijs.JsImport; import ua.com.fielden.platform.web.ref_hierarchy.ReferenceHierarchyWebUiConfig; import ua.com.fielden.platform.web.resources.webui.exceptions.InvalidUiConfigException; import ua.com.fielden.platform.web.sse.EventSourceDispatchingEmitter; @@ -47,6 +47,7 @@ import java.util.concurrent.ConcurrentHashMap; import static java.lang.String.format; +import static java.lang.String.join; import static java.util.Arrays.asList; import static java.util.Optional.of; import static java.util.Optional.ofNullable; @@ -56,6 +57,7 @@ import static ua.com.fielden.platform.types.Hyperlink.SupportedProtocols.HTTPS; import static ua.com.fielden.platform.types.tuples.T2.t2; import static ua.com.fielden.platform.utils.ResourceLoader.getStream; +import static ua.com.fielden.platform.utils.ResourceLoader.getText; import static ua.com.fielden.platform.web.centre.CentreUpdater.getDefaultCentre; import static ua.com.fielden.platform.web.centre.api.actions.impl.EntityActionBuilder.action; import static ua.com.fielden.platform.web.centre.api.context.impl.EntityCentreContextSelector.context; @@ -268,9 +270,31 @@ public final String genWebUiPreferences() { return webUiBuilder.genWebUiPrefComponent(); } + private static Collection convertActionImportsToAliasedForm(final MainMenuBuilder mainMenuConfig) { + return mainMenuConfig.mainMenuActionImports().stream().map(JsImport::convertToAliasedForm).toList(); + } + + private SortedSet mainMenuActionImports() { + final var combinedImports = new TreeSet(convertActionImportsToAliasedForm(desktopMainMenuConfig)); + combinedImports.addAll(convertActionImportsToAliasedForm(mobileMainMenuConfig)); + if (combinedImports.stream().map(JsImport::alias).distinct().toList().size() < combinedImports.size()) { + throw new InvalidUiConfigException("Action import names are in conflict.\n%s".formatted(combinedImports)); + } + return combinedImports; + } + @Override public final String genMainWebUIComponent() { - final String mainWebUiComponent = ResourceLoader.getText("ua/com/fielden/platform/web/app/tg-app-template.js"); + final var mainMenuActionImports = mainMenuActionImports(); + final String mainWebUiComponent = Objects.requireNonNull(getText("ua/com/fielden/platform/web/app/tg-app-template.js")) + .replace("@mainMenuActionImports", + mainMenuActionImports.isEmpty() ? "" + : "\n" + join("\n", mainMenuActionImports.stream().map(jsImport -> "import { %s as %s } from '/resources/%s.js';".formatted(jsImport.name(), jsImport.alias().get(), jsImport.path())).toList()) + + "\n" + "const mainMenuActionImports = {%s};".formatted( + join(",", mainMenuActionImports.stream().map(jsImport -> jsImport.alias().get()).map(alias -> "%s: %s".formatted(alias, alias)).toList()) + ) + ); + if (Workflows.deployment == workflow || Workflows.vulcanizing == workflow) { return mainWebUiComponent.replace("//@use-empty-console.log", "console.log = () => {};\n"); } else { diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/api/actions/EntityActionConfig.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/api/actions/EntityActionConfig.java index a863e0a56a5..e1174a854ea 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/api/actions/EntityActionConfig.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/api/actions/EntityActionConfig.java @@ -1,17 +1,22 @@ package ua.com.fielden.platform.web.centre.api.actions; -import java.util.HashSet; -import java.util.Optional; -import java.util.Set; - import ua.com.fielden.platform.entity.AbstractFunctionalEntityWithCentreContext; import ua.com.fielden.platform.reflection.TitlesDescsGetter; import ua.com.fielden.platform.web.PrefDim; import ua.com.fielden.platform.web.centre.api.context.CentreContextConfig; import ua.com.fielden.platform.web.centre.api.insertion_points.InsertionPoints; +import ua.com.fielden.platform.web.minijs.JsImport; +import ua.com.fielden.platform.web.view.master.api.actions.IAction; import ua.com.fielden.platform.web.view.master.api.actions.post.IPostAction; import ua.com.fielden.platform.web.view.master.api.actions.pre.IPreAction; +import java.util.HashSet; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Stream; + +import static java.util.stream.Stream.of; + /** * Configuration of a specific entity action, which is associated with an entity on an entity centre. * @@ -315,4 +320,16 @@ public boolean equals(final Object obj) { } return true; } + + public Stream importStatements() { + return of(importStatements(preAction), importStatements(successPostAction), importStatements(errorPostAction)) + .flatMap(s -> s); + } + + public Stream importStatements(final Optional actionOpt) { + return actionOpt + .map(action -> action.importStatements().stream()) + .orElseGet(Stream::empty); + } + } diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/menu/impl/MainMenuBuilder.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/menu/impl/MainMenuBuilder.java index c159fab91e7..93e4fca203a 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/menu/impl/MainMenuBuilder.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/menu/impl/MainMenuBuilder.java @@ -12,6 +12,9 @@ import ua.com.fielden.platform.web.menu.layout.IMenuLayoutConfig0; import ua.com.fielden.platform.web.menu.layout.impl.LayoutConfig; import ua.com.fielden.platform.web.menu.module.impl.ModuleConfig; +import ua.com.fielden.platform.web.minijs.JsImport; + +import java.util.Set; /** * An implementation of {@link IMainMenuBuilderWithLayout} contract, which serves both as the main menu builder and the representation of the final main menu configuration. @@ -55,4 +58,9 @@ public Menu getMenu() { setWhenTablet(tileLayout.getLayout(Device.TABLET, null).get()). setWhenMobile(tileLayout.getLayout(Device.MOBILE, null).get()); } + + public Set mainMenuActionImports() { + return mainMenu.actionImports(); + } + } diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/menu/impl/WebMainMenu.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/menu/impl/WebMainMenu.java index 0a28af7e1a6..8fafdd8fe41 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/menu/impl/WebMainMenu.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/menu/impl/WebMainMenu.java @@ -1,16 +1,19 @@ package ua.com.fielden.platform.web.menu.impl; -import static java.util.stream.Collectors.toList; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.atomic.AtomicInteger; - import ua.com.fielden.platform.menu.ModuleMenu; import ua.com.fielden.platform.web.centre.api.actions.EntityActionConfig; import ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionKind; import ua.com.fielden.platform.web.menu.module.impl.WebMenuModule; import ua.com.fielden.platform.web.minijs.JsCode; +import ua.com.fielden.platform.web.minijs.JsImport; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; + +import static java.util.stream.Collectors.toList; +import static java.util.stream.Collectors.toSet; public class WebMainMenu { @@ -52,4 +55,11 @@ public EntityActionConfig getActionConfig(final int actionNumber, final Function JsCode createActionsObject() { return new JsCode(null); } + + public Set actionImports() { + return modules.stream() + .flatMap(module -> module.getActions().stream().flatMap(EntityActionConfig::importStatements)) + .collect(toSet()); + } + } diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/minijs/JsImport.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/minijs/JsImport.java new file mode 100644 index 00000000000..1081f7b989d --- /dev/null +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/minijs/JsImport.java @@ -0,0 +1,79 @@ +package ua.com.fielden.platform.web.minijs; + +import ua.com.fielden.platform.web.minijs.exceptions.JsCodeException; + +import java.util.Comparator; +import java.util.Optional; + +import static java.util.Comparator.comparing; +import static java.util.Objects.requireNonNull; +import static java.util.Optional.empty; +import static java.util.Optional.of; + +/** + * An abstraction for JavaScript imports covering named imports (including aliased) and default imports. + * + * @author TG Team + * + */ +public record JsImport(String name, String path, Optional alias) implements Comparable { + private static final String DEFAULT = "default"; // reserved JavaScript word for default imports + private static final String ERR_JAVA_SCRIPT_IMPORT_NAME_IS_BLANK = "JavaScript import statement name [%s] is blank. Should either be [%s] or actual named export identifier from [%s] module."; + private static final String ERR_JAVA_SCRIPT_IMPORT_PATH_IS_BLANK = "JavaScript import statement path [%s] is blank."; + public static final String ERR_JAVA_SCRIPT_DEFAULT_IMPORT_ALIAS_IS_NOT_PROVIDED = "JavaScript default import statement alias is not provided."; + public static final String ERR_JAVA_SCRIPT_IMPORT_ALIAS_IS_BLANK = "JavaScript import statement alias [%s] is blank."; + + private static final Comparator ALIASED_FORM_COMPARATOR = + comparing(JsImport::path) + .thenComparing(jsImport -> jsImport.alias().get()); + + public JsImport { + if (requireNonNull(name).isBlank()) { + throw new JsCodeException(ERR_JAVA_SCRIPT_IMPORT_NAME_IS_BLANK.formatted(name, DEFAULT, path)); + } + if (requireNonNull(path).isBlank()) { + throw new JsCodeException(ERR_JAVA_SCRIPT_IMPORT_PATH_IS_BLANK.formatted(path)); + } + if (DEFAULT.equals(name) && alias.isPresent()) { + throw new JsCodeException(ERR_JAVA_SCRIPT_DEFAULT_IMPORT_ALIAS_IS_NOT_PROVIDED); + } + if (alias.isPresent() && alias.get().isBlank()) { + throw new JsCodeException(ERR_JAVA_SCRIPT_IMPORT_ALIAS_IS_BLANK.formatted(alias)); + } + } + + /** + * Creates a named {@link JsImport} importing concrete {@code name} from a {@code path} module. + */ + public static JsImport namedImport(final String name, final String path) { + return new JsImport(name, path, empty()); + } + + /** + * Creates a named {@link JsImport} importing concrete {@code name} with an {@code alias} from a {@code path} module. + */ + public static JsImport namedImport(final String name, final String path, final String alias) { + return new JsImport(name, path, of(alias)); + } + + /** + * Creates default {@link JsImport} with an {@code alias} from a {@code path} module. + */ + public static JsImport defaultImport(final String alias, final String path) { + return new JsImport("default", path, of(alias)); + } + + /** + * Converts import statement to single aliased form being able to analyse in a relation to others:
+ * {@code import {exportedName|default as exportedName|myIdentifier} from 'path';} + */ + public JsImport convertToAliasedForm() { + return namedImport(name, path, alias().orElse(name())); + } + + @Override + public int compareTo(final JsImport other) { + return ALIASED_FORM_COMPARATOR.compare(this, other); + } + +} diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/minijs/exceptions/JsCodeException.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/minijs/exceptions/JsCodeException.java new file mode 100644 index 00000000000..d6954752abc --- /dev/null +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/minijs/exceptions/JsCodeException.java @@ -0,0 +1,21 @@ +package ua.com.fielden.platform.web.minijs.exceptions; + +import ua.com.fielden.platform.exceptions.AbstractPlatformRuntimeException; + +/** + * A runtime exception that indicates erroneous situation pertaining to JavaScript code. + * + * @author TG Team + * + */ +public class JsCodeException extends AbstractPlatformRuntimeException { + + public JsCodeException(final String msg) { + super(msg); + } + + public JsCodeException(final String msg, final Throwable cause) { + super(msg, cause); + } + +} \ No newline at end of file diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/actions/IAction.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/actions/IAction.java index 080d6cb70db..091a4bf2bfe 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/actions/IAction.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/actions/IAction.java @@ -1,9 +1,14 @@ package ua.com.fielden.platform.web.view.master.api.actions; import ua.com.fielden.platform.web.minijs.JsCode; +import ua.com.fielden.platform.web.minijs.JsImport; import ua.com.fielden.platform.web.view.master.api.actions.post.IPostAction; import ua.com.fielden.platform.web.view.master.api.actions.pre.IPreAction; +import java.util.Set; + +import static java.util.Set.of; + /** * Common ancestor for {@link IPreAction} and {@link IPostAction}. * @@ -11,4 +16,9 @@ */ public interface IAction { JsCode build(); + + default Set importStatements() { + return of(); + }; + } \ No newline at end of file diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/app/tg-app-template.js b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/app/tg-app-template.js index 53c2a88f38a..ca178699bb3 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/app/tg-app-template.js +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/app/tg-app-template.js @@ -30,7 +30,7 @@ import { TgFocusRestorationBehavior } from '/resources/actions/tg-focus-restorat import { TgTooltipBehavior } from '/resources/components/tg-tooltip-behavior.js'; import { InsertionPointManager } from '/resources/centre/tg-insertion-point-manager.js'; import { tearDownEvent, deepestActiveElement, generateUUID, isMobileApp} from '/resources/reflection/tg-polymer-utils.js'; -import '/resources/polymer/@polymer/paper-icon-button/paper-icon-button.js'; +import '/resources/polymer/@polymer/paper-icon-button/paper-icon-button.js';@mainMenuActionImports let screenWidth = window.screen.availWidth; let screenHeight = window.screen.availHeight; @@ -596,14 +596,15 @@ Polymer({ this.entityType = "ua.com.fielden.platform.menu.Menu"; //Init master related functions. this.postRetrieved = function (entity, bindingEntity, customObject) { + const createFunctionFromString = prePostActionStr => new Function(...Object.keys(mainMenuActionImports || {}), "const self = this; return " + prePostActionStr).bind(this, ...Object.values(mainMenuActionImports || {}))(); entity.menu.forEach(menuItem => { menuItem.actions.forEach(action => { action._showDialog = this._showDialog; action.toaster = this.toaster; action._createContextHolder = this._createContextHolder; - action.preAction = new Function("const self = this; return " + action.preAction).bind(this)(); - action.postActionSuccess = new Function("const self = this; return " + action.postActionSuccess).bind(this)(); - action.postActionError = new Function("const self = this; return " + action.postActionError).bind(this)(); + action.preAction = createFunctionFromString(action.preAction); + action.postActionSuccess = createFunctionFromString(action.postActionSuccess); + action.postActionError = createFunctionFromString(action.postActionError); action.attrs = JSON.parse(action.attrs, (key, value) => { if (key === 'width' || key === "height") { return new Function("return " + value)(); From 224a8d9af91da9daaa3d5d71e456ec0e6ef57c31 Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Sat, 29 Mar 2025 23:52:42 +0200 Subject: [PATCH 02/76] #2407 Added OpenLinkPostAction. --- .../web/action/post/OpenLinkPostAction.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/OpenLinkPostAction.java diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/OpenLinkPostAction.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/OpenLinkPostAction.java new file mode 100644 index 00000000000..7c2002c7205 --- /dev/null +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/OpenLinkPostAction.java @@ -0,0 +1,43 @@ +package ua.com.fielden.platform.web.action.post; + +import ua.com.fielden.platform.processors.metamodel.IConvertableToPath; +import ua.com.fielden.platform.web.minijs.JsCode; +import ua.com.fielden.platform.web.minijs.JsImport; +import ua.com.fielden.platform.web.view.master.api.actions.post.IPostAction; + +import java.util.Set; + +import static java.util.Objects.requireNonNull; +import static java.util.Set.of; +import static ua.com.fielden.platform.web.minijs.JsCode.jsCode; +import static ua.com.fielden.platform.web.minijs.JsImport.namedImport; + +/** + * A standard post-action that should be used for opening a link from a property. + *

+ * Standard 'window.open' opening can be susceptible to tab-napping. + * So it is always recommended to use this post-action for user-entered links. + *

+ * See more in 'tg-polymer-utils.openLink'. + */ +public class OpenLinkPostAction implements IPostAction { + private final IConvertableToPath property; + + /** + * Create {@link OpenLinkPostAction} for {@code property} containing a link to open. + */ + public OpenLinkPostAction(final IConvertableToPath property) { + this.property = requireNonNull(property); + } + + @Override + public Set importStatements() { + return of(namedImport("openLink", "reflection/tg-polymer-utils")); + } + + @Override + public JsCode build() { + return jsCode("openLink(functionalEntity.get('%s'));".formatted(property.toPath())); + } + +} From 658516649ed9020972e822aa74e207a4a0a7cb0c Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Mon, 31 Mar 2025 18:33:08 +0300 Subject: [PATCH 03/76] #2407 Shuffled dependency to conform to normal npm sorting. --- platform-web-ui/src/main/resources/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-web-ui/src/main/resources/package.json b/platform-web-ui/src/main/resources/package.json index 320cce00afe..8fbad73fa84 100644 --- a/platform-web-ui/src/main/resources/package.json +++ b/platform-web-ui/src/main/resources/package.json @@ -1,5 +1,6 @@ { "dependencies": { + "@fullcalendar/moment-timezone": "^6.1.15", "@google-web-components/google-chart": "^3.4.0", "@polymer/app-layout": "^3.1.0", "@polymer/app-route": "^3.0.2", @@ -58,7 +59,6 @@ "@webcomponents/webcomponentsjs": "^2.8.0", "antlr4": "^4.13.2", "fullcalendar": "^6.1.15", - "@fullcalendar/moment-timezone": "^6.1.15", "moment": "^2.30.1", "moment-timezone": "^0.5.47", "web-animations-js": "^2.3.2" From 5ab22883d0d7a25ec708ba288da9c380515cff16 Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Mon, 31 Mar 2025 18:34:51 +0300 Subject: [PATCH 04/76] #2407 Updated moment-timezone - very minor patch update of tz-data. --- platform-web-ui/src/main/resources/package-lock.json | 6 +++--- .../src/main/resources/polymer/.package-lock.json | 6 +++--- .../polymer/moment-timezone/data/packed/latest.json.js | 7 ++++--- .../resources/polymer/moment-timezone/moment-timezone.js | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/platform-web-ui/src/main/resources/package-lock.json b/platform-web-ui/src/main/resources/package-lock.json index 7d932c40371..f3eeeefda88 100644 --- a/platform-web-ui/src/main/resources/package-lock.json +++ b/platform-web-ui/src/main/resources/package-lock.json @@ -1539,9 +1539,9 @@ } }, "node_modules/moment-timezone": { - "version": "0.5.47", - "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.47.tgz", - "integrity": "sha512-UbNt/JAWS0m/NJOebR0QMRHBk0hu03r5dx9GK8Cs0AS3I81yDcOc9k+DytPItgVvBP7J6Mf6U2n3BPAacAV9oA==", + "version": "0.5.48", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.48.tgz", + "integrity": "sha512-f22b8LV1gbTO2ms2j2z13MuPogNoh5UzxL3nzNAYKGraILnbGc9NEE6dyiiiLv46DGRb8A4kg8UKWLjPthxBHw==", "license": "MIT", "dependencies": { "moment": "^2.29.4" diff --git a/platform-web-ui/src/main/resources/polymer/.package-lock.json b/platform-web-ui/src/main/resources/polymer/.package-lock.json index 3139f43e336..1307dd43035 100644 --- a/platform-web-ui/src/main/resources/polymer/.package-lock.json +++ b/platform-web-ui/src/main/resources/polymer/.package-lock.json @@ -1448,9 +1448,9 @@ } }, "node_modules/moment-timezone": { - "version": "0.5.47", - "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.47.tgz", - "integrity": "sha512-UbNt/JAWS0m/NJOebR0QMRHBk0hu03r5dx9GK8Cs0AS3I81yDcOc9k+DytPItgVvBP7J6Mf6U2n3BPAacAV9oA==", + "version": "0.5.48", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.48.tgz", + "integrity": "sha512-f22b8LV1gbTO2ms2j2z13MuPogNoh5UzxL3nzNAYKGraILnbGc9NEE6dyiiiLv46DGRb8A4kg8UKWLjPthxBHw==", "license": "MIT", "dependencies": { "moment": "^2.29.4" diff --git a/platform-web-ui/src/main/resources/polymer/moment-timezone/data/packed/latest.json.js b/platform-web-ui/src/main/resources/polymer/moment-timezone/data/packed/latest.json.js index 59772bbbc3a..f2b30a48d89 100644 --- a/platform-web-ui/src/main/resources/polymer/moment-timezone/data/packed/latest.json.js +++ b/platform-web-ui/src/main/resources/polymer/moment-timezone/data/packed/latest.json.js @@ -1,4 +1,4 @@ -var version = "2025a"; +var version = "2025b"; var zones = [ "Africa/Abidjan|LMT GMT|g.8 0|01|-2ldXH.Q|48e5", "Africa/Nairobi|LMT +0230 EAT +0245|-2r.g -2u -30 -2J|012132|-2ua2r.g N6nV.g 3Fbu h1cu dzbJ|47e5", @@ -54,6 +54,7 @@ var zones = [ "America/Chihuahua|LMT MST CST MDT CDT|74.k 70 60 60 50|0121312424231313131313131313131313131313131313131313131313132|-1UQF0 deo0 8lz0 16p0 11z0 1dd0 2zQN0 1lb0 14p0 1lb0 14q0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0|81e4", "America/Ciudad_Juarez|LMT MST CST MDT CDT|75.U 70 60 60 50|01213124242313131313131313131313131313131313131313131313131321313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131|-1UQF0 deo0 8lz0 16p0 11z0 1dd0 2zQN0 1lb0 14p0 1lb0 14q0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 U10 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1wn0 cm0 EP0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|", "America/Costa_Rica|LMT SJMT CST CDT|5A.d 5A.d 60 50|01232323232|-3eLun.L 1fyo0 2lu0n.L Db0 1Kp0 Db0 pRB0 15b0 1kp0 mL0|12e5", + "America/Coyhaique|LMT SMT -05 -04 -03|4M.g 4G.J 50 40 30|012131323232323232323434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434|-3eLvb.I MJbS.t fJAh.f 5knG.J 1Vzh.f jRAG.J 1pbh.f 11d0 1oL0 11d0 1oL0 11d0 1oL0 11d0 1pb0 11d0 nHX0 op0 blz0 ko0 Qeo0 WL0 1zd0 On0 1ip0 11z0 1o10 11z0 1qN0 WL0 1ld0 14n0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 1cL0 1cN0 11z0 1o10 11z0 1qN0 WL0 1fB0 19X0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1ip0 1fz0 1fB0 11z0 1qN0 WL0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1o10 19X0 1fB0 1nX0 G10 1EL0 Op0 1zb0 Rd0 1wn0 Rd0 46n0 Ap0 1Nb0 Ap0 1Nb0 Ap0 1zb0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 11B0 1qL0 11B0|", "America/Phoenix|LMT MST MDT MWT|7s.i 70 60 60|012121313121|-3tFF0 1nEe0 1nX0 11B0 1nX0 SgN0 4Al1 Ap0 1db0 SWqX 1cL0|42e5", "America/Cuiaba|LMT -04 -03|3I.k 40 30|012121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-2glwf.E HdLf.E 1cc0 1e10 1bX0 Ezd0 So0 1vA0 Mn0 1BB0 ML0 1BB0 zX0 qe10 xb0 2ep0 nz0 1C10 zX0 1C10 LX0 1C10 Mn0 H210 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 1EN0 Lz0 1C10 IL0 1HB0 Db0 1HB0 On0 1zd0 On0 1zd0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 4a10 HX0 1zd0 On0 1HB0 IL0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 Rb0 1zd0 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1HB0 FX0|54e4", "America/Danmarkshavn|LMT -03 -02 GMT|1e.E 30 20 0|01212121212121212121212121212121213|-2a5WJ.k 2z5fJ.k 19U0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 DC0|8", @@ -216,7 +217,7 @@ var zones = [ "Asia/Taipei|LMT CST JST CDT|-86 -80 -90 -90|012131313131313131313131313131313131313131|-30bk6 1FDc6 joM0 1yo0 Tz0 1ip0 1jX0 1cN0 11b0 1oN0 11b0 1oN0 11b0 1oN0 11b0 10N0 1BX0 10p0 1pz0 10p0 1pz0 10p0 1db0 1dd0 1db0 1cN0 1db0 1cN0 1db0 1cN0 1db0 1BB0 ML0 1Bd0 ML0 uq10 1db0 1cN0 1db0 97B0 AL0|74e5", "Asia/Tashkent|LMT +05 +06 +07|-4B.b -50 -60 -70|012323232323232323232321|-1Pc4B.b eUnB.b 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0|23e5", "Asia/Tbilisi|LMT TBMT +03 +04 +05|-2X.b -2X.b -30 -40 -50|01234343434343434343434323232343434343434343434323|-3D8OX.b 1LUM0 1jUnX.b WCL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 1cK0 1cL0 1cN0 1cL0 1cN0 2pz0 1cL0 1fB0 3Nz0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 An0 Os0 WM0|11e5", - "Asia/Tehran|LMT TMT +0330 +0430 +04 +05|-3p.I -3p.I -3u -4u -40 -50|012345423232323232323232323232323232323232323232323232323232323232323232|-2btDp.I Llc0 1FHaT.I 1pc0 120u Rc0 XA0 Wou JX0 1dB0 1en0 pNB0 UL0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 64p0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0|14e6", + "Asia/Tehran|LMT TMT +0330 +0430 +04 +05|-3p.I -3p.I -3u -4u -40 -50|012345423232323232323232323232323232323232323232323232323232323232323232|-2btDp.I Llc0 1FHaT.I 1pc0 120u Rc0 Dc0 1iMu JX0 1dB0 1en0 pNB0 UL0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 64p0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0|14e6", "Asia/Thimphu|LMT +0530 +06|-5W.A -5u -60|012|-Su5W.A 1BGMs.A|79e3", "Asia/Tokyo|LMT JST JDT|-9i.X -90 -a0|0121212121|-3jE90 2qSo0 Rc0 1lc0 14o0 1zc0 Oo0 1zc0 Oo0|38e6", "Asia/Tomsk|LMT +06 +07 +08|-5D.P -60 -70 -80|0123232323232323232323212323232323232323232323212121212121212121212|-21NhD.P pxzD.P 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 co0 1bB0 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3Qp0|10e5", @@ -644,7 +645,7 @@ var countries = [ "CH|Europe/Zurich", "CI|Africa/Abidjan", "CK|Pacific/Rarotonga", - "CL|America/Santiago America/Punta_Arenas Pacific/Easter", + "CL|America/Santiago America/Coyhaique America/Punta_Arenas Pacific/Easter", "CM|Africa/Lagos Africa/Douala", "CN|Asia/Shanghai Asia/Urumqi", "CO|America/Bogota", diff --git a/platform-web-ui/src/main/resources/polymer/moment-timezone/moment-timezone.js b/platform-web-ui/src/main/resources/polymer/moment-timezone/moment-timezone.js index 5b63b3b94d3..0d59c37b987 100644 --- a/platform-web-ui/src/main/resources/polymer/moment-timezone/moment-timezone.js +++ b/platform-web-ui/src/main/resources/polymer/moment-timezone/moment-timezone.js @@ -10,7 +10,7 @@ function requireMomentTimezone () { hasRequiredMomentTimezone = 1; (function (module) { //! moment-timezone.js - //! version : 0.5.47 + //! version : 0.5.48 //! Copyright (c) JS Foundation and other contributors //! license : MIT //! github.com/moment/moment-timezone @@ -36,7 +36,7 @@ function requireMomentTimezone () { // return moment; // } - var VERSION = "0.5.47", + var VERSION = "0.5.48", zones = {}, links = {}, countries = {}, From a7abd60e4d3019908b149f9eb053dd58ae919fd8 Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Mon, 31 Mar 2025 18:43:04 +0300 Subject: [PATCH 05/76] #2407 Adjusted deps to contain the most recent version in package.json. --- platform-web-ui/src/main/resources/package-lock.json | 2 +- platform-web-ui/src/main/resources/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platform-web-ui/src/main/resources/package-lock.json b/platform-web-ui/src/main/resources/package-lock.json index f3eeeefda88..5c10d964e2e 100644 --- a/platform-web-ui/src/main/resources/package-lock.json +++ b/platform-web-ui/src/main/resources/package-lock.json @@ -65,7 +65,7 @@ "antlr4": "^4.13.2", "fullcalendar": "^6.1.15", "moment": "^2.30.1", - "moment-timezone": "^0.5.47", + "moment-timezone": "^0.5.48", "web-animations-js": "^2.3.2" }, "devDependencies": { diff --git a/platform-web-ui/src/main/resources/package.json b/platform-web-ui/src/main/resources/package.json index 8fbad73fa84..b705b05fd1c 100644 --- a/platform-web-ui/src/main/resources/package.json +++ b/platform-web-ui/src/main/resources/package.json @@ -60,7 +60,7 @@ "antlr4": "^4.13.2", "fullcalendar": "^6.1.15", "moment": "^2.30.1", - "moment-timezone": "^0.5.47", + "moment-timezone": "^0.5.48", "web-animations-js": "^2.3.2" }, "devDependencies": { From e7fb82128c44ba729252bc111a347d1ea0acd921 Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Mon, 31 Mar 2025 19:28:48 +0300 Subject: [PATCH 06/76] #2407 Remove main application usage of old FileSaver dependency. --- .../src/main/web/ua/com/fielden/platform/web/index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/index.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/index.html index cc0e72b35e5..cda31775b1d 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/index.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/index.html @@ -29,7 +29,6 @@ loadTag('meta', ['name', 'msapplication-TileImage'], ['content', '/resources/icons/tg-icon144x144.png']); // Tile icon for Win8 (144x144) loadTag('script', ['src', '/resources/polymer/@webcomponents/webcomponentsjs/webcomponents-bundle.js'], ['async', 'true']); loadTag('script', ['src', '/resources/polymer/web-animations-js/web-animations-next-lite.min.js'], ['async', 'true']); - loadTag('script', ['src', '/resources/filesaver/FileSaver.min.js'], ['async', 'true']); import('/resources/@startupResources.js'); }; @service-worker From 1bcf5597aa563e18037a2083da4543a6c99e3905 Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Mon, 31 Mar 2025 19:31:31 +0300 Subject: [PATCH 07/76] #2407 Update file-saver from 1.1.20160328 (2016) to 2.0.5 (2020). And placed to npm / Rollup infrastructure. Explicitly used unminified file. --- platform-web-ui/src/main/resources/lib/file-saver-lib.js | 1 + platform-web-ui/src/main/resources/package.json | 1 + platform-web-ui/src/main/resources/rollup.config.js | 1 + 3 files changed, 3 insertions(+) create mode 100644 platform-web-ui/src/main/resources/lib/file-saver-lib.js diff --git a/platform-web-ui/src/main/resources/lib/file-saver-lib.js b/platform-web-ui/src/main/resources/lib/file-saver-lib.js new file mode 100644 index 00000000000..80cb65f8020 --- /dev/null +++ b/platform-web-ui/src/main/resources/lib/file-saver-lib.js @@ -0,0 +1 @@ +export { saveAs } from 'file-saver/dist/FileSaver'; // use explicit file instead of 'file-saver' to avoid minified version \ No newline at end of file diff --git a/platform-web-ui/src/main/resources/package.json b/platform-web-ui/src/main/resources/package.json index b705b05fd1c..118a65419aa 100644 --- a/platform-web-ui/src/main/resources/package.json +++ b/platform-web-ui/src/main/resources/package.json @@ -58,6 +58,7 @@ "@webcomponents/shadycss": "^1.11.2", "@webcomponents/webcomponentsjs": "^2.8.0", "antlr4": "^4.13.2", + "file-saver": "^2.0.5", "fullcalendar": "^6.1.15", "moment": "^2.30.1", "moment-timezone": "^0.5.48", diff --git a/platform-web-ui/src/main/resources/rollup.config.js b/platform-web-ui/src/main/resources/rollup.config.js index 7b19b29581e..03581cfa536 100644 --- a/platform-web-ui/src/main/resources/rollup.config.js +++ b/platform-web-ui/src/main/resources/rollup.config.js @@ -19,6 +19,7 @@ export default { // Our other libraries. 'node_modules/lib/antlr-lib.js', + 'node_modules/lib/file-saver-lib.js', 'node_modules/lib/fullcalendar-lib.js', 'node_modules/lib/moment-lib.js', 'node_modules/lib/toastui-editor-lib.js', From ff0d8a9e91a771808e8b2130d5a55953c0f5e443 Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Mon, 31 Mar 2025 19:32:02 +0300 Subject: [PATCH 08/76] #2407 Update file-saver from 1.1.20160328 (2016) to 2.0.5 (2020). Regenerated the tree. --- .../src/main/resources/_virtual/FileSaver.js | 5 + .../src/main/resources/_virtual/FileSaver2.js | 3 + .../resources/_virtual/_commonjsHelpers.js | 4 +- .../src/main/resources/package-lock.json | 7 + .../main/resources/polymer/.package-lock.json | 6 + .../polymer/file-saver/dist/FileSaver.js | 195 ++++++++++++++++++ .../resources/polymer/lib/file-saver-lib.js | 6 + 7 files changed, 225 insertions(+), 1 deletion(-) create mode 100644 platform-web-ui/src/main/resources/_virtual/FileSaver.js create mode 100644 platform-web-ui/src/main/resources/_virtual/FileSaver2.js create mode 100644 platform-web-ui/src/main/resources/polymer/file-saver/dist/FileSaver.js create mode 100644 platform-web-ui/src/main/resources/polymer/lib/file-saver-lib.js diff --git a/platform-web-ui/src/main/resources/_virtual/FileSaver.js b/platform-web-ui/src/main/resources/_virtual/FileSaver.js new file mode 100644 index 00000000000..32500616aa2 --- /dev/null +++ b/platform-web-ui/src/main/resources/_virtual/FileSaver.js @@ -0,0 +1,5 @@ +import { __require as requireFileSaver } from '../polymer/file-saver/dist/FileSaver.js'; + +var FileSaverExports = requireFileSaver(); + +export { FileSaverExports as F }; diff --git a/platform-web-ui/src/main/resources/_virtual/FileSaver2.js b/platform-web-ui/src/main/resources/_virtual/FileSaver2.js new file mode 100644 index 00000000000..5ac0508f3ea --- /dev/null +++ b/platform-web-ui/src/main/resources/_virtual/FileSaver2.js @@ -0,0 +1,3 @@ +var FileSaver = {exports: {}}; + +export { FileSaver as __module }; diff --git a/platform-web-ui/src/main/resources/_virtual/_commonjsHelpers.js b/platform-web-ui/src/main/resources/_virtual/_commonjsHelpers.js index 7b7c5f4f531..fb22ddb24b6 100644 --- a/platform-web-ui/src/main/resources/_virtual/_commonjsHelpers.js +++ b/platform-web-ui/src/main/resources/_virtual/_commonjsHelpers.js @@ -1,5 +1,7 @@ +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + function getDefaultExportFromCjs (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } -export { getDefaultExportFromCjs }; +export { commonjsGlobal, getDefaultExportFromCjs }; diff --git a/platform-web-ui/src/main/resources/package-lock.json b/platform-web-ui/src/main/resources/package-lock.json index 5c10d964e2e..9ba6b58bd44 100644 --- a/platform-web-ui/src/main/resources/package-lock.json +++ b/platform-web-ui/src/main/resources/package-lock.json @@ -63,6 +63,7 @@ "@webcomponents/shadycss": "^1.11.2", "@webcomponents/webcomponentsjs": "^2.8.0", "antlr4": "^4.13.2", + "file-saver": "^2.0.5", "fullcalendar": "^6.1.15", "moment": "^2.30.1", "moment-timezone": "^0.5.48", @@ -1167,6 +1168,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/file-saver": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz", + "integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA==", + "license": "MIT" + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", diff --git a/platform-web-ui/src/main/resources/polymer/.package-lock.json b/platform-web-ui/src/main/resources/polymer/.package-lock.json index 1307dd43035..1650553921a 100644 --- a/platform-web-ui/src/main/resources/polymer/.package-lock.json +++ b/platform-web-ui/src/main/resources/polymer/.package-lock.json @@ -1091,6 +1091,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/file-saver": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz", + "integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA==", + "license": "MIT" + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", diff --git a/platform-web-ui/src/main/resources/polymer/file-saver/dist/FileSaver.js b/platform-web-ui/src/main/resources/polymer/file-saver/dist/FileSaver.js new file mode 100644 index 00000000000..18f268d639d --- /dev/null +++ b/platform-web-ui/src/main/resources/polymer/file-saver/dist/FileSaver.js @@ -0,0 +1,195 @@ +import { commonjsGlobal } from '../../../_virtual/_commonjsHelpers.js'; +import { __module as FileSaver$1 } from '../../../_virtual/FileSaver2.js'; + +var FileSaver = FileSaver$1.exports; + +var hasRequiredFileSaver; + +function requireFileSaver () { + if (hasRequiredFileSaver) return FileSaver$1.exports; + hasRequiredFileSaver = 1; + (function (module, exports) { + (function (global, factory) { + { + factory(); + } + })(FileSaver, function () { + + /* + * FileSaver.js + * A saveAs() FileSaver implementation. + * + * By Eli Grey, http://eligrey.com + * + * License : https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md (MIT) + * source : http://purl.eligrey.com/github/FileSaver.js + */ + // The one and only way of getting global scope in all environments + // https://stackoverflow.com/q/3277182/1008999 + var _global = typeof window === 'object' && window.window === window ? window : typeof self === 'object' && self.self === self ? self : typeof commonjsGlobal === 'object' && commonjsGlobal.global === commonjsGlobal ? commonjsGlobal : void 0; + + function bom(blob, opts) { + if (typeof opts === 'undefined') opts = { + autoBom: false + };else if (typeof opts !== 'object') { + console.warn('Deprecated: Expected third argument to be a object'); + opts = { + autoBom: !opts + }; + } // prepend BOM for UTF-8 XML and text/* types (including HTML) + // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF + + if (opts.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) { + return new Blob([String.fromCharCode(0xFEFF), blob], { + type: blob.type + }); + } + + return blob; + } + + function download(url, name, opts) { + var xhr = new XMLHttpRequest(); + xhr.open('GET', url); + xhr.responseType = 'blob'; + + xhr.onload = function () { + saveAs(xhr.response, name, opts); + }; + + xhr.onerror = function () { + console.error('could not download file'); + }; + + xhr.send(); + } + + function corsEnabled(url) { + var xhr = new XMLHttpRequest(); // use sync to avoid popup blocker + + xhr.open('HEAD', url, false); + + try { + xhr.send(); + } catch (e) {} + + return xhr.status >= 200 && xhr.status <= 299; + } // `a.click()` doesn't work for all browsers (#465) + + + function click(node) { + try { + node.dispatchEvent(new MouseEvent('click')); + } catch (e) { + var evt = document.createEvent('MouseEvents'); + evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null); + node.dispatchEvent(evt); + } + } // Detect WebView inside a native macOS app by ruling out all browsers + // We just need to check for 'Safari' because all other browsers (besides Firefox) include that too + // https://www.whatismybrowser.com/guides/the-latest-user-agent/macos + + + var isMacOSWebView = _global.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent); + var saveAs = _global.saveAs || ( // probably in some web worker + typeof window !== 'object' || window !== _global ? function saveAs() {} + /* noop */ + // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView + : 'download' in HTMLAnchorElement.prototype && !isMacOSWebView ? function saveAs(blob, name, opts) { + var URL = _global.URL || _global.webkitURL; + var a = document.createElement('a'); + name = name || blob.name || 'download'; + a.download = name; + a.rel = 'noopener'; // tabnabbing + // TODO: detect chrome extensions & packaged apps + // a.target = '_blank' + + if (typeof blob === 'string') { + // Support regular links + a.href = blob; + + if (a.origin !== location.origin) { + corsEnabled(a.href) ? download(blob, name, opts) : click(a, a.target = '_blank'); + } else { + click(a); + } + } else { + // Support blobs + a.href = URL.createObjectURL(blob); + setTimeout(function () { + URL.revokeObjectURL(a.href); + }, 4E4); // 40s + + setTimeout(function () { + click(a); + }, 0); + } + } // Use msSaveOrOpenBlob as a second approach + : 'msSaveOrOpenBlob' in navigator ? function saveAs(blob, name, opts) { + name = name || blob.name || 'download'; + + if (typeof blob === 'string') { + if (corsEnabled(blob)) { + download(blob, name, opts); + } else { + var a = document.createElement('a'); + a.href = blob; + a.target = '_blank'; + setTimeout(function () { + click(a); + }); + } + } else { + navigator.msSaveOrOpenBlob(bom(blob, opts), name); + } + } // Fallback to using FileReader and a popup + : function saveAs(blob, name, opts, popup) { + // Open a popup immediately do go around popup blocker + // Mostly only available on user interaction and the fileReader is async so... + popup = popup || open('', '_blank'); + + if (popup) { + popup.document.title = popup.document.body.innerText = 'downloading...'; + } + + if (typeof blob === 'string') return download(blob, name, opts); + var force = blob.type === 'application/octet-stream'; + + var isSafari = /constructor/i.test(_global.HTMLElement) || _global.safari; + + var isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent); + + if ((isChromeIOS || force && isSafari || isMacOSWebView) && typeof FileReader !== 'undefined') { + // Safari doesn't allow downloading of blob URLs + var reader = new FileReader(); + + reader.onloadend = function () { + var url = reader.result; + url = isChromeIOS ? url : url.replace(/^data:[^;]*;/, 'data:attachment/file;'); + if (popup) popup.location.href = url;else location = url; + popup = null; // reverse-tabnabbing #460 + }; + + reader.readAsDataURL(blob); + } else { + var URL = _global.URL || _global.webkitURL; + var url = URL.createObjectURL(blob); + if (popup) popup.location = url;else location.href = url; + popup = null; // reverse-tabnabbing #460 + + setTimeout(function () { + URL.revokeObjectURL(url); + }, 4E4); // 40s + } + }); + _global.saveAs = saveAs.saveAs = saveAs; + + { + module.exports = saveAs; + } + }); + } (FileSaver$1, FileSaver$1.exports)); + return FileSaver$1.exports; +} + +export { requireFileSaver as __require }; diff --git a/platform-web-ui/src/main/resources/polymer/lib/file-saver-lib.js b/platform-web-ui/src/main/resources/polymer/lib/file-saver-lib.js new file mode 100644 index 00000000000..e7e1af3a806 --- /dev/null +++ b/platform-web-ui/src/main/resources/polymer/lib/file-saver-lib.js @@ -0,0 +1,6 @@ +import { F as FileSaverExports } from '../../_virtual/FileSaver.js'; + + + +var saveAs = FileSaverExports.saveAs; +export { saveAs }; From 442ce65181cec7d7ed1ca8dc00783e369cf512d5 Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Mon, 31 Mar 2025 20:44:17 +0300 Subject: [PATCH 09/76] #2407 IPre/PostAction JavaScript imports support in centres. --- .../resources/webui/AbstractWebUiConfig.java | 28 ++++++------------- .../platform/web/centre/EntityCentre.java | 27 ++++++++++++------ .../impl/FunctionalActionElement.java | 28 +++++++++++-------- .../fielden/platform/web/minijs/JsImport.java | 24 ++++++++++++++++ 4 files changed, 68 insertions(+), 39 deletions(-) diff --git a/platform-web-resources/src/main/java/ua/com/fielden/platform/web/resources/webui/AbstractWebUiConfig.java b/platform-web-resources/src/main/java/ua/com/fielden/platform/web/resources/webui/AbstractWebUiConfig.java index 009a64fcefc..cb5bce0e033 100644 --- a/platform-web-resources/src/main/java/ua/com/fielden/platform/web/resources/webui/AbstractWebUiConfig.java +++ b/platform-web-resources/src/main/java/ua/com/fielden/platform/web/resources/webui/AbstractWebUiConfig.java @@ -47,8 +47,8 @@ import java.util.concurrent.ConcurrentHashMap; import static java.lang.String.format; -import static java.lang.String.join; import static java.util.Arrays.asList; +import static java.util.Objects.requireNonNull; import static java.util.Optional.of; import static java.util.Optional.ofNullable; import static org.apache.commons.validator.routines.UrlValidator.ALLOW_LOCAL_URLS; @@ -62,6 +62,8 @@ import static ua.com.fielden.platform.web.centre.api.actions.impl.EntityActionBuilder.action; import static ua.com.fielden.platform.web.centre.api.context.impl.EntityCentreContextSelector.context; import static ua.com.fielden.platform.web.minijs.JsCode.jsCode; +import static ua.com.fielden.platform.web.minijs.JsImport.extendAndValidateCombinedImports; +import static ua.com.fielden.platform.web.minijs.JsImport.extractImportStatements; import static ua.com.fielden.platform.web.resources.webui.CentreResourceUtils.SAVE_OWN_COPY_MSG; import static ua.com.fielden.platform.web.resources.webui.FileResource.generateFileName; import static ua.com.fielden.platform.web.view.master.api.actions.impl.MasterActionOptions.ALL_OFF; @@ -270,31 +272,17 @@ public final String genWebUiPreferences() { return webUiBuilder.genWebUiPrefComponent(); } - private static Collection convertActionImportsToAliasedForm(final MainMenuBuilder mainMenuConfig) { - return mainMenuConfig.mainMenuActionImports().stream().map(JsImport::convertToAliasedForm).toList(); - } - private SortedSet mainMenuActionImports() { - final var combinedImports = new TreeSet(convertActionImportsToAliasedForm(desktopMainMenuConfig)); - combinedImports.addAll(convertActionImportsToAliasedForm(mobileMainMenuConfig)); - if (combinedImports.stream().map(JsImport::alias).distinct().toList().size() < combinedImports.size()) { - throw new InvalidUiConfigException("Action import names are in conflict.\n%s".formatted(combinedImports)); - } + final var combinedImports = new TreeSet(); + extendAndValidateCombinedImports(combinedImports, desktopMainMenuConfig.mainMenuActionImports()); + extendAndValidateCombinedImports(combinedImports, mobileMainMenuConfig.mainMenuActionImports()); return combinedImports; } @Override public final String genMainWebUIComponent() { - final var mainMenuActionImports = mainMenuActionImports(); - final String mainWebUiComponent = Objects.requireNonNull(getText("ua/com/fielden/platform/web/app/tg-app-template.js")) - .replace("@mainMenuActionImports", - mainMenuActionImports.isEmpty() ? "" - : "\n" + join("\n", mainMenuActionImports.stream().map(jsImport -> "import { %s as %s } from '/resources/%s.js';".formatted(jsImport.name(), jsImport.alias().get(), jsImport.path())).toList()) - + "\n" + "const mainMenuActionImports = {%s};".formatted( - join(",", mainMenuActionImports.stream().map(jsImport -> jsImport.alias().get()).map(alias -> "%s: %s".formatted(alias, alias)).toList()) - ) - ); - + final String mainWebUiComponent = requireNonNull(getText("ua/com/fielden/platform/web/app/tg-app-template.js")) + .replace("@mainMenuActionImports", extractImportStatements(mainMenuActionImports(), of("mainMenuActionImports"))); if (Workflows.deployment == workflow || Workflows.vulcanizing == workflow) { return mainWebUiComponent.replace("//@use-empty-console.log", "console.log = () => {};\n"); } else { diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/EntityCentre.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/EntityCentre.java index a6de6bee96a..c8133e5de13 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/EntityCentre.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/EntityCentre.java @@ -45,7 +45,10 @@ import ua.com.fielden.platform.web.app.IWebUiConfig; import ua.com.fielden.platform.web.app.exceptions.WebUiBuilderException; import ua.com.fielden.platform.web.centre.api.EntityCentreConfig; -import ua.com.fielden.platform.web.centre.api.EntityCentreConfig.*; +import ua.com.fielden.platform.web.centre.api.EntityCentreConfig.MatcherOptions; +import ua.com.fielden.platform.web.centre.api.EntityCentreConfig.OrderDirection; +import ua.com.fielden.platform.web.centre.api.EntityCentreConfig.ResultSetProp; +import ua.com.fielden.platform.web.centre.api.EntityCentreConfig.SummaryPropDef; import ua.com.fielden.platform.web.centre.api.ICentre; import ua.com.fielden.platform.web.centre.api.actions.EntityActionConfig; import ua.com.fielden.platform.web.centre.api.actions.multi.EntityMultiActionConfig; @@ -71,6 +74,7 @@ import ua.com.fielden.platform.web.interfaces.IRenderable; import ua.com.fielden.platform.web.layout.FlexLayout; import ua.com.fielden.platform.web.minijs.JsCode; +import ua.com.fielden.platform.web.minijs.JsImport; import ua.com.fielden.platform.web.sse.IEventSource; import ua.com.fielden.platform.web.utils.EntityResourceUtils; @@ -110,6 +114,7 @@ import static ua.com.fielden.platform.web.centre.api.insertion_points.InsertionPoints.ALTERNATIVE_VIEW; import static ua.com.fielden.platform.web.centre.api.resultset.toolbar.impl.CentreToolbar.selectView; import static ua.com.fielden.platform.web.interfaces.DeviceProfile.DESKTOP; +import static ua.com.fielden.platform.web.minijs.JsImport.*; import static ua.com.fielden.platform.web.utils.EntityResourceUtils.getOriginalPropertyName; import static ua.com.fielden.platform.web.utils.EntityResourceUtils.getOriginalType; import static ua.com.fielden.platform.web.view.master.EntityMaster.flattenedNameOf; @@ -863,7 +868,7 @@ public Optional> getRenderingCustomiser() { if (dslDefaultConfig.getResultSetRenderingCustomiserType().isPresent()) { return Optional.of(injector.getInstance(dslDefaultConfig.getResultSetRenderingCustomiserType().get())); } else { - return Optional.empty(); + return empty(); } } @@ -946,6 +951,7 @@ public ICentreDomainTreeManagerAndEnhancer createDefaultCentre() { private IRenderable createRenderableRepresentation(final ICentreDomainTreeManagerAndEnhancer centre) { final LinkedHashSet importPaths = new LinkedHashSet<>(); + final SortedSet actionImports = new TreeSet<>(); importPaths.add("master/tg-entity-master"); logger.debug("Initiating layout..."); @@ -1024,6 +1030,7 @@ private IRenderable createRenderableRepresentation(final ICentreDomainTreeManage } column.getActions().forEach(action -> { importPaths.add(action.importPath()); + extendAndValidateCombinedImports(actionImports, action.actionImports()); propActionsObject.append(prefix + createActionObject(action)); }); egiColumns.add(column.render()); @@ -1057,6 +1064,7 @@ private IRenderable createRenderableRepresentation(final ICentreDomainTreeManage final DomElement groupElement = createActionGroupDom(i); for (final FunctionalActionElement el : actionGroups.get(i)) { importPaths.add(el.importPath()); + extendAndValidateCombinedImports(actionImports, el.actionImports()); groupElement.add(el.render()); functionalActionsObjects.append(prefix + createActionObject(el)); } @@ -1087,6 +1095,7 @@ private IRenderable createRenderableRepresentation(final ICentreDomainTreeManage for (int actionIndex = 0; actionIndex < frontActions.size(); actionIndex++) { final FunctionalActionElement actionElement = new FunctionalActionElement(frontActions.get(actionIndex), actionIndex, FunctionalActionKind.FRONT); importPaths.add(actionElement.importPath()); + extendAndValidateCombinedImports(actionImports, actionElement.actionImports()); frontActionsDom.add(actionElement.render()); frontActionsObjects.append(prefix + createActionObject(actionElement)); } @@ -1101,6 +1110,7 @@ private IRenderable createRenderableRepresentation(final ICentreDomainTreeManage for (int actionIndex = 0; actionIndex < shareActions.size(); actionIndex++) { final FunctionalActionElement actionElement = new FunctionalActionElement(shareActions.get(actionIndex), actionIndex, FunctionalActionKind.SHARE); importPaths.add(actionElement.importPath()); + extendAndValidateCombinedImports(actionImports, actionElement.actionImports()); shareActionsDom.add(actionElement.render()); shareActionsObjects.append(prefix + createActionObject(actionElement)); } @@ -1168,7 +1178,7 @@ private IRenderable createRenderableRepresentation(final ICentreDomainTreeManage bottomInsertionPointsDom.add(insertionPoint); } else if (el.whereToInsert() == InsertionPoints.ALTERNATIVE_VIEW) { final Optional switchButtons = switchViewButtons(insertionPointActionsElements, Optional.of(el)); - final Optional topActions = alternativeViewActions(el, importPaths, functionalActionsObjects, alternativeViewActionOrder); + final Optional topActions = alternativeViewActions(el, importPaths, actionImports, functionalActionsObjects, alternativeViewActionOrder); alternativeViewsDom.add(insertionPoint.toString() .replace(SWITCH_VIEW_ACTION_DOM, switchButtons.map(domElem -> domElem.toString()).orElse("")) .replace(EGI_FUNCTIONAL_ACTION_DOM, topActions.map(domElem -> domElem.toString()).orElse(""))); @@ -1177,7 +1187,7 @@ private IRenderable createRenderableRepresentation(final ICentreDomainTreeManage } } - final Optional egiSwitchViewButtons = switchViewButtons(insertionPointActionsElements, Optional.empty()); + final Optional egiSwitchViewButtons = switchViewButtons(insertionPointActionsElements, empty()); //Generating shortcuts for EGI final StringBuilder shortcuts = new StringBuilder(); @@ -1211,7 +1221,7 @@ private IRenderable createRenderableRepresentation(final ICentreDomainTreeManage final String text = ResourceLoader.getText("ua/com/fielden/platform/web/centre/tg-entity-centre-template.js"); logger.debug("Replacing some parts..."); final String entityCentreStr = text. - replace(IMPORTS, createImports(importPaths) + customImports.map(ci -> ci.toString()).orElse("")). + replace(IMPORTS, createImports(importPaths) + customImports.map(ci -> ci.toString()).orElse("") + extractImportStatements(actionImports, empty())). replace(EGI_LAYOUT, gridLayoutConfig.getKey()). replace(FULL_ENTITY_TYPE, entityType.getName()). replace(MI_TYPE, flattenedNameOf(miType)). @@ -1294,12 +1304,13 @@ public DomElement render() { * @param alternativeViewActionOrder * @return */ - private Optional alternativeViewActions(final InsertionPointBuilder el, final LinkedHashSet importPaths, final StringBuilder functionalActionsObjects, final AtomicInteger alternativeViewActionOrder) { + private Optional alternativeViewActions(final InsertionPointBuilder el, final LinkedHashSet importPaths, final SortedSet actionImports, final StringBuilder functionalActionsObjects, final AtomicInteger alternativeViewActionOrder) { if (!el.getActions().isEmpty()) { final DomElement domContainer = new DomContainer(); for (final EntityActionConfig actionConfig: el.getActions()) { final FunctionalActionElement funcAction = new FunctionalActionElement(actionConfig, alternativeViewActionOrder.getAndIncrement(), FunctionalActionKind.TOP_LEVEL); importPaths.add(funcAction.importPath()); + extendAndValidateCombinedImports(actionImports, funcAction.actionImports()); domContainer.add(funcAction.render()); functionalActionsObjects.append(",\n" + createActionObject(funcAction)); } @@ -1613,7 +1624,7 @@ public Optional> getAdditionalFetchProviderForTooltipPropertie tooltipProps.add(property.tooltipProp.get()); } })); - return tooltipProps.isEmpty() ? Optional.empty() : Optional.of(EntityUtils.fetchNotInstrumented(entityType).with(tooltipProps)); + return tooltipProps.isEmpty() ? empty() : Optional.of(EntityUtils.fetchNotInstrumented(entityType).with(tooltipProps)); } public Optional, Optional>> getQueryEnhancerConfig() { @@ -1622,7 +1633,7 @@ public Optional, Optional>> getQuery final Class> queryEnhancerType = queryEnhancerConfig.get().getKey(); return Optional.of(new Pair<>(injector.getInstance(queryEnhancerType), queryEnhancerConfig.get().getValue())); } else { - return Optional.empty(); + return empty(); } } diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/api/resultset/impl/FunctionalActionElement.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/api/resultset/impl/FunctionalActionElement.java index 56b70f909d5..9c54597e0a6 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/api/resultset/impl/FunctionalActionElement.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/api/resultset/impl/FunctionalActionElement.java @@ -1,16 +1,5 @@ package ua.com.fielden.platform.web.centre.api.resultset.impl; -import static java.lang.String.format; -import static java.util.Optional.empty; -import static java.util.Optional.of; -import static java.util.stream.Collectors.joining; -import static java.util.stream.Collectors.toList; -import static org.apache.commons.lang3.StringUtils.join; - -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Optional; - import ua.com.fielden.platform.dom.DomElement; import ua.com.fielden.platform.entity.AbstractFunctionalEntityWithCentreContext; import ua.com.fielden.platform.web.centre.api.actions.EntityActionConfig; @@ -18,10 +7,22 @@ import ua.com.fielden.platform.web.centre.api.crit.impl.AbstractCriterionWidget; import ua.com.fielden.platform.web.interfaces.IImportable; import ua.com.fielden.platform.web.interfaces.IRenderable; +import ua.com.fielden.platform.web.minijs.JsImport; import ua.com.fielden.platform.web.view.master.api.actions.IAction; import ua.com.fielden.platform.web.view.master.api.actions.post.IPostAction; import ua.com.fielden.platform.web.view.master.api.actions.pre.IPreAction; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Optional; +import java.util.Set; + +import static java.lang.String.format; +import static java.util.Optional.empty; +import static java.util.Optional.of; +import static java.util.stream.Collectors.*; +import static org.apache.commons.lang3.StringUtils.join; + /** * The implementation for functional entity actions (DOM element). * @@ -403,4 +404,9 @@ public boolean isForMaster() { public void setForMaster(final boolean forMaster) { this.forMaster = forMaster; } + + public Set actionImports() { + return entityActionConfig.importStatements().collect(toSet()); + } + } diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/minijs/JsImport.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/minijs/JsImport.java index 1081f7b989d..0a392d95866 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/minijs/JsImport.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/minijs/JsImport.java @@ -4,11 +4,15 @@ import java.util.Comparator; import java.util.Optional; +import java.util.Set; +import java.util.SortedSet; +import static java.lang.String.join; import static java.util.Comparator.comparing; import static java.util.Objects.requireNonNull; import static java.util.Optional.empty; import static java.util.Optional.of; +import static java.util.stream.Collectors.toSet; /** * An abstraction for JavaScript imports covering named imports (including aliased) and default imports. @@ -76,4 +80,24 @@ public int compareTo(final JsImport other) { return ALIASED_FORM_COMPARATOR.compare(this, other); } + private static Set convertJsImportsToAliasedForm(final Set jsImports) { + return jsImports.stream().map(JsImport::convertToAliasedForm).collect(toSet()); + } + + public static SortedSet extendAndValidateCombinedImports(final SortedSet combinedImports, final Set jsImports) { + combinedImports.addAll(convertJsImportsToAliasedForm(jsImports)); + if (combinedImports.stream().map(JsImport::alias).distinct().toList().size() < combinedImports.size()) { + throw new JsCodeException("Action import names are in conflict.\n%s".formatted(combinedImports)); + } + return combinedImports; + } + + public static String extractImportStatements(final SortedSet combinedImports, final Optional importObjectNameOpt) { + return combinedImports.isEmpty() ? "" + : "\n" + join("\n", combinedImports.stream().map(jsImport -> "import { %s as %s } from '/resources/%s.js';".formatted(jsImport.name(), jsImport.alias().get(), jsImport.path())).toList()) + + importObjectNameOpt.map(importObjectName -> + "\n" + "const %s = {%s};".formatted(importObjectName, join(",", combinedImports.stream().map(jsImport -> jsImport.alias().get()).map(alias -> "%s: %s".formatted(alias, alias)).toList())) + ).orElse(""); + } + } From 19de11f7f0a43a295466bbab9725a2a327aa7c98 Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Mon, 31 Mar 2025 20:48:39 +0300 Subject: [PATCH 10/76] #2407 Use import statement support for FileSaverPostAction (by importing ES6-like file-saver dependency function instead of old, everywhere imported, file). --- .../platform/web/action/post/FileSaverPostAction.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/FileSaverPostAction.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/FileSaverPostAction.java index 9d3b325b8e3..434ff5bc849 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/FileSaverPostAction.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/FileSaverPostAction.java @@ -1,8 +1,14 @@ package ua.com.fielden.platform.web.action.post; import ua.com.fielden.platform.web.minijs.JsCode; +import ua.com.fielden.platform.web.minijs.JsImport; import ua.com.fielden.platform.web.view.master.api.actions.post.IPostAction; +import java.util.Set; + +import static java.util.Set.of; +import static ua.com.fielden.platform.web.minijs.JsImport.namedImport; + /** * A standard post-action that should be used for saving data to a local file. * Its implementation depends on the contract that the underlying functional entity has properties: @@ -19,6 +25,11 @@ */ public class FileSaverPostAction implements IPostAction { + @Override + public Set importStatements() { + return of(namedImport("saveAs", "polymer/lib/file-saver-lib")); + } + @Override public JsCode build() { final JsCode jsCode = new JsCode( From 9f7d4c02feefb19aa8d8697495efd2eb3169d9af Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Mon, 31 Mar 2025 22:39:47 +0300 Subject: [PATCH 11/76] #2407 Convenient method to chain IPre/PostAction with additional code. --- .../master/api/actions/post/IPostAction.java | 21 +++++++++++++++++++ .../master/api/actions/pre/IPreAction.java | 21 +++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/actions/post/IPostAction.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/actions/post/IPostAction.java index 5e9bc360fdd..e04d7473c0b 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/actions/post/IPostAction.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/actions/post/IPostAction.java @@ -1,7 +1,13 @@ package ua.com.fielden.platform.web.view.master.api.actions.post; +import ua.com.fielden.platform.web.minijs.JsCode; +import ua.com.fielden.platform.web.minijs.JsImport; import ua.com.fielden.platform.web.view.master.api.actions.IAction; +import java.util.Set; + +import static ua.com.fielden.platform.web.minijs.JsCode.jsCode; + /** * A contract that should be implemented by all concrete implementations of post-action behaviour for Entity Master actions. * @@ -11,4 +17,19 @@ * */ public interface IPostAction extends IAction { + + default IPostAction andThen(final JsCode code) { + return new IPostAction() { + @Override + public Set importStatements() { + return IPostAction.this.importStatements(); + } + + @Override + public JsCode build() { + return jsCode(IPostAction.this.build() + code.toString()); + } + }; + } + } \ No newline at end of file diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/actions/pre/IPreAction.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/actions/pre/IPreAction.java index 938bf8b5b7c..4265700ec88 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/actions/pre/IPreAction.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/actions/pre/IPreAction.java @@ -1,7 +1,13 @@ package ua.com.fielden.platform.web.view.master.api.actions.pre; +import ua.com.fielden.platform.web.minijs.JsCode; +import ua.com.fielden.platform.web.minijs.JsImport; import ua.com.fielden.platform.web.view.master.api.actions.IAction; +import java.util.Set; + +import static ua.com.fielden.platform.web.minijs.JsCode.jsCode; + /** * A contract that should be implemented by all concrete implementations of pre-action behaviour for Entity Master actions. * @@ -11,4 +17,19 @@ * */ public interface IPreAction extends IAction { + + default IPreAction andThen(final JsCode code) { + return new IPreAction() { + @Override + public Set importStatements() { + return IPreAction.this.importStatements(); + } + + @Override + public JsCode build() { + return jsCode(IPreAction.this.build() + code.toString()); + } + }; + } + } \ No newline at end of file From 3dbedc51a2ad07733fe96aec7a96f70fab44b807 Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Mon, 31 Mar 2025 22:40:57 +0300 Subject: [PATCH 12/76] #2407 IPre/PostAction JavaScript imports support in masters. --- .../master/api/impl/SimpleMasterBuilder.java | 49 +++++++++---------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/impl/SimpleMasterBuilder.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/impl/SimpleMasterBuilder.java index 526b88ddcf9..7b6db110c20 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/impl/SimpleMasterBuilder.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/impl/SimpleMasterBuilder.java @@ -1,25 +1,5 @@ package ua.com.fielden.platform.web.view.master.api.impl; -import static java.lang.String.format; -import static java.util.Optional.empty; -import static java.util.Optional.of; -import static java.util.stream.Collectors.toMap; -import static ua.com.fielden.platform.types.tuples.T2.t2; -import static ua.com.fielden.platform.utils.CollectionUtil.setOf; -import static ua.com.fielden.platform.web.centre.EntityCentre.IMPORTS; -import static ua.com.fielden.platform.web.centre.api.actions.EntityActionConfig.setRole; -import static ua.com.fielden.platform.web.view.master.EntityMaster.ENTITY_TYPE; -import static ua.com.fielden.platform.web.view.master.EntityMaster.flattenedNameOf; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.concurrent.atomic.AtomicInteger; - import ua.com.fielden.platform.basic.IValueMatcherWithContext; import ua.com.fielden.platform.dom.DomContainer; import ua.com.fielden.platform.dom.DomElement; @@ -38,6 +18,7 @@ import ua.com.fielden.platform.web.interfaces.IRenderable; import ua.com.fielden.platform.web.layout.FlexLayout; import ua.com.fielden.platform.web.minijs.JsCode; +import ua.com.fielden.platform.web.minijs.JsImport; import ua.com.fielden.platform.web.view.master.api.IMaster; import ua.com.fielden.platform.web.view.master.api.ISimpleMasterBuilder; import ua.com.fielden.platform.web.view.master.api.actions.MasterActions; @@ -46,18 +27,29 @@ import ua.com.fielden.platform.web.view.master.api.actions.entity.IEntityActionConfigWithoutNew; import ua.com.fielden.platform.web.view.master.api.actions.entity.impl.DefaultEntityAction; import ua.com.fielden.platform.web.view.master.api.actions.entity.impl.EntityActionConfig; -import ua.com.fielden.platform.web.view.master.api.helpers.IActionBarLayoutConfig1; -import ua.com.fielden.platform.web.view.master.api.helpers.IComplete; -import ua.com.fielden.platform.web.view.master.api.helpers.ILayoutConfig; -import ua.com.fielden.platform.web.view.master.api.helpers.ILayoutConfigWithDimensionsAndDone; -import ua.com.fielden.platform.web.view.master.api.helpers.IPropertySelector; -import ua.com.fielden.platform.web.view.master.api.helpers.IWidgetSelector; +import ua.com.fielden.platform.web.view.master.api.helpers.*; import ua.com.fielden.platform.web.view.master.api.helpers.impl.WidgetSelector; import ua.com.fielden.platform.web.view.master.api.widgets.IDividerConfig; import ua.com.fielden.platform.web.view.master.api.widgets.IHtmlTextConfig; import ua.com.fielden.platform.web.view.master.api.widgets.autocompleter.impl.AbstractEntityAutocompletionWidget; import ua.com.fielden.platform.web.view.master.exceptions.EntityMasterConfigurationException; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; + +import static java.lang.String.format; +import static java.util.Optional.empty; +import static java.util.Optional.of; +import static java.util.stream.Collectors.toMap; +import static ua.com.fielden.platform.types.tuples.T2.t2; +import static ua.com.fielden.platform.utils.CollectionUtil.setOf; +import static ua.com.fielden.platform.web.centre.EntityCentre.IMPORTS; +import static ua.com.fielden.platform.web.centre.api.actions.EntityActionConfig.setRole; +import static ua.com.fielden.platform.web.minijs.JsImport.extendAndValidateCombinedImports; +import static ua.com.fielden.platform.web.minijs.JsImport.extractImportStatements; +import static ua.com.fielden.platform.web.view.master.EntityMaster.ENTITY_TYPE; +import static ua.com.fielden.platform.web.view.master.EntityMaster.flattenedNameOf; + public class SimpleMasterBuilder> implements ISimpleMasterBuilder, IPropertySelector, ILayoutConfig, ILayoutConfigWithDimensionsAndDone, IEntityActionConfig5, IActionBarLayoutConfig1 { private static final String ERR_WIDGET_IS_ALREADY_PRESENT = "A widget with property [%s] is already present in the entity master for [%s]."; @@ -222,6 +214,7 @@ public ILayoutConfigWithDimensionsAndDone setLayoutFor(final Device device, f @Override public IMaster done() { + final SortedSet actionImports = new TreeSet<>(); final LinkedHashSet importPaths = new LinkedHashSet<>(); // importPaths.add("polymer/polymer/polymer"); // FIXME check and delete if all good -- this is not really needed due to tg-entity-master-template-behavior dependencies @@ -248,6 +241,7 @@ public IMaster done() { shortcuts.append(actionConfig.shortcut.get() + " "); } importPaths.add(el.importPath()); + extendAndValidateCombinedImports(actionImports, el.actionImports()); widgetElement.add(el.render().attr("slot", "property-action").clazz("property-action-icon")); primaryActionObjects.append(prefix + el.createActionObject()); }); @@ -278,6 +272,7 @@ public IMaster done() { shortcuts.append(config.shortcut.get() + " "); } importPaths.add(el.importPath()); + extendAndValidateCombinedImports(actionImports, el.actionImports()); actionContainer.add(el.render().clazz("primary-action")); primaryActionObjects.append(prefix + el.createActionObject()); } @@ -297,7 +292,7 @@ public IMaster done() { final String dimensionsString = prefDimBuilder.toString(); final String entityMasterStr = ResourceLoader.getText("ua/com/fielden/platform/web/master/tg-entity-master-template.js") - .replace(IMPORTS, createImports(importPaths) + customImports.map(ci -> ci.toString()).orElse("")) + .replace(IMPORTS, createImports(importPaths) + customImports.map(ci -> ci.toString()).orElse("") + extractImportStatements(actionImports, empty())) .replace(ENTITY_TYPE, flattenedNameOf(entityType)) .replace("", elementContainer.toString()) // TODO should contain prop actions .replace("//@ready-callback", From 605c0f3e21199e0ff5972bc127aec1cf984bfbd0 Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Mon, 31 Mar 2025 22:42:30 +0300 Subject: [PATCH 13/76] #2407 Replaced global import in every master to only be in required BindSavedPropertyPostActionSuccess/Error contexts. --- .../post/BindSavedPropertyPostActionSuccess.java | 14 ++++++++++++-- .../web/master/tg-entity-master-template.js | 1 - 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/BindSavedPropertyPostActionSuccess.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/BindSavedPropertyPostActionSuccess.java index c737176be52..44b0f910c02 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/BindSavedPropertyPostActionSuccess.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/BindSavedPropertyPostActionSuccess.java @@ -1,11 +1,16 @@ package ua.com.fielden.platform.web.action.post; -import static java.lang.String.format; - import ua.com.fielden.platform.web.centre.api.actions.IEntityActionBuilder2; import ua.com.fielden.platform.web.minijs.JsCode; +import ua.com.fielden.platform.web.minijs.JsImport; import ua.com.fielden.platform.web.view.master.api.actions.post.IPostAction; +import java.util.Set; + +import static java.lang.String.format; +import static java.util.Set.of; +import static ua.com.fielden.platform.web.minijs.JsImport.namedImport; + /** * In case if functional entity saves its master entity, it is necessary to bind saved instance to its respective entity master. * Use this {@link IPostAction} in {@link IEntityActionBuilder2#postActionSuccess(IPostAction)} call. @@ -30,6 +35,11 @@ public JsCode build() { return createPostAction(false, propertyName); } + @Override + public Set importStatements() { + return of(namedImport("getParentAnd", "reflection/tg-polymer-utils")); + } + /** * Creates {@link IPostAction}. For {@code erroneous} one we also attaches 'exceptionOccurred' to the master entity. * diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/tg-entity-master-template.js b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/tg-entity-master-template.js index f2581425506..6814a0b3ea0 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/tg-entity-master-template.js +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/tg-entity-master-template.js @@ -4,7 +4,6 @@ import '/resources/actions/tg-ui-action.js'; import { TgEntityMasterTemplateBehavior, Polymer, html } from '/resources/master/tg-entity-master-template-behavior.js'; import { TgReflector } from '/app/tg-reflector.js'; -import { getParentAnd } from '/resources/reflection/tg-polymer-utils.js'; // required by BindSavedPropertyPostActionSuccess/Error handlers // From cdd63e1b0a9585405b24b025b3a69f6241a36cbc Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Tue, 1 Apr 2025 16:36:27 +0300 Subject: [PATCH 14/76] #2407 Force BindSavedPropertyPostAction to use IConvertableToPath. --- .../ui_actions/MakeCompletedAction.java | 22 ++++++++++++------- .../platform/web/test/server/WebUiConfig.java | 5 +++-- .../BindSavedPropertyPostActionError.java | 17 +++++++------- .../BindSavedPropertyPostActionSuccess.java | 18 ++++++++------- 4 files changed, 36 insertions(+), 26 deletions(-) diff --git a/platform-pojo-bl/src/main/java/ua/com/fielden/platform/sample/domain/ui_actions/MakeCompletedAction.java b/platform-pojo-bl/src/main/java/ua/com/fielden/platform/sample/domain/ui_actions/MakeCompletedAction.java index e6bceba2ad4..0064a6acb91 100644 --- a/platform-pojo-bl/src/main/java/ua/com/fielden/platform/sample/domain/ui_actions/MakeCompletedAction.java +++ b/platform-pojo-bl/src/main/java/ua/com/fielden/platform/sample/domain/ui_actions/MakeCompletedAction.java @@ -1,18 +1,15 @@ package ua.com.fielden.platform.sample.domain.ui_actions; -import static ua.com.fielden.platform.entity.NoKey.NO_KEY; -import static ua.com.fielden.platform.reflection.TitlesDescsGetter.getEntityTitleAndDesc; - import ua.com.fielden.platform.entity.AbstractFunctionalEntityWithCentreContext; import ua.com.fielden.platform.entity.NoKey; -import ua.com.fielden.platform.entity.annotation.CompanionObject; -import ua.com.fielden.platform.entity.annotation.IsProperty; -import ua.com.fielden.platform.entity.annotation.KeyType; -import ua.com.fielden.platform.entity.annotation.Observable; -import ua.com.fielden.platform.entity.annotation.SkipEntityExistsValidation; +import ua.com.fielden.platform.entity.annotation.*; +import ua.com.fielden.platform.processors.metamodel.IConvertableToPath; import ua.com.fielden.platform.sample.domain.TgPersistentEntityWithProperties; import ua.com.fielden.platform.utils.Pair; +import static ua.com.fielden.platform.entity.NoKey.NO_KEY; +import static ua.com.fielden.platform.reflection.TitlesDescsGetter.getEntityTitleAndDesc; + /** * Functional entity to make {@link TgPersistentEntityWithProperties} entity completed and save. * It applies all user modifications, sets 'completed' property and 'dateProp' and saves the instance. @@ -34,6 +31,15 @@ public MakeCompletedAction() { setKey(NO_KEY); } + public enum Property implements IConvertableToPath { + masterEntity; + + @Override + public String toPath() { + return name(); + } + } + @IsProperty @SkipEntityExistsValidation private TgPersistentEntityWithProperties masterEntity; diff --git a/platform-web-resources/src/main/java/ua/com/fielden/platform/web/test/server/WebUiConfig.java b/platform-web-resources/src/main/java/ua/com/fielden/platform/web/test/server/WebUiConfig.java index 1c245fa0f14..5ed8d01de34 100644 --- a/platform-web-resources/src/main/java/ua/com/fielden/platform/web/test/server/WebUiConfig.java +++ b/platform-web-resources/src/main/java/ua/com/fielden/platform/web/test/server/WebUiConfig.java @@ -89,6 +89,7 @@ import static ua.com.fielden.platform.entity.query.fluent.EntityQueryUtils.fetchOnly; import static ua.com.fielden.platform.entity.query.fluent.EntityQueryUtils.select; import static ua.com.fielden.platform.reflection.TitlesDescsGetter.getEntityTitleAndDesc; +import static ua.com.fielden.platform.sample.domain.ui_actions.MakeCompletedAction.Property.masterEntity; import static ua.com.fielden.platform.types.tuples.T2.t2; import static ua.com.fielden.platform.utils.Pair.pair; import static ua.com.fielden.platform.web.PrefDim.mkDim; @@ -651,8 +652,8 @@ public void initConfiguration() { .addAction(action(MakeCompletedAction.class) .withContext(context().withMasterEntity().build()) // .postActionSuccess(() -> new JsCode(new BindSavedPropertyPostActionSuccess("masterEntity").build().toString() + "self.publishCloseForcibly();")) // use this for additional manual testing of forced closing - .postActionSuccess(new BindSavedPropertyPostActionSuccess("masterEntity")) - .postActionError(new BindSavedPropertyPostActionError("masterEntity")) + .postActionSuccess(new BindSavedPropertyPostActionSuccess(masterEntity)) + .postActionError(new BindSavedPropertyPostActionError(masterEntity)) .shortDesc("Complete") .longDesc("Complete this entity.") .build() diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/BindSavedPropertyPostActionError.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/BindSavedPropertyPostActionError.java index 51761d781b4..38b0baec946 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/BindSavedPropertyPostActionError.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/BindSavedPropertyPostActionError.java @@ -1,11 +1,12 @@ package ua.com.fielden.platform.web.action.post; -import static ua.com.fielden.platform.web.action.post.BindSavedPropertyPostActionSuccess.createPostAction; - +import ua.com.fielden.platform.processors.metamodel.IConvertableToPath; import ua.com.fielden.platform.web.centre.api.actions.IEntityActionBuilder2; import ua.com.fielden.platform.web.minijs.JsCode; import ua.com.fielden.platform.web.view.master.api.actions.post.IPostAction; +import static ua.com.fielden.platform.web.action.post.BindSavedPropertyPostActionSuccess.createPostAction; + /** * In case if functional entity saves its master entity, it is necessary to bind saved instance to its respective entity master. * Use this {@link IPostAction} in {@link IEntityActionBuilder2#postActionError(IPostAction)} call. @@ -14,20 +15,20 @@ * */ public class BindSavedPropertyPostActionError implements IPostAction { - private final String propertyName; + private final IConvertableToPath property; /** - * Creates {@link BindSavedPropertyPostActionError} with {@code propertyName} indicating where master entity resides. + * Creates {@link BindSavedPropertyPostActionError} with {@code property} indicating where master entity resides. * - * @param propertyName + * @param property */ - public BindSavedPropertyPostActionError(final String propertyName) { - this.propertyName = propertyName; + public BindSavedPropertyPostActionError(final IConvertableToPath property) { + this.property = property; } @Override public JsCode build() { - return createPostAction(true, propertyName); + return createPostAction(true, property); } } \ No newline at end of file diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/BindSavedPropertyPostActionSuccess.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/BindSavedPropertyPostActionSuccess.java index 44b0f910c02..78884b4ccb3 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/BindSavedPropertyPostActionSuccess.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/BindSavedPropertyPostActionSuccess.java @@ -1,5 +1,6 @@ package ua.com.fielden.platform.web.action.post; +import ua.com.fielden.platform.processors.metamodel.IConvertableToPath; import ua.com.fielden.platform.web.centre.api.actions.IEntityActionBuilder2; import ua.com.fielden.platform.web.minijs.JsCode; import ua.com.fielden.platform.web.minijs.JsImport; @@ -8,6 +9,7 @@ import java.util.Set; import static java.lang.String.format; +import static java.util.Objects.requireNonNull; import static java.util.Set.of; import static ua.com.fielden.platform.web.minijs.JsImport.namedImport; @@ -19,20 +21,20 @@ * */ public class BindSavedPropertyPostActionSuccess implements IPostAction { - private final String propertyName; + private final IConvertableToPath property; /** - * Creates {@link BindSavedPropertyPostActionSuccess} with {@code propertyName} indicating where master entity resides. + * Creates {@link BindSavedPropertyPostActionSuccess} with {@code property} indicating where master entity resides. * - * @param propertyName + * @param property */ - public BindSavedPropertyPostActionSuccess(final String propertyName) { - this.propertyName = propertyName; + public BindSavedPropertyPostActionSuccess(final IConvertableToPath property) { + this.property = requireNonNull(property); } @Override public JsCode build() { - return createPostAction(false, propertyName); + return createPostAction(false, property); } @Override @@ -46,7 +48,7 @@ public Set importStatements() { * @param erroneous * @return */ - static JsCode createPostAction(final boolean erroneous, final String propertyName) { + static JsCode createPostAction(final boolean erroneous, final IConvertableToPath property) { return new JsCode(format("" + "const parentMasterName = `tg-${functionalEntity.type().prop('%s').type()._simpleClassName()}-master`;\n" + "const parentMaster = getParentAnd(self, parent => parent.matches(parentMasterName));\n" @@ -59,7 +61,7 @@ static JsCode createPostAction(final boolean erroneous, final String propertyNam // in unsuccessful case it is even more important to leave propertyActionIndices as previously (not to clear them or something); // this is because parentMaster update will not be performed and, in case of clearing, all actions on parentMaster will disappear (at this stage even non-multi action should have zero index) + "parentMaster._postSavedDefault([masterEntity, { propertyActionIndices: parentMaster._propertyActionIndices }]);\n", - propertyName, propertyName + property.toPath(), property.toPath() )); } From 80140d80f7fa9b80eaca62d08cee8f58d040c456 Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Tue, 1 Apr 2025 16:55:24 +0300 Subject: [PATCH 15/76] #2407 Properly support main menus with no specific action imports. --- .../web/ua/com/fielden/platform/web/app/tg-app-template.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/app/tg-app-template.js b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/app/tg-app-template.js index ca178699bb3..f5b66b98d4e 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/app/tg-app-template.js +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/app/tg-app-template.js @@ -596,7 +596,8 @@ Polymer({ this.entityType = "ua.com.fielden.platform.menu.Menu"; //Init master related functions. this.postRetrieved = function (entity, bindingEntity, customObject) { - const createFunctionFromString = prePostActionStr => new Function(...Object.keys(mainMenuActionImports || {}), "const self = this; return " + prePostActionStr).bind(this, ...Object.values(mainMenuActionImports || {}))(); + const mainMenuActionImportsIfPresent = () => typeof mainMenuActionImports !== "undefined" ? mainMenuActionImports : {}; + const createFunctionFromString = prePostActionStr => new Function(...Object.keys(mainMenuActionImportsIfPresent()), "const self = this; return " + prePostActionStr).bind(this, ...Object.values(mainMenuActionImportsIfPresent()))(); entity.menu.forEach(menuItem => { menuItem.actions.forEach(action => { action._showDialog = this._showDialog; From d3612d8bcbb30058100f4aeefa58fd8501cf5395 Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Tue, 1 Apr 2025 17:39:16 +0300 Subject: [PATCH 16/76] #2407 Removed unused alternative for more comprehensive FileSaverPostAction. --- .../action/post/FileDownloadPostAction.java | 32 ------------------- .../web/action/post/FileSaverPostAction.java | 4 +-- 2 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/FileDownloadPostAction.java diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/FileDownloadPostAction.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/FileDownloadPostAction.java deleted file mode 100644 index 4011fbf7fe9..00000000000 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/FileDownloadPostAction.java +++ /dev/null @@ -1,32 +0,0 @@ -package ua.com.fielden.platform.web.action.post; - -import ua.com.fielden.platform.web.minijs.JsCode; -import ua.com.fielden.platform.web.view.master.api.actions.post.IPostAction; - -/** - * This is an alternative implementation to {@link FileSaverPostAction}, which depends on HTML5 feature a.download. - * - * @author TG Team - * - */ -public class FileDownloadPostAction implements IPostAction { - - @Override - public JsCode build() { - final JsCode jsCode = new JsCode( - "var byteCharacters = atob(functionalEntity.data);" - + "var byteNumbers = new Uint8Array(byteCharacters.length);\n" - + "for (var index = 0; index < byteCharacters.length; index++) {\n" - + " byteNumbers[index] = byteCharacters.charCodeAt(index);\n" - + "}\n" - + "var blob = new Blob([byteNumbers], {type: functionalEntity.mime});\n" - + "var url = URL.createObjectURL(blob);\n" - + "var a = document.createElement('a');\n" - + "a.setAttribute('href', url);\n" - + "a.setAttribute('download', functionalEntity.fileName);\n" - + "a.click();\n" - + "URL.revokeObjectURL(url)"); - return jsCode; - } - -} diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/FileSaverPostAction.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/FileSaverPostAction.java index 434ff5bc849..a9a1a909009 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/FileSaverPostAction.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/action/post/FileSaverPostAction.java @@ -17,9 +17,7 @@ *

  • fileName -- a file name including file extension where the data should be saved *
  • data -- base64 string representing a binary array * - * - * See also an alternative implementation {@link FileDownloadPostAction}. - * + * * @author TG Team * */ From dcc884140ee5b1ac14438515c10a81fb658594d9 Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Tue, 1 Apr 2025 18:17:02 +0300 Subject: [PATCH 17/76] #2407 Removed old FIXME -- no need to provide polymer imports. --- .../platform/web/view/master/api/impl/SimpleMasterBuilder.java | 1 - 1 file changed, 1 deletion(-) diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/impl/SimpleMasterBuilder.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/impl/SimpleMasterBuilder.java index 7b6db110c20..26daa51ad92 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/impl/SimpleMasterBuilder.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/impl/SimpleMasterBuilder.java @@ -216,7 +216,6 @@ public ILayoutConfigWithDimensionsAndDone setLayoutFor(final Device device, f public IMaster done() { final SortedSet actionImports = new TreeSet<>(); final LinkedHashSet importPaths = new LinkedHashSet<>(); - // importPaths.add("polymer/polymer/polymer"); // FIXME check and delete if all good -- this is not really needed due to tg-entity-master-template-behavior dependencies final AtomicInteger funcActionSeq = new AtomicInteger(0); // used for both entity and property level functional actions final String prefix = ",\n"; From 3e186b8fcd4d6e8cf4bd510ab4f5440a792d6815 Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Tue, 1 Apr 2025 18:23:02 +0300 Subject: [PATCH 18/76] #2407 Support for full paths instead of shorten ones (resources). --- .../main/java/ua/com/fielden/platform/web/minijs/JsImport.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/minijs/JsImport.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/minijs/JsImport.java index 0a392d95866..7227917ece5 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/minijs/JsImport.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/minijs/JsImport.java @@ -94,7 +94,7 @@ public static SortedSet extendAndValidateCombinedImports(final SortedS public static String extractImportStatements(final SortedSet combinedImports, final Optional importObjectNameOpt) { return combinedImports.isEmpty() ? "" - : "\n" + join("\n", combinedImports.stream().map(jsImport -> "import { %s as %s } from '/resources/%s.js';".formatted(jsImport.name(), jsImport.alias().get(), jsImport.path())).toList()) + : "\n" + join("\n", combinedImports.stream().map(jsImport -> "import { %s as %s } from '%s.js';".formatted(jsImport.name(), jsImport.alias().get(), (jsImport.path().startsWith("/") ? "" : "/resources/") + jsImport.path())).toList()) + importObjectNameOpt.map(importObjectName -> "\n" + "const %s = {%s};".formatted(importObjectName, join(",", combinedImports.stream().map(jsImport -> jsImport.alias().get()).map(alias -> "%s: %s".formatted(alias, alias)).toList())) ).orElse(""); From e918d0b44873d0acc8ac6c05e1a75334815311d5 Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Tue, 1 Apr 2025 18:25:47 +0300 Subject: [PATCH 19/76] #2407 Replaced global import in every master / centre to only be placed in required ReferenceHierarchyPreAction contexts. --- .../ReferenceHierarchyWebUiConfig.java | 48 ++++++++++++------- .../hierarchy/ReferenceHierarchyMaster.java | 18 +++---- .../web/centre/tg-entity-centre-template.js | 1 - .../web/master/tg-entity-master-template.js | 1 - 4 files changed, 40 insertions(+), 28 deletions(-) diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/ref_hierarchy/ReferenceHierarchyWebUiConfig.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/ref_hierarchy/ReferenceHierarchyWebUiConfig.java index 45787c2f3bd..744964cf59c 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/ref_hierarchy/ReferenceHierarchyWebUiConfig.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/ref_hierarchy/ReferenceHierarchyWebUiConfig.java @@ -6,15 +6,20 @@ import ua.com.fielden.platform.web.centre.api.actions.EntityActionConfig; import ua.com.fielden.platform.web.centre.api.context.CentreContextConfig; import ua.com.fielden.platform.web.minijs.JsCode; +import ua.com.fielden.platform.web.minijs.JsImport; import ua.com.fielden.platform.web.view.master.EntityMaster; import ua.com.fielden.platform.web.view.master.api.actions.pre.IPreAction; import ua.com.fielden.platform.web.view.master.hierarchy.ReferenceHierarchyMaster; +import java.util.Set; + +import static java.util.Set.of; import static ua.com.fielden.platform.error.Result.failuref; import static ua.com.fielden.platform.reflection.PropertyTypeDeterminator.determinePropertyType; import static ua.com.fielden.platform.web.centre.api.actions.impl.EntityActionBuilder.action; import static ua.com.fielden.platform.web.centre.api.context.impl.EntityCentreContextSelector.context; import static ua.com.fielden.platform.web.minijs.JsCode.jsCode; +import static ua.com.fielden.platform.web.minijs.JsImport.namedImport; /** * Web UI configuration for reference hierarchy master and action needed to call reference hierarchy. @@ -119,27 +124,34 @@ public static EntityActionConfig mkAction(final CentreContextConfig ccConfig) { * @author TG Team */ private record ReferenceHierarchyPreAction(boolean useMasterEntity) implements IPreAction { + + @Override + public Set importStatements() { + return of(namedImport("TgReflector", "/app/tg-reflector")); + } + @Override public JsCode build() { return jsCode(""" - const reflector = new TgReflector(); - let entity = null; - if (action.requireSelectedEntities === 'ONE') { - entity = action.currentEntity(); - } else if (action.requireSelectedEntities === 'ALL' && self.$.egi.getSelectedEntities().length > 0) { - entity = self.$.egi.getSelectedEntities()[0]; - } else if (action.requireMasterEntity === "true") { - if(%s) { - entity = action.parentElement.entity['@@origin']; - } else { - const value = reflector.tg_getFullValue(action.parentElement.entity, action.parentElement.propertyName); - entity = reflector.isEntity(value) ? value : action.parentElement.entity['@@origin']; - } - } - if (entity) { - action.shortDesc = reflector.getType(entity.constructor.prototype.type.call(entity).notEnhancedFullClassName()).entityTitle(); - } - """.formatted(this.useMasterEntity)); + const reflector = new TgReflector(); + let entity = null; + if (action.requireSelectedEntities === 'ONE') { + entity = action.currentEntity(); + } else if (action.requireSelectedEntities === 'ALL' && self.$.egi.getSelectedEntities().length > 0) { + entity = self.$.egi.getSelectedEntities()[0]; + } else if (action.requireMasterEntity === "true") { + if(%s) { + entity = action.parentElement.entity['@@origin']; + } else { + const value = reflector.tg_getFullValue(action.parentElement.entity, action.parentElement.propertyName); + entity = reflector.isEntity(value) ? value : action.parentElement.entity['@@origin']; + } + } + if (entity) { + action.shortDesc = reflector.getType(entity.constructor.prototype.type.call(entity).notEnhancedFullClassName()).entityTitle(); + } + """.formatted(this.useMasterEntity)); + } } diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/hierarchy/ReferenceHierarchyMaster.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/hierarchy/ReferenceHierarchyMaster.java index 7eefe6801fb..8eadc12d97d 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/hierarchy/ReferenceHierarchyMaster.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/hierarchy/ReferenceHierarchyMaster.java @@ -11,17 +11,17 @@ import ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionElement; import ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionKind; import ua.com.fielden.platform.web.interfaces.IRenderable; +import ua.com.fielden.platform.web.minijs.JsImport; import ua.com.fielden.platform.web.ref_hierarchy.ReferenceHierarchyWebUiConfig; import ua.com.fielden.platform.web.view.master.api.IMaster; -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Optional; +import java.util.*; import static java.util.Optional.empty; import static ua.com.fielden.platform.web.centre.EntityCentre.IMPORTS; import static ua.com.fielden.platform.web.centre.api.context.impl.EntityCentreContextSelector.context; +import static ua.com.fielden.platform.web.minijs.JsImport.extendAndValidateCombinedImports; +import static ua.com.fielden.platform.web.minijs.JsImport.extractImportStatements; import static ua.com.fielden.platform.web.view.master.EntityMaster.ENTITY_TYPE; import static ua.com.fielden.platform.web.view.master.EntityMaster.flattenedNameOf; import static ua.com.fielden.platform.web.view.master.api.impl.SimpleMasterBuilder.createImports; @@ -38,14 +38,13 @@ public class ReferenceHierarchyMaster implements IMaster { private final IRenderable renderable; public ReferenceHierarchyMaster () { - + final SortedSet actionImports = new TreeSet<>(); final LinkedHashSet importPaths = new LinkedHashSet<>(); importPaths.add("components/tg-reference-hierarchy"); importPaths.add("editors/tg-singleline-text-editor"); importPaths.add("editors/tg-boolean-editor"); importPaths.add("actions/tg-ui-action"); - this.actions.add(EntityActionBuilder.editAction().withContext(context().withCurrentEntity().build()) .icon("editor:mode-edit") .longDesc("Opens master for editing this entity") @@ -97,6 +96,7 @@ public ReferenceHierarchyMaster () { for (int actionIdx = 0; actionIdx < this.actions.size(); actionIdx++) { final EntityActionConfig action = this.actions.get(actionIdx); final FunctionalActionElement el = FunctionalActionElement.newEntityActionForMaster(action, actionIdx); + extendAndValidateCombinedImports(actionImports, el.actionImports()); importPaths.add(el.importPath()); referenceHierarchyDom.add(el.render().attr("hidden", null).clazz("primary-action").attr("slot", "reference-hierarchy-action")); customActionObjects.append(prefix + el.createActionObject()); @@ -107,8 +107,10 @@ public ReferenceHierarchyMaster () { prefDimBuilder.append("{'width': function() {return '50%'}, 'height': function() {return '70%'}, 'widthUnit': '', 'heightUnit': ''}"); final String entityMasterStr = ResourceLoader.getText("ua/com/fielden/platform/web/master/tg-entity-master-template.js") - .replace(IMPORTS, createImports(importPaths)+ - "\nimport { TgEntityBinderBehavior } from '/resources/binding/tg-entity-binder-behavior.js';\n") + .replace(IMPORTS, createImports(importPaths) + + "\nimport { TgEntityBinderBehavior } from '/resources/binding/tg-entity-binder-behavior.js';\n" + + extractImportStatements(actionImports, empty()) + ) .replace(ENTITY_TYPE, flattenedNameOf(ReferenceHierarchy.class)) .replace("", referenceHierarchyDom.toString()) .replace("//generatedPrimaryActions", customActionObjectsString.length() > prefixLength ? customActionObjectsString.substring(prefixLength) diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/tg-entity-centre-template.js b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/tg-entity-centre-template.js index f16ce2793e1..ece32260d26 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/tg-entity-centre-template.js +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/tg-entity-centre-template.js @@ -27,7 +27,6 @@ import '/resources/centre/tg-entity-centre-styles.js'; import '/resources/centre/tg-selection-criteria-styles.js'; import { TgEntityCentreTemplateBehavior } from '/resources/centre/tg-entity-centre-template-behavior.js'; import '/resources/centre/tg-entity-centre-insertion-point.js'; -import { TgReflector } from '/app/tg-reflector.js'; const selectionCritTemplate = html` diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/tg-entity-master-template.js b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/tg-entity-master-template.js index 6814a0b3ea0..b4e6845f5bd 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/tg-entity-master-template.js +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/tg-entity-master-template.js @@ -3,7 +3,6 @@ import '/resources/actions/tg-ui-action.js'; import { TgEntityMasterTemplateBehavior, Polymer, html } from '/resources/master/tg-entity-master-template-behavior.js'; -import { TgReflector } from '/app/tg-reflector.js'; // From 380d6f93e5ac0ac1c51255c5a10478c14c9ac6ea Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Tue, 1 Apr 2025 19:30:55 +0300 Subject: [PATCH 20/76] #2407 IPre/PostAction JavaScript imports support in centres (primary / secondary actions). --- .../platform/web/centre/EntityCentre.java | 4 ++-- .../multi/FunctionalMultiActionElement.java | 16 ++++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/EntityCentre.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/EntityCentre.java index c8133e5de13..44ef86c8752 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/EntityCentre.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/EntityCentre.java @@ -1082,7 +1082,7 @@ private IRenderable createRenderableRepresentation(final ICentreDomainTreeManage importPaths.add(el.importPath()); primaryActionDom.add(el.render().attr("slot", "primary-action").attr("hidden", null)); - primaryActionObject.append(prefix + el.createActionObject(importPaths)); + primaryActionObject.append(prefix + el.createActionObject(importPaths, actionImports)); } ////////////////////Primary result-set action [END] ////////////// @@ -1127,7 +1127,7 @@ private IRenderable createRenderableRepresentation(final ICentreDomainTreeManage final FunctionalMultiActionElement el = new FunctionalMultiActionElement(multiActionConfig, numberOfAction, FunctionalActionKind.SECONDARY_RESULT_SET); importPaths.add(el.importPath()); secondaryActionsDom.add(el.render().attr("slot", "secondary-action")); - secondaryActionsObjects.append(prefix + el.createActionObject(importPaths)); + secondaryActionsObjects.append(prefix + el.createActionObject(importPaths, actionImports)); numberOfAction += multiActionConfig.actions().size(); } } diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/api/actions/multi/FunctionalMultiActionElement.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/api/actions/multi/FunctionalMultiActionElement.java index 7d90d7392fe..af94cca7a54 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/api/actions/multi/FunctionalMultiActionElement.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/api/actions/multi/FunctionalMultiActionElement.java @@ -1,9 +1,5 @@ package ua.com.fielden.platform.web.centre.api.actions.multi; -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; - import ua.com.fielden.platform.dom.DomElement; import ua.com.fielden.platform.web.centre.api.actions.EntityActionConfig; import ua.com.fielden.platform.web.centre.api.crit.impl.AbstractCriterionWidget; @@ -11,6 +7,14 @@ import ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionKind; import ua.com.fielden.platform.web.interfaces.IImportable; import ua.com.fielden.platform.web.interfaces.IRenderable; +import ua.com.fielden.platform.web.minijs.JsImport; + +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.SortedSet; + +import static ua.com.fielden.platform.web.minijs.JsImport.extendAndValidateCombinedImports; /** * {@link IRenderable} and {@link IImportable} element that represents multiple action element and it is renderable into tg-egi-multi-action component instance. @@ -56,11 +60,12 @@ public DomElement render() { * * @return */ - public String createActionObject(final LinkedHashSet importPaths) { + public String createActionObject(final LinkedHashSet importPaths, final SortedSet actionImports) { final String prefix = ",\n"; final StringBuilder actionsObjects = new StringBuilder(); for(final FunctionalActionElement el: actionElements) { importPaths.add(el.importPath()); + extendAndValidateCombinedImports(actionImports, el.actionImports()); actionsObjects.append(prefix + el.createActionObject()); } final int prefixLength = prefix.length(); @@ -68,7 +73,6 @@ public String createActionObject(final LinkedHashSet importPaths) { return actionString.length() > prefixLength ? actionString.substring(prefixLength) : actionString; } - @Override public String importPath() { return widgetPath; From a8239295fca0230f84a52ad4b7ee20c969e5fb34 Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Tue, 1 Apr 2025 19:40:18 +0300 Subject: [PATCH 21/76] #2407 IPre/PostAction JavaScript imports support in centres (insertion points). --- .../platform/web/centre/EntityCentre.java | 1 + .../InsertionPointBuilder.java | 21 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/EntityCentre.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/EntityCentre.java index 44ef86c8752..34da3ac40fe 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/EntityCentre.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/EntityCentre.java @@ -1145,6 +1145,7 @@ private IRenderable createRenderableRepresentation(final ICentreDomainTreeManage final StringBuilder insertionPointActionsObjects = new StringBuilder(); for (final InsertionPointBuilder el : insertionPointActionsElements) { importPaths.addAll(el.importPaths()); + extendAndValidateCombinedImports(actionImports, el.actionImports()); insertionPointActionsDom.add(el.renderInsertionPointAction()); insertionPointActionsObjects.append(prefix + el.code()); } diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/api/insertion_points/InsertionPointBuilder.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/api/insertion_points/InsertionPointBuilder.java index e6e6c9a6cdc..3f6f7831f2b 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/api/insertion_points/InsertionPointBuilder.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/centre/api/insertion_points/InsertionPointBuilder.java @@ -1,15 +1,5 @@ package ua.com.fielden.platform.web.centre.api.insertion_points; -import static org.apache.commons.lang3.StringUtils.join; -import static ua.com.fielden.platform.web.centre.api.insertion_points.InsertionPoints.ALTERNATIVE_VIEW; -import static ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionKind.INSERTION_POINT; - -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Optional; -import java.util.Set; - import ua.com.fielden.platform.dom.DomElement; import ua.com.fielden.platform.web.centre.api.actions.EntityActionConfig; import ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionElement; @@ -17,6 +7,13 @@ import ua.com.fielden.platform.web.interfaces.IExecutable; import ua.com.fielden.platform.web.interfaces.IRenderable; import ua.com.fielden.platform.web.minijs.JsCode; +import ua.com.fielden.platform.web.minijs.JsImport; + +import java.util.*; + +import static org.apache.commons.lang3.StringUtils.join; +import static ua.com.fielden.platform.web.centre.api.insertion_points.InsertionPoints.ALTERNATIVE_VIEW; +import static ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionKind.INSERTION_POINT; /** * The Insertion point builder class that allows one to render insertion point and generate action object. @@ -84,6 +81,10 @@ public DomElement renderInsertionPointAction() { return insertionPointActionElement.render().clazz("insertion-point-action").attr("hidden", null); } + public Set actionImports() { + return insertionPointActionElement.actionImports(); + } + /** * Returns the import paths for this insertion point * From 276b1f182657abd63070b8cff65edcc8e076d2b1 Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Tue, 1 Apr 2025 19:43:13 +0300 Subject: [PATCH 22/76] #2407 IPre/PostAction JavaScript imports support in masters (compound menu items). --- .../api/compound/impl/MasterWithMenu.java | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/compound/impl/MasterWithMenu.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/compound/impl/MasterWithMenu.java index 1a5ee9ed37a..ff98ce92a07 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/compound/impl/MasterWithMenu.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/compound/impl/MasterWithMenu.java @@ -1,19 +1,6 @@ package ua.com.fielden.platform.web.view.master.api.compound.impl; -import static java.lang.String.format; -import static org.apache.logging.log4j.LogManager.getLogger; -import static ua.com.fielden.platform.web.centre.EntityCentre.IMPORTS; -import static ua.com.fielden.platform.web.view.master.EntityMaster.ENTITY_TYPE; -import static ua.com.fielden.platform.web.view.master.EntityMaster.flattenedNameOf; -import static ua.com.fielden.platform.web.view.master.api.impl.SimpleMasterBuilder.createImports; - -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Optional; - import org.apache.logging.log4j.Logger; - import ua.com.fielden.platform.basic.IValueMatcherWithContext; import ua.com.fielden.platform.dom.DomContainer; import ua.com.fielden.platform.dom.DomElement; @@ -25,8 +12,21 @@ import ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionElement; import ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionKind; import ua.com.fielden.platform.web.interfaces.IRenderable; +import ua.com.fielden.platform.web.minijs.JsImport; import ua.com.fielden.platform.web.view.master.api.IMaster; +import java.util.*; + +import static java.lang.String.format; +import static java.util.Optional.empty; +import static org.apache.logging.log4j.LogManager.getLogger; +import static ua.com.fielden.platform.web.centre.EntityCentre.IMPORTS; +import static ua.com.fielden.platform.web.minijs.JsImport.extendAndValidateCombinedImports; +import static ua.com.fielden.platform.web.minijs.JsImport.extractImportStatements; +import static ua.com.fielden.platform.web.view.master.EntityMaster.ENTITY_TYPE; +import static ua.com.fielden.platform.web.view.master.EntityMaster.flattenedNameOf; +import static ua.com.fielden.platform.web.view.master.api.impl.SimpleMasterBuilder.createImports; + /** * A compound entity master that has a menu, that extends {@link IMaster} contract. * @@ -57,6 +57,7 @@ class MasterWithMenu, F extends AbstractFunctionalEn throw new IllegalArgumentException(format("The default menu item index %s is outside of the range for the provided menu items.", defaultMenuItemIndex)); } + final SortedSet actionImports = new TreeSet<>(); final LinkedHashSet importPaths = new LinkedHashSet<>(); importPaths.add("master/menu/tg-master-menu"); importPaths.add("master/menu/tg-master-menu-item-section"); @@ -77,6 +78,7 @@ class MasterWithMenu, F extends AbstractFunctionalEn for (final FunctionalActionElement el : menuItemActionsElements) { importPaths.add(el.importPath()); + extendAndValidateCombinedImports(actionImports, el.actionImports()); menuItemActionsDom.add(el.render()); jsMenuItemActionObjects.append(el.createActionObject() + ",\n"); menuItemViewsDom.add( @@ -102,7 +104,9 @@ class MasterWithMenu, F extends AbstractFunctionalEn // generate the final master with menu final String entityMasterStr = ResourceLoader.getText("ua/com/fielden/platform/web/master/tg-entity-master-template.js") - .replace(IMPORTS, createImports(importPaths)) + .replace(IMPORTS, createImports(importPaths) + + extractImportStatements(actionImports, empty()) + ) .replace(ENTITY_TYPE, flattenedNameOf(functionalEntityType)) .replace("", format("" From 253607bf065cb1a105b8c1764ebc811850d0c47d Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Tue, 1 Apr 2025 20:02:54 +0300 Subject: [PATCH 23/76] #2407 IPre/PostAction JavaScript imports support in centres (charts and alt views). --- .../impl/CalendarEntityMaster.java | 33 ++++++++----- .../decker/api/impl/ChartDeckerMaster.java | 47 ++++++++++--------- .../api/implementation/ScatterPlotMaster.java | 13 +++-- 3 files changed, 56 insertions(+), 37 deletions(-) diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/with_master/impl/CalendarEntityMaster.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/with_master/impl/CalendarEntityMaster.java index 5b7687a3d4d..8f55ac4ddaa 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/with_master/impl/CalendarEntityMaster.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/api/with_master/impl/CalendarEntityMaster.java @@ -1,15 +1,5 @@ package ua.com.fielden.platform.web.view.master.api.with_master.impl; -import static java.util.Optional.empty; -import static ua.com.fielden.platform.web.centre.EntityCentre.IMPORTS; -import static ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionKind.PRIMARY_RESULT_SET; -import static ua.com.fielden.platform.web.view.master.EntityMaster.ENTITY_TYPE; -import static ua.com.fielden.platform.web.view.master.EntityMaster.flattenedNameOf; -import static ua.com.fielden.platform.web.view.master.api.impl.SimpleMasterBuilder.createImports; - -import java.util.LinkedHashSet; -import java.util.Optional; - import ua.com.fielden.platform.basic.IValueMatcherWithContext; import ua.com.fielden.platform.dom.DomElement; import ua.com.fielden.platform.dom.InnerTextElement; @@ -19,8 +9,23 @@ import ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionElement; import ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionKind; import ua.com.fielden.platform.web.interfaces.IRenderable; +import ua.com.fielden.platform.web.minijs.JsImport; import ua.com.fielden.platform.web.view.master.api.IMaster; +import java.util.LinkedHashSet; +import java.util.Optional; +import java.util.SortedSet; +import java.util.TreeSet; + +import static java.util.Optional.empty; +import static ua.com.fielden.platform.web.centre.EntityCentre.IMPORTS; +import static ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionKind.PRIMARY_RESULT_SET; +import static ua.com.fielden.platform.web.minijs.JsImport.extendAndValidateCombinedImports; +import static ua.com.fielden.platform.web.minijs.JsImport.extractImportStatements; +import static ua.com.fielden.platform.web.view.master.EntityMaster.ENTITY_TYPE; +import static ua.com.fielden.platform.web.view.master.EntityMaster.flattenedNameOf; +import static ua.com.fielden.platform.web.view.master.api.impl.SimpleMasterBuilder.createImports; + /** * An entity master that contains a calendar view. * @@ -61,6 +66,7 @@ public CalendarEntityMaster( this.editAction = editAction; + final SortedSet actionImports = new TreeSet<>(); final LinkedHashSet importPaths = new LinkedHashSet<>(); importPaths.add(calendarComponentUri); @@ -81,6 +87,7 @@ public CalendarEntityMaster( final FunctionalActionElement el = FunctionalActionElement.newEntityActionForMaster(editAction, 0); importPaths.add(el.importPath()); + extendAndValidateCombinedImports(actionImports, el.actionImports()); calendar.add(el.render().attr("hidden", true).clazz("primary-action").attr("slot", "calendar-action")); final String editActionObjectString = el.createActionObject(); @@ -88,8 +95,10 @@ public CalendarEntityMaster( prefDimBuilder.append("{'width': function() {return '100%'}, 'height': function() {return '100%'}, 'widthUnit': '', 'heightUnit': ''}"); final String entityMasterStr = ResourceLoader.getText("ua/com/fielden/platform/web/master/tg-entity-master-template.js") - .replace(IMPORTS, createImports(importPaths) + - "\nimport { TgEntityBinderBehavior } from '/resources/binding/tg-entity-binder-behavior.js';\n") + .replace(IMPORTS, createImports(importPaths) + + "\nimport { TgEntityBinderBehavior } from '/resources/binding/tg-entity-binder-behavior.js';\n" + + extractImportStatements(actionImports, empty()) + ) .replace(ENTITY_TYPE, flattenedNameOf(entityType)) .replace("", calendar.toString()) .replace("//generatedPrimaryActions", editActionObjectString) diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/chart/decker/api/impl/ChartDeckerMaster.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/chart/decker/api/impl/ChartDeckerMaster.java index 2229be17282..3add87ef1e6 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/chart/decker/api/impl/ChartDeckerMaster.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/chart/decker/api/impl/ChartDeckerMaster.java @@ -1,24 +1,6 @@ package ua.com.fielden.platform.web.view.master.chart.decker.api.impl; -import static java.util.Optional.ofNullable; -import static org.apache.commons.lang3.StringUtils.isEmpty; -import static org.apache.commons.lang3.StringUtils.join; -import static ua.com.fielden.platform.serialisation.jackson.DefaultValueContract.getTimePortionToDisplay; -import static ua.com.fielden.platform.serialisation.jackson.DefaultValueContract.getTimeZone; -import static ua.com.fielden.platform.web.centre.EntityCentre.IMPORTS; -import static ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionKind.PRIMARY_RESULT_SET; -import static ua.com.fielden.platform.web.view.master.EntityMaster.ENTITY_TYPE; -import static ua.com.fielden.platform.web.view.master.EntityMaster.flattenedNameOf; -import static ua.com.fielden.platform.web.view.master.api.impl.SimpleMasterBuilder.createImports; - -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Optional; -import java.util.function.Function; - import org.apache.commons.lang3.StringUtils; - import ua.com.fielden.platform.basic.IValueMatcherWithContext; import ua.com.fielden.platform.dom.DomContainer; import ua.com.fielden.platform.dom.DomElement; @@ -32,25 +14,45 @@ import ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionElement; import ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionKind; import ua.com.fielden.platform.web.interfaces.IRenderable; +import ua.com.fielden.platform.web.minijs.JsImport; import ua.com.fielden.platform.web.view.master.api.IMaster; import ua.com.fielden.platform.web.view.master.chart.decker.api.IChartDeckerConfig; +import java.util.*; +import java.util.function.Function; + +import static java.util.Optional.empty; +import static java.util.Optional.ofNullable; +import static org.apache.commons.lang3.StringUtils.isEmpty; +import static org.apache.commons.lang3.StringUtils.join; +import static ua.com.fielden.platform.serialisation.jackson.DefaultValueContract.getTimePortionToDisplay; +import static ua.com.fielden.platform.serialisation.jackson.DefaultValueContract.getTimeZone; +import static ua.com.fielden.platform.web.centre.EntityCentre.IMPORTS; +import static ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionKind.PRIMARY_RESULT_SET; +import static ua.com.fielden.platform.web.minijs.JsImport.extendAndValidateCombinedImports; +import static ua.com.fielden.platform.web.minijs.JsImport.extractImportStatements; +import static ua.com.fielden.platform.web.view.master.EntityMaster.ENTITY_TYPE; +import static ua.com.fielden.platform.web.view.master.EntityMaster.flattenedNameOf; +import static ua.com.fielden.platform.web.view.master.api.impl.SimpleMasterBuilder.createImports; + public class ChartDeckerMaster> implements IMaster { private final IRenderable renderable; private final List actions = new ArrayList<>(); public ChartDeckerMaster(final IChartDeckerConfig deckerConfig) { - + final SortedSet actionImports = new TreeSet<>(); final LinkedHashSet importPaths = new LinkedHashSet<>(); importPaths.add("components/tg-bar-chart/tg-bar-chart"); final DomElement decks = createDeckElements(deckerConfig); - final Pair actions = generateActions(deckerConfig, importPaths); + final Pair actions = generateActions(deckerConfig, importPaths, actionImports); decks.add(actions.getValue()); final String entityMasterStr = ResourceLoader.getText("ua/com/fielden/platform/web/components/chart-decker/tg-chart-decker-template.js") - .replace(IMPORTS, createImports(importPaths)) + .replace(IMPORTS, createImports(importPaths) + + extractImportStatements(actionImports, empty()) + ) .replace(ENTITY_TYPE, flattenedNameOf(deckerConfig.getEntityType())) .replace("", decks.toString()) .replace("//generatedPrimaryActions", actions.getKey()) @@ -66,7 +68,7 @@ public DomElement render() { }; } - private Pair generateActions(final IChartDeckerConfig deckerConfig, final LinkedHashSet importPaths) { + private Pair generateActions(final IChartDeckerConfig deckerConfig, final LinkedHashSet importPaths, final SortedSet actionImports) { final DomElement container = new DomContainer(); final List primaryActionObjects = new ArrayList<>(); final List> decs = deckerConfig.getDecs(); @@ -79,6 +81,7 @@ private Pair generateActions(final IChartDeckerConfig dec if (config != null) { final FunctionalActionElement el = FunctionalActionElement.newPropertyActionForMaster(config, deckIndex, s.getPropertyName()); importPaths.add(el.importPath()); + extendAndValidateCombinedImports(actionImports, el.actionImports()); container.add(el.render().clazz("chart-action").attr("hidden", true).attr("action-index", seriesIndex).attr("deck-index", deckIndex)); primaryActionObjects.add(el.createActionObject()); } diff --git a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/scatterplot/api/implementation/ScatterPlotMaster.java b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/scatterplot/api/implementation/ScatterPlotMaster.java index c25a936330b..62e9373ba67 100644 --- a/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/scatterplot/api/implementation/ScatterPlotMaster.java +++ b/platform-web-ui/src/main/java/ua/com/fielden/platform/web/view/master/scatterplot/api/implementation/ScatterPlotMaster.java @@ -14,6 +14,7 @@ import ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionElement; import ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionKind; import ua.com.fielden.platform.web.interfaces.IRenderable; +import ua.com.fielden.platform.web.minijs.JsImport; import ua.com.fielden.platform.web.view.master.api.IMaster; import java.util.*; @@ -28,6 +29,8 @@ import static ua.com.fielden.platform.serialisation.jackson.DefaultValueContract.getTimeZone; import static ua.com.fielden.platform.web.centre.EntityCentre.IMPORTS; import static ua.com.fielden.platform.web.centre.api.resultset.impl.FunctionalActionKind.PRIMARY_RESULT_SET; +import static ua.com.fielden.platform.web.minijs.JsImport.extendAndValidateCombinedImports; +import static ua.com.fielden.platform.web.minijs.JsImport.extractImportStatements; import static ua.com.fielden.platform.web.view.master.EntityMaster.ENTITY_TYPE; import static ua.com.fielden.platform.web.view.master.EntityMaster.flattenedNameOf; import static ua.com.fielden.platform.web.view.master.api.impl.SimpleMasterBuilder.createImports; @@ -52,11 +55,14 @@ public class ScatterPlotMaster> implements IMaster scatterPlotMasterBuilder) { this.action = scatterPlotMasterBuilder.getAction(); + final SortedSet actionImports = new TreeSet<>(); final LinkedHashSet importPaths = new LinkedHashSet<>(); - final Optional> actionPair = generateAction(importPaths, scatterPlotMasterBuilder.getAction()); + final Optional> actionPair = generateAction(importPaths, actionImports, scatterPlotMasterBuilder.getAction()); final String entityMasterStr = ResourceLoader.getText("ua/com/fielden/platform/web/master/scatter-plot/tg-scatter-plot-master-template.js") - .replace(IMPORTS, createImports(importPaths)) + .replace(IMPORTS, createImports(importPaths) + + extractImportStatements(actionImports, empty()) + ) .replace(ENTITY_TYPE, flattenedNameOf(scatterPlotMasterBuilder.getEntityType())) .replace("", actionPair.map(a -> a.getValue().toString()).orElse("")) .replace("//generatedPrimaryActions", actionPair.map(a -> a.getKey().toString()).orElse("")) @@ -73,10 +79,11 @@ public DomElement render() { }; } - private Optional> generateAction(final LinkedHashSet importPaths, final EntityActionConfig action) { + private Optional> generateAction(final LinkedHashSet importPaths, final SortedSet actionImports, final EntityActionConfig action) { if (action != null) { final FunctionalActionElement el = FunctionalActionElement.newEntityActionForMaster(action, 0); importPaths.add(el.importPath()); + extendAndValidateCombinedImports(actionImports, el.actionImports()); return of(new Pair<>(el.createActionObject(), el.render().clazz("chart-action").attr("hidden", true))); } return empty(); From 8ee540d18c5e72b58da726456ebafaee24ea6f79 Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Tue, 1 Apr 2025 20:34:18 +0300 Subject: [PATCH 24/76] #2407 Removed invalid comment. --- .../web/ua/com/fielden/platform/web/master/actions/tg-action.js | 1 - 1 file changed, 1 deletion(-) diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/actions/tg-action.js b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/actions/tg-action.js index da85fd02675..d8c3904c77a 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/actions/tg-action.js +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/actions/tg-action.js @@ -20,7 +20,6 @@ import { allDefined, localStorageKey, getParentAnd } from '/resources/reflection import { enhanceStateRestoration } from '/resources/components/tg-global-error-handler.js'; import { _isEntity } from '/app/tg-reflector.js'; -// depends on '/resources/filesaver/FileSaver.min.js' const createDescWithShortcut = function(desc, shortcuts) { From 4342c20edfee33b59f49bc3b659c7f48ee79e37f Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Tue, 1 Apr 2025 20:41:18 +0300 Subject: [PATCH 25/76] #2407 Remove old version of FileSaver lib. --- .../src/main/resources/filesaver/FileSaver.js | 280 ------------------ .../main/resources/filesaver/FileSaver.min.js | 2 - 2 files changed, 282 deletions(-) delete mode 100644 platform-web-ui/src/main/resources/filesaver/FileSaver.js delete mode 100644 platform-web-ui/src/main/resources/filesaver/FileSaver.min.js diff --git a/platform-web-ui/src/main/resources/filesaver/FileSaver.js b/platform-web-ui/src/main/resources/filesaver/FileSaver.js deleted file mode 100644 index fd5927d2d0e..00000000000 --- a/platform-web-ui/src/main/resources/filesaver/FileSaver.js +++ /dev/null @@ -1,280 +0,0 @@ -/* FileSaver.js - * A saveAs() FileSaver implementation. - * 1.1.20160328 - * - * By Eli Grey, http://eligrey.com - * License: MIT - * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md - */ - -/*global self */ -/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */ - -/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ - -var saveAs = saveAs || (function(view) { - "use strict"; - // IE <10 is explicitly unsupported - if (typeof navigator !== "undefined" && /MSIE [1-9]\./.test(navigator.userAgent)) { - return; - } - var - doc = view.document - // only get URL when necessary in case Blob.js hasn't overridden it yet - , get_URL = function() { - return view.URL || view.webkitURL || view; - } - , save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a") - , can_use_save_link = "download" in save_link - , click = function(node) { - var event = new MouseEvent("click"); - node.dispatchEvent(event); - } - , is_safari = /Version\/[\d\.]+.*Safari/.test(navigator.userAgent) - , webkit_req_fs = view.webkitRequestFileSystem - , req_fs = view.requestFileSystem || webkit_req_fs || view.mozRequestFileSystem - , throw_outside = function(ex) { - (view.setImmediate || view.setTimeout)(function() { - throw ex; - }, 0); - } - , force_saveable_type = "application/octet-stream" - , fs_min_size = 0 - // the Blob API is fundamentally broken as there is no "downloadfinished" event to subscribe to - , arbitrary_revoke_timeout = 1000 * 40 // in ms - , revoke = function(file) { - var revoker = function() { - if (typeof file === "string") { // file is an object URL - get_URL().revokeObjectURL(file); - } else { // file is a File - file.remove(); - } - }; - /* // Take note W3C: - var - uri = typeof file === "string" ? file : file.toURL() - , revoker = function(evt) { - // idealy DownloadFinishedEvent.data would be the URL requested - if (evt.data === uri) { - if (typeof file === "string") { // file is an object URL - get_URL().revokeObjectURL(file); - } else { // file is a File - file.remove(); - } - } - } - ; - view.addEventListener("downloadfinished", revoker); - */ - setTimeout(revoker, arbitrary_revoke_timeout); - } - , dispatch = function(filesaver, event_types, event) { - event_types = [].concat(event_types); - var i = event_types.length; - while (i--) { - var listener = filesaver["on" + event_types[i]]; - if (typeof listener === "function") { - try { - listener.call(filesaver, event || filesaver); - } catch (ex) { - throw_outside(ex); - } - } - } - } - , auto_bom = function(blob) { - // prepend BOM for UTF-8 XML and text/* types (including HTML) - if (/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) { - return new Blob(["\ufeff", blob], {type: blob.type}); - } - return blob; - } - , FileSaver = function(blob, name, no_auto_bom) { - if (!no_auto_bom) { - blob = auto_bom(blob); - } - // First try a.download, then web filesystem, then object URLs - var - filesaver = this - , type = blob.type - , blob_changed = false - , object_url - , target_view - , dispatch_all = function() { - dispatch(filesaver, "writestart progress write writeend".split(" ")); - } - // on any filesys errors revert to saving with object URLs - , fs_error = function() { - if (target_view && is_safari && typeof FileReader !== "undefined") { - // Safari doesn't allow downloading of blob urls - var reader = new FileReader(); - reader.onloadend = function() { - var base64Data = reader.result; - target_view.location.href = "data:attachment/file" + base64Data.slice(base64Data.search(/[,;]/)); - filesaver.readyState = filesaver.DONE; - dispatch_all(); - }; - reader.readAsDataURL(blob); - filesaver.readyState = filesaver.INIT; - return; - } - // don't create more object URLs than needed - if (blob_changed || !object_url) { - object_url = get_URL().createObjectURL(blob); - } - if (target_view) { - target_view.location.href = object_url; - } else { - var new_tab = view.open(object_url, "_blank"); - if (new_tab === undefined && is_safari) { - //Apple do not allow window.open, see http://bit.ly/1kZffRI - view.location.href = object_url - } - } - filesaver.readyState = filesaver.DONE; - dispatch_all(); - revoke(object_url); - } - , abortable = function(func) { - return function() { - if (filesaver.readyState !== filesaver.DONE) { - return func.apply(this, arguments); - } - }; - } - , create_if_not_found = {create: true, exclusive: false} - , slice - ; - filesaver.readyState = filesaver.INIT; - if (!name) { - name = "download"; - } - if (can_use_save_link) { - object_url = get_URL().createObjectURL(blob); - setTimeout(function() { - save_link.href = object_url; - save_link.download = name; - click(save_link); - dispatch_all(); - revoke(object_url); - filesaver.readyState = filesaver.DONE; - }); - return; - } - // Object and web filesystem URLs have a problem saving in Google Chrome when - // viewed in a tab, so I force save with application/octet-stream - // http://code.google.com/p/chromium/issues/detail?id=91158 - // Update: Google errantly closed 91158, I submitted it again: - // https://code.google.com/p/chromium/issues/detail?id=389642 - if (view.chrome && type && type !== force_saveable_type) { - slice = blob.slice || blob.webkitSlice; - blob = slice.call(blob, 0, blob.size, force_saveable_type); - blob_changed = true; - } - // Since I can't be sure that the guessed media type will trigger a download - // in WebKit, I append .download to the filename. - // https://bugs.webkit.org/show_bug.cgi?id=65440 - if (webkit_req_fs && name !== "download") { - name += ".download"; - } - if (type === force_saveable_type || webkit_req_fs) { - target_view = view; - } - if (!req_fs) { - fs_error(); - return; - } - fs_min_size += blob.size; - req_fs(view.TEMPORARY, fs_min_size, abortable(function(fs) { - fs.root.getDirectory("saved", create_if_not_found, abortable(function(dir) { - var save = function() { - dir.getFile(name, create_if_not_found, abortable(function(file) { - file.createWriter(abortable(function(writer) { - writer.onwriteend = function(event) { - target_view.location.href = file.toURL(); - filesaver.readyState = filesaver.DONE; - dispatch(filesaver, "writeend", event); - revoke(file); - }; - writer.onerror = function() { - var error = writer.error; - if (error.code !== error.ABORT_ERR) { - fs_error(); - } - }; - "writestart progress write abort".split(" ").forEach(function(event) { - writer["on" + event] = filesaver["on" + event]; - }); - writer.write(blob); - filesaver.abort = function() { - writer.abort(); - filesaver.readyState = filesaver.DONE; - }; - filesaver.readyState = filesaver.WRITING; - }), fs_error); - }), fs_error); - }; - dir.getFile(name, {create: false}, abortable(function(file) { - // delete file if it already exists - file.remove(); - save(); - }), abortable(function(ex) { - if (ex.code === ex.NOT_FOUND_ERR) { - save(); - } else { - fs_error(); - } - })); - }), fs_error); - }), fs_error); - } - , FS_proto = FileSaver.prototype - , saveAs = function(blob, name, no_auto_bom) { - return new FileSaver(blob, name, no_auto_bom); - } - ; - // IE 10+ (native saveAs) - if (typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob) { - return function(blob, name, no_auto_bom) { - if (!no_auto_bom) { - blob = auto_bom(blob); - } - return navigator.msSaveOrOpenBlob(blob, name || "download"); - }; - } - - FS_proto.abort = function() { - var filesaver = this; - filesaver.readyState = filesaver.DONE; - dispatch(filesaver, "abort"); - }; - FS_proto.readyState = FS_proto.INIT = 0; - FS_proto.WRITING = 1; - FS_proto.DONE = 2; - - FS_proto.error = - FS_proto.onwritestart = - FS_proto.onprogress = - FS_proto.onwrite = - FS_proto.onabort = - FS_proto.onerror = - FS_proto.onwriteend = - null; - - return saveAs; -}( - typeof self !== "undefined" && self - || typeof window !== "undefined" && window - || this.content -)); -// `self` is undefined in Firefox for Android content script context -// while `this` is nsIContentFrameMessageManager -// with an attribute `content` that corresponds to the window - -if (typeof module !== "undefined" && module.exports) { - module.exports.saveAs = saveAs; -} else if ((typeof define !== "undefined" && define !== null) && (define.amd !== null)) { - define([], function() { - return saveAs; - }); -} diff --git a/platform-web-ui/src/main/resources/filesaver/FileSaver.min.js b/platform-web-ui/src/main/resources/filesaver/FileSaver.min.js deleted file mode 100644 index 6268ec99dde..00000000000 --- a/platform-web-ui/src/main/resources/filesaver/FileSaver.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ -var saveAs=saveAs||function(e){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,n=function(){return e.URL||e.webkitURL||e},o=t.createElementNS("http://www.w3.org/1999/xhtml","a"),r="download"in o,i=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},a=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),c=e.webkitRequestFileSystem,f=e.requestFileSystem||c||e.mozRequestFileSystem,u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},d="application/octet-stream",s=0,l=4e4,v=function(e){var t=function(){"string"==typeof e?n().revokeObjectURL(e):e.remove()};setTimeout(t,l)},p=function(e,t,n){t=[].concat(t);for(var o=t.length;o--;){var r=e["on"+t[o]];if("function"==typeof r)try{r.call(e,n||e)}catch(i){u(i)}}},w=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e},y=function(t,u,l){l||(t=w(t));var y,m,S,h=this,R=t.type,O=!1,g=function(){p(h,"writestart progress write writeend".split(" "))},b=function(){if(m&&a&&"undefined"!=typeof FileReader){var o=new FileReader;return o.onloadend=function(){var e=o.result;m.location.href="data:attachment/file"+e.slice(e.search(/[,;]/)),h.readyState=h.DONE,g()},o.readAsDataURL(t),void(h.readyState=h.INIT)}if((O||!y)&&(y=n().createObjectURL(t)),m)m.location.href=y;else{var r=e.open(y,"_blank");void 0===r&&a&&(e.location.href=y)}h.readyState=h.DONE,g(),v(y)},E=function(e){return function(){return h.readyState!==h.DONE?e.apply(this,arguments):void 0}},N={create:!0,exclusive:!1};return h.readyState=h.INIT,u||(u="download"),r?(y=n().createObjectURL(t),void setTimeout(function(){o.href=y,o.download=u,i(o),g(),v(y),h.readyState=h.DONE})):(e.chrome&&R&&R!==d&&(S=t.slice||t.webkitSlice,t=S.call(t,0,t.size,d),O=!0),c&&"download"!==u&&(u+=".download"),(R===d||c)&&(m=e),f?(s+=t.size,void f(e.TEMPORARY,s,E(function(e){e.root.getDirectory("saved",N,E(function(e){var n=function(){e.getFile(u,N,E(function(e){e.createWriter(E(function(n){n.onwriteend=function(t){m.location.href=e.toURL(),h.readyState=h.DONE,p(h,"writeend",t),v(e)},n.onerror=function(){var e=n.error;e.code!==e.ABORT_ERR&&b()},"writestart progress write abort".split(" ").forEach(function(e){n["on"+e]=h["on"+e]}),n.write(t),h.abort=function(){n.abort(),h.readyState=h.DONE},h.readyState=h.WRITING}),b)}),b)};e.getFile(u,{create:!1},E(function(e){e.remove(),n()}),E(function(e){e.code===e.NOT_FOUND_ERR?n():b()}))}),b)}),b)):void b())},m=y.prototype,S=function(e,t,n){return new y(e,t,n)};return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,n){return n||(e=w(e)),navigator.msSaveOrOpenBlob(e,t||"download")}:(m.abort=function(){var e=this;e.readyState=e.DONE,p(e,"abort")},m.readyState=m.INIT=0,m.WRITING=1,m.DONE=2,m.error=m.onwritestart=m.onprogress=m.onwrite=m.onabort=m.onerror=m.onwriteend=null,S)}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);"undefined"!=typeof module&&module.exports?module.exports.saveAs=saveAs:"undefined"!=typeof define&&null!==define&&null!==define.amd&&define([],function(){return saveAs}); \ No newline at end of file From 144aafc9a0c300474889685d4ca759e52af10162 Mon Sep 17 00:00:00 2001 From: jhou-pro Date: Tue, 1 Apr 2025 20:46:53 +0300 Subject: [PATCH 26/76] #2407 Remove unused FileSaver loading in web tests and examples. --- .../fielden/platform/web/app/test/tg-menu-list-changes-test.html | 1 - .../platform/web/centre/test/tg-entity-centre-context.html | 1 - .../test/tg-entity-centre-entity-editing-with-collections.html | 1 - .../platform/web/centre/test/tg-entity-centre-filtering.html | 1 - .../platform/web/centre/test/tg-entity-centre-generation.html | 1 - .../platform/web/centre/test/tg-entity-centre-performance.html | 1 - .../platform/web/centre/test/tg-entity-centre-query-param.html | 1 - .../centre/test/tg-entity-centre-refresh-for-complex-centre.html | 1 - .../centre/test/tg-entity-centre-running-for-complex-centre.html | 1 - .../platform/web/centre/test/tg-entity-centre-selection.html | 1 - .../test/tg-entity-centre-test-delete-refresh-functionality.html | 1 - .../test/tg-entity-centre-with-property-descriptor-criteria.html | 1 - .../com/fielden/platform/web/centre/test/tg-entity-centre.html | 1 - .../platform/web/centre/tg-generated-entity-centre-example.html | 1 - .../web/components/test/tg-global-error-handler-test.html | 1 - .../ua/com/fielden/platform/web/components/tg-drag-example.html | 1 - .../fielden/platform/web/components/tg-menu-search-example.html | 1 - .../platform/web/editors/test/tg-collectional-editor.html | 1 - ...atetime-picker-approximations-for-DDMMYYYY-slash-24hours.html | 1 - ...atetime-picker-approximations-for-MMDDYYYY-slash-12hours.html | 1 - ...atetime-picker-approximations-for-MMDDYYYY-slash-24hours.html | 1 - ...datetime-picker-approximations-for-YYYYMMDD-dash-24hours.html | 1 - .../platform/web/editors/test/tg-datetime-picker-time-zones.html | 1 - .../web/ua/com/fielden/platform/web/editors/test/tg-editor.html | 1 - .../com/fielden/platform/web/editors/test/tg-entity-editor.html | 1 - .../fielden/platform/web/editors/test/tg-entity-formatter.html | 1 - .../fielden/platform/web/egi/egi-dynamic-columns-example.html | 1 - .../main/web/ua/com/fielden/platform/web/egi/egi-example.html | 1 - .../platform/web/egi/test/tg-egi-dynamic-column-dom-test.html | 1 - .../web/egi/test/tg-egi-dynamic-rendering-hints-test.html | 1 - .../com/fielden/platform/web/element_loader/loader-example.html | 1 - .../com/fielden/platform/web/master/test/tg-compound-master.html | 1 - .../web/master/test/tg-entity-master-conflict-resolution.html | 1 - .../web/master/test/tg-entity-master-editors-touching.html | 1 - .../platform/web/master/test/tg-entity-master-filtering.html | 1 - .../web/master/test/tg-entity-master-layout-binding.html | 1 - .../web/master/test/tg-entity-master-with-rich-text.html | 1 - .../com/fielden/platform/web/master/test/tg-entity-master.html | 1 - .../web/master/tg-entity-with-rich-text-prop-master-example.html | 1 - .../web/master/tg-generated-collectional-master-example.html | 1 - .../platform/web/master/tg-generated-entity-master-example.html | 1 - .../fielden/platform/web/reflection/test/tg-numeric-utils.html | 1 - .../com/fielden/platform/web/reflection/test/tg-reflector.html | 1 - .../fielden/platform/web/serialisation/test/tg-serialiser.html | 1 - .../com/fielden/platform/web/spikes/input-performance-spike.html | 1 - .../fielden/platform/web/spikes/lit-input-performance-spike.html | 1 - .../ua/com/fielden/platform/web/spikes/tg-bar-chart-example.html | 1 - 47 files changed, 47 deletions(-) diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/app/test/tg-menu-list-changes-test.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/app/test/tg-menu-list-changes-test.html index e09b943d68b..dbb371c8e9a 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/app/test/tg-menu-list-changes-test.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/app/test/tg-menu-list-changes-test.html @@ -8,7 +8,6 @@ - - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-entity-editing-with-collections.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-entity-editing-with-collections.html index cd57dc3a4bc..09f7544961a 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-entity-editing-with-collections.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-entity-editing-with-collections.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-filtering.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-filtering.html index 2c6e9cab80c..3478e4462ec 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-filtering.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-filtering.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-generation.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-generation.html index c394cb4cac9..865985d5e6e 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-generation.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-generation.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-performance.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-performance.html index 43c638893e8..c4022ee0657 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-performance.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-performance.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-query-param.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-query-param.html index 6b747bc4c9d..818c993ceec 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-query-param.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-query-param.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-refresh-for-complex-centre.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-refresh-for-complex-centre.html index 88f789e6bb0..021f631112e 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-refresh-for-complex-centre.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-refresh-for-complex-centre.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-running-for-complex-centre.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-running-for-complex-centre.html index 5a410121cd8..54305b895b4 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-running-for-complex-centre.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-running-for-complex-centre.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-selection.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-selection.html index c7292fa527f..ac848dca43c 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-selection.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-selection.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-test-delete-refresh-functionality.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-test-delete-refresh-functionality.html index 3d0ef2d1bf3..2154907414a 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-test-delete-refresh-functionality.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-test-delete-refresh-functionality.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-with-property-descriptor-criteria.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-with-property-descriptor-criteria.html index 965be1787ae..ddfc7404ffe 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-with-property-descriptor-criteria.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre-with-property-descriptor-criteria.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre.html index dda2090dee8..ae2594d1719 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/test/tg-entity-centre.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/tg-generated-entity-centre-example.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/tg-generated-entity-centre-example.html index 6d8d4dbeb1f..27ba900ecd3 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/tg-generated-entity-centre-example.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/centre/tg-generated-entity-centre-example.html @@ -6,7 +6,6 @@ Generated Centre - - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/components/tg-drag-example.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/components/tg-drag-example.html index c473458d71e..50531dd9e25 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/components/tg-drag-example.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/components/tg-drag-example.html @@ -7,7 +7,6 @@ - - - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-datetime-picker-approximations-for-DDMMYYYY-slash-24hours.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-datetime-picker-approximations-for-DDMMYYYY-slash-24hours.html index f575a978955..17f5ac495bc 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-datetime-picker-approximations-for-DDMMYYYY-slash-24hours.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-datetime-picker-approximations-for-DDMMYYYY-slash-24hours.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-datetime-picker-approximations-for-MMDDYYYY-slash-12hours.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-datetime-picker-approximations-for-MMDDYYYY-slash-12hours.html index 0d7753c8d54..adee1fb3548 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-datetime-picker-approximations-for-MMDDYYYY-slash-12hours.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-datetime-picker-approximations-for-MMDDYYYY-slash-12hours.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-datetime-picker-approximations-for-MMDDYYYY-slash-24hours.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-datetime-picker-approximations-for-MMDDYYYY-slash-24hours.html index 513c3005646..5f165cbc605 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-datetime-picker-approximations-for-MMDDYYYY-slash-24hours.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-datetime-picker-approximations-for-MMDDYYYY-slash-24hours.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-datetime-picker-approximations-for-YYYYMMDD-dash-24hours.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-datetime-picker-approximations-for-YYYYMMDD-dash-24hours.html index 07cea20f2bd..25e32c20416 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-datetime-picker-approximations-for-YYYYMMDD-dash-24hours.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-datetime-picker-approximations-for-YYYYMMDD-dash-24hours.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-datetime-picker-time-zones.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-datetime-picker-time-zones.html index ab0caee3681..71886715013 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-datetime-picker-time-zones.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-datetime-picker-time-zones.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-editor.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-editor.html index ee5cd947c54..06dbaad8cd0 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-editor.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-editor.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-entity-editor.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-entity-editor.html index c9c4e2b61b8..25d50bbbbca 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-entity-editor.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-entity-editor.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-entity-formatter.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-entity-formatter.html index 53bb04a3db1..113aa6a6c80 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-entity-formatter.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/editors/test/tg-entity-formatter.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/egi/egi-dynamic-columns-example.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/egi/egi-dynamic-columns-example.html index 3570a15e2ec..fde227087a0 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/egi/egi-dynamic-columns-example.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/egi/egi-dynamic-columns-example.html @@ -7,7 +7,6 @@ Dynamic egi column - - - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/egi/test/tg-egi-dynamic-rendering-hints-test.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/egi/test/tg-egi-dynamic-rendering-hints-test.html index 276ce383ce6..a6abf744ea7 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/egi/test/tg-egi-dynamic-rendering-hints-test.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/egi/test/tg-egi-dynamic-rendering-hints-test.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/element_loader/loader-example.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/element_loader/loader-example.html index 1ef4df1316f..8de768f19a0 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/element_loader/loader-example.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/element_loader/loader-example.html @@ -5,7 +5,6 @@ Element Loader Example - - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master-conflict-resolution.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master-conflict-resolution.html index bf9cabfc42b..2c137a1778b 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master-conflict-resolution.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master-conflict-resolution.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master-editors-touching.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master-editors-touching.html index 4fd7ac91cae..7ac67d23621 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master-editors-touching.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master-editors-touching.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master-filtering.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master-filtering.html index bdbb1448cb5..96bc70f9e9d 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master-filtering.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master-filtering.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master-layout-binding.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master-layout-binding.html index 4d8f7f4a47f..e0032bc01dd 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master-layout-binding.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master-layout-binding.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master-with-rich-text.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master-with-rich-text.html index ebea0431979..be927564500 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master-with-rich-text.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master-with-rich-text.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master.html index 853498a3c71..b4e0246cdda 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/test/tg-entity-master.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/tg-entity-with-rich-text-prop-master-example.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/tg-entity-with-rich-text-prop-master-example.html index 9fb9b67e4af..5ad0e5854cb 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/tg-entity-with-rich-text-prop-master-example.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/master/tg-entity-with-rich-text-prop-master-example.html @@ -6,7 +6,6 @@ Generated Master - - - - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/reflection/test/tg-reflector.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/reflection/test/tg-reflector.html index 48fe11cace0..ae3d1842fff 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/reflection/test/tg-reflector.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/reflection/test/tg-reflector.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/serialisation/test/tg-serialiser.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/serialisation/test/tg-serialiser.html index 692b928af50..1f0fb97887b 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/serialisation/test/tg-serialiser.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/serialisation/test/tg-serialiser.html @@ -8,7 +8,6 @@ - diff --git a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/spikes/input-performance-spike.html b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/spikes/input-performance-spike.html index 492fa5916b8..567ff0d66a2 100644 --- a/platform-web-ui/src/main/web/ua/com/fielden/platform/web/spikes/input-performance-spike.html +++ b/platform-web-ui/src/main/web/ua/com/fielden/platform/web/spikes/input-performance-spike.html @@ -7,7 +7,6 @@ Input performance spike with flex layout - - -