Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoregister helperFactory #1467

Merged
merged 1 commit into from
Oct 18, 2024
Merged

autoregister helperFactory #1467

merged 1 commit into from
Oct 18, 2024

Conversation

ymo-sci
Copy link
Contributor

@ymo-sci ymo-sci commented Oct 17, 2024

This is useful for Feature-flagged helpers in customizations which are scoped and not enabled in all scopes Without autoRegister the framework warns on the following code:

@Register
public static class SubHelperFactory extends SuperHelperFactory {
	@Nonnull
	@Override
	public SuperHelper make(@Nonnull ScopeInfo scopeInfo) {
		if (!UserContext.getCurrentUser().hasPermission("feature-sub")) {
			return new SubHelper(scopeInfo);
 	    	}
 	   	return super.make(scopeInfo);
	}
}

Description

Additional Notes

  • This PR fixes or works on following ticket(s): SE-14106
  • This PR is related to PR:

Checklist

  • Code change has been tested and works locally
  • Code was formatted via IntelliJ and follows SonarLint & best practices
  • Patch Tasks: Is local execution of Patch Tasks necessary? If so, please also mark the PR with the tag.

This is useful for Feature-flagged helpers in customizations which are scoped and not enabled in all scopes
Without autoRegister the framework warns on the following code:
@register
    public static class SubHelperFactory extends SuperHelperFactory {
	@nonnull
	@OverRide
	public SubHelper make(@nonnull ScopeInfo scopeInfo) {
		if (!UserContext.getCurrentUser().hasPermission("feature-sub")) {
			return new SubHelper(scopeInfo);
 	    	}
 	   	return super.make(scopeInfo);
	}
}
@ymo-sci ymo-sci added the 🧬 Enhancement Contains new features label Oct 17, 2024
@ymo-sci ymo-sci merged commit ceff24b into develop Oct 18, 2024
4 checks passed
@ymo-sci ymo-sci deleted the feature/ymo/helper-auto branch October 18, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧬 Enhancement Contains new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants