Skip to content
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

Improve incidents file-path naming and template locations #1098

Merged
merged 12 commits into from
Jan 7, 2025

Conversation

hmpf
Copy link
Contributor

@hmpf hmpf commented Dec 18, 2024

This is, and should be, a pure refactor.

This changes incident*s* to incident in directory names and moves a subset of templates in the templates/htmx/incident/ directory so that the structure is easier to understand.

Reading commit by commit is probably best.

Do come with suggestions for other renames/moves in the templates/htmx/incident/ directory.

Copy link
Contributor

@podliashanyk podliashanyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import paths have to be fixed in following files:

  • src/argus/htmx/urls.py
  • src/argus/htmx/themes/views.py
  • src/argus/htmx/dateformat/views.py
  • src/argus/htmx/user/views.py

Another updates necessary:

  • ARGUS_HTMX_FILTER_FUNCTION = "argus.htmx.incident.filter.incident_list_filter" in src/argus/htmx/defaults.py

Should we also singularize some of the path names in src/argus/htmx/incident/urls.py?

src/argus/htmx/incident/constants.py Outdated Show resolved Hide resolved
@hmpf
Copy link
Contributor Author

hmpf commented Dec 18, 2024

Import paths have to be fixed in following files:

Urk, you mean my grep-fu has failed me? Bah.

Should we also singularize some of the path names in src/argus/htmx/incident/urls.py?

Do you mean

    path("update/<str:action>/", views.incidents_update, name="incidents-update"),
    path("filter/", views.filter_form, name="incidents-filter"),           

to

    path("update/<str:action>/", views.incident_update, name="incident-update"),
    path("filter/", views.filter_form, name="incident-filter"),           

Sure.

@podliashanyk
Copy link
Contributor

Urk, you mean my grep-fu has failed me? Bah.

Those were tricky ones 😄

Should we also singularize some of the path names in src/argus/htmx/incident/urls.py?

Do you mean

    path("update/<str:action>/", views.incidents_update, name="incidents-update"),
    path("filter/", views.filter_form, name="incidents-filter"),           

to

    path("update/<str:action>/", views.incident_update, name="incident-update"),
    path("filter/", views.filter_form, name="incident-filter"),           

Sure.

Yes!

@podliashanyk podliashanyk self-requested a review December 18, 2024 10:51
@hmpf hmpf mentioned this pull request Dec 18, 2024
@hmpf
Copy link
Contributor Author

hmpf commented Dec 18, 2024

Remember to also move BadgeDropdownMultiSelect and htmx/incidents/widgets/incident_source_select.html out of incidents, they are generic.

@hmpf hmpf force-pushed the singularize-incidents branch from 44ce735 to 6043b18 Compare December 18, 2024 12:22
@hmpf hmpf force-pushed the singularize-incidents branch from 9517654 to 7405508 Compare December 18, 2024 12:30
@hmpf hmpf self-assigned this Dec 18, 2024
@hmpf hmpf requested a review from elfjes January 7, 2025 07:05
@codecov-commenter
Copy link

codecov-commenter commented Jan 7, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 79.83%. Comparing base (5c3d87f) to head (96c9a41).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
src/argus/htmx/incident/views.py 50.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1098   +/-   ##
=======================================
  Coverage   79.83%   79.83%           
=======================================
  Files         145      145           
  Lines        5267     5267           
=======================================
  Hits         4205     4205           
  Misses       1062     1062           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@podliashanyk podliashanyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See URL name that needs fixing below.
Also, should we now delete the src/argus/htmx/incidents directory?

src/argus/htmx/incident/filter.py Outdated Show resolved Hide resolved
@hmpf
Copy link
Contributor Author

hmpf commented Jan 7, 2025

Also, should we now delete the src/argus/htmx/incidents directory?

Yes, git will not do it for us.

@hmpf hmpf requested a review from podliashanyk January 7, 2025 09:26
Copy link

sonarqubecloud bot commented Jan 7, 2025

Copy link
Contributor

@podliashanyk podliashanyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have gone through the code and checked the functionality via Ui and nothing seems to break

@hmpf hmpf merged commit 7f603f9 into Uninett:master Jan 7, 2025
14 checks passed
@hmpf hmpf deleted the singularize-incidents branch January 7, 2025 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Affects frontend refactor
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants