Skip to content

Commit

Permalink
#1275 Properties forms
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoraboeuf committed Jun 2, 2024
1 parent 284b8e7 commit 537e684
Show file tree
Hide file tree
Showing 7 changed files with 186 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
import java.util.Set;
import java.util.function.Function;

/**
* No longer used.
*/
@Component
@Deprecated
public class AutoPromotionLevelPropertyType extends AbstractPropertyType<AutoPromotionLevelProperty>
implements PromotionLevelPropertyType<AutoPromotionLevelProperty> {

Expand Down Expand Up @@ -50,10 +46,10 @@ public Optional<PromotionLevel> getOrCreatePromotionLevel(AutoPromotionLevelProp
// Creates the promotion level
return Optional.of(
securityService.asAdmin(() ->
structureService.newPromotionLevelFromPredefined(
branch,
oPredefinedPromotionLevel.get()
)
structureService.newPromotionLevelFromPredefined(
branch,
oPredefinedPromotionLevel.get()
)
)
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import {Form, Input, InputNumber} from "antd";
import {prefixedFormName} from "@components/form/formUtils";

export default function PropertyForm({prefix}) {

return (
<>
<Form.Item
label="Configuration"
extra="Reference to the Artifactory configuration"
name={prefixedFormName(prefix, 'configuration')}
rules={[{required: true, message: 'Configuration is required.'}]}
>
<Input/>
</Form.Item>
<Form.Item
label="Build name"
extra="Artifactory build name"
name={prefixedFormName(prefix, 'buildName')}
rules={[{required: true, message: 'Build name is required.'}]}
>
<Input/>
</Form.Item>
<Form.Item
label="Build name filter"
extra="Artifactory build name filter"
name={prefixedFormName(prefix, 'buildNameFilter')}
rules={[{required: true, message: 'Build name filter is required.'}]}
>
<Input/>
</Form.Item>
<Form.Item
label="Interval"
extra="Interval between each synchronisation in minutes"
name={prefixedFormName(prefix, 'interval')}
rules={[{required: true, message: 'Interval is required.'}]}
>
<InputNumber/>
</Form.Item>
</>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import TimestampText from "@components/common/TimestampText";
export default function Display({property}) {
return (
<Descriptions
column={12}
items={[
{
key: 'branchIncludes',
Expand All @@ -13,6 +14,7 @@ export default function Display({property}) {
<Tag key={pattern}>{pattern}</Tag>
</>
)),
span: 12,
},
{
key: 'branchExcludes',
Expand All @@ -22,6 +24,7 @@ export default function Display({property}) {
<Tag key={pattern}>{pattern}</Tag>
</>
)),
span: 12,
},
{
key: 'lastActivityDate',
Expand All @@ -32,6 +35,7 @@ export default function Display({property}) {
<Typography.Text type="secondary" italic>None</Typography.Text>
}
/>,
span: 12,
},
]}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import {DatePicker, Form, Input, InputNumber, Select} from "antd";
import {prefixedFormName} from "@components/form/formUtils";

export default function PropertyForm({prefix}) {

return (
<>
<Form.Item
label="Including branches"
extra="List of regular expressions. AV requests match if at least one regular expression is matched by the target branch name. If empty, all target branches match (the default)."
name={prefixedFormName(prefix, 'branchIncludes')}
>
<Select
mode="tags"
style={{width: '100%'}}
placeholder="Enter a list of regular expressions"
/>
</Form.Item>
<Form.Item
label="Excluding branches"
extra="List of regular expressions. AV requests match if no regular expression is matched by the target branch name. If empty, the target branch is considered matching."
name={prefixedFormName(prefix, 'branchExcludes')}
>
<Select
mode="tags"
style={{width: '100%'}}
placeholder="Enter a list of regular expressions"
/>
</Form.Item>
<Form.Item
label="Last activity date"
extra="If defined, any target branch whose last activity (last build creation) is before this date will be ignored by the auto-versioning"
name={prefixedFormName(prefix, 'lastActivityDate')}
>
<DatePicker showTime/>
</Form.Item>
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import {Form, Input, InputNumber} from "antd";
import {prefixedFormName} from "@components/form/formUtils";

export default function PropertyForm({prefix}) {

return (
<>
<Form.Item
label="Configuration"
extra="Name of the Bitbucket Cloud configuration"
name={prefixedFormName(prefix, 'configuration')}
rules={[{required: true, message: 'Configuration is required.'}]}
>
<Input/>
</Form.Item>
<Form.Item
label="Repository"
extra="Name of the repository"
name={prefixedFormName(prefix, 'repository')}
rules={[{required: true, message: 'Repository name is required.'}]}
>
<Input/>
</Form.Item>
<Form.Item
label="Indexation interval"
extra="How often to index the repository, in minutes. Use 0 to disable indexation"
name={prefixedFormName(prefix, 'indexationInterval')}
>
<InputNumber/>
</Form.Item>
<Form.Item
label="Issue service"
extra="Identifier for the issue service"
name={prefixedFormName(prefix, 'issueServiceConfigurationIdentifier')}
>
<Input/>
</Form.Item>
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {Form, Switch} from "antd";
import {prefixedFormName} from "@components/form/formUtils";

export default function PropertyForm({prefix}) {

return (
<>
<Form.Item
label="Auto create"
extra="If set, allows promotion levels to be created automatically"
name={prefixedFormName(prefix, 'autoCreate')}
>
<Switch/>
</Form.Item>
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import {Form, Input} from "antd";
import {prefixedFormName} from "@components/form/formUtils";
import SelectMultipleValidationStampNames from "@components/validationStamps/SelectMultipleValidationStampNames";
import SelectMultiplePromotionLevelNames from "@components/promotionLevels/SelectMultiplePromotionLevelNames";

export default function PropertyForm({prefix}) {

return (
<>
<Form.Item
label="Validation stamps"
extra="List of validation stamps which trigger this promotion"
name={prefixedFormName(prefix, 'validationStamps')}
>
<SelectMultipleValidationStampNames/>
</Form.Item>
<Form.Item
label="Including"
extra="Regular expression to include validation stamps by name"
name={prefixedFormName(prefix, 'include')}
>
<Input/>
</Form.Item>
<Form.Item
label="Excluding"
extra="Regular expression to exclude validation stamps by name"
name={prefixedFormName(prefix, 'exclude')}
>
<Input/>
</Form.Item>
<Form.Item
label="Promotion levels"
extra="List of promotion levels which trigger this promotion"
name={prefixedFormName(prefix, 'promotionLevels')}
>
<SelectMultiplePromotionLevelNames/>
</Form.Item>
</>
)
}

0 comments on commit 537e684

Please sign in to comment.