diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index dc9213c..8c9fb1d 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -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 @@ -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 @@ -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 diff --git a/.pouch.yml b/.pouch.yml index d0bb7db..275cc4b 100644 --- a/.pouch.yml +++ b/.pouch.yml @@ -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 \ No newline at end of file diff --git a/Tree Tracker/AppDelegate.swift b/Tree Tracker/AppDelegate.swift index e79518f..1c82914 100644 --- a/Tree Tracker/AppDelegate.swift +++ b/Tree Tracker/AppDelegate.swift @@ -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") diff --git a/Tree Tracker/Constants.swift b/Tree Tracker/Constants.swift index 8e17eb0..0a9d44f 100644 --- a/Tree Tracker/Constants.swift +++ b/Tree Tracker/Constants.swift @@ -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 } } diff --git a/Tree Tracker/Screens/Settings/SettingsController.swift b/Tree Tracker/Screens/Settings/SettingsController.swift index 4862406..a51324f 100644 --- a/Tree Tracker/Screens/Settings/SettingsController.swift +++ b/Tree Tracker/Screens/Settings/SettingsController.swift @@ -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() @@ -41,7 +43,7 @@ class SettingsController: UITableViewController { case 0: return entityTypes.count case 1: - return 1 + return apiProperties.count default: return 0 } @@ -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