-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Create new WebHookSettingsManager - Convert uses of ProjectSettingsManager to WebHookSettingsManager. - Add support for showing webhook count on Templates list page. - Prevent template from being deleted if in use. - Show context relevant information in Template delete dialog. - Update to Java8 and new versions of spring-core and teamcity (10.0) - Remove reference to payload format where applicable - Now supports project ID search - Hover state on table rows. - Handle 403 errors from API. - Fix up template names, and tidy up display beans. - Add enabled/disabled tag - Add tags for headers, filters, parameters. - Add show=all, and unfiltered result count. - Add webhook count and link to admin tab. - Add support for displaying tags and generalisedUrl. - Add buildType search - Only show full URL if permissioned. - Show tags in Tags column. - Add ability to search with buildTypeId=<externalBuildTypeId>
- Loading branch information
Showing
21 changed files
with
577 additions
and
434 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
/.classpath | ||
/.project | ||
/.settings | ||
/bin | ||
/.apt_generated_tests/ | ||
/bin |
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
24 changes: 24 additions & 0 deletions
24
...-api-legacy/src/main/java/webhook/teamcity/server/rest/errors/TemplateInUseException.java
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 @@ | ||
package webhook.teamcity.server.rest.errors; | ||
|
||
import webhook.teamcity.server.rest.model.template.ErrorResult; | ||
|
||
public class TemplateInUseException extends RuntimeException { | ||
|
||
private static final long serialVersionUID = 1062265324610559830L; | ||
private final ErrorResult result; | ||
|
||
public TemplateInUseException(String message, ErrorResult result) { | ||
super(message); | ||
this.result = result; | ||
} | ||
|
||
public TemplateInUseException(String message, Throwable cause, ErrorResult result) { | ||
super(message, cause); | ||
this.result = result; | ||
} | ||
|
||
public ErrorResult getResult() { | ||
return result; | ||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
...egacy/src/main/java/webhook/teamcity/server/rest/errors/TemplateInUseExceptionMapper.java
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,18 @@ | ||
package webhook.teamcity.server.rest.errors; | ||
|
||
import javax.ws.rs.core.Response; | ||
import javax.ws.rs.ext.ExceptionMapper; | ||
import javax.ws.rs.ext.Provider; | ||
|
||
import jetbrains.buildServer.server.rest.jersey.ExceptionMapperUtil; | ||
|
||
@Provider | ||
public class TemplateInUseExceptionMapper extends ExceptionMapperUtil implements ExceptionMapper<TemplateInUseException> { | ||
|
||
public Response toResponse(TemplateInUseException exception) { | ||
Response.ResponseBuilder builder = Response.status(409); | ||
builder.entity(exception.getResult()); | ||
return builder.build(); | ||
} | ||
} | ||
|
46 changes: 46 additions & 0 deletions
46
...acy/src/main/java/webhook/teamcity/server/rest/jersey/WebHookSettingsManagerProvider.java
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,46 @@ | ||
package webhook.teamcity.server.rest.jersey; | ||
|
||
import java.lang.reflect.Type; | ||
|
||
import javax.ws.rs.core.Context; | ||
import javax.ws.rs.ext.Provider; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
import com.sun.jersey.core.spi.component.ComponentContext; | ||
import com.sun.jersey.core.spi.component.ComponentScope; | ||
import com.sun.jersey.spi.inject.Injectable; | ||
import com.sun.jersey.spi.inject.InjectableProvider; | ||
|
||
import webhook.teamcity.settings.WebHookSettingsManager; | ||
|
||
@Provider | ||
public class WebHookSettingsManagerProvider implements InjectableProvider<Context, Type>, Injectable<WebHookSettingsManager> { | ||
private final WebHookSettingsManager webHookSettingsManager; | ||
|
||
/** | ||
* Injected by Spring | ||
* @param webHookSettingsManager | ||
*/ | ||
public WebHookSettingsManagerProvider( | ||
@NotNull final WebHookSettingsManager webHookSettingsManager | ||
) { | ||
this.webHookSettingsManager = webHookSettingsManager; | ||
} | ||
|
||
public ComponentScope getScope() { | ||
return ComponentScope.Singleton; | ||
} | ||
|
||
public Injectable<WebHookSettingsManager> getInjectable(final ComponentContext ic, final Context context, final Type type) { | ||
if (type.equals(WebHookSettingsManager.class)) { | ||
return this; | ||
} | ||
return null; | ||
} | ||
|
||
public WebHookSettingsManager getValue() { | ||
return webHookSettingsManager; | ||
} | ||
|
||
} |
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
62 changes: 31 additions & 31 deletions
62
...t-api-legacy/src/main/java/webhook/teamcity/server/rest/model/webhook/CustomTemplate.java
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 |
---|---|---|
@@ -1,31 +1,31 @@ | ||
package webhook.teamcity.server.rest.model.webhook; | ||
|
||
import javax.xml.bind.annotation.XmlAttribute; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
|
||
/* | ||
* <custom-template type="buildStatusHtml" template="${branchDisplayName} ${projectId}" enabled="true"/> | ||
*/ | ||
|
||
@XmlRootElement(name="custom-template") | ||
public class CustomTemplate { | ||
private String type; | ||
private String template; | ||
private Boolean enabled; | ||
|
||
@XmlAttribute | ||
public String getType() { | ||
return type; | ||
} | ||
|
||
@XmlAttribute | ||
public String getTemplate() { | ||
return template; | ||
} | ||
|
||
@XmlAttribute | ||
public Boolean getEnabled() { | ||
return enabled; | ||
} | ||
|
||
} | ||
package webhook.teamcity.server.rest.model.webhook; | ||
|
||
import javax.xml.bind.annotation.XmlAttribute; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
|
||
/* | ||
* <custom-template type="buildStatusHtml" template="${branchDisplayName} ${projectId}" enabled="true"/> | ||
*/ | ||
|
||
@XmlRootElement(name="customTemplate") | ||
public class CustomTemplate { | ||
private String type; | ||
private String template; | ||
private Boolean enabled; | ||
|
||
@XmlAttribute | ||
public String getType() { | ||
return type; | ||
} | ||
|
||
@XmlAttribute | ||
public String getTemplate() { | ||
return template; | ||
} | ||
|
||
@XmlAttribute | ||
public Boolean getEnabled() { | ||
return enabled; | ||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
...acy/src/main/java/webhook/teamcity/server/rest/model/webhook/ProjectWebHookBuildType.java
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,31 @@ | ||
package webhook.teamcity.server.rest.model.webhook; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlAttribute; | ||
import javax.xml.bind.annotation.XmlElement; | ||
import javax.xml.bind.annotation.XmlElementWrapper; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
import java.util.Collection; | ||
|
||
@XmlRootElement(name="buildType") | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@XmlAccessorType(XmlAccessType.FIELD) | ||
@Getter @Setter | ||
public class ProjectWebHookBuildType { | ||
|
||
@XmlAttribute | ||
private Boolean allEnabled; | ||
|
||
@XmlAttribute | ||
private Boolean subProjectsEnabled; | ||
|
||
@XmlElement(name = "id") @XmlElementWrapper(name = "enabledBuildTypes") | ||
private Collection<String> enabledBuildTypes; | ||
} |
Oops, something went wrong.