-
Notifications
You must be signed in to change notification settings - Fork 413
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIXED JENKINS-30559] Dropdown list to select commit info for notific…
…ations Convert existing checkbox "Show Commit List with Title and Authors" into a dropdown list with the following options: - nothing about commits - commit list with authors only - commit list with authors and titles This list can be easily extended with new options.
- Loading branch information
Showing
5 changed files
with
86 additions
and
14 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
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,61 @@ | ||
package jenkins.plugins.slack; | ||
|
||
public enum CommitInfoChoice { | ||
NONE("nothing about commits") { | ||
@Override | ||
public boolean showAuthor() { | ||
return false; | ||
} | ||
@Override | ||
public boolean showTitle() { | ||
return false; | ||
} | ||
}, | ||
|
||
AUTHORS("commit list with authors only") { | ||
@Override | ||
public boolean showAuthor() { | ||
return true; | ||
} | ||
@Override | ||
public boolean showTitle() { | ||
return false; | ||
} | ||
}, | ||
|
||
AUTHORS_AND_TITLES("commit list with authors and titles") { | ||
@Override | ||
public boolean showAuthor() { | ||
return true; | ||
} | ||
@Override | ||
public boolean showTitle() { | ||
return true; | ||
} | ||
}; | ||
|
||
private final String displayName; | ||
|
||
private CommitInfoChoice(String displayName) { | ||
this.displayName = displayName; | ||
} | ||
|
||
public abstract boolean showAuthor(); | ||
public abstract boolean showTitle(); | ||
public boolean showAnything() { | ||
return showAuthor() || showTitle(); | ||
} | ||
|
||
public String getDisplayName() { | ||
return this.displayName; | ||
} | ||
|
||
public static CommitInfoChoice forDisplayName(String displayName) { | ||
for (CommitInfoChoice commitInfoChoice : values()) { | ||
if (commitInfoChoice.getDisplayName().equals(displayName)) { | ||
return commitInfoChoice; | ||
} | ||
} | ||
return null; | ||
} | ||
} |
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
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
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