Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/lib/kit/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import isString from 'lodash/isString';

import {COMMON_POPOVER_PLACEMENT, COMMON_TITLE_MAX_WIDTH} from '../../constants/common';
import {block} from '../../utils';
import {HTMLContent} from '../HTMLContent';

import './Card.scss';

Expand Down Expand Up @@ -95,7 +96,7 @@ export const Card: React.FC<CardProps> = ({
placement: COMMON_POPOVER_PLACEMENT,
}}
>
{description}
<HTMLContent html={description} />
</HelpMark>
</div>
) : null}
Expand Down
9 changes: 9 additions & 0 deletions src/lib/kit/components/HTMLContent/HTMLContent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

interface HTMLContentProps {
html: string;
}

export const HTMLContent: React.FC<HTMLContentProps> = ({html}) => {
return <div dangerouslySetInnerHTML={{__html: html}} />;
};
1 change: 1 addition & 0 deletions src/lib/kit/components/HTMLContent/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './HTMLContent';
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
import {useSearchContext} from '../../../../core/components/Form/hooks';
import {COMMON_POPOVER_PLACEMENT} from '../../../constants/common';
import {block} from '../../../utils';
import {HTMLContent} from '../../HTMLContent';

import './TableArrayInput.scss';

Expand Down Expand Up @@ -115,7 +116,7 @@ export const TableArrayInput: ArrayInput = ({spec, name, arrayInput, input}) =>
placement: COMMON_POPOVER_PLACEMENT,
}}
>
{description}
<HTMLContent html={description} />
</HelpMark>
</Flex>
),
Expand Down
3 changes: 2 additions & 1 deletion src/lib/kit/components/Layouts/Column/Column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {isArrayItem, isArraySpec, isObjectSpec, withGenerateButton} from '../../
import {ErrorWrapper, GenerateRandomValueButton} from '../../../components';
import {COMMON_POPOVER_PLACEMENT} from '../../../constants/common';
import {block} from '../../../utils';
import {HTMLContent} from '../../HTMLContent';

import './Column.scss';

Expand Down Expand Up @@ -40,7 +41,7 @@ const ColumnBase = <T extends FieldValue, S extends Spec>({
placement: COMMON_POPOVER_PLACEMENT,
}}
>
{spec.viewSpec.layoutDescription}
<HTMLContent html={spec.viewSpec.layoutDescription} />
</HelpMark>
</Text>
</span>
Expand Down
3 changes: 2 additions & 1 deletion src/lib/kit/components/Layouts/Row/Row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {isArrayItem, isArraySpec, isObjectSpec, withGenerateButton} from '../../
import {ErrorWrapper, GenerateRandomValueButton} from '../../../components';
import {COMMON_POPOVER_PLACEMENT} from '../../../constants/common';
import {block} from '../../../utils';
import {HTMLContent} from '../../HTMLContent';

import './Row.scss';

Expand Down Expand Up @@ -43,7 +44,7 @@ const RowBase = <T extends FieldValue, S extends Spec>({
placement: COMMON_POPOVER_PLACEMENT,
}}
>
{spec.viewSpec.layoutDescription}
<HTMLContent html={spec.viewSpec.layoutDescription} />
</HelpMark>
</Text>
</span>
Expand Down
3 changes: 2 additions & 1 deletion src/lib/kit/components/Layouts/Section/Section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type {
} from '../../../../core';
import {isArrayItem, isArraySpec, isObjectSpec} from '../../../../core';
import {block} from '../../../utils';
import {HTMLContent} from '../../HTMLContent';
import {RemoveButton} from '../../RemoveButton';

import './Section.scss';
Expand Down Expand Up @@ -122,7 +123,7 @@ const SectionBase = <
placement: COMMON_POPOVER_PLACEMENT,
}}
>
{spec.viewSpec.layoutDescription}
<HTMLContent html={spec.viewSpec.layoutDescription} />
</HelpMark>
</Text>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {Button, HelpMark, Icon, Popover, Text} from '@gravity-ui/uikit';

import {COMMON_POPOVER_PLACEMENT} from '../../constants/common';
import {block} from '../../utils';
import {HTMLContent} from '../HTMLContent';

import './SimpleVerticalAccordeon.scss';

Expand Down Expand Up @@ -206,7 +207,7 @@ export class SimpleVerticalAccordeon extends React.Component<
placement: COMMON_POPOVER_PLACEMENT,
}}
>
{note}
<HTMLContent html={note} />
</HelpMark>
</Text>
) : null;
Expand Down
3 changes: 2 additions & 1 deletion src/lib/kit/components/TogglerCard/TogglerCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {Card, HelpMark, Text} from '@gravity-ui/uikit';

import {COMMON_POPOVER_PLACEMENT} from '../../constants/common';
import {block} from '../../utils';
import {HTMLContent} from '../HTMLContent';

import './TogglerCard.scss';

Expand Down Expand Up @@ -45,7 +46,7 @@ export const TogglerCard: React.FC<TogglerCardProps> = ({
placement: COMMON_POPOVER_PLACEMENT,
}}
>
{description}
<HTMLContent html={description} />
</HelpMark>
) : null}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {useDynamicFormsCtx} from '../../../../core';
import {CopyButton} from '../../../../kit';
import {COMMON_POPOVER_PLACEMENT} from '../../../constants/common';
import {block, isNotEmptyValue} from '../../../utils';
import {HTMLContent} from '../../HTMLContent';

import './ViewColumn.scss';

Expand Down Expand Up @@ -36,7 +37,7 @@ export const ViewColumn = <T extends FormValue, S extends Spec>({
placement: COMMON_POPOVER_PLACEMENT,
}}
>
{spec.viewSpec.layoutDescription}
<HTMLContent html={spec.viewSpec.layoutDescription} />
</HelpMark>
) : null}
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/lib/kit/components/ViewLayouts/ViewRow/ViewRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {useDynamicFormsCtx} from '../../../../core';
import {CopyButton} from '../../../../kit';
import {COMMON_POPOVER_PLACEMENT} from '../../../constants/common';
import {block, isNotEmptyValue} from '../../../utils';
import {HTMLContent} from '../../HTMLContent';

import './ViewRow.scss';

Expand Down Expand Up @@ -36,7 +37,7 @@ export const ViewRow = <T extends FormValue, S extends Spec>({
placement: COMMON_POPOVER_PLACEMENT,
}}
>
{spec.viewSpec.layoutDescription}
<HTMLContent html={spec.viewSpec.layoutDescription} />
</HelpMark>
) : null}
<div className={b('dots')} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
} from '../../../../core';
import {COMMON_POPOVER_PLACEMENT} from '../../../constants/common';
import {block} from '../../../utils';
import {HTMLContent} from '../../HTMLContent';

import './TableArrayView.scss';

Expand Down Expand Up @@ -53,7 +54,7 @@ export const TableArrayView: ArrayView = ({value = [], spec, name}) => {
placement: COMMON_POPOVER_PLACEMENT,
}}
>
{description}
<HTMLContent html={description} />
</HelpMark>
</Flex>
)
Expand Down