Skip to content

Commit

Permalink
Use override attrs API to transition resource's attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhu committed Oct 13, 2017
1 parent f7a3515 commit 57da6e4
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,20 @@ func (transition *Transition) ConfigureQorResource(res resource.Resourcer) {
meta.Permission = roles.Deny(roles.Update, roles.Anyone).Deny(roles.Create, roles.Anyone)
}

res.IndexAttrs(res.IndexAttrs(), "-StateChangeLogs")
res.ShowAttrs(res.ShowAttrs(), "-StateChangeLogs", false)
res.NewAttrs(res.NewAttrs(), "-StateChangeLogs")
res.EditAttrs(res.EditAttrs(), "-StateChangeLogs")
res.OverrideIndexAttrs(func() {
res.IndexAttrs(res.IndexAttrs(), "-StateChangeLogs")
})

res.OverrideShowAttrs(func() {
res.ShowAttrs(res.ShowAttrs(), "-StateChangeLogs")
})

res.OverrideNewAttrs(func() {
res.NewAttrs(res.NewAttrs(), "-StateChangeLogs")
})

res.OverrideEditAttrs(func() {
res.EditAttrs(res.EditAttrs(), "-StateChangeLogs")
})
}
}

0 comments on commit 57da6e4

Please sign in to comment.