@@ -60,16 +60,22 @@ const ApplicationRoundAllocation = dynamic(
6060const withAuthorization = (
6161 component : JSX . Element ,
6262 apiBaseUrl : string ,
63+ feedbackUrl : string ,
6364 permission ?: Permission
6465) => (
65- < AuthorizationChecker permission = { permission } apiUrl = { apiBaseUrl } >
66+ < AuthorizationChecker
67+ permission = { permission }
68+ apiUrl = { apiBaseUrl }
69+ feedbackUrl = { feedbackUrl }
70+ >
6671 { component }
6772 </ AuthorizationChecker >
6873) ;
6974
7075type Props = {
7176 reservationUnitPreviewUrl : string ;
7277 apiBaseUrl : string ;
78+ feedbackUrl : string ;
7379} ;
7480const UnitsRouter = ( {
7581 reservationUnitPreviewUrl,
@@ -117,82 +123,125 @@ const ApplicationRoundsRouter = () => (
117123 </ Routes >
118124) ;
119125
120- const PremisesRouter = ( ) => (
126+ const PremisesRouter = ( {
127+ apiBaseUrl,
128+ feedbackUrl,
129+ } : Omit < Props , "reservationUnitPreviewUrl" > ) => (
121130 < Routes >
122131 < Route
123132 path = "spaces"
124- element = { withAuthorization ( < SpacesList /> , Permission . CAN_MANAGE_SPACES ) }
133+ element = { withAuthorization (
134+ < SpacesList /> ,
135+ apiBaseUrl ,
136+ feedbackUrl ,
137+ Permission . CAN_MANAGE_SPACES
138+ ) }
125139 />
126140 < Route
127141 path = { `${ prefixes . reservationUnits } ` }
128142 element = { withAuthorization (
129143 < ReservationUnits /> ,
144+ apiBaseUrl ,
145+ feedbackUrl ,
130146 Permission . CAN_MANAGE_UNITS
131147 ) }
132148 />
133149 < Route
134150 path = "resources"
135151 element = { withAuthorization (
136152 < ResourcesList /> ,
153+ apiBaseUrl ,
154+ feedbackUrl ,
137155 Permission . CAN_MANAGE_RESOURCES
138156 ) }
139157 />
140158 < Route
141159 path = "units"
142- element = { withAuthorization ( < Units /> , Permission . CAN_MANAGE_UNITS ) }
160+ element = { withAuthorization (
161+ < Units /> ,
162+ apiBaseUrl ,
163+ feedbackUrl ,
164+ Permission . CAN_MANAGE_UNITS
165+ ) }
143166 />
144167 </ Routes >
145168) ;
146169
147- function ClientApp ( { reservationUnitPreviewUrl, apiBaseUrl } : Props ) {
170+ function ClientApp ( {
171+ reservationUnitPreviewUrl,
172+ apiBaseUrl,
173+ feedbackUrl,
174+ } : Props ) {
148175 return (
149176 < BrowserRouter basename = { PUBLIC_URL } >
150- < PageWrapper apiBaseUrl = { apiBaseUrl } >
177+ < PageWrapper apiBaseUrl = { apiBaseUrl } feedbackUrl = { feedbackUrl } >
151178 < Routes >
152179 < Route path = "*" element = { < Error404 /> } />
153180 < Route
154181 path = "/"
155- element = { withAuthorization ( < HomePage /> , apiBaseUrl ) }
182+ element = { withAuthorization ( < HomePage /> , apiBaseUrl , feedbackUrl ) }
156183 />
157184 < Route
158185 path = { `${ prefixes . applications } /*` }
159186 element = { withAuthorization (
160187 < ApplicationRouter /> ,
188+ apiBaseUrl ,
189+ feedbackUrl ,
161190 Permission . CAN_VALIDATE_APPLICATIONS
162191 ) }
163192 />
164193 < Route
165194 path = { `${ prefixes . recurringReservations } /application-rounds/*` }
166195 element = { withAuthorization (
167196 < ApplicationRoundsRouter /> ,
197+ apiBaseUrl ,
198+ feedbackUrl ,
168199 Permission . CAN_VALIDATE_APPLICATIONS
169200 ) }
170201 />
171202 < Route
172203 path = "/premises-and-settings/*"
173- element = { withAuthorization ( < PremisesRouter /> , apiBaseUrl ) }
204+ element = { withAuthorization (
205+ < PremisesRouter
206+ apiBaseUrl = { apiBaseUrl }
207+ feedbackUrl = { feedbackUrl }
208+ /> ,
209+ apiBaseUrl ,
210+ feedbackUrl
211+ ) }
174212 />
175213 < Route
176214 path = "/unit/*"
177215 element = { withAuthorization (
178216 < UnitsRouter
179217 reservationUnitPreviewUrl = { reservationUnitPreviewUrl }
180218 /> ,
181- apiBaseUrl
219+ apiBaseUrl ,
220+ feedbackUrl
182221 ) }
183222 />
184223 < Route
185224 path = "/reservations/*"
186- element = { withAuthorization ( < ReservationsRouter /> , apiBaseUrl ) }
225+ element = { withAuthorization (
226+ < ReservationsRouter /> ,
227+ apiBaseUrl ,
228+ feedbackUrl
229+ ) }
187230 />
188231 < Route
189232 path = "/my-units/*"
190- element = { withAuthorization ( < MyUnitsRouter /> , apiBaseUrl ) }
233+ element = { withAuthorization (
234+ < MyUnitsRouter /> ,
235+ apiBaseUrl ,
236+ feedbackUrl
237+ ) }
191238 />
192239 < Route
193240 path = "/messaging/notifications/*"
194241 element = { withAuthorization (
195242 < NotificationsRouter /> ,
243+ apiBaseUrl ,
244+ feedbackUrl ,
196245 Permission . CAN_MANAGE_BANNER_NOTIFICATIONS
197246 ) }
198247 />
0 commit comments