diff --git a/Tech Tracker.xcodeproj/project.pbxproj b/Tech Tracker.xcodeproj/project.pbxproj
index 9a6f785..690b0bb 100644
--- a/Tech Tracker.xcodeproj/project.pbxproj
+++ b/Tech Tracker.xcodeproj/project.pbxproj
@@ -201,7 +201,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1530;
- LastUpgradeCheck = 1530;
+ LastUpgradeCheck = 1600;
TargetAttributes = {
03308F3F2BC2035300D59E96 = {
CreatedOnToolsVersion = 15.3;
@@ -452,7 +452,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
- MARKETING_VERSION = 0.2.3;
+ MARKETING_VERSION = 0.3;
PRODUCT_BUNDLE_IDENTIFIER = "GibbyB.Tech-Tracker";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -487,7 +487,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
- MARKETING_VERSION = 0.2.3;
+ MARKETING_VERSION = 0.3;
PRODUCT_BUNDLE_IDENTIFIER = "GibbyB.Tech-Tracker";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -499,7 +499,6 @@
03308F682BC2035500D59E96 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
@@ -519,7 +518,6 @@
03308F692BC2035500D59E96 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
@@ -539,7 +537,6 @@
03308F6B2BC2035500D59E96 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
@@ -558,7 +555,6 @@
03308F6C2BC2035500D59E96 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
diff --git a/Tech Tracker.xcodeproj/project.xcworkspace/xcuserdata/gib.xcuserdatad/UserInterfaceState.xcuserstate b/Tech Tracker.xcodeproj/project.xcworkspace/xcuserdata/gib.xcuserdatad/UserInterfaceState.xcuserstate
index 6ef5f58..292e2d4 100644
Binary files a/Tech Tracker.xcodeproj/project.xcworkspace/xcuserdata/gib.xcuserdatad/UserInterfaceState.xcuserstate and b/Tech Tracker.xcodeproj/project.xcworkspace/xcuserdata/gib.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/Tech Tracker.xcodeproj/xcshareddata/xcschemes/Tech Tracker.xcscheme b/Tech Tracker.xcodeproj/xcshareddata/xcschemes/Tech Tracker.xcscheme
new file mode 100644
index 0000000..36308c6
--- /dev/null
+++ b/Tech Tracker.xcodeproj/xcshareddata/xcschemes/Tech Tracker.xcscheme
@@ -0,0 +1,109 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Tech Tracker.xcodeproj/xcuserdata/gib.xcuserdatad/xcschemes/xcschememanagement.plist b/Tech Tracker.xcodeproj/xcuserdata/gib.xcuserdatad/xcschemes/xcschememanagement.plist
index ffa15c7..ac9df23 100644
--- a/Tech Tracker.xcodeproj/xcuserdata/gib.xcuserdatad/xcschemes/xcschememanagement.plist
+++ b/Tech Tracker.xcodeproj/xcuserdata/gib.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -10,5 +10,23 @@
0
+ SuppressBuildableAutocreation
+
+ 03308F3F2BC2035300D59E96
+
+ primary
+
+
+ 03308F4F2BC2035500D59E96
+
+ primary
+
+
+ 03308F592BC2035500D59E96
+
+ primary
+
+
+
diff --git a/Tech Tracker/ContentView.swift b/Tech Tracker/ContentView.swift
index ddcbdc1..936929d 100644
--- a/Tech Tracker/ContentView.swift
+++ b/Tech Tracker/ContentView.swift
@@ -86,7 +86,7 @@ struct StatusUpdateView: View {
.font(.headline) // Make the button text larger
.padding() // Add padding around the button text to make the button larger
.frame(minWidth: 0, maxWidth: .infinity) // Makes the button expand to full width
- .background(Color.accent) // Sets the button background color to blue
+ .background(Color.accentColor) // Sets the button background color to blue
.foregroundColor(.white) // Sets the button text color to white
.cornerRadius(10) // Rounds the corners of the button
}
@@ -102,7 +102,7 @@ struct StatusUpdateView: View {
.font(.headline)
.padding()
.frame(maxWidth: .infinity)
- .background(Color.accent)
+ .background(Color.accentColor)
.foregroundColor(.white)
.cornerRadius(10)
}
@@ -115,7 +115,7 @@ struct StatusUpdateView: View {
.font(.headline)
.padding()
.frame(maxWidth: .infinity)
- .background(Color.accent)
+ .background(Color.accentColor)
.foregroundColor(.white)
.cornerRadius(10)
}
@@ -129,7 +129,7 @@ struct StatusUpdateView: View {
.font(.headline)
.padding()
.frame(maxWidth: .infinity)
- .background(Color.accent)
+ .background(Color.accentColor)
.foregroundColor(.white)
.cornerRadius(10)
}
@@ -142,7 +142,7 @@ struct StatusUpdateView: View {
.font(.headline)
.padding()
.frame(maxWidth: /*@START_MENU_TOKEN@*/.infinity/*@END_MENU_TOKEN@*/)
- .background(Color.accent)
+ .background(Color.accentColor)
.foregroundColor(.white)
.cornerRadius(10)
}
@@ -156,7 +156,7 @@ struct StatusUpdateView: View {
.font(.headline)
.padding()
.frame(maxWidth: .infinity)
- .background(Color.accent)
+ .background(Color.accentColor)
.foregroundColor(.white)
.cornerRadius(10)
}
@@ -169,7 +169,7 @@ struct StatusUpdateView: View {
.font(.headline)
.padding()
.frame(maxWidth: .infinity)
- .background(Color.accent)
+ .background(Color.accentColor)
.foregroundColor(.white)
.cornerRadius(10)
}
@@ -183,7 +183,7 @@ struct StatusUpdateView: View {
.font(.headline)
.padding()
.frame(maxWidth: .infinity)
- .background(Color.accent)
+ .background(Color.accentColor)
.foregroundColor(.white)
.cornerRadius(10)
}
@@ -196,7 +196,7 @@ struct StatusUpdateView: View {
.font(.headline)
.padding()
.frame(maxWidth: .infinity)
- .background(Color.accent)
+ .background(Color.accentColor)
.foregroundColor(.white)
.cornerRadius(10)
}
@@ -210,7 +210,7 @@ struct StatusUpdateView: View {
.font(.headline)
.padding()
.frame(maxWidth: .infinity)
- .background(Color.accent)
+ .background(Color.accentColor)
.foregroundColor(.white)
.cornerRadius(10)
}
@@ -223,7 +223,7 @@ struct StatusUpdateView: View {
.font(.headline)
.padding()
.frame(maxWidth: .infinity)
- .background(Color.accent)
+ .background(Color.accentColor)
.foregroundColor(.white)
.cornerRadius(10)
}
@@ -243,9 +243,12 @@ class TechnicianViewModel: ObservableObject {
@Published var currentPage = 1
var totalPageCount = 1
+ let apiKey = ProcessInfo.processInfo.environment["API_KEY"] ?? ""
+
// Fetch technicians function for Technicians API
func fetchTechnicians() {
- let urlString = "https://techtracker.gibbyb.com/api/technicians?apikey=APIKEYHERE"
+
+ let urlString = "https://techtracker.gibbyb.com/api/technicians?apikey=" + apiKey
guard let url = URL(string: urlString) else { return }
URLSession.shared.dataTask(with: url) { [weak self] data, response, error in
@@ -281,7 +284,7 @@ class TechnicianViewModel: ObservableObject {
// Update Technician Status function for the Update API
func updateTechnicianStatus(name: String, newStatus: String) {
- let urlString = "https://techtracker.gibbyb.com/api/update_technicians?apikey=APIKEYHERE"
+ let urlString = "https://techtracker.gibbyb.com/api/update_technicians?apikey=" + apiKey
guard let url = URL(string: urlString) else { return }
let updateData = [TechnicianUpdate(name: name, status: newStatus)]
@@ -325,7 +328,7 @@ class TechnicianViewModel: ObservableObject {
// Fetch Technician History Function for the History API. Very similar to Technician API
// but with some added metadata
func fetchTechnicianHistory(page: Int = 1) {
- let urlString = "https://techtracker.gibbyb.com/api/history?apikey=APIKEYHERE&page=\(page)"
+ let urlString = "https://techtracker.gibbyb.com/api/history?apikey=" + apiKey + "&page=\(page)"
guard let url = URL(string: urlString) else { return }
URLSession.shared.dataTask(with: url) { [weak self] data, response, error in
@@ -395,10 +398,11 @@ struct ContentView: View {
List {
ForEach(viewModel.technicians) { technician in
Button(action: {
- self.showingUpdateView = true
+ viewModel.fetchTechnicians()
self.selectedTechnicianName = technician.name
self.selectedTechnicianCurrStatus = technician.status
- }) {
+ self.showingUpdateView = true
+ }) {
HStack {
VStack(alignment: .leading, spacing: 5) {
Text(technician.name).bold()
@@ -428,7 +432,6 @@ struct ContentView: View {
viewModel.fetchTechnicians()
}
.sheet(isPresented: $showingUpdateView) {
- // Pass the selected technician name directly to an explicitly initialized StatusUpdateView
StatusUpdateView(isPresented: $showingUpdateView,
technicianName: selectedTechnicianName,
technicianStatus: selectedTechnicianCurrStatus,