mirror of
				https://github.com/TheAnachronism/docspell.git
				synced 2025-11-04 12:30:12 +00:00 
			
		
		
		
	Add a use colum to metadata entities
This commit is contained in:
		@@ -14,6 +14,7 @@ type PersonUse
 | 
			
		||||
    = Correspondent
 | 
			
		||||
    | Concerning
 | 
			
		||||
    | Both
 | 
			
		||||
    | Disabled
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
fromString : String -> Maybe PersonUse
 | 
			
		||||
@@ -28,6 +29,9 @@ fromString str =
 | 
			
		||||
        "both" ->
 | 
			
		||||
            Just Both
 | 
			
		||||
 | 
			
		||||
        "disabled" ->
 | 
			
		||||
            Just Disabled
 | 
			
		||||
 | 
			
		||||
        _ ->
 | 
			
		||||
            Nothing
 | 
			
		||||
 | 
			
		||||
@@ -44,6 +48,9 @@ asString pu =
 | 
			
		||||
        Both ->
 | 
			
		||||
            "both"
 | 
			
		||||
 | 
			
		||||
        Disabled ->
 | 
			
		||||
            "disabled"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
label : PersonUse -> String
 | 
			
		||||
label pu =
 | 
			
		||||
@@ -57,10 +64,13 @@ label pu =
 | 
			
		||||
        Both ->
 | 
			
		||||
            "Both"
 | 
			
		||||
 | 
			
		||||
        Disabled ->
 | 
			
		||||
            "Disabled"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
all : List PersonUse
 | 
			
		||||
all =
 | 
			
		||||
    [ Correspondent, Concerning, Both ]
 | 
			
		||||
    [ Correspondent, Concerning, Both, Disabled ]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
spanPersonList : List Person -> { concerning : List Person, correspondent : List Person }
 | 
			
		||||
@@ -86,5 +96,8 @@ spanPersonList input =
 | 
			
		||||
                        | correspondent = p :: res.correspondent
 | 
			
		||||
                        , concerning = p :: res.concerning
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                Disabled ->
 | 
			
		||||
                    res
 | 
			
		||||
    in
 | 
			
		||||
    List.foldl merge init input
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user