From 56080353d53a0db0d05d19f4c5d78dd987e5905c Mon Sep 17 00:00:00 2001 From: Richard Wilkes Date: Fri, 16 Aug 2024 15:01:44 -0700 Subject: [PATCH] Closes #877: Templates should show the library source columns --- .golangci.yml | 1 + ux/equipment_provider.go | 2 +- ux/notes_provider.go | 2 +- ux/skills_provider.go | 2 +- ux/spells_provider.go | 2 +- ux/traits_provider.go | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 0833751da..7ed384dee 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -101,3 +101,4 @@ issues: - "package-comments: should have a package comment" - "stdmethods: method MarshalJSON" - "stdmethods: method UnmarshalJSON" + - "SA1003: value of type bool cannot be used with binary.Write" diff --git a/ux/equipment_provider.go b/ux/equipment_provider.go index 0a3e88763..db87cff8a 100644 --- a/ux/equipment_provider.go +++ b/ux/equipment_provider.go @@ -202,7 +202,7 @@ func (p *equipmentProvider) ColumnIDs() []int { } columnIDs = append(columnIDs, gurps.EquipmentReferenceColumn) if p.forPage { - if entity := p.DataOwner().OwningEntity(); entity != nil && !entity.SheetSettings.HideSourceMismatch { + if entity := p.DataOwner().OwningEntity(); entity == nil || !entity.SheetSettings.HideSourceMismatch { columnIDs = append(columnIDs, gurps.EquipmentLibSrcColumn) } } diff --git a/ux/notes_provider.go b/ux/notes_provider.go index 7a62c5ed2..e1643b0e3 100644 --- a/ux/notes_provider.go +++ b/ux/notes_provider.go @@ -117,7 +117,7 @@ func (p *notesProvider) ColumnIDs() []int { gurps.NoteReferenceColumn, } if p.forPage { - if entity := p.DataOwner().OwningEntity(); entity != nil && !entity.SheetSettings.HideSourceMismatch { + if entity := p.DataOwner().OwningEntity(); entity == nil || !entity.SheetSettings.HideSourceMismatch { columnIDs = append(columnIDs, gurps.NoteLibSrcColumn) } } diff --git a/ux/skills_provider.go b/ux/skills_provider.go index 398fb6cb8..db92b5b88 100644 --- a/ux/skills_provider.go +++ b/ux/skills_provider.go @@ -158,7 +158,7 @@ func (p *skillsProvider) ColumnIDs() []int { } columnIDs = append(columnIDs, gurps.SkillReferenceColumn) if p.forPage { - if entity := p.DataOwner().OwningEntity(); entity != nil && !entity.SheetSettings.HideSourceMismatch { + if entity := p.DataOwner().OwningEntity(); entity == nil || !entity.SheetSettings.HideSourceMismatch { columnIDs = append(columnIDs, gurps.SkillLibSrcColumn) } } diff --git a/ux/spells_provider.go b/ux/spells_provider.go index f036a2118..2a1aae898 100644 --- a/ux/spells_provider.go +++ b/ux/spells_provider.go @@ -171,7 +171,7 @@ func (p *spellsProvider) ColumnIDs() []int { } columnIDs = append(columnIDs, gurps.SpellReferenceColumn) if p.forPage { - if entity := p.DataOwner().OwningEntity(); entity != nil && !entity.SheetSettings.HideSourceMismatch { + if entity := p.DataOwner().OwningEntity(); entity == nil || !entity.SheetSettings.HideSourceMismatch { columnIDs = append(columnIDs, gurps.SpellLibSrcColumn) } } diff --git a/ux/traits_provider.go b/ux/traits_provider.go index 1e6268844..263a781dc 100644 --- a/ux/traits_provider.go +++ b/ux/traits_provider.go @@ -157,7 +157,7 @@ func (p *traitsProvider) ColumnIDs() []int { } columnIDs = append(columnIDs, gurps.TraitReferenceColumn) if p.forPage { - if entity := p.DataOwner().OwningEntity(); entity != nil && !entity.SheetSettings.HideSourceMismatch { + if entity := p.DataOwner().OwningEntity(); entity == nil || !entity.SheetSettings.HideSourceMismatch { columnIDs = append(columnIDs, gurps.TraitLibSrcColumn) } }