-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add support for device tags #191
Merged
Merged
Conversation
This file contains 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
Pull Request Test Coverage Report for Build 0f63c3d73fd3e48ba70f72c901e47e24e6a82b3d-PR-191Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
szakhlypa
reviewed
May 18, 2022
davidebriani
requested changes
May 19, 2022
backend/priv/repo/migrations/20220517063737_create_devices_tags.exs
Outdated
Show resolved
Hide resolved
szakhlypa
suggested changes
May 26, 2022
rbino
force-pushed
the
device-tags
branch
2 times, most recently
from
May 27, 2022 07:45
ac0c414
to
29d2348
Compare
davidebriani
approved these changes
May 27, 2022
szakhlypa
reviewed
May 27, 2022
szakhlypa
approved these changes
May 27, 2022
szakhlypa
approved these changes
May 27, 2022
davidebriani
approved these changes
May 30, 2022
bettio
approved these changes
May 30, 2022
bettio
requested changes
May 30, 2022
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.
Let's add something to the changelog
Generated with: mix phx.gen.schema Devices.Tag tags tenant_id:references:tenants \ name:string:unique License headers added afterwards Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
- Use the correct defaults for tenant_id - Scope the unique_index to :tenant_id additionally - Add the unique_index on id and tenant_id needed for foreign keys - Make name not null Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Generated with: mix phx.gen.schema Devices.DeviceTag devices_tags tenant_id:references:tenants \ tag_id:references:tags device_id:references:devices License header added after generation. Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Rework the schema and migration to accomodate the change: - No need for a primary key in devices_tags, use a composite one - Autogenerate tenant_id (use integer since id fields can't have an autogenerate option) - Adjust all references to take tenant_id into account Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Also add relevant tests Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Show tags for the device object and allow updating them with the update_device mutation. Add all the relevant tests. Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
bettio
approved these changes
Jun 8, 2022
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.
Allow tagging a device, showing its tags when querying it and filtering for a specific tag when requesting the device list.