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
UI: settings show/hide update display #1072
Conversation
This PR replaces the PR Stirling-Tools#1003 In this PR, the visual for available update is added to the foreground. There are new settings to generally show/hide the update display, and only administrators receive the update display.
import stirling.software.SPDF.repository.UserRepository; | ||
|
||
@Service | ||
public class AppUpdateShowService { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having this in the security folder means non security enabled jars will have build issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also adding it as parameter to all view files isnt a good solution personally i prefer doing it via bean such as the global properties in
https://github.com/Stirling-Tools/Stirling-PDF/blob/main/src/main/java/stirling/software/SPDF/config/AppConfig.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in AppConfig.java
I cannot query the user's status, as in the case of whether he is an admin or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont mean placing in AppConfig but that @bean(name = "appName") is a nicer way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I will try to use it 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./gradlew compileJava
> Configure project :
0.22.1
BUILD SUCCESSFUL in 6s
4 actionable tasks: 2 executed, 2 up-to-date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything else looks good!
this.applicationProperties = applicationProperties; | ||
} | ||
|
||
public boolean isShow() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should call this shouldShow
.
} | ||
|
||
public boolean isShow() { | ||
boolean showUpdate = applicationProperties.getSystem().getShowUpdate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should have a check for this and return it immediately since it's used in every branch?
There will be problems, and unfortunately I can't find a solution if the condition is correct Line 30 in ace4e20
|
I can help with that, I'll take a look tonight |
I cant commit to this PR but basically something like
This class is in the security package, and is the only thing containing security stuff
|
Naming and things might be garbage, change whatever, but thats the basic idea |
Thanks for the code, there is the problem that |
Could do something like
with |
AppUpdateAuthService.java needs moving to security folder |
Then the ShowAdminInterface.java shouldn't be in the repository folder, right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/main/java/stirling/software/SPDF/config/AppUpdateService.java
Outdated
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
Good to merge? |
The birth was difficult. You can merge. |
Description
This PR replaces the PR #1003
In this PR, the visual for available update is added to the foreground.
There are new settings to generally show/hide the update display, and only administrators receive the update display.
Checklist:
Contributor License Agreement
By submitting this pull request, I acknowledge and agree that my contributions will be included in Stirling-PDF and that they can be relicensed in the future under the MPL 2.0 (Mozilla Public License Version 2.0) license.
(This does not change the general open-source nature of Stirling-PDF, simply moving from one license to another license)