diff --git a/web/src/elements/router/Route.ts b/web/src/elements/router/Route.ts index cafbb7740..bf4b61301 100644 --- a/web/src/elements/router/Route.ts +++ b/web/src/elements/router/Route.ts @@ -4,11 +4,15 @@ export const SLUG_REGEX = "[-a-zA-Z0-9_]+"; export const ID_REGEX = "\\d+"; export const UUID_REGEX = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"; +export interface RouteArgs { + [key: string]: string; +} + export class Route { url: RegExp; private element?: TemplateResult; - private callback?: (args: { [key: string]: string }) => TemplateResult; + private callback?: (args: RouteArgs) => TemplateResult; constructor(url: RegExp, element?: TemplateResult) { this.url = url; @@ -24,12 +28,12 @@ export class Route { return this; } - then(render: (args: { [key: string]: string }) => TemplateResult): Route { + then(render: (args: RouteArgs) => TemplateResult): Route { this.callback = render; return this; } - render(args: { [key: string]: string }): TemplateResult { + render(args: RouteArgs): TemplateResult { if (this.callback) { return this.callback(args); } diff --git a/web/src/pages/providers/OAuth2ProviderViewPage.ts b/web/src/pages/providers/OAuth2ProviderViewPage.ts index c2ac450ee..c58413c92 100644 --- a/web/src/pages/providers/OAuth2ProviderViewPage.ts +++ b/web/src/pages/providers/OAuth2ProviderViewPage.ts @@ -10,11 +10,12 @@ import "../../elements/CodeMirror"; import "../../elements/Tabs"; import { Page } from "../../elements/Page"; import { convertToTitle } from "../../utils"; +import "./RelatedApplicationButton"; @customElement("ak-provider-oauth2-view") export class OAuth2ProviderViewPage extends Page { pageTitle(): string { - return gettext(`OAuth Provider ${this.provider?.name}`); + return gettext(`OAuth Provider ${this.provider?.name || ""}`); } pageDescription(): string | undefined { return; @@ -72,12 +73,7 @@ export class OAuth2ProviderViewPage extends Page {