Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
4ebf20a
#2407 Initial support for IPre/PostAction JavaScript imports.
jhou-pro Mar 29, 2025
224a8d9
#2407 Added OpenLinkPostAction.
jhou-pro Mar 29, 2025
6585166
#2407 Shuffled dependency to conform to normal npm sorting.
jhou-pro Mar 31, 2025
5ab2288
#2407 Updated moment-timezone - very minor patch update of tz-data.
jhou-pro Mar 31, 2025
a7abd60
#2407 Adjusted deps to contain the most recent version in package.json.
jhou-pro Mar 31, 2025
e7fb821
#2407 Remove main application usage of old FileSaver dependency.
jhou-pro Mar 31, 2025
1bcf559
#2407 Update file-saver from 1.1.20160328 (2016) to 2.0.5 (2020).
jhou-pro Mar 31, 2025
ff0d8a9
#2407 Update file-saver from 1.1.20160328 (2016) to 2.0.5 (2020).
jhou-pro Mar 31, 2025
442ce65
#2407 IPre/PostAction JavaScript imports support in centres.
jhou-pro Mar 31, 2025
19de11f
#2407 Use import statement support for FileSaverPostAction (by import…
jhou-pro Mar 31, 2025
9f7d4c0
#2407 Convenient method to chain IPre/PostAction with additional code.
jhou-pro Mar 31, 2025
3dbedc5
#2407 IPre/PostAction JavaScript imports support in masters.
jhou-pro Mar 31, 2025
605c0f3
#2407 Replaced global import in every master to only be in required B…
jhou-pro Mar 31, 2025
51a46eb
Merge branch '2.0.0-SNAPSHOT' into Issue-#2407
jhou-pro Apr 1, 2025
cdd63e1
#2407 Force BindSavedPropertyPostAction to use IConvertableToPath.
jhou-pro Apr 1, 2025
80140d8
#2407 Properly support main menus with no specific action imports.
jhou-pro Apr 1, 2025
d3612d8
#2407 Removed unused alternative for more comprehensive FileSaverPost…
jhou-pro Apr 1, 2025
dcc8841
#2407 Removed old FIXME -- no need to provide polymer imports.
jhou-pro Apr 1, 2025
3e186b8
#2407 Support for full paths instead of shorten ones (resources).
jhou-pro Apr 1, 2025
e918d0b
#2407 Replaced global import in every master / centre to only be plac…
jhou-pro Apr 1, 2025
380d6f9
#2407 IPre/PostAction JavaScript imports support in centres (primary …
jhou-pro Apr 1, 2025
a823929
#2407 IPre/PostAction JavaScript imports support in centres (insertio…
jhou-pro Apr 1, 2025
276b1f1
#2407 IPre/PostAction JavaScript imports support in masters (compound…
jhou-pro Apr 1, 2025
253607b
#2407 IPre/PostAction JavaScript imports support in centres (charts a…
jhou-pro Apr 1, 2025
8ee540d
#2407 Removed invalid comment.
jhou-pro Apr 1, 2025
4342c20
#2407 Remove old version of FileSaver lib.
jhou-pro Apr 1, 2025
144aafc
#2407 Remove unused FileSaver loading in web tests and examples.
jhou-pro Apr 1, 2025
95b7bc7
#2407 Don't register separate FileSaver lib file in deployment mode.
jhou-pro Apr 1, 2025
3922c91
#2407 Don't register separate FileSaver lib file in deployment mode.
jhou-pro Apr 1, 2025
0e7711a
Merge branch '2.0.0-SNAPSHOT' into Issue-#2407
jhou-pro Apr 9, 2025
d3ea7bb
#2407 Revulcanize TG Example to avoid further conflicts.
jhou-pro Apr 9, 2025
a0daaab
#2407 First steps to auto-removal of redundant resources in deploymen…
jhou-pro Apr 9, 2025
156ae77
#2407 Enforce service worker update on every change for all tabs / wi…
jhou-pro Apr 11, 2025
8ece01b
#2407 Avoid URL creation until needed.
jhou-pro Apr 11, 2025
ee6649a
#2407 Minor re-factoring and comment.
jhou-pro Apr 11, 2025
7595a34
#2407 Another minor re-factoring.
jhou-pro Apr 11, 2025
5fe8267
#2407 Avoid using 'self' for global SW context.
jhou-pro Apr 11, 2025
1d8ee9e
#2407 Ensure SW not ended before all clients control has been taken.
jhou-pro Apr 11, 2025
fd328ce
#2407 Use hoisted function declarations.
jhou-pro Apr 11, 2025
0eb6282
#2407 Conform to constant naming conventions.
jhou-pro Apr 11, 2025
bebeb33
#2407 Use shorter arrow functions.
jhou-pro Apr 11, 2025
3d865c2
#2407 Remove unnecessary and confusing wrapper function with invocation.
jhou-pro Apr 11, 2025
3dd7156
#2407 Continue with auto-removal of redundant resources in deployment…
jhou-pro Apr 11, 2025
27b6d8e
#2407 Corrected cleaningUp to clean checksums. Extended and re-format…
jhou-pro Apr 14, 2025
0716b10
Merge branch '2.0.0-SNAPSHOT' into Issue-#2407
jhou-pro Apr 15, 2025
332707e
#2407 Removed rather unconventional spaces in function definitions.
jhou-pro Apr 15, 2025
8384329
#2407 Pretty-print checksums into a file.
jhou-pro Apr 16, 2025
b240e93
#2407 Auto-remove all kinds of redundant resources.
jhou-pro Apr 16, 2025
dffadea
#2407 Misc service worker improvements.
jhou-pro Apr 16, 2025
6e7193e
#2407 Pretty-print checksums into a file.
jhou-pro Apr 17, 2025
9b44049
Merge branch 'develop' into Issue-#2407
jhou-pro Apr 17, 2025
85a7724
#2407 Make ref-hierarchy action more open for extension.
jhou-pro Apr 18, 2025
3f62b22
#2407 Warn API users before manually building JsCode strings for IPre…
jhou-pro Apr 18, 2025
48c8949
#2407 Misc docs / code improvements.
jhou-pro Apr 18, 2025
89d365b
#2407 IPre/PostAction API / impl improvements.
jhou-pro Apr 19, 2025
fd66d4e
#2407 Corrected problematic text block conversion. Added non-essentia…
jhou-pro Apr 24, 2025
07494c3
#2407 Remove 'console.log' invocations in deployment mode.
jhou-pro Apr 25, 2025
405ee89
#2407 Reduce gen Seq Edit actions code by moving it to separate JS file.
jhou-pro Apr 26, 2025
88761fb
#2407 Misc docs / code improvements; added missing 'importStatements'.
jhou-pro Apr 26, 2025
9998200
#2407 Reduce gen Bind Saved Prop actions code by moving it to separat…
jhou-pro Apr 26, 2025
7ff7708
#2407 Reduce gen FileSave actions code by moving it to separate JS file.
jhou-pro Apr 26, 2025
37d00a6
#2407 Update existing dependencies.
jhou-pro Apr 26, 2025
8e8d051
#2407 Revulcanised.
jhou-pro Apr 26, 2025
ed54eb2
Revert "#2407 Remove 'console.log' invocations in deployment mode."
jhou-pro Apr 26, 2025
1f88f01
#2407 Revulcanised.
jhou-pro Apr 26, 2025
b3a766b
#2407 Added separate abstraction for validatable combined imports.
jhou-pro Apr 27, 2025
ca8aab7
#2407 Minot docs / code improvements.
jhou-pro Apr 27, 2025
16a5099
#2407 Use more standard URI list delimiter and media type.
jhou-pro Apr 28, 2025
aa48151
#2407 Separated IComposableAction to allow more clean descendants wit…
jhou-pro Apr 28, 2025
4236016
#2407 Corrected an edge-case of namedImport usage as default one (+te…
jhou-pro Apr 28, 2025
cb52578
#2407 Adjusted deps to contain the most recent version in package.json.
jhou-pro Apr 28, 2025
e48bbe1
#2407 Misc improvements.
jhou-pro Apr 28, 2025
b789d58
#2407 Reduce gen ReferenceHierarchy actions code by moving it to sepa…
jhou-pro Apr 30, 2025
ffb7c9b
#2407 Improve CombinedJsImports API to allow 'add', not only 'addAll'…
jhou-pro Apr 30, 2025
374687e
#2407 Revulcanised.
jhou-pro Apr 30, 2025
4176d08
Merge branch 'develop' into Issue-#2407
jhou-pro May 2, 2025
df41742
#2407 Made pre-/post-actions actually open for extension in end-apps.
jhou-pro May 7, 2025
528717d
Merge branch 'develop' of github.com:fieldenms/tg into Issue-#2407
oleh-maikovych Jul 9, 2025
3520567
#2407 Adjusted link opener post action according to latest changes in…
oleh-maikovych Jul 16, 2025
26408cb
#2407 Adjusted post action link opener to avoid conflict with existin…
oleh-maikovych Jul 17, 2025
9b5dc4d
Merge branch '3.0.0-SNAPSHOT' of github.com:fieldenms/tg into Issue-#…
oleh-maikovych Jul 24, 2025
8a3eb9a
#2407 Minor adjustments after merge
oleh-maikovych Jul 24, 2025
0bd7f13
#2407 Removed copied unit test
oleh-maikovych Jul 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import ua.com.fielden.platform.web.resources.RestServerUtil;
import ua.com.fielden.platform.web.security.DefaultWebResourceGuard;

import static ua.com.fielden.platform.web.resources.webui.AppIndexResource.BINDING_PATH;

/**
* Represents a web application that is running on the server.
* It is responsible for request routing and serving web resources.
Expand Down Expand Up @@ -105,7 +107,7 @@ public final Restlet createInboundRoot() {
final RestServerUtil restUtil = injector.getInstance(RestServerUtil.class);

// Attach main application resource.
guardedRouter.attach("/", new AppIndexResourceFactory(webResourceLoader, webApp, userProvider, deviceProvider, dates, injector.getInstance(ICriteriaGenerator.class)));
guardedRouter.attach(BINDING_PATH, new AppIndexResourceFactory(webResourceLoader, webApp, userProvider, deviceProvider, dates, injector.getInstance(ICriteriaGenerator.class)));
guardedRouter.attach("/app/tg-app-config.js", new WebUiPreferencesResourceFactory(webResourceLoader, deviceProvider, dates));
guardedRouter.attach("/app/tg-app.js", new MainWebUiComponentResourceFactory(webResourceLoader, deviceProvider, dates));
// type meta info resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
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.factories.webui.ResourceFactoryUtils.*;
import static ua.com.fielden.platform.web.resources.webui.AppIndexResource.FILE_APP_INDEX_HTML;
import static ua.com.fielden.platform.web.resources.webui.FileResource.generateFileName;
import static ua.com.fielden.platform.web.resources.webui.LoginInitiateResetResource.FILE_APP_LOGIN_INITIATE_RESET_HTML;

/**
* {@link IWebResourceLoader} implementation.
Expand Down Expand Up @@ -77,11 +79,11 @@ public InputStream loadStream(final String resourceUri) {
private Optional<String> getSource(final String resourceUri) {
if ("/app/application-startup-resources.js".equalsIgnoreCase(resourceUri)) {
return getApplicationStartupResourcesSource(webUiConfig);
} else if ("/app/tg-app-index.html".equalsIgnoreCase(resourceUri)) {
} else if (FILE_APP_INDEX_HTML.equalsIgnoreCase(resourceUri)) {
return injectServiceWorkerScriptInto(webUiConfig.genAppIndex());
} else if ("/app/logout.html".equalsIgnoreCase(resourceUri)) {
return getFileSource("/resources/logout.html", webUiConfig.resourcePaths()).map(src -> StringUtils.replace(src, "@title", "Logout"));
} else if ("/app/login-initiate-reset.html".equalsIgnoreCase(resourceUri)) {
} else if (FILE_APP_LOGIN_INITIATE_RESET_HTML.equalsIgnoreCase(resourceUri)) {
return getFileSource("/resources/login-initiate-reset.html", webUiConfig.resourcePaths()).map(src -> StringUtils.replace(src, "@title", "Login Reset Request"));
} else if ("/app/tg-app-config.js".equalsIgnoreCase(resourceUri)) {
return ofNullable(webUiConfig.genWebUiPreferences());
Expand Down Expand Up @@ -109,6 +111,11 @@ public Optional<String> checksum(final String resourceURI) {
return webUiConfig.checksum(resourceURI);
}

@Override
public SequencedSet<String> deploymentResourcePaths() {
return webUiConfig.deploymentResourcePaths();
}

/**
* Generates 'tg-reflector' resource with type table containing master configurations.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -32,6 +31,7 @@
import ua.com.fielden.platform.web.ioc.exceptions.MissingWebResourceException;
import ua.com.fielden.platform.web.menu.IMainMenuBuilder;
import ua.com.fielden.platform.web.menu.impl.MainMenuBuilder;
import ua.com.fielden.platform.web.minijs.CombinedJsImports;
import ua.com.fielden.platform.web.minijs.JsCode;
import ua.com.fielden.platform.web.ref_hierarchy.ReferenceHierarchyWebUiConfig;
import ua.com.fielden.platform.web.resources.webui.exceptions.InvalidUiConfigException;
Expand All @@ -48,20 +48,25 @@

import static java.lang.String.format;
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 java.util.stream.Collectors.toCollection;
import static org.apache.commons.validator.routines.UrlValidator.ALLOW_LOCAL_URLS;
import static ua.com.fielden.platform.error.Result.failuref;
import static ua.com.fielden.platform.error.Result.successful;
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;
import static ua.com.fielden.platform.web.minijs.JsCode.jsCode;
import static ua.com.fielden.platform.web.resources.webui.AppIndexResource.FILE_APP_INDEX_HTML;
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.resources.webui.LoginInitiateResetResource.FILE_APP_LOGIN_INITIATE_RESET_HTML;
import static ua.com.fielden.platform.web.view.master.api.actions.impl.MasterActionOptions.ALL_OFF;

/**
Expand All @@ -78,6 +83,8 @@ public abstract class AbstractWebUiConfig implements IWebUiConfig {
private static final String ERR_IN_COMPOUND_EMITTER = "Event source compound emitter should have cought this error. Something went wrong in WebUiConfig.";
private static final String CREATE_DEFAULT_CONFIG_INFO = "Creating default configurations for [%s]-typed centres (caching)...";
private static final int DEFAULT_EXTERNAL_SITE_EXPIRY_DAYS = 183;
/// Name for a constant in generated `tg-app-template` containing imports from main menu actions.
private static final String MAIN_MENU_ACTION_IMPORTS = "mainMenuActionImports";

private final String title;
private final Optional<String> ideaUri;
Expand All @@ -97,7 +104,7 @@ public abstract class AbstractWebUiConfig implements IWebUiConfig {
*/
private final List<String> resourcePaths;
private final Workflows workflow;
private final Map<String, String> checksums;
private final SequencedMap<String, String> checksums;
private final boolean independentTimeZone;
private final MasterActionOptions masterActionOptions;

Expand Down Expand Up @@ -268,9 +275,18 @@ public final String genWebUiPreferences() {
return webUiBuilder.genWebUiPrefComponent();
}

/// [CombinedJsImports] from main menu actions on both desktop / mobile configurations.
private CombinedJsImports mainMenuActionImports() {
final var combinedImports = new CombinedJsImports();
combinedImports.addAll(desktopMainMenuConfig.mainMenuActionImports());
combinedImports.addAll(mobileMainMenuConfig.mainMenuActionImports());
return combinedImports;
}

@Override
public final String genMainWebUIComponent() {
final String mainWebUiComponent = ResourceLoader.getText("ua/com/fielden/platform/web/app/tg-app-template.js");
final String mainWebUiComponent = requireNonNull(getText("ua/com/fielden/platform/web/app/tg-app-template.js"))
.replace("@%s".formatted(MAIN_MENU_ACTION_IMPORTS), mainMenuActionImports().toStringWith(MAIN_MENU_ACTION_IMPORTS));
if (Workflows.deployment == workflow || Workflows.vulcanizing == workflow) {
return mainWebUiComponent.replace("//@use-empty-console.log", "console.log = () => {};\n");
} else {
Expand Down Expand Up @@ -375,6 +391,20 @@ public Optional<String> checksum(final String resourceURI) {
return ofNullable(checksums.get(resourceURI));
}

@Override
public SequencedSet<String> deploymentResourcePaths() {
return checksums.keySet().stream()
.map(path -> switch (path) {
// Only two deployment resources are generated and have special binding paths.
// See `VulcanizingUtility.vulcanize` for full list.
// All generated paths start with `/app/...`, but only two of them is outside main vulcanised file.
case FILE_APP_INDEX_HTML -> AppIndexResource.BINDING_PATH;
case FILE_APP_LOGIN_INITIATE_RESET_HTML -> LoginInitiateResetResource.BINDING_PATH;
default -> path;
})
.collect(toCollection(LinkedHashSet::new));
}

@Override
public boolean independentTimeZone() {
return independentTimeZone;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
package ua.com.fielden.platform.web.resources.webui;

import static org.restlet.data.MediaType.TEXT_HTML;
import static ua.com.fielden.platform.web.resources.webui.FileResource.createRepresentation;

import java.lang.management.ManagementFactory;

import org.restlet.Context;
import org.restlet.Request;
import org.restlet.Response;
import org.restlet.representation.Representation;
import org.restlet.resource.Get;

import ua.com.fielden.platform.basic.config.Workflows;
import ua.com.fielden.platform.criteria.generator.ICriteriaGenerator;
import ua.com.fielden.platform.criteria.generator.impl.CriteriaGenerator;
import ua.com.fielden.platform.security.user.IUserProvider;
import ua.com.fielden.platform.security.user.User;
import ua.com.fielden.platform.utils.IDates;
import ua.com.fielden.platform.web.app.IWebResourceLoader;
import ua.com.fielden.platform.web.app.IWebUiConfig;
import ua.com.fielden.platform.web.interfaces.IDeviceProvider;

import java.io.ByteArrayInputStream;
import java.lang.management.ManagementFactory;

import static com.google.common.base.Charsets.UTF_8;
import static java.lang.String.join;
import static org.restlet.data.MediaType.TEXT_HTML;
import static org.restlet.data.MediaType.TEXT_URI_LIST;
import static ua.com.fielden.platform.web.resources.RestServerUtil.encodedRepresentation;
import static ua.com.fielden.platform.web.resources.webui.FileResource.createRepresentation;

/**
* Responds to GET request with a generated application specific index resource (for desktop and mobile web apps).
* <p>
Expand All @@ -30,6 +33,11 @@
*
*/
public class AppIndexResource extends AbstractWebResource {
public static final String BINDING_PATH = "/";
public static final String FILE_APP_INDEX_HTML = "/app/tg-app-index.html";
private static final String RESOURCES_URL_SUFFIX = "?resources=true";
private static final String RESOURCES_DELIMITER = "\n";

private final IWebUiConfig webUiConfig;
private final IUserProvider userProvider;
private final IWebResourceLoader webResourceLoader;
Expand Down Expand Up @@ -69,7 +77,12 @@ public Representation get() {
webUiConfig.clearConfiguration();
webUiConfig.initConfiguration();
}
return createRepresentation(webResourceLoader, TEXT_HTML, "/app/tg-app-index.html", getReference().getRemainingPart());
// Handle special Service Worker '?resources=true' GET request against `AppIndexResource` (aka '/').
if (getReference().getRemainingPart().endsWith(RESOURCES_URL_SUFFIX)) {
return encodedRepresentation(new ByteArrayInputStream(join(RESOURCES_DELIMITER, webResourceLoader.deploymentResourcePaths()).getBytes(UTF_8)), TEXT_URI_LIST);
}
// Handle actual `AppIndexResource` generated file (see 'index.html').
return createRepresentation(webResourceLoader, TEXT_HTML, FILE_APP_INDEX_HTML, getReference().getRemainingPart());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
*
*/
public class FileResource extends AbstractWebResource {
public static final String CHECKSUM_URL_SUFFIX = "?checksum=true";
private final List<String> resourcePaths;
private final IWebResourceLoader webResourceLoader;

Expand Down Expand Up @@ -74,7 +75,7 @@ public Representation load() {
* @return
*/
private static Representation returnChecksumRepresentationOr(final Supplier<Representation> createRepresentation, final IWebResourceLoader webResourceLoader, final MediaType mediaType, final String path, final String remainingPart) {
if (remainingPart.endsWith("?checksum=true")) {
if (remainingPart.endsWith(CHECKSUM_URL_SUFFIX)) {
return encodedRepresentation(new ByteArrayInputStream(webResourceLoader.checksum(path).orElse("").getBytes(UTF_8)), mediaType);
} else {
return createRepresentation.get();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
package ua.com.fielden.platform.web.resources.webui;

import static java.lang.String.format;
import static java.util.Optional.empty;
import static ua.com.fielden.platform.entity.AbstractEntity.DESC;
import static ua.com.fielden.platform.entity.AbstractEntity.KEY;
import static ua.com.fielden.platform.entity.ActivatableAbstractEntity.ACTIVE;
import static ua.com.fielden.platform.web.PrefDim.mkDim;
import static ua.com.fielden.platform.web.action.pre.ConfirmationPreAction.okCancel;
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.layout.api.impl.LayoutBuilder.cell;
import static ua.com.fielden.platform.web.layout.api.impl.LayoutCellBuilder.layout;
import static ua.com.fielden.platform.web.layout.api.impl.LayoutComposer.mkActionLayoutForMaster;

import java.util.Optional;

import com.google.inject.Injector;

import ua.com.fielden.platform.entity.ActivatableAbstractEntity;
import ua.com.fielden.platform.entity.EntityDeleteAction;
import ua.com.fielden.platform.entity.EntityEditAction;
Expand All @@ -28,7 +12,6 @@
import ua.com.fielden.platform.ui.menu.sample.MiUserRole;
import ua.com.fielden.platform.web.PrefDim.Unit;
import ua.com.fielden.platform.web.action.CentreConfigurationWebUiConfig.CentreConfigActions;
import ua.com.fielden.platform.web.action.pre.EntityNavigationPreAction;
import ua.com.fielden.platform.web.app.config.IWebUiBuilder;
import ua.com.fielden.platform.web.centre.EntityCentre;
import ua.com.fielden.platform.web.centre.api.actions.EntityActionConfig;
Expand All @@ -41,6 +24,22 @@
import ua.com.fielden.platform.web.view.master.api.actions.MasterActions;
import ua.com.fielden.platform.web.view.master.api.impl.SimpleMasterBuilder;

import java.util.Optional;

import static java.lang.String.format;
import static java.util.Optional.empty;
import static ua.com.fielden.platform.entity.AbstractEntity.DESC;
import static ua.com.fielden.platform.entity.AbstractEntity.KEY;
import static ua.com.fielden.platform.entity.ActivatableAbstractEntity.ACTIVE;
import static ua.com.fielden.platform.web.PrefDim.mkDim;
import static ua.com.fielden.platform.web.action.pre.PreActions.entityNavigation;
import static ua.com.fielden.platform.web.action.pre.PreActions.okCancel;
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.layout.api.impl.LayoutBuilder.cell;
import static ua.com.fielden.platform.web.layout.api.impl.LayoutCellBuilder.layout;
import static ua.com.fielden.platform.web.layout.api.impl.LayoutComposer.mkActionLayoutForMaster;

/**
* {@link UserRole} Web UI configuration.
*
Expand Down Expand Up @@ -177,7 +176,7 @@ public EntityActionConfig mkAction() {
public EntityActionConfig mkAction() {
return action(EntityEditAction.class)
.withContext(context().withCurrentEntity().withSelectionCrit().build())
.preAction(new EntityNavigationPreAction("User Role"))
.preAction(entityNavigation("User Role"))
.icon("editor:mode-edit")
.shortDesc("Edit User Role")
.longDesc("Opens master for User Role editing.")
Expand Down
Loading