-
Notifications
You must be signed in to change notification settings - Fork 283
Feature/7087 statistic data local 7 day incidence/7687 UI 7 day local incidences #3003
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UA approved
…branch' into feature/7087-Statistic-data-local-7-day-incidence/7687-UI-7-day-local-incedences
}) | ||
} | ||
|
||
// mutating func save() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future: could be renamed to what is being save, save is a bit generic.
...NA/ENA/Source/Scenes/Home/Cells/Statistics/AddStatisticsCardView/AddStatisticsCardView.swift
Outdated
Show resolved
Hide resolved
...NA/ENA/Source/Scenes/Home/Cells/Statistics/AddStatisticsCardView/AddStatisticsCardView.swift
Outdated
Show resolved
Hide resolved
...NA/ENA/Source/Scenes/Home/Cells/Statistics/AddStatisticsCardView/AddStatisticsCardView.swift
Outdated
Show resolved
Hide resolved
...NA/ENA/Source/Scenes/Home/Cells/Statistics/AddStatisticsCardView/AddStatisticsCardView.swift
Show resolved
Hide resolved
@@ -1367,7 +1367,11 @@ enum AppStrings { | |||
|
|||
enum Statistics { | |||
static let error = NSLocalizedString("Statistics_LoadingError", comment: "") | |||
|
|||
enum AddCard { | |||
static let SevenDayIncidence = NSLocalizedString("Statistics_Add_SevenDayIncidence", comment: "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sevenDayIncidence
|
||
enum CreatedLocalStatisticsState { | ||
case empty // 0 | ||
case NotYetFull // 0 < number of local statistics cards < 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
notYetFull
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would ditch the whole state which can lead to complications if not updated correctly and create a computed var:
var canAddMore: Boo { return currentCount < threshold }
States are bad!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@whiskey we have 3 have three states o:
1- show only add button if there number of cards = 0
2- show both add and edit buttons when 0 < number < 5
3- disable add button but leave the edit button enabled when 5 < number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know the use case but don't think it's the best solution here because if I miss out to update the state after removing a cell, it might get corrupted. Let's leave it for now but I'd like to test out my 'computed approach' as well and see if this is easy to implement w/o any dependencies to the store
.
|
||
init( | ||
localStatisticsModel: AddLocalStatisticsModel, | ||
presentSelectStateList: @escaping (SelectValueViewModel) -> Void, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be presentFederalStatesList?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between a State and federalState ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A state can be a state in the app, so not to confuse the new developer, also it's "plural" States as is a list of FederalStates
init( | ||
localStatisticsModel: AddLocalStatisticsModel, | ||
presentSelectStateList: @escaping (SelectValueViewModel) -> Void, | ||
presentSelectDistrictList: @escaping (SelectValueViewModel) -> Void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be presentSelectDistrictsList?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor questions and tweaks. Happy to discuss my points.
let jsonData = try Data(contentsOf: jsonFileURL) | ||
self.allDistricts = try JSONDecoder().decode([DistrictElement].self, from: jsonData) | ||
} catch { | ||
Log.debug("Failed to read / parse district json", log: .ppac) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why no error then? It's more serious than just a debug
log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, need to discuss this with max
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I just mean logging the error as Log.error
instead of .debug
. Decoder errors are definitely worth noting!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log.debug("Failed to read / parse district json", log: .ppac) | |
Log.error("Failed to read / parse district json: \(error)", log: .ppac, error: error) |
error
should not contain any critical information and can be dumped in the logs
...NA/ENA/Source/Scenes/Home/Cells/Statistics/AddStatisticsCardView/AddStatisticsCardView.swift
Outdated
Show resolved
Hide resolved
...NA/ENA/Source/Scenes/Home/Cells/Statistics/AddStatisticsCardView/AddStatisticsCardView.swift
Outdated
Show resolved
Hide resolved
...NA/ENA/Source/Scenes/Home/Cells/Statistics/AddStatisticsCardView/AddStatisticsCardView.swift
Outdated
Show resolved
Hide resolved
src/xcode/ENA/ENA/Source/Scenes/SelectValueViewController/SelectValueTableViewController.swift
Outdated
Show resolved
Hide resolved
|
||
enum AddCard { | ||
static let SevenDayIncidence = NSLocalizedString("Statistics_Add_SevenDayIncidence", comment: "") | ||
static let fromTheWholeCountry = NSLocalizedString("Statistics_Add_fromTheWholeCountry", comment: "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering, what is the difference between "whole country" and "nationwide"? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are actually different texts in German in the Design
the first is translated in german as "Gesamtes Bundesland" , the other is "Bundesweit"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaahh. I would think suggest something like 'whole state' then because 'country' is more the whole of Germany than just a… state/Bundesland.
…ctValueTableViewController.swift Co-authored-by: Carsten Knoblich <carsten@staticline.de>
…sticsCardView/AddStatisticsCardView.swift Co-authored-by: Carsten Knoblich <carsten@staticline.de>
…UI-7-day-local-incedences' of github.com:corona-warn-app/cwa-app-ios into feature/7087-Statistic-data-local-7-day-incidence/7687-UI-7-day-local-incedences
26be896
into
feature/7087-Statistic-data-local-7-day-incidence/storybranch
Description
Add Flow and Logic to Adding new local statistics
Add filtering mechanism
The remaining TO DOs are just a guidance on where to integrate the network calls and the persistence
Obstacles to work on:
1- moving the content Offset of the scrollView without animation.
2- the back button on the district navigation toolbar
Link to Jira
https://jira-ibs.wbs.net.sap/browse/EXPOSUREAPP-7687
Screenshots
RPReplay_Final1624543706.MP4