@ltht-react/type-summary 2.0.193 → 2.0.197
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -15
- package/package.json +8 -8
- package/src/atoms/date-summary.tsx +31 -31
- package/src/atoms/index.ts +4 -4
- package/src/atoms/narrative-summary.tsx +31 -31
- package/src/atoms/period-summary.tsx +20 -20
- package/src/atoms/redacted-description.tsx +13 -13
- package/src/index.tsx +2 -2
- package/src/organisms/error-summary.tsx +25 -25
- package/src/organisms/index.ts +5 -5
- package/src/organisms/info-summary.tsx +25 -25
- package/src/organisms/missing-data-summary.tsx +105 -105
- package/src/organisms/missing-data-warning.tsx +25 -25
- package/src/organisms/warning-summary.tsx +25 -25
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# Summary
|
|
2
|
-
|
|
3
|
-
<!-- STORY -->
|
|
4
|
-
|
|
5
|
-
### Import
|
|
6
|
-
|
|
7
|
-
```js
|
|
8
|
-
import Summary from '@ltht-react/type-summary'
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
### Usage
|
|
12
|
-
|
|
13
|
-
```jsx
|
|
14
|
-
<Summary />
|
|
15
|
-
```
|
|
1
|
+
# Summary
|
|
2
|
+
|
|
3
|
+
<!-- STORY -->
|
|
4
|
+
|
|
5
|
+
### Import
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
import Summary from '@ltht-react/type-summary'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Usage
|
|
12
|
+
|
|
13
|
+
```jsx
|
|
14
|
+
<Summary />
|
|
15
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ltht-react/type-summary",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.197",
|
|
4
4
|
"description": "ltht-react clinical Summary component.",
|
|
5
5
|
"author": "LTHT",
|
|
6
6
|
"homepage": "",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@emotion/react": "^11.0.0",
|
|
30
30
|
"@emotion/styled": "^11.0.0",
|
|
31
|
-
"@ltht-react/card": "^2.0.
|
|
32
|
-
"@ltht-react/icon": "^2.0.
|
|
33
|
-
"@ltht-react/list": "^2.0.
|
|
34
|
-
"@ltht-react/styles": "^2.0.
|
|
35
|
-
"@ltht-react/types": "^2.0.
|
|
36
|
-
"@ltht-react/utils": "^2.0.
|
|
31
|
+
"@ltht-react/card": "^2.0.197",
|
|
32
|
+
"@ltht-react/icon": "^2.0.197",
|
|
33
|
+
"@ltht-react/list": "^2.0.197",
|
|
34
|
+
"@ltht-react/styles": "^2.0.197",
|
|
35
|
+
"@ltht-react/types": "^2.0.197",
|
|
36
|
+
"@ltht-react/utils": "^2.0.197",
|
|
37
37
|
"date-fns": "^3.6.0",
|
|
38
38
|
"react": "^18.2.0"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "4a6b00c93b6516bf271fc09c9bcc252cc0f13ef4"
|
|
41
41
|
}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { HTMLAttributes, FC } from 'react'
|
|
2
|
-
import styled from '@emotion/styled'
|
|
3
|
-
|
|
4
|
-
import { TEXT_COLOURS } from '@ltht-react/styles'
|
|
5
|
-
import { PartialDateTime } from '@ltht-react/types'
|
|
6
|
-
import { partialDateTimeText, formatPartialDateTimeAsDateOnly } from '@ltht-react/utils'
|
|
7
|
-
|
|
8
|
-
const StyledDateSummary = styled.div<IStyledDateSummary>`
|
|
9
|
-
color: ${TEXT_COLOURS.PRIMARY};
|
|
10
|
-
text-decoration: ${({ enteredInError }) => (enteredInError ? 'line-through' : 'none')};
|
|
11
|
-
display: inline-block;
|
|
12
|
-
`
|
|
13
|
-
|
|
14
|
-
const DateSummary: FC<Props> = ({ datetime, enteredInError, dateOnlyView, ...rest }) => (
|
|
15
|
-
<StyledDateSummary enteredInError={enteredInError} dateOnlyView={dateOnlyView} {...rest}>
|
|
16
|
-
{dateOnlyView ? formatPartialDateTimeAsDateOnly(datetime) : partialDateTimeText(datetime)}
|
|
17
|
-
</StyledDateSummary>
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
21
|
-
datetime?: PartialDateTime | null
|
|
22
|
-
enteredInError?: boolean | undefined
|
|
23
|
-
dateOnlyView?: boolean
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface IStyledDateSummary {
|
|
27
|
-
enteredInError?: boolean | undefined
|
|
28
|
-
dateOnlyView?: boolean
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default DateSummary
|
|
1
|
+
import { HTMLAttributes, FC } from 'react'
|
|
2
|
+
import styled from '@emotion/styled'
|
|
3
|
+
|
|
4
|
+
import { TEXT_COLOURS } from '@ltht-react/styles'
|
|
5
|
+
import { PartialDateTime } from '@ltht-react/types'
|
|
6
|
+
import { partialDateTimeText, formatPartialDateTimeAsDateOnly } from '@ltht-react/utils'
|
|
7
|
+
|
|
8
|
+
const StyledDateSummary = styled.div<IStyledDateSummary>`
|
|
9
|
+
color: ${TEXT_COLOURS.PRIMARY};
|
|
10
|
+
text-decoration: ${({ enteredInError }) => (enteredInError ? 'line-through' : 'none')};
|
|
11
|
+
display: inline-block;
|
|
12
|
+
`
|
|
13
|
+
|
|
14
|
+
const DateSummary: FC<Props> = ({ datetime, enteredInError, dateOnlyView, ...rest }) => (
|
|
15
|
+
<StyledDateSummary enteredInError={enteredInError} dateOnlyView={dateOnlyView} {...rest}>
|
|
16
|
+
{dateOnlyView ? formatPartialDateTimeAsDateOnly(datetime) : partialDateTimeText(datetime)}
|
|
17
|
+
</StyledDateSummary>
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
21
|
+
datetime?: PartialDateTime | null
|
|
22
|
+
enteredInError?: boolean | undefined
|
|
23
|
+
dateOnlyView?: boolean
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface IStyledDateSummary {
|
|
27
|
+
enteredInError?: boolean | undefined
|
|
28
|
+
dateOnlyView?: boolean
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default DateSummary
|
package/src/atoms/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as PeriodSummary } from './period-summary'
|
|
2
|
-
export { default as DateSummary } from './date-summary'
|
|
3
|
-
export { default as RedactedDescription } from './redacted-description'
|
|
4
|
-
export { default as NarrativeSummary } from './narrative-summary'
|
|
1
|
+
export { default as PeriodSummary } from './period-summary'
|
|
2
|
+
export { default as DateSummary } from './date-summary'
|
|
3
|
+
export { default as RedactedDescription } from './redacted-description'
|
|
4
|
+
export { default as NarrativeSummary } from './narrative-summary'
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { FC } from 'react'
|
|
2
|
-
import styled from '@emotion/styled'
|
|
3
|
-
|
|
4
|
-
import { Narrative } from '@ltht-react/types'
|
|
5
|
-
|
|
6
|
-
const StyledNarrativeSummary = styled.div``
|
|
7
|
-
const StyledNarrativeTruncatedSummary = styled.div`
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
display: -webkit-box;
|
|
10
|
-
-webkit-box-orient: vertical;
|
|
11
|
-
-webkit-line-clamp: 2;
|
|
12
|
-
`
|
|
13
|
-
const NarrativeSummary: FC<Props> = ({ narrative, showIfEmpty = false, truncate = true, ...rest }) => {
|
|
14
|
-
if ((narrative && narrative.text.length > 0) || showIfEmpty === true) {
|
|
15
|
-
if (truncate) {
|
|
16
|
-
return <StyledNarrativeTruncatedSummary {...rest}>{narrative?.text}</StyledNarrativeTruncatedSummary>
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return <StyledNarrativeSummary {...rest}>{narrative?.text}</StyledNarrativeSummary>
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return <></>
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
interface Props {
|
|
26
|
-
narrative: Narrative | null | undefined
|
|
27
|
-
showIfEmpty: boolean
|
|
28
|
-
truncate: boolean
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default NarrativeSummary
|
|
1
|
+
import { FC } from 'react'
|
|
2
|
+
import styled from '@emotion/styled'
|
|
3
|
+
|
|
4
|
+
import { Narrative } from '@ltht-react/types'
|
|
5
|
+
|
|
6
|
+
const StyledNarrativeSummary = styled.div``
|
|
7
|
+
const StyledNarrativeTruncatedSummary = styled.div`
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
display: -webkit-box;
|
|
10
|
+
-webkit-box-orient: vertical;
|
|
11
|
+
-webkit-line-clamp: 2;
|
|
12
|
+
`
|
|
13
|
+
const NarrativeSummary: FC<Props> = ({ narrative, showIfEmpty = false, truncate = true, ...rest }) => {
|
|
14
|
+
if ((narrative && narrative.text.length > 0) || showIfEmpty === true) {
|
|
15
|
+
if (truncate) {
|
|
16
|
+
return <StyledNarrativeTruncatedSummary {...rest}>{narrative?.text}</StyledNarrativeTruncatedSummary>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return <StyledNarrativeSummary {...rest}>{narrative?.text}</StyledNarrativeSummary>
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return <></>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface Props {
|
|
26
|
+
narrative: Narrative | null | undefined
|
|
27
|
+
showIfEmpty: boolean
|
|
28
|
+
truncate: boolean
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default NarrativeSummary
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { HTMLAttributes, FC } from 'react'
|
|
2
|
-
import styled from '@emotion/styled'
|
|
3
|
-
|
|
4
|
-
import { TEXT_COLOURS } from '@ltht-react/styles'
|
|
5
|
-
import { Period } from '@ltht-react/types'
|
|
6
|
-
import { periodSummaryText } from '@ltht-react/utils'
|
|
7
|
-
|
|
8
|
-
const StyledPeriodSummary = styled.div`
|
|
9
|
-
color: ${TEXT_COLOURS.PRIMARY};
|
|
10
|
-
`
|
|
11
|
-
|
|
12
|
-
const PeriodSummary: FC<Props> = ({ period, ...rest }) => (
|
|
13
|
-
<StyledPeriodSummary {...rest}>{periodSummaryText(period)}</StyledPeriodSummary>
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
17
|
-
period?: Period | null
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default PeriodSummary
|
|
1
|
+
import { HTMLAttributes, FC } from 'react'
|
|
2
|
+
import styled from '@emotion/styled'
|
|
3
|
+
|
|
4
|
+
import { TEXT_COLOURS } from '@ltht-react/styles'
|
|
5
|
+
import { Period } from '@ltht-react/types'
|
|
6
|
+
import { periodSummaryText } from '@ltht-react/utils'
|
|
7
|
+
|
|
8
|
+
const StyledPeriodSummary = styled.div`
|
|
9
|
+
color: ${TEXT_COLOURS.PRIMARY};
|
|
10
|
+
`
|
|
11
|
+
|
|
12
|
+
const PeriodSummary: FC<Props> = ({ period, ...rest }) => (
|
|
13
|
+
<StyledPeriodSummary {...rest}>{periodSummaryText(period)}</StyledPeriodSummary>
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
17
|
+
period?: Period | null
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default PeriodSummary
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { HTMLAttributes, FC } from 'react'
|
|
2
|
-
import styled from '@emotion/styled'
|
|
3
|
-
import { TEXT_COLOURS } from '@ltht-react/styles'
|
|
4
|
-
|
|
5
|
-
const StyledRedactedDescription = styled.div`
|
|
6
|
-
color: ${TEXT_COLOURS.SECONDARY.VALUE};
|
|
7
|
-
`
|
|
8
|
-
|
|
9
|
-
const RedactedDescription: FC<HTMLAttributes<HTMLDivElement>> = ({ ...rest }) => (
|
|
10
|
-
<StyledRedactedDescription {...rest}>Insufficient privileges</StyledRedactedDescription>
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
export default RedactedDescription
|
|
1
|
+
import { HTMLAttributes, FC } from 'react'
|
|
2
|
+
import styled from '@emotion/styled'
|
|
3
|
+
import { TEXT_COLOURS } from '@ltht-react/styles'
|
|
4
|
+
|
|
5
|
+
const StyledRedactedDescription = styled.div`
|
|
6
|
+
color: ${TEXT_COLOURS.SECONDARY.VALUE};
|
|
7
|
+
`
|
|
8
|
+
|
|
9
|
+
const RedactedDescription: FC<HTMLAttributes<HTMLDivElement>> = ({ ...rest }) => (
|
|
10
|
+
<StyledRedactedDescription {...rest}>Insufficient privileges</StyledRedactedDescription>
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
export default RedactedDescription
|
package/src/index.tsx
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './atoms'
|
|
2
|
-
export * from './organisms'
|
|
1
|
+
export * from './atoms'
|
|
2
|
+
export * from './organisms'
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { FC, MouseEvent } from 'react'
|
|
2
|
-
import Card from '@ltht-react/card'
|
|
3
|
-
|
|
4
|
-
const ErrorSummary: FC<Props> = ({ clickHandler }) => {
|
|
5
|
-
const handleClick = (e: MouseEvent<HTMLElement>): void => {
|
|
6
|
-
e.preventDefault()
|
|
7
|
-
clickHandler && clickHandler()
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const errorSummaryProps = {
|
|
11
|
-
...(clickHandler && { onClick: handleClick }),
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<Card.Banner status="danger" {...errorSummaryProps}>
|
|
16
|
-
Regional Providers Unavailable
|
|
17
|
-
</Card.Banner>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
interface Props {
|
|
22
|
-
clickHandler?(): void
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default ErrorSummary
|
|
1
|
+
import { FC, MouseEvent } from 'react'
|
|
2
|
+
import Card from '@ltht-react/card'
|
|
3
|
+
|
|
4
|
+
const ErrorSummary: FC<Props> = ({ clickHandler }) => {
|
|
5
|
+
const handleClick = (e: MouseEvent<HTMLElement>): void => {
|
|
6
|
+
e.preventDefault()
|
|
7
|
+
clickHandler && clickHandler()
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const errorSummaryProps = {
|
|
11
|
+
...(clickHandler && { onClick: handleClick }),
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<Card.Banner status="danger" {...errorSummaryProps}>
|
|
16
|
+
Regional Providers Unavailable
|
|
17
|
+
</Card.Banner>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface Props {
|
|
22
|
+
clickHandler?(): void
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default ErrorSummary
|
package/src/organisms/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { default as MissingDataSummary } from './missing-data-summary'
|
|
2
|
-
export { default as MissingDataWarning } from './missing-data-warning'
|
|
3
|
-
export { default as ErrorSummary } from './error-summary'
|
|
4
|
-
export { default as InfoSummary } from './info-summary'
|
|
5
|
-
export { default as WarningSummary } from './warning-summary'
|
|
1
|
+
export { default as MissingDataSummary } from './missing-data-summary'
|
|
2
|
+
export { default as MissingDataWarning } from './missing-data-warning'
|
|
3
|
+
export { default as ErrorSummary } from './error-summary'
|
|
4
|
+
export { default as InfoSummary } from './info-summary'
|
|
5
|
+
export { default as WarningSummary } from './warning-summary'
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { FC, MouseEvent } from 'react'
|
|
2
|
-
import Card from '@ltht-react/card'
|
|
3
|
-
|
|
4
|
-
const InfoSummary: FC<Props> = ({ clickHandler }) => {
|
|
5
|
-
const handleClick = (e: MouseEvent<HTMLElement>): void => {
|
|
6
|
-
e.preventDefault()
|
|
7
|
-
clickHandler && clickHandler()
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const infoSummaryProps = {
|
|
11
|
-
...(clickHandler && { onClick: handleClick }),
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<Card.Banner status="info" {...infoSummaryProps}>
|
|
16
|
-
View Data Sources
|
|
17
|
-
</Card.Banner>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
interface Props {
|
|
22
|
-
clickHandler?(): void
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default InfoSummary
|
|
1
|
+
import { FC, MouseEvent } from 'react'
|
|
2
|
+
import Card from '@ltht-react/card'
|
|
3
|
+
|
|
4
|
+
const InfoSummary: FC<Props> = ({ clickHandler }) => {
|
|
5
|
+
const handleClick = (e: MouseEvent<HTMLElement>): void => {
|
|
6
|
+
e.preventDefault()
|
|
7
|
+
clickHandler && clickHandler()
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const infoSummaryProps = {
|
|
11
|
+
...(clickHandler && { onClick: handleClick }),
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<Card.Banner status="info" {...infoSummaryProps}>
|
|
16
|
+
View Data Sources
|
|
17
|
+
</Card.Banner>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface Props {
|
|
22
|
+
clickHandler?(): void
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default InfoSummary
|
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
import { FC } from 'react'
|
|
2
|
-
import { Maybe } from '@ltht-react/types'
|
|
3
|
-
import Card from '@ltht-react/card'
|
|
4
|
-
import Icon from '@ltht-react/icon'
|
|
5
|
-
|
|
6
|
-
const MissingDataSummary: FC<Props> = ({ type, noData, partialData, completeData, missingData }) => {
|
|
7
|
-
const missingDataSection =
|
|
8
|
-
missingData != null && missingData.length > 0 ? (
|
|
9
|
-
<>
|
|
10
|
-
<Card.Banner
|
|
11
|
-
data-testid="missing-data-count"
|
|
12
|
-
status="warning"
|
|
13
|
-
icon={<Icon type="counter" size="large" color="amber" counterValue={missingData.length} />}
|
|
14
|
-
>
|
|
15
|
-
Missing Data
|
|
16
|
-
</Card.Banner>
|
|
17
|
-
<Card.List data-testid="missing-data-list">
|
|
18
|
-
{missingData.map((data, index) => (
|
|
19
|
-
<Card.ListItem key={`${type}-missing-data-${index}`}>{data}</Card.ListItem>
|
|
20
|
-
))}
|
|
21
|
-
</Card.List>
|
|
22
|
-
</>
|
|
23
|
-
) : (
|
|
24
|
-
<></>
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
const partialDataSection =
|
|
28
|
-
partialData != null && partialData.length > 0 ? (
|
|
29
|
-
<>
|
|
30
|
-
<Card.Banner
|
|
31
|
-
data-testid="partial-data-count"
|
|
32
|
-
status="warning"
|
|
33
|
-
icon={<Icon type="counter" size="large" color="amber" counterValue={partialData.length} />}
|
|
34
|
-
>
|
|
35
|
-
Partial Data
|
|
36
|
-
</Card.Banner>
|
|
37
|
-
<Card.List data-testid="partial-data-list">
|
|
38
|
-
{partialData.map((data, index) => (
|
|
39
|
-
<Card.ListItem key={`${type}-partial-data-${index}`}>{data}</Card.ListItem>
|
|
40
|
-
))}
|
|
41
|
-
</Card.List>
|
|
42
|
-
</>
|
|
43
|
-
) : (
|
|
44
|
-
<></>
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
const completeDataSection =
|
|
48
|
-
completeData != null && completeData.length > 0 ? (
|
|
49
|
-
<>
|
|
50
|
-
<Card.Banner
|
|
51
|
-
data-testid="complete-data-count"
|
|
52
|
-
status="info"
|
|
53
|
-
icon={<Icon type="counter" size="large" color="info-blue" counterValue={completeData.length} />}
|
|
54
|
-
>
|
|
55
|
-
Complete Data
|
|
56
|
-
</Card.Banner>
|
|
57
|
-
<Card.List data-testid="complete-data-list">
|
|
58
|
-
{completeData.map((data, index) => (
|
|
59
|
-
<Card.ListItem key={`${type}-complete-data-${index}`}>{data}</Card.ListItem>
|
|
60
|
-
))}
|
|
61
|
-
</Card.List>
|
|
62
|
-
</>
|
|
63
|
-
) : (
|
|
64
|
-
<></>
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
const noDataSection =
|
|
68
|
-
noData != null && noData.length > 0 ? (
|
|
69
|
-
<>
|
|
70
|
-
<Card.Banner
|
|
71
|
-
data-testid="no-data-count"
|
|
72
|
-
status="info"
|
|
73
|
-
icon={<Icon type="counter" size="large" color="info-blue" counterValue={noData.length} />}
|
|
74
|
-
>
|
|
75
|
-
No Data
|
|
76
|
-
</Card.Banner>
|
|
77
|
-
<Card.List data-testid="no-data-list">
|
|
78
|
-
{noData.map((data, index) => (
|
|
79
|
-
<Card.ListItem key={`${type}-no-data-${index}`}>{data}</Card.ListItem>
|
|
80
|
-
))}
|
|
81
|
-
</Card.List>
|
|
82
|
-
</>
|
|
83
|
-
) : (
|
|
84
|
-
<></>
|
|
85
|
-
)
|
|
86
|
-
|
|
87
|
-
return (
|
|
88
|
-
<>
|
|
89
|
-
{missingDataSection}
|
|
90
|
-
{partialDataSection}
|
|
91
|
-
{completeDataSection}
|
|
92
|
-
{noDataSection}
|
|
93
|
-
</>
|
|
94
|
-
)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
interface Props {
|
|
98
|
-
type: string
|
|
99
|
-
missingData?: Maybe<Array<string>>
|
|
100
|
-
partialData?: Maybe<Array<string>>
|
|
101
|
-
completeData?: Maybe<Array<string>>
|
|
102
|
-
noData?: Maybe<Array<string>>
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export default MissingDataSummary
|
|
1
|
+
import { FC } from 'react'
|
|
2
|
+
import { Maybe } from '@ltht-react/types'
|
|
3
|
+
import Card from '@ltht-react/card'
|
|
4
|
+
import Icon from '@ltht-react/icon'
|
|
5
|
+
|
|
6
|
+
const MissingDataSummary: FC<Props> = ({ type, noData, partialData, completeData, missingData }) => {
|
|
7
|
+
const missingDataSection =
|
|
8
|
+
missingData != null && missingData.length > 0 ? (
|
|
9
|
+
<>
|
|
10
|
+
<Card.Banner
|
|
11
|
+
data-testid="missing-data-count"
|
|
12
|
+
status="warning"
|
|
13
|
+
icon={<Icon type="counter" size="large" color="amber" counterValue={missingData.length} />}
|
|
14
|
+
>
|
|
15
|
+
Missing Data
|
|
16
|
+
</Card.Banner>
|
|
17
|
+
<Card.List data-testid="missing-data-list">
|
|
18
|
+
{missingData.map((data, index) => (
|
|
19
|
+
<Card.ListItem key={`${type}-missing-data-${index}`}>{data}</Card.ListItem>
|
|
20
|
+
))}
|
|
21
|
+
</Card.List>
|
|
22
|
+
</>
|
|
23
|
+
) : (
|
|
24
|
+
<></>
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
const partialDataSection =
|
|
28
|
+
partialData != null && partialData.length > 0 ? (
|
|
29
|
+
<>
|
|
30
|
+
<Card.Banner
|
|
31
|
+
data-testid="partial-data-count"
|
|
32
|
+
status="warning"
|
|
33
|
+
icon={<Icon type="counter" size="large" color="amber" counterValue={partialData.length} />}
|
|
34
|
+
>
|
|
35
|
+
Partial Data
|
|
36
|
+
</Card.Banner>
|
|
37
|
+
<Card.List data-testid="partial-data-list">
|
|
38
|
+
{partialData.map((data, index) => (
|
|
39
|
+
<Card.ListItem key={`${type}-partial-data-${index}`}>{data}</Card.ListItem>
|
|
40
|
+
))}
|
|
41
|
+
</Card.List>
|
|
42
|
+
</>
|
|
43
|
+
) : (
|
|
44
|
+
<></>
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
const completeDataSection =
|
|
48
|
+
completeData != null && completeData.length > 0 ? (
|
|
49
|
+
<>
|
|
50
|
+
<Card.Banner
|
|
51
|
+
data-testid="complete-data-count"
|
|
52
|
+
status="info"
|
|
53
|
+
icon={<Icon type="counter" size="large" color="info-blue" counterValue={completeData.length} />}
|
|
54
|
+
>
|
|
55
|
+
Complete Data
|
|
56
|
+
</Card.Banner>
|
|
57
|
+
<Card.List data-testid="complete-data-list">
|
|
58
|
+
{completeData.map((data, index) => (
|
|
59
|
+
<Card.ListItem key={`${type}-complete-data-${index}`}>{data}</Card.ListItem>
|
|
60
|
+
))}
|
|
61
|
+
</Card.List>
|
|
62
|
+
</>
|
|
63
|
+
) : (
|
|
64
|
+
<></>
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
const noDataSection =
|
|
68
|
+
noData != null && noData.length > 0 ? (
|
|
69
|
+
<>
|
|
70
|
+
<Card.Banner
|
|
71
|
+
data-testid="no-data-count"
|
|
72
|
+
status="info"
|
|
73
|
+
icon={<Icon type="counter" size="large" color="info-blue" counterValue={noData.length} />}
|
|
74
|
+
>
|
|
75
|
+
No Data
|
|
76
|
+
</Card.Banner>
|
|
77
|
+
<Card.List data-testid="no-data-list">
|
|
78
|
+
{noData.map((data, index) => (
|
|
79
|
+
<Card.ListItem key={`${type}-no-data-${index}`}>{data}</Card.ListItem>
|
|
80
|
+
))}
|
|
81
|
+
</Card.List>
|
|
82
|
+
</>
|
|
83
|
+
) : (
|
|
84
|
+
<></>
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<>
|
|
89
|
+
{missingDataSection}
|
|
90
|
+
{partialDataSection}
|
|
91
|
+
{completeDataSection}
|
|
92
|
+
{noDataSection}
|
|
93
|
+
</>
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
interface Props {
|
|
98
|
+
type: string
|
|
99
|
+
missingData?: Maybe<Array<string>>
|
|
100
|
+
partialData?: Maybe<Array<string>>
|
|
101
|
+
completeData?: Maybe<Array<string>>
|
|
102
|
+
noData?: Maybe<Array<string>>
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export default MissingDataSummary
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { FC, MouseEvent } from 'react'
|
|
2
|
-
import Card from '@ltht-react/card'
|
|
3
|
-
|
|
4
|
-
const MissingDataWarning: FC<Props> = ({ clickHandler }) => {
|
|
5
|
-
const handleClick = (e: MouseEvent<HTMLElement>): void => {
|
|
6
|
-
e.preventDefault()
|
|
7
|
-
clickHandler && clickHandler()
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const missingDataWarningProps = {
|
|
11
|
-
...(clickHandler && { onClick: handleClick }),
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<Card.Banner status="warning" {...missingDataWarningProps}>
|
|
16
|
-
Missing Data
|
|
17
|
-
</Card.Banner>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
interface Props {
|
|
22
|
-
clickHandler?(): void
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default MissingDataWarning
|
|
1
|
+
import { FC, MouseEvent } from 'react'
|
|
2
|
+
import Card from '@ltht-react/card'
|
|
3
|
+
|
|
4
|
+
const MissingDataWarning: FC<Props> = ({ clickHandler }) => {
|
|
5
|
+
const handleClick = (e: MouseEvent<HTMLElement>): void => {
|
|
6
|
+
e.preventDefault()
|
|
7
|
+
clickHandler && clickHandler()
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const missingDataWarningProps = {
|
|
11
|
+
...(clickHandler && { onClick: handleClick }),
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<Card.Banner status="warning" {...missingDataWarningProps}>
|
|
16
|
+
Missing Data
|
|
17
|
+
</Card.Banner>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface Props {
|
|
22
|
+
clickHandler?(): void
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default MissingDataWarning
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { FC, MouseEvent } from 'react'
|
|
2
|
-
import Card from '@ltht-react/card'
|
|
3
|
-
|
|
4
|
-
const WarningSummary: FC<Props> = ({ clickHandler }) => {
|
|
5
|
-
const handleClick = (e: MouseEvent<HTMLElement>): void => {
|
|
6
|
-
e.preventDefault()
|
|
7
|
-
clickHandler && clickHandler()
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const warningSummaryProps = {
|
|
11
|
-
...(clickHandler && { onClick: handleClick }),
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<Card.Banner status="warning" {...warningSummaryProps}>
|
|
16
|
-
Incomplete Data
|
|
17
|
-
</Card.Banner>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
interface Props {
|
|
22
|
-
clickHandler?(): void
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default WarningSummary
|
|
1
|
+
import { FC, MouseEvent } from 'react'
|
|
2
|
+
import Card from '@ltht-react/card'
|
|
3
|
+
|
|
4
|
+
const WarningSummary: FC<Props> = ({ clickHandler }) => {
|
|
5
|
+
const handleClick = (e: MouseEvent<HTMLElement>): void => {
|
|
6
|
+
e.preventDefault()
|
|
7
|
+
clickHandler && clickHandler()
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const warningSummaryProps = {
|
|
11
|
+
...(clickHandler && { onClick: handleClick }),
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<Card.Banner status="warning" {...warningSummaryProps}>
|
|
16
|
+
Incomplete Data
|
|
17
|
+
</Card.Banner>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface Props {
|
|
22
|
+
clickHandler?(): void
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default WarningSummary
|