Refactor collections config - #5622
Closed
lohanidamodar wants to merge 6 commits into
Closed
lohanidamodar wants to merge 6 commits into
lohanidamodar wants to merge 6 commits into
Conversation
lohanidamodar
marked this pull request as ready for review
June 1, 2023 05:25
eldadfux
requested changes
Jun 7, 2023
| @@ -3591,6 +3603,13 @@ | |||
| ], | |||
| ], | |||
| ], | |||
| ], $commonCollections); | |||
|
|
|||
| $collections = [ | |||
Member
There was a problem hiding this comment.
I was thinking, maybe it will be easier to read if we just add a property to each collection stating where it should go.
Member
Author
There was a problem hiding this comment.
That is some limitations, and was already using it for those collections that are not common like files and collections
- usually many collections go to both console and Project database
- it will not allow us to easily extend a collection common in both project and console easily so that we add new attributes in Console only , which was one of the reason for this refactor
| public function __construct(string $collection, array $allowedAttributes) | ||
| { | ||
| $collection = Config::getParam('collections', [])[$collection]; | ||
| $config = Config::getParam('collections', []); |
Member
There was a problem hiding this comment.
What exactly are we validating here?
Member
Author
There was a problem hiding this comment.
Query allowed attributes, validating the attribute is valid in the collection structure.
| ], | ||
| ], | ||
|
|
||
| 'realtime' => [ |
Contributor
There was a problem hiding this comment.
realtime is not a common collection. It's only used in the context of console DB
eldadfux
approved these changes
Jun 15, 2023
This was referenced Jul 25, 2023
Member
Author
|
This change is already in main, no sure why there's this PR as well, I don't remember. |
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.
What does this PR do?
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Screenshots may also be helpful.)
Related PRs and Issues
Checklist