Skip to content

Commit

Permalink
Apply to dconf generation new metaEnabled/Disabled filter
Browse files Browse the repository at this point in the history
We are now ensuring that dconf is generating a different
enabled/disabled entry for its entries:
- enabled has default "empty" + "meta" entries
- disabled doesn’t need the empty entry, it will use system default
  which isn’t empty. Only file in "meta" then.

Co-authored-by: Jean-Baptiste Lallement <jean-baptiste@ubuntu.com>
  • Loading branch information
didrocks and jibel committed Jan 10, 2022
1 parent 5eca03e commit bff7f40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions internal/policies/ad/admxgen/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ type ExpandedPolicy struct {
DisplayName string
ExplainText string
ElementType WidgetType
Meta map[string]string
MetaEnabled map[string]string
MetaDisabled map[string]string
Class string `yaml:",omitempty"`
Meta map[string]string `yaml:",omitempty"`
MetaEnabled map[string]string `yaml:",omitempty"`
MetaDisabled map[string]string `yaml:",omitempty"`
Class string `yaml:",omitempty"`
Default string
Note string `yaml:",omitempty"`

Expand Down
5 changes: 4 additions & 1 deletion internal/policies/ad/admxgen/dconf/dconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,13 @@ func inflateToExpandedPolicies(policies []Policy, release, currentSessions strin
if len(s.Choices) > 0 {
ep.ElementType = common.WidgetTypeDropdownList
}
ep.Meta = map[string]string{
ep.MetaEnabled = map[string]string{
"meta": s.Type,
"empty": m.emptyValue,
}
ep.MetaDisabled = map[string]string{
"meta": s.Type,
}

if m.widgetType == common.WidgetTypeLongDecimal {
min := ep.RangeValues.Min
Expand Down

0 comments on commit bff7f40

Please sign in to comment.