1
0
forked from baron/baron-sso

chore: formatting and linting cleanup via code-check

This commit is contained in:
2026-06-02 18:53:56 +09:00
parent bf64f82507
commit f76dd4e60d
10 changed files with 266 additions and 323 deletions

View File

@@ -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";

View File

@@ -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");

View File

@@ -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"
); );
} }

View File

@@ -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(

View File

@@ -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">

View File

@@ -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
} }

View File

@@ -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

View File

@@ -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);
}); });

View File

@@ -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(