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

configure AdminFaces using Spring Boot application.yml or application.properties #555

Merged
merged 8 commits into from
Oct 17, 2018

Conversation

persapiens
Copy link
Member

No description provided.

@persapiens persapiens added this to the 3.3.0-rc1 milestone Oct 16, 2018
@persapiens persapiens self-assigned this Oct 16, 2018
@codecov
Copy link

codecov bot commented Oct 16, 2018

Codecov Report

Merging #555 into master will decrease coverage by 0.14%.
The diff coverage is 89.65%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #555      +/-   ##
============================================
- Coverage     92.22%   92.07%   -0.15%     
- Complexity      385      392       +7     
============================================
  Files            64       65       +1     
  Lines           990     1047      +57     
  Branches        112      116       +4     
============================================
+ Hits            913      964      +51     
- Misses           58       61       +3     
- Partials         19       22       +3
Impacted Files Coverage Δ Complexity Δ
...figure/adminfaces/AdminfacesAutoConfiguration.java 96.15% <100%> (+1.15%) 6 <1> (ø) ⬇️
...s/autoconfigure/adminfaces/AdminConfigWrapper.java 88.23% <88.23%> (ø) 7 <7> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0bbc5ad...4807987. Read the comment docs.

@larsgrefer
Copy link
Member

Have you tried something like this?

@Bean
@ConfigurationProperties("jsf.adminfaces")
public AdminConfig adminConfig() {
    return new AdminConfig();
}

@persapiens
Copy link
Member Author

Did you mean testing AdminConfigWrapper creation? I've just included it.

AdminConfig is already created because of @ApplicationScoped and @Named annotations.
The solution replaces AdminConfig to AdminConfigWrapper. AdminConfigWrapper overrides loadDefaults method, loading AdminFacesProperties and configuring AdminConfig attributes properly.

@larsgrefer
Copy link
Member

larsgrefer commented Oct 16, 2018

My Idea was to override/replace the BeanDefintion found by scanning the class with an explicit one which is directly annotated with @ConfigurationProperties. I'm currently testing if this would work as expected

@larsgrefer
Copy link
Member

Just replacing the AdminConfig bean doesn't work, because the nested property controlSidebar property isn't properly mapped.

@persapiens
Copy link
Member Author

Anyway, current implementation works.

@persapiens persapiens merged commit cd1ec2f into joinfaces:master Oct 17, 2018
@persapiens persapiens deleted the adminfaces-properties branch January 18, 2021 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants