ara icon indicating copy to clipboard operation
ara copied to clipboard

ui: ability to search by host or task name

Open hille721 opened this issue 1 year ago • 1 comments

Ability to search for host or task name instead of id (fixes #243) image

Furthermore this PR introduces host and task name filters on the playbook index as well image

While the taskfilter supports pattern search (icontains), the host filter expects case insensitve exact expression (iexact). Because imo that's how most will use it.

hille721 avatar Aug 08 '22 06:08 hille721

Build failed.

:heavy_check_mark: ara-tox-py3 SUCCESS in 4m 06s :heavy_check_mark: ara-tox-linters SUCCESS in 4m 01s :heavy_check_mark: ara-basic-ansible-core-devel SUCCESS in 5m 19s (non-voting) :heavy_check_mark: ara-basic-ansible-6 SUCCESS in 5m 31s :heavy_check_mark: ara-basic-ansible-core-2.13 SUCCESS in 5m 22s :heavy_check_mark: ara-basic-ansible-core-2.12 SUCCESS in 5m 59s :heavy_check_mark: ara-basic-ansible-core-2.11 SUCCESS in 6m 55s :heavy_check_mark: ara-basic-ansible-2.9 SUCCESS in 5m 23s :x: ara-container-images FAILURE in 5m 09s

recheck

hille721 avatar Aug 16 '22 09:08 hille721

Build succeeded.

:heavy_check_mark: ara-tox-py3 SUCCESS in 3m 40s :heavy_check_mark: ara-tox-linters SUCCESS in 4m 29s :heavy_check_mark: ara-basic-ansible-core-devel SUCCESS in 4m 45s (non-voting) :heavy_check_mark: ara-basic-ansible-6 SUCCESS in 4m 49s :heavy_check_mark: ara-basic-ansible-core-2.13 SUCCESS in 6m 04s :heavy_check_mark: ara-basic-ansible-core-2.12 SUCCESS in 4m 53s :heavy_check_mark: ara-basic-ansible-core-2.11 SUCCESS in 6m 08s :heavy_check_mark: ara-basic-ansible-2.9 SUCCESS in 5m 09s :heavy_check_mark: ara-container-images SUCCESS in 11m 07s

@hille721 I finally got around to testing this and it works great, I'm happy that it turned out to be simple after all \o/

This is almost good to merge, two things:

  • We should be able to search by task name under the hosts' task results too, here: https://github.com/ansible-community/ara/blob/e3521963bf56c349422d7ef9c5fd8f2018867489/ara/ui/templates/partials/host_results.html#L58-L61
  • Although it works, I don't believe the host and task name search fields belong on the playbook index search box (I had commented about this in the issue). We should be fine with the hosts and tasks page for searching about them.

dmsimard avatar Sep 10 '22 17:09 dmsimard

If you see in this gif, I click on the report link to filter the results by task (id) in the playbook report page: https://github.com/ansible-community/ara/pull/342#issuecomment-1242797898

Peek 2022-09-11 15-52

I guess we need to keep the ability to filter by ID because we do the same thing from the hosts page ?

dmsimard avatar Sep 11 '22 01:09 dmsimard

Although it works, I don't believe the host and task name search fields belong on the playbook index search box (I had commented about this in the issue). We should be fine with the hosts and tasks page for searching about them.

Yeah you probably right. With the tasks / hosts page this is not really needed.

If you see in this gif, I click on the report link to filter the results by task (id) in the playbook report page: #342 (comment) I guess we need to keep the ability to filter by ID because we do the same thing from the hosts page ?

I would say no, we can filter for the task id in the playbook report via query parameter but showing the human friendly name in the filter box. Will check that tomorrow.

hille721 avatar Sep 11 '22 19:09 hille721

Build succeeded.

:heavy_check_mark: ara-tox-py3 SUCCESS in 3m 21s :heavy_check_mark: ara-tox-linters SUCCESS in 3m 42s :heavy_check_mark: ara-basic-ansible-core-devel SUCCESS in 5m 30s (non-voting) :heavy_check_mark: ara-basic-ansible-6 SUCCESS in 6m 05s :heavy_check_mark: ara-basic-ansible-core-2.13 SUCCESS in 5m 31s :heavy_check_mark: ara-basic-ansible-core-2.12 SUCCESS in 5m 19s :heavy_check_mark: ara-basic-ansible-core-2.11 SUCCESS in 5m 32s :heavy_check_mark: ara-basic-ansible-2.9 SUCCESS in 6m 14s :heavy_check_mark: ara-container-images SUCCESS in 12m 04s

changes made as requested by @dmsimard :

  • search by task name under the hosts' task results too & updated the "task link"
  • removed host and task name filters out of playbook section

hille721 avatar Sep 12 '22 14:09 hille721

It works well on my end and it's more straightforward for humans too.

Thanks for for contribution @hille721 :)

dmsimard avatar Sep 17 '22 22:09 dmsimard