Skip to content

Commit

Permalink
Merge pull request #81 from protect-earth/al/80
Browse files Browse the repository at this point in the history
Expose env name in Rollbar notifications and settings view
  • Loading branch information
allanlang authored Sep 12, 2022
2 parents 4441671 + 2e5a6f1 commit 6278bfc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
TEST_AIRTABLE_TABLE_NAME_PREFIX: ${{ secrets.TEST_AIRTABLE_TABLE_NAME_PREFIX }}
PROTECT_EARTH_API_TOKEN: ${{ secrets.PROTECT_EARTH_API_TOKEN }}
PROTECT_EARTH_API_BASE_URL: ${{ secrets.PROTECT_EARTH_API_BASE_URL }}
PROTECT_EARTH_ENV_NAME: ${{ secrets.PROTECT_EARTH_ENV_NAME }}
ROLLBAR_AUTH_TOKEN: ${{ secrets.ROLLBAR_AUTH_TOKEN }}
run: pouch
- name: Build and test
Expand Down Expand Up @@ -72,6 +73,7 @@ jobs:
TEST_AIRTABLE_TABLE_NAME_PREFIX: ${{ secrets.TEST_AIRTABLE_TABLE_NAME_PREFIX }}
PROTECT_EARTH_API_TOKEN: ${{ secrets.PROTECT_EARTH_API_TOKEN }}
PROTECT_EARTH_API_BASE_URL: ${{ secrets.PROTECT_EARTH_API_BASE_URL }}
PROTECT_EARTH_ENV_NAME: ${{ secrets.PROTECT_EARTH_ENV_NAME }}
ROLLBAR_AUTH_TOKEN: ${{ secrets.ROLLBAR_AUTH_TOKEN }}
run: pouch
- name: Set build number
Expand Down Expand Up @@ -140,6 +142,7 @@ jobs:
TEST_AIRTABLE_TABLE_NAME_PREFIX: ${{ secrets.TEST_AIRTABLE_TABLE_NAME_PREFIX }}
PROTECT_EARTH_API_TOKEN: ${{ secrets.PROTECT_EARTH_API_TOKEN }}
PROTECT_EARTH_API_BASE_URL: ${{ secrets.PROTECT_EARTH_API_BASE_URL }}
PROTECT_EARTH_ENV_NAME: ${{ secrets.PROTECT_EARTH_ENV_NAME }}
ROLLBAR_AUTH_TOKEN: ${{ secrets.ROLLBAR_AUTH_TOKEN }}
run: pouch
- name: Set build number
Expand Down
1 change: 1 addition & 0 deletions .pouch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ secrets:
- TEST_AIRTABLE_TABLE_NAME_PREFIX
- PROTECT_EARTH_API_TOKEN
- PROTECT_EARTH_API_BASE_URL
- PROTECT_EARTH_ENV_NAME
- ROLLBAR_AUTH_TOKEN
outputs:
- ./Tree Tracker/Secrets.swift
2 changes: 1 addition & 1 deletion Tree Tracker/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let config = RollbarConfig()
config.destination.accessToken = Secrets.rollbarAuthToken
config.destination.environment = "local"
config.destination.environment = Constants.Http.protectEarthEnvironmentName

Rollbar.initWithConfiguration(config)
Rollbar.infoMessage("App startup")
Expand Down
1 change: 1 addition & 0 deletions Tree Tracker/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ enum Constants {
static let requestRetryLimit = 3
static let protectEarthApiVersion: String? = nil
static let protectEarthApiBaseUrl = Secrets.protectEarthApiBaseUrl
static let protectEarthEnvironmentName = Secrets.protectEarthEnvName
}
}
6 changes: 4 additions & 2 deletions Tree Tracker/Screens/Settings/SettingsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class SettingsController: UITableViewController {
@Injected private var supervisorsController: SupervisorsController

private var entityTypes = ["Sites", "Supervisors", "Species"]
private var apiProperties = [Constants.Http.protectEarthApiBaseUrl,
Constants.Http.protectEarthEnvironmentName]

override func viewDidLoad() {
super.viewDidLoad()
Expand Down Expand Up @@ -41,7 +43,7 @@ class SettingsController: UITableViewController {
case 0:
return entityTypes.count
case 1:
return 1
return apiProperties.count
default:
return 0
}
Expand All @@ -54,7 +56,7 @@ class SettingsController: UITableViewController {
cell.accessoryType = .disclosureIndicator
cell.textLabel?.text = entityTypes[indexPath.item]
case 1:
cell.textLabel?.text = Constants.Http.protectEarthApiBaseUrl
cell.textLabel?.text = apiProperties[indexPath.item]
cell.selectionStyle = .none
default:
break
Expand Down

0 comments on commit 6278bfc

Please sign in to comment.