Fix some warnings.

This commit is contained in:
Philippe Pittoli 2025-05-03 16:45:27 +02:00
parent 9f4500481f
commit e36be137db
4 changed files with 17 additions and 24 deletions

View file

@ -21,7 +21,7 @@ import Web.HTML (window) as HTML
import Web.HTML.Window (sessionStorage) as Window import Web.HTML.Window (sessionStorage) as Window
import Web.Storage.Storage as Storage import Web.Storage.Storage as Storage
import Utils (attach_id, remove_id) import Utils (id, attach_id, remove_id)
import App.Validation.Email as Email import App.Validation.Email as Email
import App.Type.CAA as CAA import App.Type.CAA as CAA
@ -64,9 +64,6 @@ import App.Validation.DNS as Validation
type RRId = Int type RRId = Int
id :: forall a. a -> a
id x = x
-- | `App.Page.Zone` can send messages through websocket interface -- | `App.Page.Zone` can send messages through websocket interface
-- | connected to dnsmanagerd. See `App.WS`. -- | connected to dnsmanagerd. See `App.WS`.
-- | -- |

View file

@ -7,7 +7,7 @@ module App.Templates.Table
, display_mechanisms , display_mechanisms
) where ) where
import Prelude import Prelude (comparing, map, not, show, (#), ($), (&&), (<<<), (<>), (==), (>))
import CSSClasses as C import CSSClasses as C
@ -15,7 +15,7 @@ import Data.Array.NonEmpty as NonEmpty
import Data.Array as A import Data.Array as A
import Data.Maybe (Maybe(..), fromMaybe, maybe) import Data.Maybe (Maybe(..), fromMaybe, maybe)
import Data.Tuple import Data.Tuple (Tuple(..))
import Style as Style import Style as Style
import Style.Button as Button import Style.Button as Button
@ -23,23 +23,17 @@ import Bulma as Bulma
import Halogen.HTML as HH import Halogen.HTML as HH
import Halogen.HTML.Properties as HP import Halogen.HTML.Properties as HP
import Data.String.CodePoints as CP import Data.String.CodePoints as CP
import Utils (attach_id, remove_id) import Utils (id, attach_id)
import App.Type.DMARC as DMARC import App.Type.DMARC as DMARC
import App.Type.ResourceRecord (ResourceRecord, emptyRR import App.Type.ResourceRecord (ResourceRecord
, show_qualifier, show_qualifier_char , show_mechanism, show_mechanism_type
, show_mechanism_type, show_mechanism, to_mechanism , show_modifier, show_modifier_type
, show_modifier_type, show_modifier, to_modifier , show_qualifier, show_qualifier_char)
, qualifiers import App.Type.ResourceRecord (Mechanism, Modifier, Qualifier) as RR
, mechanism_types, qualifier_types, modifier_types)
import App.Type.ResourceRecord (Mechanism, Modifier, Qualifier(..), SRVProtocol(..)
, srv_protocols, srv_protocols_txt) as RR
import App.Type.DomainInfo (DomainInfo) import App.Type.DomainInfo (DomainInfo)
id :: forall a. a -> a
id x = x
txt_name :: forall w i. String -> HH.HTML w i txt_name :: forall w i. String -> HH.HTML w i
txt_name t txt_name t
= HH.td [ rr_name_style ] [ rr_name_text ] = HH.td [ rr_name_style ] [ rr_name_text ]
@ -526,7 +520,7 @@ display_mechanisms action_remove_mechanism ms =
, HH.td_ [ Style.p m.v ] , HH.td_ [ Style.p m.v ]
, HH.td_ [ Button.alert_btn "x" (action_remove_mechanism i) ] , HH.td_ [ Button.alert_btn "x" (action_remove_mechanism i) ]
] ]
mechanism_table_header :: forall w i. HH.HTML w i mechanism_table_header :: HH.HTML w i
mechanism_table_header mechanism_table_header
= HH.thead_ [ HH.tr_ [ HH.th_ [ HH.text "Policy" ] = HH.thead_ [ HH.tr_ [ HH.th_ [ HH.text "Policy" ]
, HH.th_ [ HH.text "Type" ] , HH.th_ [ HH.text "Type" ]
@ -546,7 +540,7 @@ display_modifiers action_remove_modifier ms =
, HH.td_ [ Style.p m.v ] , HH.td_ [ Style.p m.v ]
, HH.td_ [ Button.alert_btn "x" (action_remove_modifier i) ] , HH.td_ [ Button.alert_btn "x" (action_remove_modifier i) ]
] ]
modifier_table_header :: forall w i. HH.HTML w i modifier_table_header :: HH.HTML w i
modifier_table_header modifier_table_header
= HH.thead_ [ HH.tr_ [ HH.th_ [ HH.text "Type" ] = HH.thead_ [ HH.tr_ [ HH.th_ [ HH.text "Type" ]
, HH.th_ [ HH.text "Value" ] , HH.th_ [ HH.text "Value" ]
@ -564,7 +558,7 @@ display_dmarc_mail_addresses f ms =
, HH.td_ [ Style.p $ maybe "(no size limit)" show m.limit ] , HH.td_ [ Style.p $ maybe "(no size limit)" show m.limit ]
, HH.td_ [ Button.alert_btn "x" (f i) ] , HH.td_ [ Button.alert_btn "x" (f i) ]
] ]
dmarc_dmarcuri_table_header :: forall w i. HH.HTML w i dmarc_dmarcuri_table_header :: HH.HTML w i
dmarc_dmarcuri_table_header dmarc_dmarcuri_table_header
= HH.thead_ [ HH.tr_ [ HH.th_ [ HH.text "Email address" ] = HH.thead_ [ HH.tr_ [ HH.th_ [ HH.text "Email address" ]
, HH.th_ [ HH.text "Report size limit" ] , HH.th_ [ HH.text "Report size limit" ]

View file

@ -23,6 +23,8 @@ import App.Type.DKIM as DKIM
import App.Type.DMARC as DMARC import App.Type.DMARC as DMARC
import App.Type.CAA as CAA import App.Type.CAA as CAA
import Utils (id)
-- | **History:** -- | **History:**
-- | The module once used dedicated types for each type of RR. -- | The module once used dedicated types for each type of RR.
-- | That comes with several advantages. -- | That comes with several advantages.
@ -349,6 +351,3 @@ validation entry = case entry.rrtype of
"DKIM" -> toEither $ validationDKIM entry "DKIM" -> toEither $ validationDKIM entry
"DMARC" -> toEither $ validationDMARC entry "DMARC" -> toEither $ validationDMARC entry
_ -> toEither $ invalid [UNKNOWN] _ -> toEither $ invalid [UNKNOWN]
id :: forall a. a -> a
id x = x

View file

@ -18,3 +18,6 @@ remove_id i arr = case A.head arr of
then remove_id i (fromMaybe [] $ A.tail arr) then remove_id i (fromMaybe [] $ A.tail arr)
else [x] <> remove_id i (fromMaybe [] $ A.tail arr) else [x] <> remove_id i (fromMaybe [] $ A.tail arr)
Nothing -> [] Nothing -> []
id :: forall a. a -> a
id x = x