Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrive the Admin prefix from AdminOptions.AdminUrlPrefix instead of hardcoding it (OSOE-657) #209

Closed
DemeSzabolcs opened this issue Jul 13, 2023 · 4 comments · Fixed by #210
Assignees

Comments

@DemeSzabolcs
Copy link
Member

DemeSzabolcs commented Jul 13, 2023

Related comment: #208 (comment)

Here:
https://github.com/Lombiq/Helpful-Libraries/blob/dev/Lombiq.HelpfulLibraries.OrchardCore/Mvc/TypedRoute.cs#L96

Retrive the Admin prefix from AdminOptions.AdminUrlPrefix instead of hardcoding it.

Jira issue

@github-actions github-actions bot changed the title Retrive the Admin prefix from AdminOptions.AdminUrlPrefix instead of hardcoding it Retrive the Admin prefix from AdminOptions.AdminUrlPrefix instead of hardcoding it (OSOE-657) Jul 13, 2023
@Piedone Piedone changed the title Retrive the Admin prefix from AdminOptions.AdminUrlPrefix instead of hardcoding it (OSOE-657) Retrive the Admin prefix from AdminOptions.AdminUrlPrefix instead of hardcoding it (OSOE-653) Jul 13, 2023
@Piedone Piedone changed the title Retrive the Admin prefix from AdminOptions.AdminUrlPrefix instead of hardcoding it (OSOE-653) Retrive the Admin prefix from AdminOptions.AdminUrlPrefix instead of hardcoding it (OSOE-657, OSOE-653) Jul 13, 2023
@Piedone Piedone changed the title Retrive the Admin prefix from AdminOptions.AdminUrlPrefix instead of hardcoding it (OSOE-657, OSOE-653) Retrive the Admin prefix from AdminOptions.AdminUrlPrefix instead of hardcoding it (OSOE-657) Jul 13, 2023
@Piedone
Copy link
Member

Piedone commented Jul 13, 2023

I believe the idea there is that TypedRoute is not necessarily used from the same app where the route is pointing to. It can e.g. be used in UI test projects too, see TypedRouteUITestContextExtensions. Thus, it can't (always) retrieve the target app's admin prefix. Right, @DAud-IcI?

@sarahelsaig
Copy link
Member

Yes, it's like this for the sake of UI testing (here is the extension above mentioned). When I created TypedRoute the UI-Testing-Toolbox still used a separate subprocess to run the webapp, so it was literally not possible to access configuration. I see that in the UITestContext the admin prefix is still hard coded instead of loaded from the webapp being tested, so does that mean this is still not possible?

At any rate, if we want to load the admin prefix from configuration, we must make sure if falls back to the sensible default of "/Admin" gracefully and doesn't throw.

@Piedone
Copy link
Member

Piedone commented Jul 13, 2023

Indeed, in the UI Testing Toolbox we should access AdminOptions, I created an issue for this here: Lombiq/UI-Testing-Toolbox#294

For the UITT use case we'll need to be able to optionally pass the prefix to `TypedRoute too.

@jtkech
Copy link
Member

jtkech commented Jul 13, 2023

For info, if AdminOptions is not configured, the default value of AdminUrlPrefix is Admin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants