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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

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
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: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

2 participants