-
Notifications
You must be signed in to change notification settings - Fork 34
feat: configurable main page #1903
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Hey @nitrosx - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `src/app/app-config.service.ts:145` </location>
<code_context>
}
+
+ const config: AppConfigInterface = (this.appConfig as AppConfigInterface);
+ if ("defaultMainPage" in config && Object.keys(MainPageOptions).includes(config.defaultMainPage)) {
+ config.defaultMainPage = MainPageOptions[config.defaultMainPage];
+ } else {
+ config.defaultMainPage = MainPageOptions.DATASETS;
</code_context>
<issue_to_address>
Potential mismatch between enum keys and values in MainPageOptions check.
`defaultMainPage` may be a value (e.g., '/datasets') rather than a key, causing this check to fail and always use the fallback. Decide whether to check against enum keys or values and update the logic accordingly.
</issue_to_address>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
4 tasks
nitrosx
added a commit
to SciCatProject/scicat-backend-next
that referenced
this pull request
Jun 18, 2025
## Description This Pr updates the FE config with the option needed for the configurable main page. ## Motivation This PR is related to FE PR SciCatProject/frontend#1903 ## Changes: * updated FE config ## Tests included - [ ] Included for each change/fix? - [ ] Passing? <!-- Merge will not be approved unless tests pass --> ## Documentation - [ ] swagger documentation updated (required for API changes) - [ ] official documentation updated ### official documentation info
Junjiequan
reviewed
Jun 19, 2025
Junjiequan
reviewed
Jun 19, 2025
Junjiequan
approved these changes
Jun 20, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds the functionality to set in configuration which is the main page that users will be redirected to when typing the main URL of the instance.
Motivation
We have received multiple request to be able start the user journey from an arbitrary page different than the datasets list.
Changes:
Please provide a list of the changes implemented by this PR
defaultMainPage
Tests included
Documentation
official documentation info
If you have updated the official documentation, please provide PR # and URL of the pages where the updates are included
Backend version
Summary by Sourcery
Enable configuring the application’s landing page via a new
defaultMainPage
setting in the configuration, backed by an enum and routing guard to dynamically redirect users to the chosen page.New Features:
MainPageOptions
enum and adddefaultMainPage
property to the app config interfaceAppConfigService
to load, validate, and apply the configured main page with a fallbackMainPageGuard
andDummyComponent
to routing to redirect the root path to the configured main pageEnhancements:
defaultMainPage
is specifiedAppConfigInterface
instead of the oldAppConfig