### Apache Airflow version

2.1.3 (latest released)

### Operating System

macOS Big Sur 11.3.1

### Versions of Apache Airflow Providers

n/a

### Deployment

Astronomer

### Deployment details

default Astronomer deployment with some test DAGs

### What happened

In the UI for DAGRuns there are checkboxes that allow multiple DAGRuns to be selected.

![image](https://user-images.githubusercontent.com/89415310/133841290-94cda771-9bb3-4677-8530-8c2861525719.png)

Within the Actions menu on this same view, there is a Delete option which allows multiple DAGRuns to be deleted at the same time.

![image](https://user-images.githubusercontent.com/89415310/133841362-3c7fc81d-a823-4f41-8b1d-64be425810ce.png)

Task instance view on the UI does not offer the same option, even though Task Instances can be individually deleted with the trash can button.

![image](https://user-images.githubusercontent.com/89415310/133841442-3fee0930-a6bb-4035-b172-1d10b85f3bf6.png)


### What you expected to happen

I expect that the Task Instances can also be bulk deleted, in the same way that DAGRuns can be.

### How to reproduce

Open up Task Instance and DAGRun views from the Browse tab and compare the options in the Actions dropdown menus.

### Anything else

_No response_

### Are you willing to submit PR?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

tests/www/views/test_views_tasks.py
"""Utility to get Flask-Appbuilder's string format "pk" for an object.
    Used to generate requests to FAB action views without *too* much difficulty.
    The implementation relies on FAB internals, but unfortunately I don't see
    a better way around it.
    Example usage::
        >>> from airflow.www.views import TaskInstanceModelView
        >>> ti = session.Query(TaskInstance).filter(...).one()
        >>> pk = _get_appbuilder_pk_string(TaskInstanceModelView, ti)
        >>> client.post("...", data={"action": "...", "rowid": pk})
    """
    pk_value = model_view_cls.datamodel.get_pk_value(instance)
    return model_view_cls._serialize_pk_if_composite(model_view_cls, pk_value)
def test_task_instance_delete(session, admin_client, create_task_instance):
    task_instance_to_delete = create_task_instance(
        task_id="test_task_instance_delete",
        execution_date=timezone.utcnow(),
        state=State.DEFERRED,
    )
    composite_key = _get_appbuilder_pk_string(TaskInstanceModelView, task_instance_to_delete)
    task_id = task_instance_to_delete.task_id
    assert session.query(TaskInstance).filter(TaskInstance.task_id == task_id).count() == 1
    admin_client.post(f"/taskinstance/delete/{composite_key}", follow_redirects=True)
    assert session.query(TaskInstance).filter(TaskInstance.task_id == task_id).count() == 0
def test_task_instance_delete_permission_denied(session, client_ti_without_dag_edit, create_task_instance):