Add CLOSED ticket resolution
This is a neutral resolution picked by default when the user doesn't need/want to select a more precise resolution.
This commit is contained in:
parent
75add26e2f
commit
c4bfcd1ff7
|
@ -101,6 +101,7 @@ type TicketResolution string
|
|||
|
||||
const (
|
||||
TicketResolutionUnresolved TicketResolution = "UNRESOLVED"
|
||||
TicketResolutionClosed TicketResolution = "CLOSED"
|
||||
TicketResolutionFixed TicketResolution = "FIXED"
|
||||
TicketResolutionImplemented TicketResolution = "IMPLEMENTED"
|
||||
TicketResolutionWontFix TicketResolution = "WONT_FIX"
|
||||
|
@ -112,6 +113,7 @@ const (
|
|||
|
||||
var AllTicketResolution = []TicketResolution{
|
||||
TicketResolutionUnresolved,
|
||||
TicketResolutionClosed,
|
||||
TicketResolutionFixed,
|
||||
TicketResolutionImplemented,
|
||||
TicketResolutionWontFix,
|
||||
|
@ -123,7 +125,7 @@ var AllTicketResolution = []TicketResolution{
|
|||
|
||||
func (e TicketResolution) IsValid() bool {
|
||||
switch e {
|
||||
case TicketResolutionUnresolved, TicketResolutionFixed, TicketResolutionImplemented, TicketResolutionWontFix, TicketResolutionByDesign, TicketResolutionInvalid, TicketResolutionDuplicate, TicketResolutionNotOurBug:
|
||||
case TicketResolutionUnresolved, TicketResolutionClosed, TicketResolutionFixed, TicketResolutionImplemented, TicketResolutionWontFix, TicketResolutionByDesign, TicketResolutionInvalid, TicketResolutionDuplicate, TicketResolutionNotOurBug:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
@ -159,6 +161,7 @@ const (
|
|||
RESOLVED_INVALID = 16
|
||||
RESOLVED_DUPLICATE = 32
|
||||
RESOLVED_NOT_OUR_BUG = 64
|
||||
RESOLVED_CLOSED = 128
|
||||
)
|
||||
|
||||
// Creates a TicketResolution from its database representation
|
||||
|
@ -180,6 +183,8 @@ func TicketResolutionFromInt(resolution int) TicketResolution {
|
|||
return TicketResolutionDuplicate
|
||||
case RESOLVED_NOT_OUR_BUG:
|
||||
return TicketResolutionNotOurBug
|
||||
case RESOLVED_CLOSED:
|
||||
return TicketResolutionClosed
|
||||
default:
|
||||
panic("database invariant broken")
|
||||
}
|
||||
|
@ -204,6 +209,8 @@ func (e TicketResolution) ToInt() int {
|
|||
return RESOLVED_DUPLICATE
|
||||
case TicketResolutionNotOurBug:
|
||||
return RESOLVED_NOT_OUR_BUG
|
||||
case TicketResolutionClosed:
|
||||
return RESOLVED_CLOSED
|
||||
default:
|
||||
panic("Invalid TicketResolution")
|
||||
}
|
||||
|
|
|
@ -299,6 +299,7 @@ enum TicketStatus {
|
|||
|
||||
enum TicketResolution {
|
||||
UNRESOLVED
|
||||
CLOSED
|
||||
FIXED
|
||||
IMPLEMENTED
|
||||
WONT_FIX
|
||||
|
|
|
@ -389,6 +389,8 @@ func mkResolution(res *int) *string {
|
|||
switch *res {
|
||||
case model.RESOLVED_UNRESOLVED:
|
||||
r = "unresolved"
|
||||
case model.RESOLVED_CLOSED:
|
||||
r = "closed"
|
||||
case model.RESOLVED_FIXED:
|
||||
r = "fixed"
|
||||
case model.RESOLVED_IMPLEMENTED:
|
||||
|
|
|
@ -440,7 +440,10 @@
|
|||
<select class="form-control" name="resolution">
|
||||
{% for r in TicketResolution %}
|
||||
{% if r.name != "unresolved" %}
|
||||
<option value="{{ r.value }}">{{ r.name.upper() }}</option>
|
||||
<option
|
||||
value="{{ r.value }}"
|
||||
{% if r.name == "closed" %}selected{% endif %}
|
||||
>{{ r.name.upper() }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
|
|
@ -16,6 +16,7 @@ class TicketResolution(IntFlag):
|
|||
invalid = 16
|
||||
duplicate = 32
|
||||
not_our_bug = 64
|
||||
closed = 128
|
||||
|
||||
class TicketAuthenticity(Enum):
|
||||
authentic = 0
|
||||
|
|
Loading…
Reference in New Issue