@Override
 protected Form fill(Form form, NamedBuildFilterData data) {
   return form.fill("count", data.getCount())
       .fill("fromBuild", data.getFromBuild())
       .fill("toBuild", data.getToBuild())
       .fill("withPromotionLevel", data.getWithPromotionLevel());
 }
 @Override
 public Form getEditionForm(ProjectEntity entity, AutoPromotionProperty value) {
   PromotionLevel promotionLevel = (PromotionLevel) entity;
   return Form.create()
       .with(
           MultiSelection.of("validationStamps")
               .label("Validation stamps")
               .items(
                   structureService
                       .getValidationStampListForBranch(promotionLevel.getBranch().getId())
                       .stream()
                       .map(
                           vs ->
                               new ValidationStampSelection(
                                   vs, value != null && value.containsDirectValidationStamp(vs)))
                       .collect(Collectors.toList()))
               .help(
                   "When all the selected validation stamps have passed for a build, the promotion will automatically be granted."))
       .with(
           Text.of("include")
               .label("Include")
               .optional()
               .value(value != null ? value.getInclude() : "")
               .help("Regular expression to select validation stamps by name"))
       .with(
           Text.of("exclude")
               .label("Exclude")
               .optional()
               .value(value != null ? value.getExclude() : "")
               .help("Regular expression to exclude validation stamps by name"));
 }
 @Override
 public Form getEditionForm(ProjectEntity entity, LinkProperty value) {
   return Form.create()
       .with(
           NamedEntries.of("links")
               .label("List of links")
               .nameLabel("Name")
               .valueLabel("Link")
               .nameOptional()
               .addText("Add a link")
               .help("List of links associated with a name.")
               .value(value != null ? value.getLinks() : Collections.emptyList()));
 }
 @Override
 protected Form blankForm(ID branchId) {
   // Promotion levels for this branch
   List<PromotionLevel> promotionLevels =
       structureService.getPromotionLevelListForBranch(branchId);
   // Form
   return Form.create()
       .with(
           Int.of("count")
               .label("Maximum count")
               .help("Maximum number of builds to display")
               .min(1)
               .value(10))
       .with(
           Text.of("fromBuild")
               .label("From build")
               .help(
                   "Expression to identify a list of build. Only the most recent one is kept. "
                       + "* (star) can be used as a placeholder."))
       .with(
           Text.of("toBuild")
               .label("To build")
               .optional()
               .help(
                   "Optional expression to identify a list of build. Only the most recent one is kept. "
                       + "If unset, the first build that does not comply with the \"from build\" expression is kept by default. "
                       + "* (star) can be used as a placeholder."))
       .with(
           Selection.of("withPromotionLevel")
               .label("With promotion level")
               .help(
                   "Optional. If set, restrict both \"from\" and \"to\" list to the builds with a promotion level.")
               .items(promotionLevels)
               .itemId("name")
               .optional());
 }
 @Override
 public Form getEditionForm(ProjectEntity entity, TestProperty value) {
   return Form.create()
       .with(Text.of("value").label("Value").value(value != null ? value.getValue() : ""));
 }
Exemple #6
0
 public static Form form() {
   return Form.nameAndDescription()
       .with(
           YesNo.of("disabled").label("Disabled").help("Check if the project must be disabled."));
 }