Remove the "All Applications" from the add modals - #110
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the synthetic “All Applications” option from the applications API response (used by the UI “add configuration” modals) and hardens server-side validation so configurations can’t be saved without a valid AppId.
Changes:
- Removed the injected “All Applications” entry from
ApplicationDefinitionController.Applications(). - Added/updated
AppIdvalidation in robots/llms save flows (controllers + content services) and updated/added tests to cover the new bad-request behavior. - Removed the sample
appsettings.Development.jsonand added a.gitignorerule to avoid committing development settings.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Stott.Optimizely.RobotsHandler/Robots/RobotsContentService.cs | Fixes AppId validation to correctly treat missing/blank IDs as invalid. |
| src/Stott.Optimizely.RobotsHandler/Robots/RobotsApiController.cs | Returns HTTP 400 when AppId is missing before checking conflicts/saving. |
| src/Stott.Optimizely.RobotsHandler/Llms/LlmsApiController.cs | Returns HTTP 400 when AppId is missing before checking conflicts/saving. |
| src/Stott.Optimizely.RobotsHandler/Llms/DefaultLlmsContentService.cs | Fixes AppId validation to correctly treat missing/blank IDs as invalid. |
| src/Stott.Optimizely.RobotsHandler/Applications/ApplicationDefinitionController.cs | Stops injecting the “All Applications” entry into the API response. |
| src/Stott.Optimizely.RobotsHandler.Ui/src/AddSiteLlms.jsx | Minor formatting/indentation change in the add LLMS modal markup. |
| src/Stott.Optimizely.RobotsHandler.Test/Robots/RobotsApiControllerTests.cs | Updates existing save tests to provide AppId; adds coverage for missing AppId returning 400 and not invoking service calls. |
| src/Stott.Optimizely.RobotsHandler.Test/Llms/LlmsApiControllerTests.cs | Updates existing save tests to provide AppId; adds coverage for missing AppId returning 400 and not invoking service calls. |
| Sample/OptimizelyTwelveTest/appsettings.Development.json | Removes sample development settings file. |
| .gitignore | Ignores appsettings.Development.json going forward. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
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.
Closes 109