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 { useNavigate, useSearchParams } from "react-router-dom";
|
||||
import { Button } from "../../../components/ui/button";
|
||||
import { Checkbox } from "../../../components/ui/checkbox";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
@@ -12,6 +11,7 @@ import {
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "../../../components/ui/card";
|
||||
import { Checkbox } from "../../../components/ui/checkbox";
|
||||
import { Input } from "../../../components/ui/input";
|
||||
import { Label } from "../../../components/ui/label";
|
||||
import { Textarea } from "../../../components/ui/textarea";
|
||||
|
||||
@@ -24,8 +24,6 @@ function TenantDetailPage() {
|
||||
|
||||
const profileRole = normalizeAdminRole(profile?.role);
|
||||
const canAccessSchema = profileRole === "super_admin";
|
||||
Broadway
|
||||
const showWorksmobileEntry = canShowWorksmobileEntry(tenantQuery.data);
|
||||
|
||||
const isPermissionsTab = location.pathname.includes("/permissions");
|
||||
const isOrganizationTab = location.pathname.includes("/organization");
|
||||
|
||||
@@ -19,12 +19,13 @@ export type WorksmobileAccessProfile = {
|
||||
}>;
|
||||
};
|
||||
|
||||
export function isWorksmobileExcludedConfig(
|
||||
config?: Record<string, unknown>,
|
||||
) {
|
||||
export function isWorksmobileExcludedConfig(config?: Record<string, unknown>) {
|
||||
const rawValue = config?.worksmobileExcluded;
|
||||
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", () => {
|
||||
expect(
|
||||
readTenantOrgConfig({ worksmobileExcluded: true }),
|
||||
).toMatchObject({
|
||||
expect(readTenantOrgConfig({ worksmobileExcluded: true })).toMatchObject({
|
||||
worksmobileExcluded: true,
|
||||
});
|
||||
expect(
|
||||
readTenantOrgConfig({ worksmobileExcluded: "true" }),
|
||||
).toMatchObject({
|
||||
expect(readTenantOrgConfig({ worksmobileExcluded: "true" })).toMatchObject({
|
||||
worksmobileExcluded: true,
|
||||
});
|
||||
expect(
|
||||
|
||||
@@ -986,14 +986,13 @@ function UserCreatePage() {
|
||||
}
|
||||
>
|
||||
<option value="">없음</option>
|
||||
{getTenantGradeOptions(
|
||||
appointment,
|
||||
tenants,
|
||||
).map((grade) => (
|
||||
{getTenantGradeOptions(appointment, tenants).map(
|
||||
(grade) => (
|
||||
<option key={grade} value={grade}>
|
||||
{grade}
|
||||
</option>
|
||||
))}
|
||||
),
|
||||
)}
|
||||
</select>
|
||||
</div>
|
||||
<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.")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,10 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const HanmacFamilyTenantSlug = "hanmac-family"
|
||||
const worksmobileExcludedConfigKey = "worksmobileExcluded"
|
||||
const (
|
||||
HanmacFamilyTenantSlug = "hanmac-family"
|
||||
worksmobileExcludedConfigKey = "worksmobileExcluded"
|
||||
)
|
||||
|
||||
type WorksmobileSyncer interface {
|
||||
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", () => {
|
||||
expect(
|
||||
getHanmacFamilyTenantOrderRank(
|
||||
tenant("기술개발센터", "rnd-center"),
|
||||
),
|
||||
getHanmacFamilyTenantOrderRank(tenant("기술개발센터", "rnd-center")),
|
||||
).toBe(Number.MAX_SAFE_INTEGER);
|
||||
});
|
||||
|
||||
|
||||
@@ -26,12 +26,7 @@ function tenant(
|
||||
describe("buildOrgPickerTree", () => {
|
||||
it("uses the hanmac-family company-group as the default picker root", () => {
|
||||
const tenants = [
|
||||
tenant(
|
||||
"wrong-group",
|
||||
"COMPANY_GROUP",
|
||||
"Wrong Group",
|
||||
"wrong-group",
|
||||
),
|
||||
tenant("wrong-group", "COMPANY_GROUP", "Wrong Group", "wrong-group"),
|
||||
tenant(
|
||||
"wrong-company",
|
||||
"COMPANY",
|
||||
@@ -39,12 +34,7 @@ describe("buildOrgPickerTree", () => {
|
||||
"wrong-company",
|
||||
"wrong-group",
|
||||
),
|
||||
tenant(
|
||||
"hanmac-family-id",
|
||||
"COMPANY_GROUP",
|
||||
"한맥가족",
|
||||
"hanmac-family",
|
||||
),
|
||||
tenant("hanmac-family-id", "COMPANY_GROUP", "한맥가족", "hanmac-family"),
|
||||
tenant("saman-id", "COMPANY", "삼안", "saman", "hanmac-family-id"),
|
||||
];
|
||||
|
||||
@@ -63,12 +53,7 @@ describe("buildOrgPickerTree", () => {
|
||||
|
||||
it("orders hanmac-family children by the shared organization policy", () => {
|
||||
const tenants = [
|
||||
tenant(
|
||||
"hanmac-family-id",
|
||||
"COMPANY_GROUP",
|
||||
"한맥가족",
|
||||
"hanmac-family",
|
||||
),
|
||||
tenant("hanmac-family-id", "COMPANY_GROUP", "한맥가족", "hanmac-family"),
|
||||
tenant(
|
||||
"baron-group-id",
|
||||
"COMPANY_GROUP",
|
||||
@@ -76,13 +61,7 @@ describe("buildOrgPickerTree", () => {
|
||||
"baron-group",
|
||||
"hanmac-family-id",
|
||||
),
|
||||
tenant(
|
||||
"hanmac-id",
|
||||
"COMPANY",
|
||||
"한맥기술",
|
||||
"hanmac",
|
||||
"hanmac-family-id",
|
||||
),
|
||||
tenant("hanmac-id", "COMPANY", "한맥기술", "hanmac", "hanmac-family-id"),
|
||||
tenant(
|
||||
"halla-id",
|
||||
"COMPANY",
|
||||
@@ -116,27 +95,10 @@ describe("buildOrgPickerTree", () => {
|
||||
|
||||
it("scopes descendant filtering by tenant slug", () => {
|
||||
const tenants = [
|
||||
tenant(
|
||||
"hanmac-family-id",
|
||||
"COMPANY_GROUP",
|
||||
"한맥가족",
|
||||
"hanmac-family",
|
||||
),
|
||||
tenant("hanmac-family-id", "COMPANY_GROUP", "한맥가족", "hanmac-family"),
|
||||
tenant("saman-id", "COMPANY", "삼안", "saman", "hanmac-family-id"),
|
||||
tenant(
|
||||
"planning-id",
|
||||
"ORGANIZATION",
|
||||
"기획팀",
|
||||
"planning",
|
||||
"saman-id",
|
||||
),
|
||||
tenant(
|
||||
"hanmac-id",
|
||||
"COMPANY",
|
||||
"한맥기술",
|
||||
"hanmac",
|
||||
"hanmac-family-id",
|
||||
),
|
||||
tenant("planning-id", "ORGANIZATION", "기획팀", "planning", "saman-id"),
|
||||
tenant("hanmac-id", "COMPANY", "한맥기술", "hanmac", "hanmac-family-id"),
|
||||
];
|
||||
|
||||
const tree = buildOrgPickerTree({
|
||||
@@ -154,12 +116,7 @@ describe("buildOrgPickerTree", () => {
|
||||
|
||||
it("excludes internal and private tenants from picker choices by default", () => {
|
||||
const tenants = [
|
||||
tenant(
|
||||
"hanmac-family-id",
|
||||
"COMPANY_GROUP",
|
||||
"한맥가족",
|
||||
"hanmac-family",
|
||||
),
|
||||
tenant("hanmac-family-id", "COMPANY_GROUP", "한맥가족", "hanmac-family"),
|
||||
tenant("saman-id", "COMPANY", "삼안", "saman", "hanmac-family-id"),
|
||||
{
|
||||
...tenant(
|
||||
@@ -197,19 +154,12 @@ describe("buildOrgPickerTree", () => {
|
||||
tenantId: "saman",
|
||||
});
|
||||
|
||||
expect(tree.roots[0]?.children.map((node) => node.id)).toEqual([
|
||||
"open-id",
|
||||
]);
|
||||
expect(tree.roots[0]?.children.map((node) => node.id)).toEqual(["open-id"]);
|
||||
});
|
||||
|
||||
it("includes internal tenants when explicitly requested", () => {
|
||||
const tenants = [
|
||||
tenant(
|
||||
"hanmac-family-id",
|
||||
"COMPANY_GROUP",
|
||||
"한맥가족",
|
||||
"hanmac-family",
|
||||
),
|
||||
tenant("hanmac-family-id", "COMPANY_GROUP", "한맥가족", "hanmac-family"),
|
||||
tenant("saman-id", "COMPANY", "삼안", "saman", "hanmac-family-id"),
|
||||
{
|
||||
...tenant(
|
||||
|
||||
Reference in New Issue
Block a user