Forráskód Böngészése

Update high level code to new type UIString

jherve 1 éve
szülő
commit
2fff08f1fb

+ 4 - 4
src/LinkedIn/Jobs/JobOffer.purs

@@ -10,7 +10,7 @@ import Data.Show.Generic (genericShow)
 import LinkedIn.DetachedNode (DetachedNode)
 import LinkedIn.JobsUnifiedTopCard (JobsUnifiedTopCardElement, toHeader, toPrimaryDescriptionLink, toPrimaryDescriptionText)
 import LinkedIn.Profile.Utils (toUIElement)
-import LinkedIn.UIElements.Types (UIElement(..))
+import LinkedIn.UIElements.Types (UIElement(..), UIString(..))
 
 data JobOffer = JobOffer {
   title :: String,
@@ -39,12 +39,12 @@ fromUI card = ado
 
 extractTitle :: UIElement -> Maybe String
 extractTitle = case _ of
-  UIPlainText str -> Just str
+  UIElement (UIStringPlain str) -> Just str
   _ -> Nothing
 
 extractCompany :: UIElement -> Maybe String
 extractCompany = case _ of
-  UILink _ (UIPlainText str) -> Just str
+  UILink _ (UIStringPlain str) -> Just str
   _ -> Nothing
 
 extractCompanyLink :: UIElement -> Maybe String
@@ -54,5 +54,5 @@ extractCompanyLink = case _ of
 
 extractLocation :: UIElement -> Maybe String
 extractLocation = case _ of
-  UIDotSeparated _ (UIPlainText str) -> Just str
+  UIElement (UIStringDotSeparated _ (UIStringPlain str)) -> Just str
   _ -> Nothing

+ 6 - 6
src/LinkedIn/Profile/Project.purs

@@ -7,10 +7,10 @@ import Data.Foldable (findMap)
 import Data.Generic.Rep (class Generic)
 import Data.Maybe (Maybe(..))
 import Data.Show.Generic (genericShow)
-import LinkedIn.DetachedNode (DetachedNode)
 import LinkedIn.ArtDecoCard (ArtDecoCardElement, toCenterContent, toHeaderBold, toHeaderNormal)
+import LinkedIn.DetachedNode (DetachedNode)
 import LinkedIn.Profile.Utils (maybeExtractFromMaybe, maybeGetInList, toUIElement)
-import LinkedIn.UIElements.Types (TimeSpan, UIElement(..))
+import LinkedIn.UIElements.Types (TimeSpan, UIElement(..), UIString(..))
 
 data Project = Project {
   name :: String,
@@ -39,16 +39,16 @@ fromUI card = ado
 
 extractName :: UIElement -> Maybe String
 extractName = case _ of
-  UIPlainText str -> Just str
+  UIElement (UIStringPlain str) -> Just str
   _ -> Nothing
 
 extractTimeSpan ∷ UIElement → Maybe TimeSpan
 extractTimeSpan = case _ of
-  UITimeSpan s -> Just s
-  UIDotSeparated (UITimeSpan s) _ -> Just s
+  UIElement (UIStringTimeSpan s) -> Just s
+  UIElement (UIStringDotSeparated (UIStringTimeSpan s) _) -> Just s
   _ -> Nothing
 
 extractDescription ∷ UIElement → Maybe String
 extractDescription = case _ of
-  UIPlainText d -> Just d
+  UIElement (UIStringPlain d) -> Just d
   _ -> Nothing

+ 3 - 3
src/LinkedIn/Profile/Skill.purs

@@ -7,10 +7,10 @@ import Data.Foldable (findMap)
 import Data.Generic.Rep (class Generic)
 import Data.Maybe (Maybe(..))
 import Data.Show.Generic (genericShow)
-import LinkedIn.DetachedNode (DetachedNode)
 import LinkedIn.ArtDecoTab (ArtDecoTabElement, toHeaderBold)
+import LinkedIn.DetachedNode (DetachedNode)
 import LinkedIn.Profile.Utils (toUIElement)
-import LinkedIn.UIElements.Types (UIElement(..))
+import LinkedIn.UIElements.Types (UIElement(..), UIString(..))
 
 data Skill = Skill {
   name :: String
@@ -31,5 +31,5 @@ fromUI (tab) = ado
 
 extractName :: UIElement -> Maybe String
 extractName = case _ of
-  UIPlainText str -> Just str
+  UIElement (UIStringPlain str) -> Just str
   _ -> Nothing

+ 10 - 10
src/LinkedIn/Profile/WorkExperience.purs

@@ -7,10 +7,10 @@ import Data.Foldable (findMap)
 import Data.Generic.Rep (class Generic)
 import Data.Maybe (Maybe(..))
 import Data.Show.Generic (genericShow)
-import LinkedIn.DetachedNode (DetachedNode)
 import LinkedIn.ArtDecoCard (ArtDecoCardElement, toCenterContent, toHeaderBold, toHeaderLight, toHeaderNormal)
+import LinkedIn.DetachedNode (DetachedNode)
 import LinkedIn.Profile.Utils (maybeExtractFromMaybe, maybeFindInMaybeNEL, maybeGetInList, toUIElement)
-import LinkedIn.UIElements.Types (Duration, TimeSpan, UIElement(..))
+import LinkedIn.UIElements.Types (Duration, TimeSpan, UIElement(..), UIString(..))
 
 data WorkExperience = WorkExperience {
   position :: String,
@@ -47,32 +47,32 @@ fromUI (card) = ado
 
 extractPosition :: UIElement -> Maybe String
 extractPosition = case _ of
-  UIPlainText str -> Just str
+  UIElement (UIStringPlain str) -> Just str
   _ -> Nothing
 
 extractCompany ∷ UIElement → Maybe String
 extractCompany = case _ of
-  UIPlainText str -> Just str
-  UIDotSeparated (UIPlainText str) _ -> Just str
+  UIElement (UIStringPlain str) -> Just str
+  UIElement (UIStringDotSeparated (UIStringPlain str) _) -> Just str
   _ -> Nothing
 
 extractContractType ∷ UIElement → Maybe String
 extractContractType = case _ of
-  UIDotSeparated _ (UIPlainText str) -> Just str
+  UIElement (UIStringDotSeparated _ (UIStringPlain str)) -> Just str
   _ -> Nothing
 
 extractTimeSpan ∷ UIElement → Maybe TimeSpan
 extractTimeSpan = case _ of
-  UITimeSpan s -> Just s
-  UIDotSeparated (UITimeSpan s) _ -> Just s
+  UIElement (UIStringTimeSpan s) -> Just s
+  UIElement (UIStringDotSeparated (UIStringTimeSpan s) _) -> Just s
   _ -> Nothing
 
 extractDuration ∷ UIElement → Maybe Duration
 extractDuration = case _ of
-  UIDotSeparated _ (UIDuration d) -> Just d
+  UIElement (UIStringDotSeparated _ (UIStringDuration d)) -> Just d
   _ -> Nothing
 
 extractDescription ∷ UIElement → Maybe String
 extractDescription = case _ of
-  UIPlainText d -> Just d
+  UIElement (UIStringPlain d) -> Just d
   _ -> Nothing