Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
Added a load dashboard route config
Browse files Browse the repository at this point in the history
  • Loading branch information
Casperhr authored Apr 5, 2017
1 parent 7dfade5 commit 192c853
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/AdminPanel/Support/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public struct Configuration {
case name = "adminpanel.name"
case unauthorizedPath = "adminpanel.unauthorizedPath"
case loadRoutes = "adminpanel.loadRoutes"
case loadDashboardRoute = "adminpanel.loadDashboardRoute"
case profileImageFallbackUrl = "adminpanel.profileImageFallbackUrl"
case loginSuccessPath = "adminpanel.loginSuccessPath"
case welcomeMailViewPath = "adminpanel.welcomeMailViewPath"
Expand All @@ -33,6 +34,7 @@ public struct Configuration {
public let name: String
public let unauthorizedPath: String
public let loadRoutes: Bool
public let loadDashboardRoute: Bool
public let profileImageFallbackUrl: String
public let loginSuccessPath: String
public let welcomeMailViewPath: String
Expand Down Expand Up @@ -69,6 +71,7 @@ public struct Configuration {
name = try Configuration.extract(field: .name, config: config)
unauthorizedPath = try Configuration.extract(field: .unauthorizedPath, config: config)
loadRoutes = try Configuration.extract(field: .loadRoutes, config: config)
loadDashboardRoute = config[Field.loadDashboardRoute.path]?.bool ?? true
profileImageFallbackUrl = try Configuration.extract(field: .profileImageFallbackUrl, config: config)
loginSuccessPath = try Configuration.extract(field: .loginSuccessPath, config: config)
welcomeMailViewPath = try Configuration.extract(field: .welcomeMailViewPath, config: config)
Expand All @@ -83,6 +86,7 @@ public struct Configuration {
"name" : Node(name),
"unauthorizedPath" : Node(unauthorizedPath),
"loadRoutes" : Node(loadRoutes),
"loadDashboardRoute" : Node(loadDashboardRoute),
"profileImageFallbackUrl" : Node(profileImageFallbackUrl),
"loginSuccessPath" : Node(loginSuccessPath),
"welcomeMailViewPath" : Node(welcomeMailViewPath),
Expand Down

0 comments on commit 192c853

Please sign in to comment.