Skip to content

Commit 033b0f2

Browse files
authored
Merge pull request #154 from TaskarCenterAtUW/feature-prod-env
Add prod env
2 parents a88e5c5 + 68d7de1 commit 033b0f2

File tree

5 files changed

+28
-43
lines changed

5 files changed

+28
-43
lines changed

GoInfoGame/GoInfoGame.xcodeproj/project.pbxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2603,10 +2603,10 @@
26032603
CODE_SIGN_IDENTITY = "Apple Development";
26042604
CODE_SIGN_STYLE = Automatic;
26052605
CURRENT_PROJECT_VERSION = 4;
2606-
DEVELOPMENT_TEAM = NPCMG529DV;
2606+
DEVELOPMENT_TEAM = G8MQVE5WWW;
26072607
GENERATE_INFOPLIST_FILE = YES;
26082608
INFOPLIST_FILE = GoInfoGame/Info.plist;
2609-
INFOPLIST_KEY_NSCameraUsageDescription = "This app requires to access your camera to measure width of sidewalk";
2609+
INFOPLIST_KEY_NSCameraUsageDescription = "This app requires access to your camera to upload images to Kartaview";
26102610
INFOPLIST_KEY_NSFileProviderDomainUsageDescription = "";
26112611
INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "We need your location";
26122612
INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "We need your location";
@@ -2644,7 +2644,7 @@
26442644
DEVELOPMENT_TEAM = G8MQVE5WWW;
26452645
GENERATE_INFOPLIST_FILE = YES;
26462646
INFOPLIST_FILE = GoInfoGame/Info.plist;
2647-
INFOPLIST_KEY_NSCameraUsageDescription = "This app requires to access your camera to measure width of sidewalk";
2647+
INFOPLIST_KEY_NSCameraUsageDescription = "This app requires access to your camera to upload images to Kartaview";
26482648
INFOPLIST_KEY_NSFileProviderDomainUsageDescription = "";
26492649
INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "We need your location";
26502650
INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "We need your location";

GoInfoGame/GoInfoGame/Network/APIEnvironment.swift

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010
enum APIEnvironment: String, CaseIterable {
1111
case development = "Development"
1212
case staging = "Staging"
13-
// case production = "Production"
13+
case production = "Production"
1414
// case osm = "OSM"
1515
//
1616
var workspaceBaseURL: String {
@@ -19,10 +19,8 @@ enum APIEnvironment: String, CaseIterable {
1919
return "https://api.workspaces-dev.sidewalks.washington.edu/api/v1"
2020
case .staging:
2121
return "https://api.workspaces-stage.sidewalks.washington.edu/api/v1"
22-
// case .production:
23-
// return "https://api.workspaces-prod.sidewalks.washington.edu/api/v1"
24-
// case .osm:
25-
// return ""
22+
case .production:
23+
return "https://workspaces.sidewalks.washington.edu/api/v1"
2624
}
2725
}
2826

@@ -32,10 +30,8 @@ enum APIEnvironment: String, CaseIterable {
3230
return "https://tdei-api-dev.azurewebsites.net/api/v1"
3331
case .staging:
3432
return "https://tdei-gateway-stage.azurewebsites.net/api/v1"
35-
// case .production:
36-
// return "https://tdei-gateway-prod.azurewebsites.net/api/v1"
37-
// case .osm:
38-
// return ""
33+
case .production:
34+
return "https://tdei-gateway-prod.azurewebsites.net/api/v1"
3935
}
4036
}
4137

@@ -45,10 +41,8 @@ enum APIEnvironment: String, CaseIterable {
4541
return "https://osm.workspaces-dev.sidewalks.washington.edu/api/0.6"
4642
case .staging:
4743
return "https://osm.workspaces-stage.sidewalks.washington.edu/api/0.6"
48-
// case .production:
49-
// return "https://osm.workspaces-prod.sidewalks.washington.edu/api/0.6"
50-
// case .osm:
51-
// return ""
44+
case .production:
45+
return "https://osm.workspaces.sidewalks.washington.edu/api/0.6"
5246
}
5347
}
5448

@@ -58,10 +52,8 @@ enum APIEnvironment: String, CaseIterable {
5852
return "https://tdei-usermanagement-be-dev.azurewebsites.net/api/v1"
5953
case .staging:
6054
return "https://tdei-usermanagement-stage.azurewebsites.net/api/v1"
61-
// case .production:
62-
// return ""
63-
// case .osm:
64-
// return ""
55+
case .production:
56+
return "https://tdei-usermanagement-prod.azurewebsites.net/api/v1"
6557
}
6658
}
6759

@@ -71,6 +63,8 @@ enum APIEnvironment: String, CaseIterable {
7163
return "https://api.openstreetcam.org/1.0"
7264
case .staging:
7365
return "https://api.openstreetcam.org/1.0"
66+
case .production:
67+
return "https://api.openstreetcam.org/1.0"
7468
}
7569
}
7670
}

GoInfoGame/GoInfoGame/Network/models/WorkspacesResponse.swift

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,21 @@ class WorkSpacesResponse: Codable {
2222
}
2323

2424
// MARK: - Workspace
25-
struct Workspace: Codable, CustomStringConvertible,Hashable {
25+
struct Workspace: Codable,Hashable {
2626
let id: Int
2727
let title: String
28-
// let tdeiRecordId:String
29-
// let tdeiProjectGroupId:String
30-
// let tdeiServiceId: String
31-
// let tdeiMetadata: String
28+
let type: String?
3229

33-
init(id: Int, title: String) {
34-
self.id = id
35-
self.title = title
36-
// self.tdeiRecordId = tdeiRecordId
37-
// self.tdeiProjectGroupId = tdeiProjectGroupId
38-
// self.tdeiServiceId = tdeiServiceId
39-
// self.tdeiMetadata = tdeiMetadata
40-
//
41-
}
42-
43-
var description: String {
44-
var d = "{ \n"
45-
d += "name: \(self.title) \n"
46-
d += "id: \(self.id) \n"
47-
d += "}\n"
48-
return d
49-
}
30+
init(from decoder: Decoder) throws {
31+
let container = try decoder.container(keyedBy: CodingKeys.self)
32+
id = try container.decode(Int.self, forKey: .id)
33+
title = try container.decode(String.self, forKey: .title)
34+
type = try container.decodeIfPresent(String.self, forKey: .type) ?? "osw"
35+
}
36+
37+
enum CodingKeys: String, CodingKey {
38+
case id, title, type
39+
}
5040
}
5141

5242
// MARK: - Polygon

GoInfoGame/GoInfoGame/UI/InitialView/InitialView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct WorkspacesListView: View {
7777
.padding()
7878
ScrollView {
7979
VStack(spacing: 20) {
80-
ForEach(workspaces, id: \.id) { workspace in
80+
ForEach(workspaces.filter({$0.type == "osw"}), id: \.id) { workspace in
8181
Button {
8282
viewModel.fetchLongQuestsFor(workspaceId: "\(workspace.id)", completion: { success in
8383
if success {

GoInfoGame/GoInfoGame/UserProfile/View/UserProfileView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ struct UserProfileView: View {
6767
_ = KeychainManager.delete(key: "accessToken")
6868
_ = KeychainManager.delete(key: "username")
6969
loggedIn = false
70+
UserProfileCache.shared.clearUserProfile()
7071

7172
if let window = UIApplication.shared.windows.first {
7273
window.rootViewController = UIHostingController(rootView: PosmLoginView())

0 commit comments

Comments
 (0)