Skip to content

Commit

Permalink
Merge pull request #32 from aapis/feature/ui-pass
Browse files Browse the repository at this point in the history
A couple UI tweaks in Hierarchy view mode
  • Loading branch information
aapis authored Jul 1, 2024
2 parents 0836110 + 3665ad9 commit 44b27c8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions KlockWork-iOS/KlockWork-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "KlockWork-iOS/KlockWork_iOS.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 13;
CURRENT_PROJECT_VERSION = 14;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"KlockWork-iOS/Preview Content\"";
DEVELOPMENT_TEAM = 6DT7L2N5X6;
Expand Down Expand Up @@ -847,7 +847,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "KlockWork-iOS/KlockWork_iOS.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 13;
CURRENT_PROJECT_VERSION = 14;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"KlockWork-iOS/Preview Content\"";
DEVELOPMENT_TEAM = 6DT7L2N5X6;
Expand Down
5 changes: 2 additions & 3 deletions KlockWork-iOS/KlockWork-iOS/Entities/Companies.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ import SwiftUI
struct Companies: View {
typealias EntityType = PageConfiguration.EntityType

@EnvironmentObject private var state: AppState
private let entityType: EntityType = .companies
@State public var items: [Company] = []

@Environment(\.managedObjectContext) var moc

var body: some View {
NavigationStack {
Expand Down Expand Up @@ -47,7 +46,7 @@ struct Companies: View {

}
.onAppear(perform: {
items = CoreDataCompanies(moc: moc).alive()
items = CoreDataCompanies(moc: self.state.moc).alive()
})
.scrollContentBackground(.hidden)
.background(Theme.cGreen)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct CompanyDetail: View {
@State private var createdDate: Date = Date()
@State private var lastUpdate: Date = Date()
@State private var name: String = ""
@State private var pid: Int64 = 0
@State private var pid: Int64 = Int64.random(in: 99999...99999999)
@State private var abbreviation: String = ""
@State private var hidden: Bool = false
@State private var colour: Color = .clear
Expand Down
6 changes: 3 additions & 3 deletions KlockWork-iOS/KlockWork-iOS/SharedViews/RowAddButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ struct RowAddButton: View {
ZStack(alignment: .center) {
RadialGradient(colors: [Theme.base, .clear], center: .center, startRadius: 0, endRadius: 40)
.blendMode(.softLight)
.opacity(0.6)
.opacity(0.8)
Text(self.title)
.font(.caption)
.padding(6)
.padding([.leading, .trailing], 8)
.background(self.isPresented ? .orange : .white.opacity(0.4))
.background(self.isPresented ? .orange : .white)
.foregroundStyle(Theme.base)
.clipShape(.capsule(style: .continuous))
}
Expand All @@ -46,7 +46,7 @@ struct RowAddNavLink: View {
ZStack(alignment: .center) {
RadialGradient(colors: [Theme.base, .clear], center: .center, startRadius: 0, endRadius: 40)
.blendMode(.softLight)
.opacity(0.6)
.opacity(0.8)
Text(self.title)
.font(.caption)
.padding(6)
Expand Down
16 changes: 9 additions & 7 deletions KlockWork-iOS/KlockWork-iOS/SharedViews/Tabs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ extension Tabs.Content {
}

struct HierarchyExplorer: View {
@EnvironmentObject private var state: AppState
public var inSheet: Bool
public var page: PageConfiguration.AppPage = .today
@FetchRequest private var items: FetchedResults<Company>
Expand All @@ -283,7 +284,7 @@ extension Tabs.Content {
ScrollView {
VStack(alignment: .leading, spacing: 0) {
if self.items.count > 0 {
ForEach(self.items.filter({$0.alive == true})) { item in
ForEach(items) { item in
TopLevel(entity: item)
}
} else {
Expand Down Expand Up @@ -1103,12 +1104,13 @@ extension Tabs.Content {
.opacity(0.7)
.padding(.leading, 8)
Spacer()
RowAddNavLink(
title: "+ Person",
target: AnyView(
PersonDetail(company: self.entity)
)
)
// @TODO: uncomment after we list out people under projects
// RowAddNavLink(
// title: "+ Person",
// target: AnyView(
// PersonDetail(company: self.entity)
// )
// )
RowAddNavLink(
title: "+ Project",
target: AnyView(
Expand Down

0 comments on commit 44b27c8

Please sign in to comment.