Skip to content

Commit

Permalink
Merge pull request #34 from Zolon-DOL/2023-Changes
Browse files Browse the repository at this point in the history
2023 changes
  • Loading branch information
pbhatt17 authored May 12, 2023
2 parents 43b4f03 + deaa668 commit 103701e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Child Labor/countries_2016.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33942,7 +33942,7 @@ addressing-labor-exploitation-fishing-asean</Link>
<Labor_Unannounced_Inspections_Conducted>Yes</Labor_Unannounced_Inspections_Conducted>
<Labor_Complaint_Mechanism>Yes</Labor_Complaint_Mechanism>
<Labor_Referral_Mechanism>Yes</Labor_Referral_Mechanism>
<Labor_Inspectors_Intl_Standards>NO</Labor_Inspectors_Intl_Standards>
<Labor_Inspectors_Intl_Standards>No</Labor_Inspectors_Intl_Standards>
<Criminal_Investigations>Unknown</Criminal_Investigations>
<Criminal_Violations>Unknown</Criminal_Violations>
<Criminal_Prosecutions>Unknown</Criminal_Prosecutions>
Expand Down
19 changes: 13 additions & 6 deletions charts/AssesmentLevelParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,25 @@ class AssesmentLevelParser {

for country in goodsXML[kCountries][kCountry].all {
if let countryRegion = country["Region"].element?.text, !countryRegion.isEmpty {

if var enforcements = country["Enforcements"]["Labor_Inspectors_Intl_Standards"].element?.text, !enforcements.isEmpty {
var enforcementss = ""
if var enforcement = country["Enforcements"]["Labor_Inspectors_Intl_Standards"]["Territory"]["Enforcement"].element?.text {
enforcementss = enforcement
} else {
if var enforcements = country["Enforcements"]["Labor_Inspectors_Intl_Standards"].element?.text, !enforcements.isEmpty {
enforcementss = enforcements
}
}
if enforcementss.count > 0 {
if var currentSector = self.goodsSectors[countryRegion] as? Dictionary<String, Any> {
if var advancementInfo = currentSector[enforcements] as? Int {
if var advancementInfo = currentSector[enforcementss] as? Int {
advancementInfo += 1
currentSector[enforcements] = advancementInfo
currentSector[enforcementss] = advancementInfo
} else {
currentSector[enforcements] = 1
currentSector[enforcementss] = 1
}
self.goodsSectors[countryRegion] = currentSector
} else {
self.goodsSectors[countryRegion] = [enforcements : 1]
self.goodsSectors[countryRegion] = [enforcementss : 1]
}
}
}
Expand Down
17 changes: 13 additions & 4 deletions charts/AssesmentsPageViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,20 @@ class AssesmentsPageViewController: UIPageViewController {
if let regionAssesmentsDict = assesmentData[key] as? [String : Any] {
var chartSegments = [Segment]()
for assesmentKey in regionAssesmentsDict.keys {
let assesmentSegment = Segment.init(color: colorCodes[assesmentKey] ?? .gray, value: CGFloat(regionAssesmentsDict[assesmentKey] as! Int), title : assesmentKey, isFloatType: false)
chartSegments.append(assesmentSegment)
if !assesmentKey.contains("\n") {
let assesmentSegment = Segment.init(color: colorCodes[assesmentKey] ?? .gray, value: CGFloat(regionAssesmentsDict[assesmentKey] as! Int), title : assesmentKey, isFloatType: false)
chartSegments.append(assesmentSegment)
}

}
let chartDetails = AssesmentPageDetails(name: key, mainTitle: "Advancement Level for \(key)", index: index, chartData: chartSegments)
advancementsArr.append(chartDetails)
if screenType == .assesmentLevelByRegion {
let chartDetails = AssesmentPageDetails(name: key, mainTitle: "Advancement Level for \(key)", index: index, chartData: chartSegments)
advancementsArr.append(chartDetails)
} else if screenType == .newDVASCountries {
let chartDetails = AssesmentPageDetails(name: key, mainTitle: "Assessment Level for \(key)", index: index, chartData: chartSegments)
advancementsArr.append(chartDetails)
}

}
}

Expand Down

0 comments on commit 103701e

Please sign in to comment.