forked from baron/baron-sso
Fix org chart manager ordering and title wrapping
This commit is contained in:
@@ -214,7 +214,7 @@ function AppLayout() {
|
||||
});
|
||||
const orgfrontUrl = buildAuthenticatedOrgChartUrl(
|
||||
import.meta.env.ORGFRONT_URL || "http://localhost:5175",
|
||||
{ includeInternal: true },
|
||||
{ includeInternal: false },
|
||||
);
|
||||
|
||||
// Splice optional menus in a standard order
|
||||
|
||||
@@ -71,18 +71,20 @@ describe("orgChartPicker", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("builds the admin chart navigation URL with internal visibility enabled", () => {
|
||||
it("builds the admin chart navigation URL without internal visibility by default", () => {
|
||||
expect(buildAuthenticatedOrgChartUrl("https://orgchart.example.com/")).toBe(
|
||||
"https://orgchart.example.com/login?auto=1&returnTo=%2Fchart%3FincludeInternal%3Dtrue",
|
||||
"https://orgchart.example.com/login?auto=1&returnTo=%2Fchart",
|
||||
);
|
||||
});
|
||||
|
||||
it("can build chart navigation URL without internal visibility", () => {
|
||||
it("can build chart navigation URL with internal visibility when explicitly requested", () => {
|
||||
expect(
|
||||
buildAuthenticatedOrgChartUrl("https://orgchart.example.com/", {
|
||||
includeInternal: false,
|
||||
includeInternal: true,
|
||||
}),
|
||||
).toBe("https://orgchart.example.com/login?auto=1&returnTo=%2Fchart");
|
||||
).toBe(
|
||||
"https://orgchart.example.com/login?auto=1&returnTo=%2Fchart%3FincludeInternal%3Dtrue",
|
||||
);
|
||||
});
|
||||
|
||||
it("parses the first tenant id and name from orgfront confirm messages", () => {
|
||||
|
||||
@@ -348,7 +348,7 @@ export function buildAuthenticatedOrgChartUserMultiPickerUrl(baseUrl?: string) {
|
||||
|
||||
export function buildAuthenticatedOrgChartUrl(
|
||||
baseUrl?: string,
|
||||
options: OrgChartLoginOptions = { includeInternal: true },
|
||||
options: OrgChartLoginOptions = { includeInternal: false },
|
||||
) {
|
||||
const normalizedBase =
|
||||
baseUrl?.trim().replace(/\/+$/, "") || DEFAULT_ORGFRONT_BASE_URL;
|
||||
|
||||
Reference in New Issue
Block a user