-
Notifications
You must be signed in to change notification settings - Fork 253
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
[Tests and Doc] Implemented SavedView Model #5678
Conversation
nautobot/users/factory.py
Outdated
reverse(list_view_name) | ||
VIEW_NAMES.append(f"{app_label}:{model}_list") | ||
except NoReverseMatch: | ||
pass |
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.
Do we have any SavedView models that are missing list-views? That would seem like a bug to me.
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.
consoleport template and other templates are missing list views. This try and except block is attempting to exclude them.
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.
Right, but doesn't that mean we should set those models to is_saved_view_model = False
for now?
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.
Can we remove the except: pass
now?
nautobot/docs/user-guide/feature-guides/images/saved-views/clear-view-button.png
Outdated
Show resolved
Hide resolved
<div class="modal-body"> | ||
{% csrf_token %} | ||
<div class="form-group"> | ||
{% render_field form.name %} | ||
<input type="hidden" id="view" name="view" value="{{view}}"> | ||
<input type="hidden" id="params" name="params" value="{{params}}"> |
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.
Did you test whether we need to urlencode
params
here if it contains special 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.
nautobot/users/factory.py
Outdated
reverse(list_view_name) | ||
VIEW_NAMES.append(f"{app_label}:{model}_list") | ||
except NoReverseMatch: | ||
pass |
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.
Can we remove the except: pass
now?
nautobot/users/tests/test_views.py
Outdated
# Custom action requires custom permission | ||
self.add_permissions("users.clear_savedview") |
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.
That's definitely not ideal... will be a tripping point for users setting up permissions.
* first commit * model changes * various changes to make update current view working * create new view complete * change savedview to a changelogged model * hacking table_config workflow together * material design icons update * Last UI changes * added changelogs * address feedback from standup and PR * more refactoring * added SavedViewMixin and refactored models based on that * fix unittests * ruff fix * unittests * unittests * address most PR feedback * unittests * address PR feedback * refactor table_config, pagination_count, filter_params and sort_order into one field config * address review feedback * use urllib.parse.urlencode * address review feedback * revert changes from users: to user: * revert minor change * user vs users * address PR feedback * address PR feedback * Make 'saved_view=...' query param imply the correct filtering, sorting, config, and pagination values (#5682) * Make 'saved_view=...' query param imply the correct filtering, sorting, config, and pagination values * Fix update behavior and create behavior when given an existing instance * Test fix * [Tests and Doc] Implemented SavedView Model (#5678) * added factories and some documentation * added api and view tests * filter test and ruff fix * include savedview.md in nav * delete print statement * user factory modifications * fix user unittest * delete comment * address PR feedback * add additional tests * factory changes * delete output.txt * added saved view clear view * added all_filters_removed non_filter_params * added tooltip title to asterik * added user guide for creating and updating saved view * added refereneces to user guide * completed user guide * refactor create saved view * address some pr feedback * refactored SavedViewModal * attempt to fix unittests * fix screenshots * specify is_saved_view_model=False on ComponentTemplateModel * added clear_view_modal * fixed saved view edit url * address pr feedback on user guide * fix all unittests * markdownlint * fix unittest * ruff * fix factory and tests * refactored SavedViewClearView to custom action on SavedViewUIViewSet * address PR feedback * ruff fix * pylint and unittest fixes * fix unittest * address pr feedabck * refactor and remove is_saved_view_model=False on StaticGroup * ruff fix * unittests * Enforce users:change_savedview instead of users:clear_savedview * pylint * fix clear_view_modal bug * address PR feedback * add json blob on saved_view_modal * gray out json blob on saved_view_modal * move get_table_class_string_from_view_name() to nautobot.core.utils.lookup * update migration file * include missing savedview doc * refactor StaticGroupFactory * unittests --------- Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
Closes #1758
What's Changed
Test and documentation update for SavedView Model.
TODO