forked from baron/baron-sso
chore: formatting and linting cleanup via code-check
This commit is contained in:
@@ -4,7 +4,6 @@ import { Building2, Sparkles } from "lucide-react";
|
|||||||
import { useCallback, useMemo, useState } from "react";
|
import { useCallback, useMemo, useState } from "react";
|
||||||
import { useNavigate, useSearchParams } from "react-router-dom";
|
import { useNavigate, useSearchParams } from "react-router-dom";
|
||||||
import { Button } from "../../../components/ui/button";
|
import { Button } from "../../../components/ui/button";
|
||||||
import { Checkbox } from "../../../components/ui/checkbox";
|
|
||||||
import {
|
import {
|
||||||
Card,
|
Card,
|
||||||
CardContent,
|
CardContent,
|
||||||
@@ -12,6 +11,7 @@ import {
|
|||||||
CardHeader,
|
CardHeader,
|
||||||
CardTitle,
|
CardTitle,
|
||||||
} from "../../../components/ui/card";
|
} from "../../../components/ui/card";
|
||||||
|
import { Checkbox } from "../../../components/ui/checkbox";
|
||||||
import { Input } from "../../../components/ui/input";
|
import { Input } from "../../../components/ui/input";
|
||||||
import { Label } from "../../../components/ui/label";
|
import { Label } from "../../../components/ui/label";
|
||||||
import { Textarea } from "../../../components/ui/textarea";
|
import { Textarea } from "../../../components/ui/textarea";
|
||||||
|
|||||||
@@ -24,8 +24,6 @@ function TenantDetailPage() {
|
|||||||
|
|
||||||
const profileRole = normalizeAdminRole(profile?.role);
|
const profileRole = normalizeAdminRole(profile?.role);
|
||||||
const canAccessSchema = profileRole === "super_admin";
|
const canAccessSchema = profileRole === "super_admin";
|
||||||
Broadway
|
|
||||||
const showWorksmobileEntry = canShowWorksmobileEntry(tenantQuery.data);
|
|
||||||
|
|
||||||
const isPermissionsTab = location.pathname.includes("/permissions");
|
const isPermissionsTab = location.pathname.includes("/permissions");
|
||||||
const isOrganizationTab = location.pathname.includes("/organization");
|
const isOrganizationTab = location.pathname.includes("/organization");
|
||||||
|
|||||||
@@ -19,12 +19,13 @@ export type WorksmobileAccessProfile = {
|
|||||||
}>;
|
}>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function isWorksmobileExcludedConfig(
|
export function isWorksmobileExcludedConfig(config?: Record<string, unknown>) {
|
||||||
config?: Record<string, unknown>,
|
|
||||||
) {
|
|
||||||
const rawValue = config?.worksmobileExcluded;
|
const rawValue = config?.worksmobileExcluded;
|
||||||
return (
|
return (
|
||||||
rawValue === true || String(rawValue ?? "").trim().toLowerCase() === "true"
|
rawValue === true ||
|
||||||
|
String(rawValue ?? "")
|
||||||
|
.trim()
|
||||||
|
.toLowerCase() === "true"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,14 +80,10 @@ describe("tenant org config", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("reads, writes, and removes the Worksmobile exclusion flag", () => {
|
it("reads, writes, and removes the Worksmobile exclusion flag", () => {
|
||||||
expect(
|
expect(readTenantOrgConfig({ worksmobileExcluded: true })).toMatchObject({
|
||||||
readTenantOrgConfig({ worksmobileExcluded: true }),
|
|
||||||
).toMatchObject({
|
|
||||||
worksmobileExcluded: true,
|
worksmobileExcluded: true,
|
||||||
});
|
});
|
||||||
expect(
|
expect(readTenantOrgConfig({ worksmobileExcluded: "true" })).toMatchObject({
|
||||||
readTenantOrgConfig({ worksmobileExcluded: "true" }),
|
|
||||||
).toMatchObject({
|
|
||||||
worksmobileExcluded: true,
|
worksmobileExcluded: true,
|
||||||
});
|
});
|
||||||
expect(
|
expect(
|
||||||
|
|||||||
@@ -986,14 +986,13 @@ function UserCreatePage() {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<option value="">없음</option>
|
<option value="">없음</option>
|
||||||
{getTenantGradeOptions(
|
{getTenantGradeOptions(appointment, tenants).map(
|
||||||
appointment,
|
(grade) => (
|
||||||
tenants,
|
|
||||||
).map((grade) => (
|
|
||||||
<option key={grade} value={grade}>
|
<option key={grade} value={grade}>
|
||||||
{grade}
|
{grade}
|
||||||
</option>
|
</option>
|
||||||
))}
|
),
|
||||||
|
)}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
|
|||||||
@@ -82,4 +82,3 @@ func SyncKetoRelations(db *gorm.DB, outbox repository.KetoOutboxRepository) erro
|
|||||||
slog.Info("✅ Keto ReBAC synchronization items added to Outbox.")
|
slog.Info("✅ Keto ReBAC synchronization items added to Outbox.")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,10 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
const HanmacFamilyTenantSlug = "hanmac-family"
|
const (
|
||||||
const worksmobileExcludedConfigKey = "worksmobileExcluded"
|
HanmacFamilyTenantSlug = "hanmac-family"
|
||||||
|
worksmobileExcludedConfigKey = "worksmobileExcluded"
|
||||||
|
)
|
||||||
|
|
||||||
type WorksmobileSyncer interface {
|
type WorksmobileSyncer interface {
|
||||||
EnqueueTenantUpsertIfInScope(ctx context.Context, tenant domain.Tenant) error
|
EnqueueTenantUpsertIfInScope(ctx context.Context, tenant domain.Tenant) error
|
||||||
|
|||||||
@@ -50,9 +50,7 @@ describe("hanmac family organization order", () => {
|
|||||||
|
|
||||||
it("does not rank generic technical centers as GPDTDC", () => {
|
it("does not rank generic technical centers as GPDTDC", () => {
|
||||||
expect(
|
expect(
|
||||||
getHanmacFamilyTenantOrderRank(
|
getHanmacFamilyTenantOrderRank(tenant("기술개발센터", "rnd-center")),
|
||||||
tenant("기술개발센터", "rnd-center"),
|
|
||||||
),
|
|
||||||
).toBe(Number.MAX_SAFE_INTEGER);
|
).toBe(Number.MAX_SAFE_INTEGER);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -26,12 +26,7 @@ function tenant(
|
|||||||
describe("buildOrgPickerTree", () => {
|
describe("buildOrgPickerTree", () => {
|
||||||
it("uses the hanmac-family company-group as the default picker root", () => {
|
it("uses the hanmac-family company-group as the default picker root", () => {
|
||||||
const tenants = [
|
const tenants = [
|
||||||
tenant(
|
tenant("wrong-group", "COMPANY_GROUP", "Wrong Group", "wrong-group"),
|
||||||
"wrong-group",
|
|
||||||
"COMPANY_GROUP",
|
|
||||||
"Wrong Group",
|
|
||||||
"wrong-group",
|
|
||||||
),
|
|
||||||
tenant(
|
tenant(
|
||||||
"wrong-company",
|
"wrong-company",
|
||||||
"COMPANY",
|
"COMPANY",
|
||||||
@@ -39,12 +34,7 @@ describe("buildOrgPickerTree", () => {
|
|||||||
"wrong-company",
|
"wrong-company",
|
||||||
"wrong-group",
|
"wrong-group",
|
||||||
),
|
),
|
||||||
tenant(
|
tenant("hanmac-family-id", "COMPANY_GROUP", "한맥가족", "hanmac-family"),
|
||||||
"hanmac-family-id",
|
|
||||||
"COMPANY_GROUP",
|
|
||||||
"한맥가족",
|
|
||||||
"hanmac-family",
|
|
||||||
),
|
|
||||||
tenant("saman-id", "COMPANY", "삼안", "saman", "hanmac-family-id"),
|
tenant("saman-id", "COMPANY", "삼안", "saman", "hanmac-family-id"),
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -63,12 +53,7 @@ describe("buildOrgPickerTree", () => {
|
|||||||
|
|
||||||
it("orders hanmac-family children by the shared organization policy", () => {
|
it("orders hanmac-family children by the shared organization policy", () => {
|
||||||
const tenants = [
|
const tenants = [
|
||||||
tenant(
|
tenant("hanmac-family-id", "COMPANY_GROUP", "한맥가족", "hanmac-family"),
|
||||||
"hanmac-family-id",
|
|
||||||
"COMPANY_GROUP",
|
|
||||||
"한맥가족",
|
|
||||||
"hanmac-family",
|
|
||||||
),
|
|
||||||
tenant(
|
tenant(
|
||||||
"baron-group-id",
|
"baron-group-id",
|
||||||
"COMPANY_GROUP",
|
"COMPANY_GROUP",
|
||||||
@@ -76,13 +61,7 @@ describe("buildOrgPickerTree", () => {
|
|||||||
"baron-group",
|
"baron-group",
|
||||||
"hanmac-family-id",
|
"hanmac-family-id",
|
||||||
),
|
),
|
||||||
tenant(
|
tenant("hanmac-id", "COMPANY", "한맥기술", "hanmac", "hanmac-family-id"),
|
||||||
"hanmac-id",
|
|
||||||
"COMPANY",
|
|
||||||
"한맥기술",
|
|
||||||
"hanmac",
|
|
||||||
"hanmac-family-id",
|
|
||||||
),
|
|
||||||
tenant(
|
tenant(
|
||||||
"halla-id",
|
"halla-id",
|
||||||
"COMPANY",
|
"COMPANY",
|
||||||
@@ -116,27 +95,10 @@ describe("buildOrgPickerTree", () => {
|
|||||||
|
|
||||||
it("scopes descendant filtering by tenant slug", () => {
|
it("scopes descendant filtering by tenant slug", () => {
|
||||||
const tenants = [
|
const tenants = [
|
||||||
tenant(
|
tenant("hanmac-family-id", "COMPANY_GROUP", "한맥가족", "hanmac-family"),
|
||||||
"hanmac-family-id",
|
|
||||||
"COMPANY_GROUP",
|
|
||||||
"한맥가족",
|
|
||||||
"hanmac-family",
|
|
||||||
),
|
|
||||||
tenant("saman-id", "COMPANY", "삼안", "saman", "hanmac-family-id"),
|
tenant("saman-id", "COMPANY", "삼안", "saman", "hanmac-family-id"),
|
||||||
tenant(
|
tenant("planning-id", "ORGANIZATION", "기획팀", "planning", "saman-id"),
|
||||||
"planning-id",
|
tenant("hanmac-id", "COMPANY", "한맥기술", "hanmac", "hanmac-family-id"),
|
||||||
"ORGANIZATION",
|
|
||||||
"기획팀",
|
|
||||||
"planning",
|
|
||||||
"saman-id",
|
|
||||||
),
|
|
||||||
tenant(
|
|
||||||
"hanmac-id",
|
|
||||||
"COMPANY",
|
|
||||||
"한맥기술",
|
|
||||||
"hanmac",
|
|
||||||
"hanmac-family-id",
|
|
||||||
),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const tree = buildOrgPickerTree({
|
const tree = buildOrgPickerTree({
|
||||||
@@ -154,12 +116,7 @@ describe("buildOrgPickerTree", () => {
|
|||||||
|
|
||||||
it("excludes internal and private tenants from picker choices by default", () => {
|
it("excludes internal and private tenants from picker choices by default", () => {
|
||||||
const tenants = [
|
const tenants = [
|
||||||
tenant(
|
tenant("hanmac-family-id", "COMPANY_GROUP", "한맥가족", "hanmac-family"),
|
||||||
"hanmac-family-id",
|
|
||||||
"COMPANY_GROUP",
|
|
||||||
"한맥가족",
|
|
||||||
"hanmac-family",
|
|
||||||
),
|
|
||||||
tenant("saman-id", "COMPANY", "삼안", "saman", "hanmac-family-id"),
|
tenant("saman-id", "COMPANY", "삼안", "saman", "hanmac-family-id"),
|
||||||
{
|
{
|
||||||
...tenant(
|
...tenant(
|
||||||
@@ -197,19 +154,12 @@ describe("buildOrgPickerTree", () => {
|
|||||||
tenantId: "saman",
|
tenantId: "saman",
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(tree.roots[0]?.children.map((node) => node.id)).toEqual([
|
expect(tree.roots[0]?.children.map((node) => node.id)).toEqual(["open-id"]);
|
||||||
"open-id",
|
|
||||||
]);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("includes internal tenants when explicitly requested", () => {
|
it("includes internal tenants when explicitly requested", () => {
|
||||||
const tenants = [
|
const tenants = [
|
||||||
tenant(
|
tenant("hanmac-family-id", "COMPANY_GROUP", "한맥가족", "hanmac-family"),
|
||||||
"hanmac-family-id",
|
|
||||||
"COMPANY_GROUP",
|
|
||||||
"한맥가족",
|
|
||||||
"hanmac-family",
|
|
||||||
),
|
|
||||||
tenant("saman-id", "COMPANY", "삼안", "saman", "hanmac-family-id"),
|
tenant("saman-id", "COMPANY", "삼안", "saman", "hanmac-family-id"),
|
||||||
{
|
{
|
||||||
...tenant(
|
...tenant(
|
||||||
|
|||||||
Reference in New Issue
Block a user