kibana/x-pack/plugins/saved_objects_tagging/public/management/types.ts
Pierre Gayvallet 446390d86a
Add bulk assign action to tag management (#84177)
* initial draft

* move components to their own files

* create services folder and move tags package

* add assignment service

* fix some types

* prepare assign tag route

* move server-side tag client under the `services` folder

* add security check, move a lot of stuff.

* design improvements

* display tags in flyout

* improve button and add notification on save

* add action on tag rows

* fix types

* fix mock import paths

* add lens to the list of assignable types

* update generated doc

* add base functional tests

* move api to internal

* add api/security test suites

* add / use get_assignable_types API

* fix feature control tests

* fix assignable types propagation

* rename actions folder to bulk_actions

* extract actions to their own module

* add common / server unit tests

* add client-side assign tests

* add some tests and tsdoc

* typo

* add getActions test

* revert width change

* fix typo in API

* various minor improvements

* typo

* tsdoc on flyout page object

* close flyout when leaving the page

* fix bug when redirecting to SO management with a tag having whitespaces in its name

* check for dupes in toAdd and toRemove

* add lazy load to assign modal opener

* add lazy load to edit/create modals

* check if at least one assign or unassign tag id is specified

* grammar

* add explicit type existence check
2020-12-07 11:18:43 +01:00

41 lines
1.1 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { Observable } from 'rxjs';
import { EuiIconType } from '@elastic/eui/src/components/icon/icon';
/**
* Represents a tag `bulk action`
*/
export interface TagBulkAction {
/**
* The unique identifier for this action.
*/
id: string;
/**
* The label displayed in the bulk action context menu.
*/
label: string;
/**
* Optional aria-label if the visual label isn't descriptive enough.
*/
'aria-label'?: string;
/**
* An optional icon to display before the label in the context menu.
*/
icon?: EuiIconType;
/**
* Handler to execute this action against the given list of selected tag ids.
*/
execute: (
tagIds: string[],
{ canceled$ }: { canceled$: Observable<void> }
) => void | Promise<void>;
/**
* If true, the list of tags will be reloaded after the action's execution. Defaults to false.
*/
refreshAfterExecute?: boolean;
}