-
Notifications
You must be signed in to change notification settings - Fork 8
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
Dashboard View #191
Dashboard View #191
Conversation
I think this is a great addition to the plugin and agree with @glennmatthews that it would make a good plugin landing/home page. |
I'm currently waiting on #195 before I continue on. |
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.
Calling the overview
view, without any Circuit Maintenance, raises an AttributeError
exception
AttributeError at /plugins/circuit-maintenance/maintenance/overview/
'NoneType' object has no attribute 'start_time'
Request Method: GET
Request URL: http://localhost:8080/plugins/circuit-maintenance/maintenance/overview/
Django Version: 3.2.15
Exception Type: AttributeError
Exception Value:
'NoneType' object has no attribute 'start_time'
Exception Location: /source/nautobot_circuit_maintenance/views.py, line 169, in get_month_list
Python Executable: /usr/local/bin/python
Python Version: 3.7.13
Python Path:
['/source',
'/usr/local/lib/python3.7/site-packages/git/ext/gitdb',
'/source',
'/usr/local/bin',
'/usr/local/lib/python37.zip',
'/usr/local/lib/python3.7',
'/usr/local/lib/python3.7/lib-dynload',
'/root/.local/lib/python3.7/site-packages',
'/usr/local/lib/python3.7/site-packages',
'/source',
'/usr/local/lib/python3.7/site-packages/gitdb/ext/smmap']
Server time: Wed, 24 Aug 2022 07:08:07 +0000
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.
Accessing the overview
view with a CircuitMaintenance
without circuits, trigger a ZeroDivisionError
exception
ZeroDivisionError at /plugins/circuit-maintenance/maintenance/overview/
division by zero
Request Method: GET
Request URL: http://localhost:8080/plugins/circuit-maintenance/maintenance/overview/
Django Version: 3.2.15
Exception Type: ZeroDivisionError
Exception Value:
division by zero
Exception Location: /source/nautobot_circuit_maintenance/views.py, line 69, in setup
Python Executable: /usr/local/bin/python
Python Version: 3.7.13
Python Path:
['/source',
'/usr/local/lib/python3.7/site-packages/git/ext/gitdb',
'/source',
'/usr/local/bin',
'/usr/local/lib/python37.zip',
'/usr/local/lib/python3.7',
'/usr/local/lib/python3.7/lib-dynload',
'/root/.local/lib/python3.7/site-packages',
'/usr/local/lib/python3.7/site-packages',
'/source',
'/usr/local/lib/python3.7/site-packages/gitdb/ext/smmap']
Server time: Wed, 24 Aug 2022 07:09:54 +0000
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.
…n-circuit-maintenance into jv_cm_dashboard
Corrected. The |
...circuit_maintenance/templates/nautobot_circuit_maintenance/circuit_maintenance_overview.html
Outdated
Show resolved
Hide resolved
...circuit_maintenance/templates/nautobot_circuit_maintenance/circuit_maintenance_overview.html
Outdated
Show resolved
Hide resolved
...circuit_maintenance/templates/nautobot_circuit_maintenance/circuit_maintenance_overview.html
Outdated
Show resolved
Hide resolved
...circuit_maintenance/templates/nautobot_circuit_maintenance/circuit_maintenance_overview.html
Outdated
Show resolved
Hide resolved
Co-authored-by: Glenn Matthews <[email protected]>
…n-circuit-maintenance into jv_cm_dashboard
return f"plugins:{self.model._meta.app_label}:{self.model._meta.model_name}_{{}}" | ||
|
||
def assertInstanceEqual(self, instance, data, api=False): # pylint: disable=arguments-differ | ||
"""Used to overwrite inbuilt function. Causing type issues for datetimepicker.""" |
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.
Doesn't ring a bell to me, sorry.
...circuit_maintenance/templates/nautobot_circuit_maintenance/circuit_maintenance_overview.html
Outdated
Show resolved
Hide resolved
…nance/circuit_maintenance_overview.html Co-authored-by: Glenn Matthews <[email protected]>
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.
It's almost a 👍 , I would only simply the testing of the new view (as suggested by Glenn) with a simpler test class, without all the tests that apply to a model, but in this case it's only for an extra view. It should get rid of a lot of the skip
that are not adding any value
Done @chadell |
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.
LGTM
🎉 Amazing work Josh!
I see this just a first iteration of the dashboard, where we could extend and add useful information as we add more features.
Regarding testing, for the assertInstanceEqual
weirdness, I would create a housekeeping issue to fix it.
{% table_config_form table table_name="ObjectTable" %} | ||
{% endblock %} | ||
{% block javascript %} | ||
<script src="{% static 'js/tableconfig.js' %}"></script> |
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.
@jvanderaa , could you give explain (point to doc) what are we using this for?
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.
@itdependsnetworks I took this from the GC plugin. Any insight?
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.
Removed it for now. It is used for table selection.
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 get this merged and released?
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.
It's used for customizing a table view to specify which columns are displayed. If you're removing it, you should also remove the table_config_form
template tag as well.
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.
Looks good to me
...circuit_maintenance/templates/nautobot_circuit_maintenance/circuit_maintenance_overview.html
Outdated
Show resolved
Hide resolved
…nance/circuit_maintenance_overview.html Co-authored-by: Christian Adell <[email protected]>
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.
LGTM
WIP yet, this is the work towards building a Dashboard view for the components of the circuit maintenance.
Outstanding: