-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 🎸 HCPSDKFIORIUIKIT-2812 SwiftUI KPIProgressItem refactor #936
base: main
Are you sure you want to change the base?
Conversation
zzchao-1999
commented
Dec 11, 2024
All | Percentage | Fraction |
---|---|---|
public protocol _KPIProgressItemModel: KpiProgressComponent, SubtitleComponent, FootnoteComponent, KPIHeaderItemModel {} | ||
|
||
@available(*, unavailable, renamed: "_KPIProgressItemModel", message: "Will be removed in the future release. Please create KPIProgressItem with other initializers instead.") | ||
public protocol KPIProgressItemModel {} |
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.
Missing Docs Violation: public declarations should be documented. (missing_docs)
public protocol _KPIProgressItemModel: KpiProgressComponent, SubtitleComponent, FootnoteComponent, KPIHeaderItemModel {} | ||
|
||
@available(*, unavailable, renamed: "_KPIProgressItemModel", message: "Will be removed in the future release. Please create KPIProgressItem with other initializers instead.") | ||
public protocol KPIProgressItemModel {} |
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.
Missing Docs Violation: public declarations should be documented. (missing_docs)
} | ||
|
||
public extension KPIProgressItem { | ||
init(data: Binding<KPIItemData>, chartSize: KPIProgressItemSize = .large) { |
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.
Missing Docs Violation: public declarations should be documented. (missing_docs)
} | ||
|
||
public extension KPIProgressItem { | ||
init(data: Binding<KPIItemData>, chartSize: KPIProgressItemSize = .large) { |
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.
Missing Docs Violation: public declarations should be documented. (missing_docs)
@KevinZK Can you review it from "NSS" support perspective, if this refactoring code is ready for the future NSS enhancement? |
Based on the NSS features I have designed so far, I make some suggestions: extension KPIProgressItemNSSStyle {
struct ContentNSSStyle: KPIProgressItemStyle {
let kpiProgressItemConfiguration: KPIProgressItemConfiguration
let nssData: NSSStyleData
func makeBody(_ configuration: KPIProgressItemConfiguration) -> some View {
KPIProgressItem(configuration)
.modifier(NSSStyleModifier<NSSBaseStyleType>(styles: self.nssData))
// Add custom nss style for its content
// .modifier(NSSStyleModifier<<#T: NSSCovert & RawRepresentable#>>(styles: <#T##NSSStyleData#>)
}
}
struct TitleNSSStyle: TitleStyle {
let kpiProgressItemConfiguration: KPIProgressItemConfiguration
let nssData: NSSStyleData
func makeBody(_ configuration: TitleConfiguration) -> some View {
Title(configuration)
.modifier(NSSStyleModifier<NSSBaseStyleType>(styles: self.nssData))
// Add custom nss style for Title
// .modifier(NSSStyleModifier<<#T: NSSCovert & RawRepresentable#>>(styles: <#T##NSSStyleData#>)
}
}
struct SubtitleNSSStyle: SubtitleStyle {
let kpiProgressItemConfiguration: KPIProgressItemConfiguration
let nssData: NSSStyleData
func makeBody(_ configuration: SubtitleConfiguration) -> some View {
Subtitle(configuration)
.modifier(NSSStyleModifier<NSSBaseStyleType>(styles: self.nssData))
// Add custom nss style for Subtitle
// .modifier(NSSStyleModifier<<#T: NSSCovert & RawRepresentable#>>(styles: <#T##NSSStyleData#>)
}
}
struct CircleProgressNSSStyle: ProgressStyle {
let kpiProgressItemConfiguration: KPIProgressItemConfiguration
let nssData: NSSStyleData
func makeBody(_ configuration: CircleProgressConfiguration) -> some View {
CircleProgress(configuration)
.modifier(NSSStyleModifier<NSSBaseStyleType>(styles: self.nssData))
// Add custom nss style for Circleprogress
// .modifier(NSSStyleModifier<<#T: NSSCovert & RawRepresentable#>>(styles: <#T##NSSStyleData#>)
}
}
} Since my current pull request is still under review, for reference only. |
@zzchao-1999 Some merge conflict to be resolved |
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.
Resolve merge conflict