-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d471d0
commit 320d705
Showing
5 changed files
with
190 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...-web-core/components/framework/properties/general.AutoValidationStampPropertyType/Form.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import {Form, Switch} from "antd"; | ||
import {prefixedFormName} from "@components/form/formUtils"; | ||
|
||
export default function PropertyForm({prefix}) { | ||
|
||
return ( | ||
<> | ||
<Form.Item | ||
label="Auto create" | ||
extra="If checked, creates validations from predefined ones" | ||
name={prefixedFormName(prefix, 'autoCreate')} | ||
> | ||
<Switch/> | ||
</Form.Item> | ||
<Form.Item | ||
label="Auto create if not predefined" | ||
extra="If checked, creates validations even if not predefined" | ||
name={prefixedFormName(prefix, 'autoCreateIfNotPredefined')} | ||
> | ||
<Switch/> | ||
</Form.Item> | ||
</> | ||
) | ||
} |
21 changes: 21 additions & 0 deletions
21
...ack-web-core/components/framework/properties/general.BuildLinkDisplayPropertyType/Form.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import {Form, Switch} from "antd"; | ||
import {prefixedFormName} from "@components/form/formUtils"; | ||
|
||
export default function PropertyForm({prefix}) { | ||
|
||
return ( | ||
<> | ||
<Form.Item | ||
label="Use label" | ||
extra={`Configuration at project label to specify that a | ||
build link decoration should use the release/label | ||
of a build when available. By default, it displays | ||
the release name if available, and then the build name as a default. | ||
`} | ||
name={prefixedFormName(prefix, 'useLabel')} | ||
> | ||
<Switch/> | ||
</Form.Item> | ||
</> | ||
) | ||
} |
25 changes: 25 additions & 0 deletions
25
ontrack-web-core/components/framework/properties/general.MessagePropertyType/Form.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import {Form, Input} from "antd"; | ||
import {prefixedFormName} from "@components/form/formUtils"; | ||
import SelectMessageType from "@components/common/SelectMessageType"; | ||
|
||
export default function PropertyForm({prefix}) { | ||
|
||
return ( | ||
<> | ||
<Form.Item | ||
label="Type" | ||
extra="Type of message" | ||
name={prefixedFormName(prefix, 'type')} | ||
> | ||
<SelectMessageType/> | ||
</Form.Item> | ||
<Form.Item | ||
label="Text" | ||
extra="Content of the message" | ||
name={prefixedFormName(prefix, 'text')} | ||
> | ||
<Input/> | ||
</Form.Item> | ||
</> | ||
) | ||
} |
65 changes: 65 additions & 0 deletions
65
ontrack-web-core/components/framework/properties/general.MetaInfoPropertyType/Form.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import {Button, Form, Input, Space, Typography} from "antd"; | ||
import {prefixedFormName} from "@components/form/formUtils"; | ||
import {FaPlus, FaTrash} from "react-icons/fa"; | ||
|
||
export default function PropertyForm({prefix}) { | ||
|
||
return ( | ||
<> | ||
<Form.List name={prefixedFormName(prefix, 'items')}> | ||
{(fields, {add, remove}) => ( | ||
<> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
rowGap: 16, | ||
flexDirection: 'column', | ||
}} | ||
> | ||
{fields.map(({key, name, ...restField}) => ( | ||
<> | ||
<Space | ||
key={key} | ||
> | ||
<Form.Item | ||
{...restField} | ||
name={[name, 'name']} | ||
label={<FaTrash onClick={() => remove(name)}/>} | ||
rules={[{required: true, message: 'Meta info name is required.',},]} | ||
> | ||
<Input placeholder="Name"/> | ||
</Form.Item> | ||
<Form.Item | ||
{...restField} | ||
name={[name, 'value']} | ||
> | ||
<Input placeholder="Value"/> | ||
</Form.Item> | ||
<Form.Item | ||
{...restField} | ||
name={[name, 'link']} | ||
> | ||
<Input placeholder="Link"/> | ||
</Form.Item> | ||
<Form.Item | ||
{...restField} | ||
name={[name, 'category']} | ||
> | ||
<Input placeholder="Category"/> | ||
</Form.Item> | ||
</Space> | ||
</> | ||
))} | ||
<Button type="dashed" onClick={() => add()} block> | ||
<Space> | ||
<FaPlus/> | ||
<Typography.Text>Add meta info</Typography.Text> | ||
</Space> | ||
</Button> | ||
</div> | ||
</> | ||
)} | ||
</Form.List> | ||
</> | ||
) | ||
} |
55 changes: 55 additions & 0 deletions
55
...web-core/components/framework/properties/git.branching.BranchingModelPropertyType/Form.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import {Button, Form, Input, Space, Typography} from "antd"; | ||
import {prefixedFormName} from "@components/form/formUtils"; | ||
import {FaPlus, FaTrash} from "react-icons/fa"; | ||
|
||
export default function PropertyForm({prefix}) { | ||
|
||
return ( | ||
<> | ||
<Form.List name={prefixedFormName(prefix, 'patterns')}> | ||
{(fields, {add, remove}) => ( | ||
<> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
rowGap: 16, | ||
flexDirection: 'column', | ||
}} | ||
> | ||
{fields.map(({key, name, ...restField}) => ( | ||
<> | ||
<Space | ||
key={key} | ||
> | ||
<Form.Item | ||
{...restField} | ||
name={[name, 'name']} | ||
label={<FaTrash onClick={() => remove(name)}/>} | ||
rules={[{required: true, message: 'Pattern name is required.',},]} | ||
> | ||
<Input placeholder="Name"/> | ||
</Form.Item> | ||
<Form.Item | ||
{...restField} | ||
name={[name, 'value']} | ||
label="Regex" | ||
rules={[{required: true, message: 'Pattern value is required.',},]} | ||
> | ||
<Input placeholder="Value"/> | ||
</Form.Item> | ||
</Space> | ||
</> | ||
))} | ||
<Button type="dashed" onClick={() => add()} block> | ||
<Space> | ||
<FaPlus/> | ||
<Typography.Text>Add pattern</Typography.Text> | ||
</Space> | ||
</Button> | ||
</div> | ||
</> | ||
)} | ||
</Form.List> | ||
</> | ||
) | ||
} |