kibana/packages/kbn-cases-components
Christos Nasikas 2221ff8b55
[Cases] Version cases and comment domain and apis (#161954)
## Summary

This PR versions the `cases` and `comment` domain objects and their
corresponding APIs. It was not possible to do them separately as I got
errors due to circular dependencies.

## Notable Changes
- The `Comment` type was renamed to `Attachment`
- The `Comments` type was renamed to `Attachments`
- The `*CommentRequestRt` type was renamed to `*AttachmentPayload`
- The `CommentType` type was  renamed to `AttachmentType`
- The `AttributesType*` type was renamed to `*AttachmentAttributes`
- The `*ResponseTypeUserRt` type was renamed to `*AttachmentRt`
- The word `comment` got replaced with the word `attachment` in all
types
- The `RelatedCaseInfo` type was renamed to `RelatedCase`
- The `CasesByAlertId` type was renamed to
`GetRelatedCasesByAlertResponse`

Depends on: https://github.com/elastic/kibana/pull/161783,
https://github.com/elastic/kibana/pull/162059

### Checklist

Delete any items that do not apply to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-26 06:09:10 -07:00
..
.storybook [Cases] add tooltip component to kbn-cases-components package (#148561) 2023-01-17 14:24:50 +01:00
src [Cases] Version cases and comment domain and apis (#161954) 2023-07-26 06:09:10 -07:00
index.ts [Cases] add tooltip component to kbn-cases-components package (#148561) 2023-01-17 14:24:50 +01:00
jest.config.js [Cases] Cases component package (#143011) 2022-10-12 20:48:24 +03:00
kibana.jsonc Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
package.json Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
README.md [Cases] add tooltip component to kbn-cases-components package (#148561) 2023-01-17 14:24:50 +01:00
setup_tests.ts [Cases] Cases component package (#143011) 2022-10-12 20:48:24 +03:00
tsconfig.json [Cases] add tooltip component to kbn-cases-components package (#148561) 2023-01-17 14:24:50 +01:00

@kbn/cases-components

The package exports a collection of pure Cases components.

Components

Status

The component renders the status of a case. Usage:

import { Status, CaseStatuses } from '@kbn/cases-components';

<Status status={CaseStatuses.open} />

Tooltip

The component renders the tooltip with case details on hover of an Element. Usage:

import { Tooltip, CaseStatuses } from '@kbn/cases-components';
import type { CaseTooltipContentProps, CaseTooltipProps } from '@kbn/cases-components';

const tooltipContent: CaseTooltipContentProps = {
  title: 'Case title',
  description: 'Case description',
  createdAt: '2020-02-19T23:06:33.798Z',
  createdBy: {
    fullName: 'Elastic User',
    username: 'elastic',
  },
  totalComments: 1,
  status: CaseStatuses.open,
}

const tooltipProps: CaseTooltipProps = {
  loading: false,
  content: tooltipContent,
  className: 'customClass',
};

<Tooltip {...tooltipProps}>
  <span>This is a demo span</span>
</Tooltip>