Skip to content

Commit 6c04b38

Browse files
author
Zabilsya
committed
[DOP-22299] fix after review
1 parent 8861803 commit 6c04b38

File tree

5 files changed

+25
-22
lines changed

5 files changed

+25
-22
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from 'react';
2+
3+
export const FileNameTemplateTooltipText = () => {
4+
return (
5+
<>
6+
You can use the following placeholders (with brackets {'{}'}): <br />
7+
<ul>
8+
<li>{`{index}`} - required</li>
9+
<li>{`{extension}`} - required</li>
10+
<li>{`{run_created_at}`}</li>
11+
<li>{`{run_id}`}</li>
12+
</ul>
13+
And letters, numbers, and symbols &quot;.&quot;, &quot;_&quot;, &quot;-&quot; <br />
14+
</>
15+
);
16+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './FileNameTemplateTooltipText';
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** Regexp to filename template, which must include `{extension}` and `{index}` placeholder (e.g. qwerty_{index}.{extension}) */
2+
export const FILE_NAME_TEMPLATE_REGEXP =
3+
/^(?=.*\{index\})(?=.*\{extension\})([a-zA-Z0-9._\-]*\{(?:index|extension|run_created_at|run_id)\}[a-zA-Z0-9._\-]*)*$/;
4+
5+
export const fileNamePlaceholder = '{run_created_at}_{index}.{extension}';

src/entities/file/ui/FileNameTemplate/constants.tsx

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/entities/file/ui/FileNameTemplate/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ import { Form, Input } from 'antd';
22
import React from 'react';
33
import { validateFormFieldByPattern } from '@shared/utils';
44

5-
import { FILE_NAME_TEMPLATE_REGEXP, fileNamePlaceholder, fileNameTemplateTooltipText } from './constants';
5+
import { FILE_NAME_TEMPLATE_REGEXP, fileNamePlaceholder } from './constants';
6+
import { FileNameTemplateTooltipText } from './components';
67

78
export const FileNameTemplate = () => {
89
return (
910
<Form.Item
1011
label="Filename template"
1112
normalize={(value) => (value.trim() === '' ? undefined : value)}
12-
tooltip={fileNameTemplateTooltipText}
13+
tooltip={<FileNameTemplateTooltipText />}
1314
name={['target_params', 'file_name_template']}
1415
rules={[
1516
{

0 commit comments

Comments
 (0)