@famgia/omnify-react-sso 2.2.6 → 2.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ant/index.cjs +644 -495
- package/dist/ant/index.cjs.map +1 -1
- package/dist/ant/index.d.cts +43 -1
- package/dist/ant/index.d.ts +43 -1
- package/dist/ant/index.js +502 -354
- package/dist/ant/index.js.map +1 -1
- package/dist/index.cjs +680 -505
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -1
- package/dist/index.d.ts +40 -1
- package/dist/index.js +526 -356
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/ant/index.js
CHANGED
|
@@ -839,13 +839,160 @@ function OrgBranchSelectorModal({
|
|
|
839
839
|
);
|
|
840
840
|
}
|
|
841
841
|
|
|
842
|
+
// src/ant/components/OrgGate/OrgGate.tsx
|
|
843
|
+
import { Modal as Modal2, Select as Select2, Spin as Spin2, Typography as Typography3 } from "antd";
|
|
844
|
+
import { useEffect as useEffect4, useState as useState3 } from "react";
|
|
845
|
+
|
|
846
|
+
// src/core/utils/orgSync.ts
|
|
847
|
+
var _currentOrgId = null;
|
|
848
|
+
var ORG_ID_STORAGE_KEY = "api_current_org_id";
|
|
849
|
+
function setOrgIdForApi(orgId) {
|
|
850
|
+
_currentOrgId = orgId;
|
|
851
|
+
if (typeof window === "undefined") return;
|
|
852
|
+
if (orgId) {
|
|
853
|
+
localStorage.setItem(ORG_ID_STORAGE_KEY, orgId);
|
|
854
|
+
} else {
|
|
855
|
+
localStorage.removeItem(ORG_ID_STORAGE_KEY);
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
// src/core/hooks/useSso.ts
|
|
860
|
+
import { useMemo as useMemo4 } from "react";
|
|
861
|
+
function useSso() {
|
|
862
|
+
const context = useSsoContext();
|
|
863
|
+
return useMemo4(
|
|
864
|
+
() => ({
|
|
865
|
+
// Auth
|
|
866
|
+
user: context.user,
|
|
867
|
+
isLoading: context.isLoading,
|
|
868
|
+
isAuthenticated: context.isAuthenticated,
|
|
869
|
+
login: context.login,
|
|
870
|
+
logout: context.logout,
|
|
871
|
+
globalLogout: context.globalLogout,
|
|
872
|
+
refreshUser: context.refreshUser,
|
|
873
|
+
// Organization
|
|
874
|
+
organizations: context.organizations,
|
|
875
|
+
currentOrg: context.currentOrg,
|
|
876
|
+
hasMultipleOrgs: context.organizations.length > 1,
|
|
877
|
+
switchOrg: context.switchOrg,
|
|
878
|
+
// Utilities
|
|
879
|
+
getHeaders: context.getHeaders,
|
|
880
|
+
config: context.config
|
|
881
|
+
}),
|
|
882
|
+
[context]
|
|
883
|
+
);
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
// src/ant/components/OrgGate/OrgGate.tsx
|
|
887
|
+
import { Fragment as Fragment3, jsx as jsx5 } from "react/jsx-runtime";
|
|
888
|
+
var { Text: Text3 } = Typography3;
|
|
889
|
+
var defaultTranslations = {
|
|
890
|
+
selectOrgTitle: "\u7D44\u7E54\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
891
|
+
confirmText: "\u9078\u629E",
|
|
892
|
+
selectPlaceholder: "\u7D44\u7E54\u3092\u9078\u629E",
|
|
893
|
+
noOrgsMessage: "\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u7D44\u7E54\u304C\u3042\u308A\u307E\u305B\u3093"
|
|
894
|
+
};
|
|
895
|
+
function OrgGate({
|
|
896
|
+
children,
|
|
897
|
+
translations: customTranslations,
|
|
898
|
+
loadingComponent,
|
|
899
|
+
onOrgChange
|
|
900
|
+
}) {
|
|
901
|
+
const t = { ...defaultTranslations, ...customTranslations };
|
|
902
|
+
const { isLoading: ssoLoading, isAuthenticated } = useSso();
|
|
903
|
+
const { organizations, currentOrg, switchOrg } = useOrganization();
|
|
904
|
+
const [selectedOrgSlug, setSelectedOrgSlug] = useState3(void 0);
|
|
905
|
+
useEffect4(() => {
|
|
906
|
+
if (!ssoLoading && isAuthenticated && organizations.length === 1 && !currentOrg) {
|
|
907
|
+
switchOrg(organizations[0].slug);
|
|
908
|
+
}
|
|
909
|
+
}, [ssoLoading, isAuthenticated, organizations, currentOrg, switchOrg]);
|
|
910
|
+
if (currentOrg?.slug) {
|
|
911
|
+
setOrgIdForApi(currentOrg.slug);
|
|
912
|
+
if (onOrgChange) {
|
|
913
|
+
onOrgChange(currentOrg.slug);
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
if (ssoLoading) {
|
|
917
|
+
if (loadingComponent) {
|
|
918
|
+
return /* @__PURE__ */ jsx5(Fragment3, { children: loadingComponent });
|
|
919
|
+
}
|
|
920
|
+
return /* @__PURE__ */ jsx5(
|
|
921
|
+
"div",
|
|
922
|
+
{
|
|
923
|
+
style: {
|
|
924
|
+
display: "flex",
|
|
925
|
+
justifyContent: "center",
|
|
926
|
+
alignItems: "center",
|
|
927
|
+
minHeight: "100vh"
|
|
928
|
+
},
|
|
929
|
+
children: /* @__PURE__ */ jsx5(Spin2, { size: "large" })
|
|
930
|
+
}
|
|
931
|
+
);
|
|
932
|
+
}
|
|
933
|
+
if (!isAuthenticated) {
|
|
934
|
+
return /* @__PURE__ */ jsx5(Fragment3, { children });
|
|
935
|
+
}
|
|
936
|
+
if (organizations.length === 0) {
|
|
937
|
+
return /* @__PURE__ */ jsx5(
|
|
938
|
+
"div",
|
|
939
|
+
{
|
|
940
|
+
style: {
|
|
941
|
+
display: "flex",
|
|
942
|
+
justifyContent: "center",
|
|
943
|
+
alignItems: "center",
|
|
944
|
+
minHeight: "100vh",
|
|
945
|
+
flexDirection: "column",
|
|
946
|
+
gap: 16
|
|
947
|
+
},
|
|
948
|
+
children: /* @__PURE__ */ jsx5(Text3, { type: "secondary", children: t.noOrgsMessage })
|
|
949
|
+
}
|
|
950
|
+
);
|
|
951
|
+
}
|
|
952
|
+
if (currentOrg) {
|
|
953
|
+
return /* @__PURE__ */ jsx5(Fragment3, { children });
|
|
954
|
+
}
|
|
955
|
+
const handleConfirm = () => {
|
|
956
|
+
if (selectedOrgSlug) {
|
|
957
|
+
switchOrg(selectedOrgSlug);
|
|
958
|
+
}
|
|
959
|
+
};
|
|
960
|
+
return /* @__PURE__ */ jsx5(
|
|
961
|
+
Modal2,
|
|
962
|
+
{
|
|
963
|
+
open: true,
|
|
964
|
+
closable: false,
|
|
965
|
+
maskClosable: false,
|
|
966
|
+
title: t.selectOrgTitle,
|
|
967
|
+
okText: t.confirmText,
|
|
968
|
+
okButtonProps: { disabled: !selectedOrgSlug },
|
|
969
|
+
onOk: handleConfirm,
|
|
970
|
+
cancelButtonProps: { style: { display: "none" } },
|
|
971
|
+
children: /* @__PURE__ */ jsx5("div", { style: { marginTop: 16 }, children: /* @__PURE__ */ jsx5(
|
|
972
|
+
Select2,
|
|
973
|
+
{
|
|
974
|
+
placeholder: t.selectPlaceholder,
|
|
975
|
+
style: { width: "100%" },
|
|
976
|
+
value: selectedOrgSlug,
|
|
977
|
+
onChange: setSelectedOrgSlug,
|
|
978
|
+
options: organizations.map((org) => ({
|
|
979
|
+
value: org.slug,
|
|
980
|
+
label: org.name
|
|
981
|
+
})),
|
|
982
|
+
size: "large"
|
|
983
|
+
}
|
|
984
|
+
) })
|
|
985
|
+
}
|
|
986
|
+
);
|
|
987
|
+
}
|
|
988
|
+
|
|
842
989
|
// src/ant/components/BranchGate/BranchGate.tsx
|
|
843
|
-
import React5, { useEffect as
|
|
844
|
-
import { Select as
|
|
990
|
+
import React5, { useEffect as useEffect5, useState as useState4 } from "react";
|
|
991
|
+
import { Select as Select3, Space as Space3, Typography as Typography4, Badge as Badge3, Spin as Spin3, Button as Button2, Alert as Alert2 } from "antd";
|
|
845
992
|
import { BankOutlined as BankOutlined2, ApartmentOutlined as ApartmentOutlined2, CheckCircleFilled as CheckCircleFilled2 } from "@ant-design/icons";
|
|
846
993
|
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
|
847
|
-
import { Fragment as
|
|
848
|
-
var { Text:
|
|
994
|
+
import { Fragment as Fragment4, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
995
|
+
var { Text: Text4, Title: Title2 } = Typography4;
|
|
849
996
|
var DEFAULT_STORAGE_KEY = "omnify_branch_gate_selection";
|
|
850
997
|
function BranchGate({
|
|
851
998
|
children,
|
|
@@ -857,10 +1004,10 @@ function BranchGate({
|
|
|
857
1004
|
}) {
|
|
858
1005
|
const { config, isAuthenticated } = useSsoContext();
|
|
859
1006
|
const { organizations, currentOrg, hasMultipleOrgs } = useOrganization();
|
|
860
|
-
const [storedSelection, setStoredSelection] =
|
|
861
|
-
const [isInitialized, setIsInitialized] =
|
|
862
|
-
const [tempOrgId, setTempOrgId] =
|
|
863
|
-
const [tempBranchId, setTempBranchId] =
|
|
1007
|
+
const [storedSelection, setStoredSelection] = useState4(null);
|
|
1008
|
+
const [isInitialized, setIsInitialized] = useState4(false);
|
|
1009
|
+
const [tempOrgId, setTempOrgId] = useState4(null);
|
|
1010
|
+
const [tempBranchId, setTempBranchId] = useState4(null);
|
|
864
1011
|
const branchService = React5.useMemo(
|
|
865
1012
|
() => createBranchService({ apiUrl: config.apiUrl }),
|
|
866
1013
|
[config.apiUrl]
|
|
@@ -878,7 +1025,7 @@ function BranchGate({
|
|
|
878
1025
|
});
|
|
879
1026
|
const branches = branchesData?.branches ?? [];
|
|
880
1027
|
const hasMultipleBranches = branches.length > 1;
|
|
881
|
-
|
|
1028
|
+
useEffect5(() => {
|
|
882
1029
|
if (typeof window === "undefined") return;
|
|
883
1030
|
const saved = localStorage.getItem(storageKey);
|
|
884
1031
|
if (saved) {
|
|
@@ -892,13 +1039,13 @@ function BranchGate({
|
|
|
892
1039
|
}
|
|
893
1040
|
setIsInitialized(true);
|
|
894
1041
|
}, [storageKey, onSelectionChange]);
|
|
895
|
-
|
|
1042
|
+
useEffect5(() => {
|
|
896
1043
|
if (!isAuthenticated || !isInitialized || storedSelection) return;
|
|
897
1044
|
if (organizations.length === 1 && !tempOrgId) {
|
|
898
1045
|
setTempOrgId(String(organizations[0].id));
|
|
899
1046
|
}
|
|
900
1047
|
}, [isAuthenticated, isInitialized, organizations, storedSelection, tempOrgId]);
|
|
901
|
-
|
|
1048
|
+
useEffect5(() => {
|
|
902
1049
|
if (!tempOrgId || branchesLoading || storedSelection) return;
|
|
903
1050
|
if (branches.length === 1 && !tempBranchId) {
|
|
904
1051
|
setTempBranchId(String(branches[0].id));
|
|
@@ -914,7 +1061,7 @@ function BranchGate({
|
|
|
914
1061
|
}
|
|
915
1062
|
}
|
|
916
1063
|
}, [tempOrgId, branches, branchesLoading, branchesData, storedSelection, tempBranchId]);
|
|
917
|
-
|
|
1064
|
+
useEffect5(() => {
|
|
918
1065
|
if (storedSelection || !isInitialized) return;
|
|
919
1066
|
if (!tempOrgId || !tempBranchId || branchesLoading) return;
|
|
920
1067
|
if (!hasMultipleOrgs && !hasMultipleBranches) {
|
|
@@ -948,19 +1095,19 @@ function BranchGate({
|
|
|
948
1095
|
const isLoading = !isAuthenticated || !isInitialized || !!activeOrgSlug && branchesLoading && !storedSelection;
|
|
949
1096
|
if (isLoading && !needsSelection) {
|
|
950
1097
|
if (loadingComponent) {
|
|
951
|
-
return /* @__PURE__ */
|
|
1098
|
+
return /* @__PURE__ */ jsx6(Fragment4, { children: loadingComponent });
|
|
952
1099
|
}
|
|
953
|
-
return /* @__PURE__ */
|
|
1100
|
+
return /* @__PURE__ */ jsx6("div", { style: {
|
|
954
1101
|
display: "flex",
|
|
955
1102
|
justifyContent: "center",
|
|
956
1103
|
alignItems: "center",
|
|
957
1104
|
minHeight: "100vh",
|
|
958
1105
|
background: "linear-gradient(135deg, #667eea 0%, #764ba2 100%)"
|
|
959
|
-
}, children: /* @__PURE__ */
|
|
1106
|
+
}, children: /* @__PURE__ */ jsx6(Spin3, { size: "large" }) });
|
|
960
1107
|
}
|
|
961
1108
|
if (needsSelection) {
|
|
962
1109
|
const canConfirm = tempOrgId && tempBranchId;
|
|
963
|
-
return /* @__PURE__ */
|
|
1110
|
+
return /* @__PURE__ */ jsx6("div", { style: {
|
|
964
1111
|
minHeight: "100vh",
|
|
965
1112
|
background: "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
|
|
966
1113
|
display: "flex",
|
|
@@ -976,7 +1123,7 @@ function BranchGate({
|
|
|
976
1123
|
boxShadow: "0 20px 60px rgba(0,0,0,0.3)"
|
|
977
1124
|
}, children: [
|
|
978
1125
|
/* @__PURE__ */ jsxs5("div", { style: { textAlign: "center", marginBottom: 24 }, children: [
|
|
979
|
-
/* @__PURE__ */
|
|
1126
|
+
/* @__PURE__ */ jsx6("div", { style: {
|
|
980
1127
|
width: 64,
|
|
981
1128
|
height: 64,
|
|
982
1129
|
borderRadius: "50%",
|
|
@@ -985,18 +1132,18 @@ function BranchGate({
|
|
|
985
1132
|
alignItems: "center",
|
|
986
1133
|
justifyContent: "center",
|
|
987
1134
|
margin: "0 auto 16px"
|
|
988
|
-
}, children: /* @__PURE__ */
|
|
989
|
-
/* @__PURE__ */
|
|
990
|
-
/* @__PURE__ */
|
|
1135
|
+
}, children: /* @__PURE__ */ jsx6(BankOutlined2, { style: { fontSize: 28, color: "#fff" } }) }),
|
|
1136
|
+
/* @__PURE__ */ jsx6(Title2, { level: 3, style: { margin: 0 }, children: title ?? "Select Organization" }),
|
|
1137
|
+
/* @__PURE__ */ jsx6(Text4, { type: "secondary", children: description ?? "Please select your organization and branch to continue" })
|
|
991
1138
|
] }),
|
|
992
1139
|
/* @__PURE__ */ jsxs5("div", { style: { marginBottom: 20 }, children: [
|
|
993
|
-
/* @__PURE__ */
|
|
994
|
-
/* @__PURE__ */
|
|
995
|
-
/* @__PURE__ */
|
|
996
|
-
!hasMultipleOrgs && /* @__PURE__ */
|
|
1140
|
+
/* @__PURE__ */ jsx6(Text4, { strong: true, style: { display: "block", marginBottom: 8 }, children: /* @__PURE__ */ jsxs5(Space3, { children: [
|
|
1141
|
+
/* @__PURE__ */ jsx6(BankOutlined2, {}),
|
|
1142
|
+
/* @__PURE__ */ jsx6("span", { children: "Organization" }),
|
|
1143
|
+
!hasMultipleOrgs && /* @__PURE__ */ jsx6(Badge3, { status: "success", text: "Auto-selected" })
|
|
997
1144
|
] }) }),
|
|
998
|
-
hasMultipleOrgs ? /* @__PURE__ */
|
|
999
|
-
|
|
1145
|
+
hasMultipleOrgs ? /* @__PURE__ */ jsx6(
|
|
1146
|
+
Select3,
|
|
1000
1147
|
{
|
|
1001
1148
|
value: tempOrgId,
|
|
1002
1149
|
onChange: (value) => {
|
|
@@ -1007,36 +1154,36 @@ function BranchGate({
|
|
|
1007
1154
|
size: "large",
|
|
1008
1155
|
style: { width: "100%" },
|
|
1009
1156
|
optionLabelProp: "label",
|
|
1010
|
-
children: organizations.map((org) => /* @__PURE__ */
|
|
1011
|
-
/* @__PURE__ */
|
|
1012
|
-
org.serviceRole && /* @__PURE__ */ jsxs5(
|
|
1157
|
+
children: organizations.map((org) => /* @__PURE__ */ jsx6(Select3.Option, { value: String(org.id), label: org.name, children: /* @__PURE__ */ jsx6(Space3, { style: { width: "100%", justifyContent: "space-between" }, children: /* @__PURE__ */ jsxs5("div", { children: [
|
|
1158
|
+
/* @__PURE__ */ jsx6(Text4, { strong: true, children: org.name }),
|
|
1159
|
+
org.serviceRole && /* @__PURE__ */ jsxs5(Text4, { type: "secondary", style: { marginLeft: 8, fontSize: 12 }, children: [
|
|
1013
1160
|
"(",
|
|
1014
1161
|
org.serviceRole,
|
|
1015
1162
|
")"
|
|
1016
1163
|
] })
|
|
1017
1164
|
] }) }) }, org.id))
|
|
1018
1165
|
}
|
|
1019
|
-
) : /* @__PURE__ */
|
|
1166
|
+
) : /* @__PURE__ */ jsx6("div", { style: {
|
|
1020
1167
|
padding: "8px 12px",
|
|
1021
1168
|
background: "#f5f5f5",
|
|
1022
1169
|
borderRadius: 6,
|
|
1023
1170
|
border: "1px solid #d9d9d9"
|
|
1024
1171
|
}, children: /* @__PURE__ */ jsxs5(Space3, { children: [
|
|
1025
|
-
/* @__PURE__ */
|
|
1026
|
-
/* @__PURE__ */
|
|
1172
|
+
/* @__PURE__ */ jsx6(BankOutlined2, { style: { color: "#1677ff" } }),
|
|
1173
|
+
/* @__PURE__ */ jsx6(Text4, { strong: true, children: organizations[0]?.name })
|
|
1027
1174
|
] }) })
|
|
1028
1175
|
] }),
|
|
1029
1176
|
tempOrgId && /* @__PURE__ */ jsxs5("div", { style: { marginBottom: 24 }, children: [
|
|
1030
|
-
/* @__PURE__ */
|
|
1031
|
-
/* @__PURE__ */
|
|
1032
|
-
/* @__PURE__ */
|
|
1033
|
-
!hasMultipleBranches && branches.length === 1 && /* @__PURE__ */
|
|
1177
|
+
/* @__PURE__ */ jsx6(Text4, { strong: true, style: { display: "block", marginBottom: 8 }, children: /* @__PURE__ */ jsxs5(Space3, { children: [
|
|
1178
|
+
/* @__PURE__ */ jsx6(ApartmentOutlined2, {}),
|
|
1179
|
+
/* @__PURE__ */ jsx6("span", { children: "Branch" }),
|
|
1180
|
+
!hasMultipleBranches && branches.length === 1 && /* @__PURE__ */ jsx6(Badge3, { status: "success", text: "Auto-selected" })
|
|
1034
1181
|
] }) }),
|
|
1035
1182
|
branchesLoading ? /* @__PURE__ */ jsxs5("div", { style: { padding: "12px", textAlign: "center" }, children: [
|
|
1036
|
-
/* @__PURE__ */
|
|
1037
|
-
/* @__PURE__ */
|
|
1038
|
-
] }) : hasMultipleBranches ? /* @__PURE__ */
|
|
1039
|
-
|
|
1183
|
+
/* @__PURE__ */ jsx6(Spin3, { size: "small" }),
|
|
1184
|
+
/* @__PURE__ */ jsx6(Text4, { type: "secondary", style: { marginLeft: 8 }, children: "Loading..." })
|
|
1185
|
+
] }) : hasMultipleBranches ? /* @__PURE__ */ jsx6(
|
|
1186
|
+
Select3,
|
|
1040
1187
|
{
|
|
1041
1188
|
value: tempBranchId,
|
|
1042
1189
|
onChange: (value) => setTempBranchId(String(value)),
|
|
@@ -1044,31 +1191,31 @@ function BranchGate({
|
|
|
1044
1191
|
size: "large",
|
|
1045
1192
|
style: { width: "100%" },
|
|
1046
1193
|
optionLabelProp: "label",
|
|
1047
|
-
children: branches.map((branch) => /* @__PURE__ */
|
|
1194
|
+
children: branches.map((branch) => /* @__PURE__ */ jsx6(Select3.Option, { value: String(branch.id), label: branch.name, children: /* @__PURE__ */ jsxs5(Space3, { style: { width: "100%", justifyContent: "space-between" }, children: [
|
|
1048
1195
|
/* @__PURE__ */ jsxs5("div", { children: [
|
|
1049
|
-
/* @__PURE__ */
|
|
1050
|
-
/* @__PURE__ */
|
|
1196
|
+
/* @__PURE__ */ jsx6(Text4, { strong: true, children: branch.name }),
|
|
1197
|
+
/* @__PURE__ */ jsx6(Text4, { type: "secondary", style: { marginLeft: 8, fontSize: 12 }, children: branch.code })
|
|
1051
1198
|
] }),
|
|
1052
1199
|
/* @__PURE__ */ jsxs5(Space3, { size: 4, children: [
|
|
1053
|
-
branch.is_headquarters && /* @__PURE__ */
|
|
1054
|
-
branch.is_primary && /* @__PURE__ */
|
|
1200
|
+
branch.is_headquarters && /* @__PURE__ */ jsx6(Badge3, { color: "blue", text: "HQ" }),
|
|
1201
|
+
branch.is_primary && /* @__PURE__ */ jsx6(Badge3, { color: "green", text: "Primary" })
|
|
1055
1202
|
] })
|
|
1056
1203
|
] }) }, branch.id))
|
|
1057
1204
|
}
|
|
1058
|
-
) : branches.length === 1 ? /* @__PURE__ */
|
|
1205
|
+
) : branches.length === 1 ? /* @__PURE__ */ jsx6("div", { style: {
|
|
1059
1206
|
padding: "8px 12px",
|
|
1060
1207
|
background: "#f5f5f5",
|
|
1061
1208
|
borderRadius: 6,
|
|
1062
1209
|
border: "1px solid #d9d9d9"
|
|
1063
1210
|
}, children: /* @__PURE__ */ jsxs5(Space3, { children: [
|
|
1064
|
-
/* @__PURE__ */
|
|
1065
|
-
/* @__PURE__ */
|
|
1066
|
-
/* @__PURE__ */ jsxs5(
|
|
1211
|
+
/* @__PURE__ */ jsx6(ApartmentOutlined2, { style: { color: "#1677ff" } }),
|
|
1212
|
+
/* @__PURE__ */ jsx6(Text4, { strong: true, children: branches[0].name }),
|
|
1213
|
+
/* @__PURE__ */ jsxs5(Text4, { type: "secondary", children: [
|
|
1067
1214
|
"(",
|
|
1068
1215
|
branches[0].code,
|
|
1069
1216
|
")"
|
|
1070
1217
|
] })
|
|
1071
|
-
] }) }) : /* @__PURE__ */
|
|
1218
|
+
] }) }) : /* @__PURE__ */ jsx6(
|
|
1072
1219
|
Alert2,
|
|
1073
1220
|
{
|
|
1074
1221
|
type: "warning",
|
|
@@ -1077,7 +1224,7 @@ function BranchGate({
|
|
|
1077
1224
|
}
|
|
1078
1225
|
)
|
|
1079
1226
|
] }),
|
|
1080
|
-
/* @__PURE__ */
|
|
1227
|
+
/* @__PURE__ */ jsx6(
|
|
1081
1228
|
Button2,
|
|
1082
1229
|
{
|
|
1083
1230
|
type: "primary",
|
|
@@ -1085,7 +1232,7 @@ function BranchGate({
|
|
|
1085
1232
|
block: true,
|
|
1086
1233
|
disabled: !canConfirm,
|
|
1087
1234
|
onClick: confirmSelection,
|
|
1088
|
-
icon: /* @__PURE__ */
|
|
1235
|
+
icon: /* @__PURE__ */ jsx6(CheckCircleFilled2, {}),
|
|
1089
1236
|
style: {
|
|
1090
1237
|
height: 48,
|
|
1091
1238
|
fontSize: 16,
|
|
@@ -1097,11 +1244,11 @@ function BranchGate({
|
|
|
1097
1244
|
)
|
|
1098
1245
|
] }) });
|
|
1099
1246
|
}
|
|
1100
|
-
return /* @__PURE__ */
|
|
1247
|
+
return /* @__PURE__ */ jsx6(Fragment4, { children });
|
|
1101
1248
|
}
|
|
1102
1249
|
function useBranchGate(storageKey = DEFAULT_STORAGE_KEY) {
|
|
1103
|
-
const [selection, setSelection] =
|
|
1104
|
-
|
|
1250
|
+
const [selection, setSelection] = useState4(null);
|
|
1251
|
+
useEffect5(() => {
|
|
1105
1252
|
if (typeof window === "undefined") return;
|
|
1106
1253
|
const saved = localStorage.getItem(storageKey);
|
|
1107
1254
|
if (saved) {
|
|
@@ -1152,7 +1299,7 @@ import {
|
|
|
1152
1299
|
Table,
|
|
1153
1300
|
Form as Form2,
|
|
1154
1301
|
Input,
|
|
1155
|
-
Select as
|
|
1302
|
+
Select as Select4,
|
|
1156
1303
|
DatePicker,
|
|
1157
1304
|
InputNumber,
|
|
1158
1305
|
Button as Button3,
|
|
@@ -1161,13 +1308,13 @@ import {
|
|
|
1161
1308
|
Col,
|
|
1162
1309
|
Tooltip,
|
|
1163
1310
|
Divider,
|
|
1164
|
-
Typography as
|
|
1311
|
+
Typography as Typography5,
|
|
1165
1312
|
Popconfirm,
|
|
1166
1313
|
theme
|
|
1167
1314
|
} from "antd";
|
|
1168
|
-
import { useState as
|
|
1169
|
-
import { jsx as
|
|
1170
|
-
var { Link } =
|
|
1315
|
+
import { useState as useState5, useMemo as useMemo5, useCallback as useCallback5 } from "react";
|
|
1316
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1317
|
+
var { Link } = Typography5;
|
|
1171
1318
|
var { RangePicker } = DatePicker;
|
|
1172
1319
|
var InertiaLink = null;
|
|
1173
1320
|
try {
|
|
@@ -1207,8 +1354,8 @@ var DEFAULT_STATUS_CONFIG = {
|
|
|
1207
1354
|
function renderSearchField(field, texts) {
|
|
1208
1355
|
switch (field.type) {
|
|
1209
1356
|
case "select":
|
|
1210
|
-
return /* @__PURE__ */
|
|
1211
|
-
|
|
1357
|
+
return /* @__PURE__ */ jsx7(
|
|
1358
|
+
Select4,
|
|
1212
1359
|
{
|
|
1213
1360
|
allowClear: true,
|
|
1214
1361
|
placeholder: field.placeholder || texts.selectPlaceholder,
|
|
@@ -1217,7 +1364,7 @@ function renderSearchField(field, texts) {
|
|
|
1217
1364
|
}
|
|
1218
1365
|
);
|
|
1219
1366
|
case "date":
|
|
1220
|
-
return /* @__PURE__ */
|
|
1367
|
+
return /* @__PURE__ */ jsx7(
|
|
1221
1368
|
DatePicker,
|
|
1222
1369
|
{
|
|
1223
1370
|
placeholder: field.placeholder,
|
|
@@ -1225,7 +1372,7 @@ function renderSearchField(field, texts) {
|
|
|
1225
1372
|
}
|
|
1226
1373
|
);
|
|
1227
1374
|
case "dateRange":
|
|
1228
|
-
return /* @__PURE__ */
|
|
1375
|
+
return /* @__PURE__ */ jsx7(
|
|
1229
1376
|
RangePicker,
|
|
1230
1377
|
{
|
|
1231
1378
|
placeholder: [texts.startDate, texts.endDate],
|
|
@@ -1233,7 +1380,7 @@ function renderSearchField(field, texts) {
|
|
|
1233
1380
|
}
|
|
1234
1381
|
);
|
|
1235
1382
|
case "number":
|
|
1236
|
-
return /* @__PURE__ */
|
|
1383
|
+
return /* @__PURE__ */ jsx7(
|
|
1237
1384
|
InputNumber,
|
|
1238
1385
|
{
|
|
1239
1386
|
placeholder: field.placeholder,
|
|
@@ -1241,7 +1388,7 @@ function renderSearchField(field, texts) {
|
|
|
1241
1388
|
}
|
|
1242
1389
|
);
|
|
1243
1390
|
default:
|
|
1244
|
-
return /* @__PURE__ */
|
|
1391
|
+
return /* @__PURE__ */ jsx7(
|
|
1245
1392
|
Input,
|
|
1246
1393
|
{
|
|
1247
1394
|
allowClear: true,
|
|
@@ -1252,9 +1399,9 @@ function renderSearchField(field, texts) {
|
|
|
1252
1399
|
}
|
|
1253
1400
|
function SmartLink({ href, children }) {
|
|
1254
1401
|
if (InertiaLink) {
|
|
1255
|
-
return /* @__PURE__ */
|
|
1402
|
+
return /* @__PURE__ */ jsx7(InertiaLink, { href, children });
|
|
1256
1403
|
}
|
|
1257
|
-
return /* @__PURE__ */
|
|
1404
|
+
return /* @__PURE__ */ jsx7("a", { href, children });
|
|
1258
1405
|
}
|
|
1259
1406
|
function renderValue(value, valueType, statusConfig) {
|
|
1260
1407
|
if (value === null || value === void 0) {
|
|
@@ -1266,7 +1413,7 @@ function renderValue(value, valueType, statusConfig) {
|
|
|
1266
1413
|
const statusValue = String(value);
|
|
1267
1414
|
const status = config[statusValue] || { color: "#d9d9d9", text: statusValue };
|
|
1268
1415
|
return /* @__PURE__ */ jsxs6(Space4, { children: [
|
|
1269
|
-
/* @__PURE__ */
|
|
1416
|
+
/* @__PURE__ */ jsx7(
|
|
1270
1417
|
"span",
|
|
1271
1418
|
{
|
|
1272
1419
|
style: {
|
|
@@ -1341,8 +1488,8 @@ function ProTable({
|
|
|
1341
1488
|
const { token } = theme.useToken();
|
|
1342
1489
|
const texts = { ...DEFAULT_TEXTS, ...customTexts };
|
|
1343
1490
|
const [searchForm] = Form2.useForm();
|
|
1344
|
-
const [expanded, setExpanded] =
|
|
1345
|
-
const [queryParams, setQueryParams] =
|
|
1491
|
+
const [expanded, setExpanded] = useState5(false);
|
|
1492
|
+
const [queryParams, setQueryParams] = useState5({
|
|
1346
1493
|
page: 1,
|
|
1347
1494
|
per_page: defaultPageSize,
|
|
1348
1495
|
...defaultSearchValues
|
|
@@ -1397,7 +1544,7 @@ function ProTable({
|
|
|
1397
1544
|
},
|
|
1398
1545
|
[queryParams, defaultPageSize, onChange]
|
|
1399
1546
|
);
|
|
1400
|
-
const tableColumns =
|
|
1547
|
+
const tableColumns = useMemo5(() => {
|
|
1401
1548
|
const cols = columns.filter((col) => !col.hidden).map((col) => ({
|
|
1402
1549
|
...col,
|
|
1403
1550
|
key: col.key || (Array.isArray(col.dataIndex) ? col.dataIndex.join(".") : col.dataIndex),
|
|
@@ -1413,13 +1560,13 @@ function ProTable({
|
|
|
1413
1560
|
const actions = rowActions(record).filter(
|
|
1414
1561
|
(a) => !a.hidden?.(record)
|
|
1415
1562
|
);
|
|
1416
|
-
return /* @__PURE__ */
|
|
1563
|
+
return /* @__PURE__ */ jsx7(Space4, { size: 0, children: actions.map((action, idx) => {
|
|
1417
1564
|
const isLast = idx === actions.length - 1;
|
|
1418
1565
|
let actionElement;
|
|
1419
1566
|
if (action.href) {
|
|
1420
|
-
actionElement = /* @__PURE__ */
|
|
1567
|
+
actionElement = /* @__PURE__ */ jsx7(SmartLink, { href: action.href, children: /* @__PURE__ */ jsx7(Link, { style: action.danger ? { color: token.colorError } : void 0, children: action.label }) });
|
|
1421
1568
|
} else {
|
|
1422
|
-
const linkElement = /* @__PURE__ */
|
|
1569
|
+
const linkElement = /* @__PURE__ */ jsx7(
|
|
1423
1570
|
Link,
|
|
1424
1571
|
{
|
|
1425
1572
|
style: action.danger ? { color: token.colorError } : void 0,
|
|
@@ -1428,7 +1575,7 @@ function ProTable({
|
|
|
1428
1575
|
}
|
|
1429
1576
|
);
|
|
1430
1577
|
if (action.confirm) {
|
|
1431
|
-
actionElement = /* @__PURE__ */
|
|
1578
|
+
actionElement = /* @__PURE__ */ jsx7(
|
|
1432
1579
|
Popconfirm,
|
|
1433
1580
|
{
|
|
1434
1581
|
title: typeof action.confirm === "string" ? action.confirm : `${action.label}\u3057\u307E\u3059\u304B\uFF1F`,
|
|
@@ -1445,7 +1592,7 @@ function ProTable({
|
|
|
1445
1592
|
}
|
|
1446
1593
|
return /* @__PURE__ */ jsxs6("span", { children: [
|
|
1447
1594
|
actionElement,
|
|
1448
|
-
!isLast && /* @__PURE__ */
|
|
1595
|
+
!isLast && /* @__PURE__ */ jsx7(Divider, { type: "vertical" })
|
|
1449
1596
|
] }, idx);
|
|
1450
1597
|
}) });
|
|
1451
1598
|
}
|
|
@@ -1453,7 +1600,7 @@ function ProTable({
|
|
|
1453
1600
|
}
|
|
1454
1601
|
return cols;
|
|
1455
1602
|
}, [columns, rowActions, texts]);
|
|
1456
|
-
const paginationConfig =
|
|
1603
|
+
const paginationConfig = useMemo5(() => {
|
|
1457
1604
|
if (pagination === false) return false;
|
|
1458
1605
|
return {
|
|
1459
1606
|
current: meta?.current_page || queryParams.page,
|
|
@@ -1465,7 +1612,7 @@ function ProTable({
|
|
|
1465
1612
|
};
|
|
1466
1613
|
}, [pagination, meta, queryParams, texts]);
|
|
1467
1614
|
return /* @__PURE__ */ jsxs6("div", { className, style, children: [
|
|
1468
|
-
searchFields.length > 0 && /* @__PURE__ */
|
|
1615
|
+
searchFields.length > 0 && /* @__PURE__ */ jsx7(Card, { style: { marginBottom: 24, ...cardStyle }, children: /* @__PURE__ */ jsxs6(
|
|
1469
1616
|
Form2,
|
|
1470
1617
|
{
|
|
1471
1618
|
form: searchForm,
|
|
@@ -1476,10 +1623,10 @@ function ProTable({
|
|
|
1476
1623
|
initialValues: defaultSearchValues,
|
|
1477
1624
|
children: [
|
|
1478
1625
|
/* @__PURE__ */ jsxs6(Row, { gutter: 24, children: [
|
|
1479
|
-
visibleFields.map((field) => /* @__PURE__ */
|
|
1480
|
-
/* @__PURE__ */
|
|
1481
|
-
/* @__PURE__ */
|
|
1482
|
-
/* @__PURE__ */
|
|
1626
|
+
visibleFields.map((field) => /* @__PURE__ */ jsx7(Col, { span: 8, children: /* @__PURE__ */ jsx7(Form2.Item, { name: field.name, label: field.label, children: renderSearchField(field, texts) }) }, field.name)),
|
|
1627
|
+
/* @__PURE__ */ jsx7(Col, { span: visibleFields.length === 1 ? 16 : 8, style: { textAlign: "right" }, children: /* @__PURE__ */ jsxs6(Space4, { children: [
|
|
1628
|
+
/* @__PURE__ */ jsx7(Button3, { onClick: handleReset, children: texts.reset }),
|
|
1629
|
+
/* @__PURE__ */ jsx7(Button3, { type: "primary", htmlType: "submit", children: texts.search }),
|
|
1483
1630
|
hasHiddenFields && /* @__PURE__ */ jsxs6(
|
|
1484
1631
|
Button3,
|
|
1485
1632
|
{
|
|
@@ -1487,23 +1634,23 @@ function ProTable({
|
|
|
1487
1634
|
onClick: () => setExpanded(!expanded),
|
|
1488
1635
|
children: [
|
|
1489
1636
|
expanded ? texts.collapse : texts.expand,
|
|
1490
|
-
expanded ? /* @__PURE__ */
|
|
1637
|
+
expanded ? /* @__PURE__ */ jsx7(UpOutlined, {}) : /* @__PURE__ */ jsx7(DownOutlined, {})
|
|
1491
1638
|
]
|
|
1492
1639
|
}
|
|
1493
1640
|
)
|
|
1494
1641
|
] }) })
|
|
1495
1642
|
] }),
|
|
1496
|
-
expanded && hiddenFields.length > 0 && /* @__PURE__ */
|
|
1643
|
+
expanded && hiddenFields.length > 0 && /* @__PURE__ */ jsx7(Row, { gutter: 24, style: { marginTop: 16 }, children: hiddenFields.map((field) => /* @__PURE__ */ jsx7(Col, { span: 8, children: /* @__PURE__ */ jsx7(Form2.Item, { name: field.name, label: field.label, children: renderSearchField(field, texts) }) }, field.name)) })
|
|
1497
1644
|
]
|
|
1498
1645
|
}
|
|
1499
1646
|
) }),
|
|
1500
|
-
/* @__PURE__ */
|
|
1647
|
+
/* @__PURE__ */ jsx7(
|
|
1501
1648
|
Card,
|
|
1502
1649
|
{
|
|
1503
1650
|
title: /* @__PURE__ */ jsxs6(Space4, { children: [
|
|
1504
1651
|
icon,
|
|
1505
1652
|
title,
|
|
1506
|
-
subTitle && /* @__PURE__ */
|
|
1653
|
+
subTitle && /* @__PURE__ */ jsx7("span", { style: {
|
|
1507
1654
|
fontWeight: "normal",
|
|
1508
1655
|
fontSize: 14,
|
|
1509
1656
|
color: token.colorTextSecondary
|
|
@@ -1511,20 +1658,20 @@ function ProTable({
|
|
|
1511
1658
|
] }),
|
|
1512
1659
|
extra: /* @__PURE__ */ jsxs6(Space4, { size: "small", children: [
|
|
1513
1660
|
toolbarExtra,
|
|
1514
|
-
addButtonLink && /* @__PURE__ */
|
|
1515
|
-
onAdd && !addButtonLink && /* @__PURE__ */
|
|
1516
|
-
showRefresh && /* @__PURE__ */
|
|
1661
|
+
addButtonLink && /* @__PURE__ */ jsx7(SmartLink, { href: addButtonLink, children: /* @__PURE__ */ jsx7(Button3, { type: "primary", icon: /* @__PURE__ */ jsx7(PlusOutlined, {}), children: addLabel || texts.add }) }),
|
|
1662
|
+
onAdd && !addButtonLink && /* @__PURE__ */ jsx7(Button3, { type: "primary", icon: /* @__PURE__ */ jsx7(PlusOutlined, {}), onClick: onAdd, children: addLabel || texts.add }),
|
|
1663
|
+
showRefresh && /* @__PURE__ */ jsx7(Tooltip, { title: texts.refresh, children: /* @__PURE__ */ jsx7(
|
|
1517
1664
|
Button3,
|
|
1518
1665
|
{
|
|
1519
|
-
icon: /* @__PURE__ */
|
|
1666
|
+
icon: /* @__PURE__ */ jsx7(ReloadOutlined, {}),
|
|
1520
1667
|
onClick: () => queryResult.refetch?.(),
|
|
1521
1668
|
loading: queryResult.isFetching
|
|
1522
1669
|
}
|
|
1523
1670
|
) }),
|
|
1524
|
-
showColumnSettings && /* @__PURE__ */
|
|
1671
|
+
showColumnSettings && /* @__PURE__ */ jsx7(Tooltip, { title: texts.columnSettings, children: /* @__PURE__ */ jsx7(Button3, { icon: /* @__PURE__ */ jsx7(SettingOutlined, {}) }) })
|
|
1525
1672
|
] }),
|
|
1526
1673
|
style: cardStyle,
|
|
1527
|
-
children: /* @__PURE__ */
|
|
1674
|
+
children: /* @__PURE__ */ jsx7(
|
|
1528
1675
|
Table,
|
|
1529
1676
|
{
|
|
1530
1677
|
...tableProps,
|
|
@@ -1543,7 +1690,7 @@ function ProTable({
|
|
|
1543
1690
|
|
|
1544
1691
|
// src/ant/components/PageContainer/PageContainer.tsx
|
|
1545
1692
|
import { Breadcrumb, theme as theme2 } from "antd";
|
|
1546
|
-
import { jsx as
|
|
1693
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1547
1694
|
function PageContainer({
|
|
1548
1695
|
title,
|
|
1549
1696
|
subTitle,
|
|
@@ -1566,7 +1713,7 @@ function PageContainer({
|
|
|
1566
1713
|
marginBottom: 24
|
|
1567
1714
|
},
|
|
1568
1715
|
children: [
|
|
1569
|
-
breadcrumbProps && /* @__PURE__ */
|
|
1716
|
+
breadcrumbProps && /* @__PURE__ */ jsx8(
|
|
1570
1717
|
Breadcrumb,
|
|
1571
1718
|
{
|
|
1572
1719
|
...breadcrumbProps,
|
|
@@ -1600,12 +1747,12 @@ function PageContainer({
|
|
|
1600
1747
|
gap: 8
|
|
1601
1748
|
},
|
|
1602
1749
|
children: [
|
|
1603
|
-
icon && /* @__PURE__ */
|
|
1750
|
+
icon && /* @__PURE__ */ jsx8("span", { style: { fontSize: 20 }, children: icon }),
|
|
1604
1751
|
title
|
|
1605
1752
|
]
|
|
1606
1753
|
}
|
|
1607
1754
|
),
|
|
1608
|
-
subTitle && /* @__PURE__ */
|
|
1755
|
+
subTitle && /* @__PURE__ */ jsx8(
|
|
1609
1756
|
"div",
|
|
1610
1757
|
{
|
|
1611
1758
|
style: {
|
|
@@ -1617,7 +1764,7 @@ function PageContainer({
|
|
|
1617
1764
|
}
|
|
1618
1765
|
)
|
|
1619
1766
|
] }),
|
|
1620
|
-
extra && /* @__PURE__ */
|
|
1767
|
+
extra && /* @__PURE__ */ jsx8("div", { style: { flexShrink: 0 }, children: extra })
|
|
1621
1768
|
]
|
|
1622
1769
|
}
|
|
1623
1770
|
)
|
|
@@ -1630,14 +1777,14 @@ function PageContainer({
|
|
|
1630
1777
|
|
|
1631
1778
|
// src/ant/components/LocaleSwitcher/LocaleSwitcher.tsx
|
|
1632
1779
|
import { GlobalOutlined } from "@ant-design/icons";
|
|
1633
|
-
import { Select as
|
|
1780
|
+
import { Select as Select5 } from "antd";
|
|
1634
1781
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
1635
1782
|
|
|
1636
1783
|
// src/core/i18n/index.tsx
|
|
1637
|
-
import { createContext as createContext2, useContext as useContext2, useCallback as useCallback6, useState as
|
|
1784
|
+
import { createContext as createContext2, useContext as useContext2, useCallback as useCallback6, useState as useState6, useEffect as useEffect6, useMemo as useMemo6 } from "react";
|
|
1638
1785
|
import { useTranslation, I18nextProvider, initReactI18next } from "react-i18next";
|
|
1639
1786
|
import i18n from "i18next";
|
|
1640
|
-
import { jsx as
|
|
1787
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1641
1788
|
var locales = ["ja", "en", "vi"];
|
|
1642
1789
|
var localeNames = {
|
|
1643
1790
|
ja: "\u65E5\u672C\u8A9E",
|
|
@@ -1656,7 +1803,7 @@ function useLocale() {
|
|
|
1656
1803
|
}
|
|
1657
1804
|
|
|
1658
1805
|
// src/ant/components/LocaleSwitcher/LocaleSwitcher.tsx
|
|
1659
|
-
import { jsx as
|
|
1806
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1660
1807
|
function LocaleSwitcher() {
|
|
1661
1808
|
const { i18n: i18n2 } = useTranslation2();
|
|
1662
1809
|
const locale = i18n2.language || "ja";
|
|
@@ -1664,14 +1811,14 @@ function LocaleSwitcher() {
|
|
|
1664
1811
|
i18n2.changeLanguage(newLocale);
|
|
1665
1812
|
document.cookie = `locale=${newLocale};path=/;max-age=31536000`;
|
|
1666
1813
|
};
|
|
1667
|
-
return /* @__PURE__ */
|
|
1668
|
-
|
|
1814
|
+
return /* @__PURE__ */ jsx10(
|
|
1815
|
+
Select5,
|
|
1669
1816
|
{
|
|
1670
1817
|
value: locale,
|
|
1671
1818
|
onChange: handleChange,
|
|
1672
1819
|
style: { width: 100 },
|
|
1673
1820
|
size: "small",
|
|
1674
|
-
suffixIcon: /* @__PURE__ */
|
|
1821
|
+
suffixIcon: /* @__PURE__ */ jsx10(GlobalOutlined, {}),
|
|
1675
1822
|
options: locales.map((l) => ({
|
|
1676
1823
|
value: l,
|
|
1677
1824
|
label: localeNames[l]
|
|
@@ -1686,29 +1833,29 @@ import {
|
|
|
1686
1833
|
BankOutlined as BankOutlined4
|
|
1687
1834
|
} from "@ant-design/icons";
|
|
1688
1835
|
import {
|
|
1689
|
-
Modal as
|
|
1836
|
+
Modal as Modal4,
|
|
1690
1837
|
Form as Form3,
|
|
1691
|
-
Select as
|
|
1838
|
+
Select as Select6,
|
|
1692
1839
|
Radio,
|
|
1693
1840
|
Button as Button4,
|
|
1694
1841
|
Space as Space7,
|
|
1695
1842
|
Tag as Tag2,
|
|
1696
|
-
Typography as
|
|
1843
|
+
Typography as Typography6
|
|
1697
1844
|
} from "antd";
|
|
1698
|
-
import { useState as
|
|
1845
|
+
import { useState as useState7 } from "react";
|
|
1699
1846
|
|
|
1700
1847
|
// src/ant/components/ScopeUtils/ScopeUtils.tsx
|
|
1701
1848
|
import { GlobalOutlined as GlobalOutlined2, BankOutlined as BankOutlined3, BranchesOutlined } from "@ant-design/icons";
|
|
1702
1849
|
import { Tag, Space as Space6 } from "antd";
|
|
1703
|
-
import { jsx as
|
|
1850
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1704
1851
|
function getScopeIcon(scope) {
|
|
1705
1852
|
switch (scope) {
|
|
1706
1853
|
case "global":
|
|
1707
|
-
return /* @__PURE__ */
|
|
1854
|
+
return /* @__PURE__ */ jsx11(GlobalOutlined2, {});
|
|
1708
1855
|
case "org-wide":
|
|
1709
|
-
return /* @__PURE__ */
|
|
1856
|
+
return /* @__PURE__ */ jsx11(BankOutlined3, {});
|
|
1710
1857
|
case "branch":
|
|
1711
|
-
return /* @__PURE__ */
|
|
1858
|
+
return /* @__PURE__ */ jsx11(BranchesOutlined, {});
|
|
1712
1859
|
default:
|
|
1713
1860
|
return null;
|
|
1714
1861
|
}
|
|
@@ -1726,7 +1873,7 @@ function getScopeColor(scope) {
|
|
|
1726
1873
|
}
|
|
1727
1874
|
}
|
|
1728
1875
|
function ScopeTag({ scope, label, showIcon = true }) {
|
|
1729
|
-
return /* @__PURE__ */
|
|
1876
|
+
return /* @__PURE__ */ jsx11(Tag, { color: getScopeColor(scope), icon: showIcon ? getScopeIcon(scope) : void 0, children: label || scope });
|
|
1730
1877
|
}
|
|
1731
1878
|
function ScopeLabel({ scope, label }) {
|
|
1732
1879
|
return /* @__PURE__ */ jsxs8(Space6, { children: [
|
|
@@ -1736,9 +1883,9 @@ function ScopeLabel({ scope, label }) {
|
|
|
1736
1883
|
}
|
|
1737
1884
|
|
|
1738
1885
|
// src/ant/components/UserRoleAssignModal/UserRoleAssignModal.tsx
|
|
1739
|
-
import { jsx as
|
|
1740
|
-
var { Text:
|
|
1741
|
-
var
|
|
1886
|
+
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1887
|
+
var { Text: Text5 } = Typography6;
|
|
1888
|
+
var defaultTranslations2 = {
|
|
1742
1889
|
title: "\u30ED\u30FC\u30EB\u5272\u308A\u5F53\u3066",
|
|
1743
1890
|
selectRole: "\u30ED\u30FC\u30EB\u3092\u9078\u629E",
|
|
1744
1891
|
scope: "\u30B9\u30B3\u30FC\u30D7",
|
|
@@ -1765,8 +1912,8 @@ function UserRoleAssignModal({
|
|
|
1765
1912
|
translations: t = {}
|
|
1766
1913
|
}) {
|
|
1767
1914
|
const [form] = Form3.useForm();
|
|
1768
|
-
const [isSubmitting, setIsSubmitting] =
|
|
1769
|
-
const labels = { ...
|
|
1915
|
+
const [isSubmitting, setIsSubmitting] = useState7(false);
|
|
1916
|
+
const labels = { ...defaultTranslations2, ...t };
|
|
1770
1917
|
const handleFinish = async (values) => {
|
|
1771
1918
|
setIsSubmitting(true);
|
|
1772
1919
|
try {
|
|
@@ -1780,11 +1927,11 @@ function UserRoleAssignModal({
|
|
|
1780
1927
|
form.resetFields();
|
|
1781
1928
|
onCancel();
|
|
1782
1929
|
};
|
|
1783
|
-
return /* @__PURE__ */
|
|
1784
|
-
|
|
1930
|
+
return /* @__PURE__ */ jsx12(
|
|
1931
|
+
Modal4,
|
|
1785
1932
|
{
|
|
1786
1933
|
title: /* @__PURE__ */ jsxs9(Space7, { children: [
|
|
1787
|
-
/* @__PURE__ */
|
|
1934
|
+
/* @__PURE__ */ jsx12(SafetyOutlined, {}),
|
|
1788
1935
|
labels.title,
|
|
1789
1936
|
" ",
|
|
1790
1937
|
userName ? `- ${userName}` : ""
|
|
@@ -1801,42 +1948,42 @@ function UserRoleAssignModal({
|
|
|
1801
1948
|
onFinish: handleFinish,
|
|
1802
1949
|
initialValues: { scope: "org-wide", org_id: currentOrgId },
|
|
1803
1950
|
children: [
|
|
1804
|
-
/* @__PURE__ */
|
|
1951
|
+
/* @__PURE__ */ jsx12(
|
|
1805
1952
|
Form3.Item,
|
|
1806
1953
|
{
|
|
1807
1954
|
name: "role_id",
|
|
1808
1955
|
label: labels.selectRole,
|
|
1809
1956
|
rules: [{ required: true, message: labels.required }],
|
|
1810
|
-
children: /* @__PURE__ */
|
|
1957
|
+
children: /* @__PURE__ */ jsx12(Select6, { placeholder: labels.selectRole, children: roles.map((role) => /* @__PURE__ */ jsx12(Select6.Option, { value: role.id, children: role.name }, role.id)) })
|
|
1811
1958
|
}
|
|
1812
1959
|
),
|
|
1813
|
-
/* @__PURE__ */
|
|
1814
|
-
/* @__PURE__ */
|
|
1815
|
-
/* @__PURE__ */
|
|
1816
|
-
/* @__PURE__ */
|
|
1960
|
+
/* @__PURE__ */ jsx12(Form3.Item, { name: "scope", label: labels.scope, children: /* @__PURE__ */ jsxs9(Radio.Group, { children: [
|
|
1961
|
+
/* @__PURE__ */ jsx12(Radio, { value: "global", children: /* @__PURE__ */ jsx12(ScopeLabel, { scope: "global", label: labels.global }) }),
|
|
1962
|
+
/* @__PURE__ */ jsx12(Radio, { value: "org-wide", children: /* @__PURE__ */ jsx12(ScopeLabel, { scope: "org-wide", label: labels.orgWide }) }),
|
|
1963
|
+
/* @__PURE__ */ jsx12(Radio, { value: "branch", children: /* @__PURE__ */ jsx12(ScopeLabel, { scope: "branch", label: labels.branchSpecific }) })
|
|
1817
1964
|
] }) }),
|
|
1818
|
-
/* @__PURE__ */
|
|
1965
|
+
/* @__PURE__ */ jsx12(Form3.Item, { noStyle: true, shouldUpdate: (prev, curr) => prev.scope !== curr.scope, children: ({ getFieldValue }) => (getFieldValue("scope") === "org-wide" || getFieldValue("scope") === "branch") && /* @__PURE__ */ jsx12(
|
|
1819
1966
|
Form3.Item,
|
|
1820
1967
|
{
|
|
1821
1968
|
name: "org_id",
|
|
1822
1969
|
label: labels.organization,
|
|
1823
1970
|
rules: [{ required: true, message: labels.required }],
|
|
1824
|
-
children: /* @__PURE__ */
|
|
1825
|
-
/* @__PURE__ */
|
|
1971
|
+
children: /* @__PURE__ */ jsx12(Select6, { placeholder: labels.organization, children: organizations.map((org) => /* @__PURE__ */ jsx12(Select6.Option, { value: String(org.id), children: /* @__PURE__ */ jsxs9(Space7, { children: [
|
|
1972
|
+
/* @__PURE__ */ jsx12(BankOutlined4, {}),
|
|
1826
1973
|
org.name
|
|
1827
1974
|
] }) }, org.id)) })
|
|
1828
1975
|
}
|
|
1829
1976
|
) }),
|
|
1830
|
-
/* @__PURE__ */
|
|
1977
|
+
/* @__PURE__ */ jsx12(Form3.Item, { noStyle: true, shouldUpdate: (prev, curr) => prev.scope !== curr.scope, children: ({ getFieldValue }) => getFieldValue("scope") === "branch" && /* @__PURE__ */ jsx12(
|
|
1831
1978
|
Form3.Item,
|
|
1832
1979
|
{
|
|
1833
1980
|
name: "branch_ids",
|
|
1834
1981
|
label: labels.selectBranches,
|
|
1835
1982
|
rules: [{ required: true, message: labels.required }],
|
|
1836
|
-
children: /* @__PURE__ */
|
|
1983
|
+
children: /* @__PURE__ */ jsx12(Select6, { mode: "multiple", placeholder: labels.selectBranches, children: branches?.map((branch) => /* @__PURE__ */ jsx12(Select6.Option, { value: String(branch.id), children: branch.name }, branch.id)) })
|
|
1837
1984
|
}
|
|
1838
1985
|
) }),
|
|
1839
|
-
/* @__PURE__ */
|
|
1986
|
+
/* @__PURE__ */ jsx12(Form3.Item, { noStyle: true, shouldUpdate: true, children: ({ getFieldValue }) => {
|
|
1840
1987
|
const scope = getFieldValue("scope");
|
|
1841
1988
|
const selectedOrgId = getFieldValue("org_id");
|
|
1842
1989
|
const selectedBranchIds = getFieldValue("branch_ids") || [];
|
|
@@ -1852,7 +1999,7 @@ function UserRoleAssignModal({
|
|
|
1852
1999
|
} else if (scope === "branch" && selectedBranches.length > 0) {
|
|
1853
2000
|
scopeText = selectedBranches.map((b) => b.name).join(", ");
|
|
1854
2001
|
}
|
|
1855
|
-
return scopeText ? /* @__PURE__ */
|
|
2002
|
+
return scopeText ? /* @__PURE__ */ jsx12(
|
|
1856
2003
|
"div",
|
|
1857
2004
|
{
|
|
1858
2005
|
style: {
|
|
@@ -1861,19 +2008,19 @@ function UserRoleAssignModal({
|
|
|
1861
2008
|
borderRadius: 4,
|
|
1862
2009
|
marginBottom: 16
|
|
1863
2010
|
},
|
|
1864
|
-
children: /* @__PURE__ */ jsxs9(
|
|
2011
|
+
children: /* @__PURE__ */ jsxs9(Text5, { type: "secondary", children: [
|
|
1865
2012
|
labels.assignRole,
|
|
1866
2013
|
": ",
|
|
1867
|
-
/* @__PURE__ */
|
|
2014
|
+
/* @__PURE__ */ jsx12(Text5, { strong: true, children: selectedRole.name }),
|
|
1868
2015
|
" \u2192 ",
|
|
1869
|
-
/* @__PURE__ */
|
|
2016
|
+
/* @__PURE__ */ jsx12(Tag2, { color: getScopeColor(scope), children: scopeText })
|
|
1870
2017
|
] })
|
|
1871
2018
|
}
|
|
1872
2019
|
) : null;
|
|
1873
2020
|
} }),
|
|
1874
|
-
/* @__PURE__ */
|
|
1875
|
-
/* @__PURE__ */
|
|
1876
|
-
/* @__PURE__ */
|
|
2021
|
+
/* @__PURE__ */ jsx12(Form3.Item, { children: /* @__PURE__ */ jsxs9(Space7, { children: [
|
|
2022
|
+
/* @__PURE__ */ jsx12(Button4, { type: "primary", htmlType: "submit", loading: loading || isSubmitting, children: labels.assign }),
|
|
2023
|
+
/* @__PURE__ */ jsx12(Button4, { onClick: handleCancel, children: labels.cancel })
|
|
1877
2024
|
] }) })
|
|
1878
2025
|
]
|
|
1879
2026
|
}
|
|
@@ -1894,20 +2041,20 @@ import {
|
|
|
1894
2041
|
DeleteOutlined
|
|
1895
2042
|
} from "@ant-design/icons";
|
|
1896
2043
|
import {
|
|
1897
|
-
Modal as
|
|
2044
|
+
Modal as Modal5,
|
|
1898
2045
|
Card as Card2,
|
|
1899
2046
|
Tag as Tag3,
|
|
1900
2047
|
Space as Space8,
|
|
1901
2048
|
Collapse,
|
|
1902
2049
|
Empty,
|
|
1903
|
-
Spin as
|
|
2050
|
+
Spin as Spin4,
|
|
1904
2051
|
Button as Button5,
|
|
1905
2052
|
Popconfirm as Popconfirm2,
|
|
1906
|
-
Typography as
|
|
2053
|
+
Typography as Typography7
|
|
1907
2054
|
} from "antd";
|
|
1908
|
-
import { jsx as
|
|
1909
|
-
var { Text:
|
|
1910
|
-
var
|
|
2055
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2056
|
+
var { Text: Text6 } = Typography7;
|
|
2057
|
+
var defaultTranslations3 = {
|
|
1911
2058
|
permissionBreakdown: "\u6A29\u9650\u30D6\u30EC\u30FC\u30AF\u30C0\u30A6\u30F3",
|
|
1912
2059
|
userInfo: "\u30E6\u30FC\u30B6\u30FC\u60C5\u5831",
|
|
1913
2060
|
email: "\u30E1\u30FC\u30EB",
|
|
@@ -1942,17 +2089,17 @@ function UserPermissionsModal({
|
|
|
1942
2089
|
onRemoveRole,
|
|
1943
2090
|
translations: t = {}
|
|
1944
2091
|
}) {
|
|
1945
|
-
const labels = { ...
|
|
2092
|
+
const labels = { ...defaultTranslations3, ...t };
|
|
1946
2093
|
const getBranchName = (branchId) => {
|
|
1947
2094
|
if (!branchId || !branches) return "";
|
|
1948
2095
|
const branch = branches.find((b) => String(b.id) === branchId);
|
|
1949
2096
|
return branch?.name || branchId;
|
|
1950
2097
|
};
|
|
1951
|
-
return /* @__PURE__ */
|
|
1952
|
-
|
|
2098
|
+
return /* @__PURE__ */ jsx13(
|
|
2099
|
+
Modal5,
|
|
1953
2100
|
{
|
|
1954
2101
|
title: /* @__PURE__ */ jsxs10(Space8, { children: [
|
|
1955
|
-
/* @__PURE__ */
|
|
2102
|
+
/* @__PURE__ */ jsx13(UserOutlined, {}),
|
|
1956
2103
|
userName,
|
|
1957
2104
|
" - ",
|
|
1958
2105
|
labels.permissionBreakdown
|
|
@@ -1962,53 +2109,53 @@ function UserPermissionsModal({
|
|
|
1962
2109
|
footer: null,
|
|
1963
2110
|
width: 800,
|
|
1964
2111
|
destroyOnHidden: true,
|
|
1965
|
-
children: loading ? /* @__PURE__ */
|
|
1966
|
-
/* @__PURE__ */
|
|
2112
|
+
children: loading ? /* @__PURE__ */ jsx13("div", { style: { textAlign: "center", padding: 40 }, children: /* @__PURE__ */ jsx13(Spin4, { size: "large" }) }) : permissions ? /* @__PURE__ */ jsxs10("div", { style: { display: "flex", flexDirection: "column", gap: 16 }, children: [
|
|
2113
|
+
/* @__PURE__ */ jsx13(Card2, { size: "small", title: labels.userInfo, children: /* @__PURE__ */ jsxs10("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
1967
2114
|
/* @__PURE__ */ jsxs10("div", { children: [
|
|
1968
|
-
/* @__PURE__ */ jsxs10(
|
|
2115
|
+
/* @__PURE__ */ jsxs10(Text6, { type: "secondary", children: [
|
|
1969
2116
|
labels.email,
|
|
1970
2117
|
": "
|
|
1971
2118
|
] }),
|
|
1972
|
-
/* @__PURE__ */
|
|
2119
|
+
/* @__PURE__ */ jsx13(Text6, { children: permissions.user?.email })
|
|
1973
2120
|
] }),
|
|
1974
2121
|
/* @__PURE__ */ jsxs10("div", { children: [
|
|
1975
|
-
/* @__PURE__ */ jsxs10(
|
|
2122
|
+
/* @__PURE__ */ jsxs10(Text6, { type: "secondary", children: [
|
|
1976
2123
|
labels.primaryOrganization,
|
|
1977
2124
|
": "
|
|
1978
2125
|
] }),
|
|
1979
|
-
permissions.user?.organization ? /* @__PURE__ */
|
|
2126
|
+
permissions.user?.organization ? /* @__PURE__ */ jsx13(Tag3, { icon: /* @__PURE__ */ jsx13(BankOutlined5, {}), color: "blue", children: permissions.user.organization.name }) : /* @__PURE__ */ jsx13(Tag3, { icon: /* @__PURE__ */ jsx13(GlobalOutlined4, {}), color: "purple", children: labels.global })
|
|
1980
2127
|
] })
|
|
1981
2128
|
] }) }),
|
|
1982
|
-
/* @__PURE__ */
|
|
1983
|
-
currentOrg && /* @__PURE__ */
|
|
1984
|
-
currentBranch && /* @__PURE__ */
|
|
2129
|
+
/* @__PURE__ */ jsx13(Card2, { size: "small", title: labels.currentContext, children: /* @__PURE__ */ jsxs10(Space8, { wrap: true, children: [
|
|
2130
|
+
currentOrg && /* @__PURE__ */ jsx13(Tag3, { icon: /* @__PURE__ */ jsx13(BankOutlined5, {}), color: "blue", children: currentOrg.name }),
|
|
2131
|
+
currentBranch && /* @__PURE__ */ jsx13(Tag3, { icon: /* @__PURE__ */ jsx13(BranchesOutlined3, {}), color: "green", children: currentBranch.name })
|
|
1985
2132
|
] }) }),
|
|
1986
|
-
/* @__PURE__ */
|
|
2133
|
+
/* @__PURE__ */ jsx13(
|
|
1987
2134
|
Card2,
|
|
1988
2135
|
{
|
|
1989
2136
|
size: "small",
|
|
1990
2137
|
title: /* @__PURE__ */ jsxs10(Space8, { children: [
|
|
1991
|
-
/* @__PURE__ */
|
|
2138
|
+
/* @__PURE__ */ jsx13(SafetyOutlined2, {}),
|
|
1992
2139
|
labels.roleAssignments,
|
|
1993
2140
|
" (",
|
|
1994
2141
|
permissions.role_assignments.length,
|
|
1995
2142
|
")"
|
|
1996
2143
|
] }),
|
|
1997
|
-
extra: onAddRole && /* @__PURE__ */
|
|
1998
|
-
children: permissions.role_assignments.length === 0 ? /* @__PURE__ */
|
|
2144
|
+
extra: onAddRole && /* @__PURE__ */ jsx13(Button5, { type: "primary", size: "small", icon: /* @__PURE__ */ jsx13(PlusOutlined2, {}), onClick: onAddRole, children: labels.add }),
|
|
2145
|
+
children: permissions.role_assignments.length === 0 ? /* @__PURE__ */ jsx13(Empty, { description: labels.noRolesAssigned }) : /* @__PURE__ */ jsx13(Collapse, { ghost: true, children: permissions.role_assignments.map((assignment, index) => /* @__PURE__ */ jsx13(
|
|
1999
2146
|
Collapse.Panel,
|
|
2000
2147
|
{
|
|
2001
2148
|
header: /* @__PURE__ */ jsxs10(Space8, { wrap: true, children: [
|
|
2002
2149
|
getScopeIcon(assignment.scope),
|
|
2003
|
-
/* @__PURE__ */
|
|
2004
|
-
/* @__PURE__ */
|
|
2005
|
-
assignment.scope === "branch" && assignment.org_name && /* @__PURE__ */
|
|
2150
|
+
/* @__PURE__ */ jsx13(Text6, { strong: true, children: assignment.role.name }),
|
|
2151
|
+
/* @__PURE__ */ jsx13(Tag3, { color: getScopeColor(assignment.scope), children: assignment.scope === "global" ? labels.global : assignment.scope === "org-wide" ? assignment.org_name || labels.orgWide : assignment.branch_name || getBranchName(assignment.console_branch_id) }),
|
|
2152
|
+
assignment.scope === "branch" && assignment.org_name && /* @__PURE__ */ jsx13(Tag3, { color: "blue", icon: /* @__PURE__ */ jsx13(BankOutlined5, {}), children: assignment.org_name }),
|
|
2006
2153
|
/* @__PURE__ */ jsxs10(Tag3, { children: [
|
|
2007
2154
|
assignment.permissions.length,
|
|
2008
2155
|
" ",
|
|
2009
2156
|
labels.permissions
|
|
2010
2157
|
] }),
|
|
2011
|
-
onRemoveRole && /* @__PURE__ */
|
|
2158
|
+
onRemoveRole && /* @__PURE__ */ jsx13(
|
|
2012
2159
|
Popconfirm2,
|
|
2013
2160
|
{
|
|
2014
2161
|
title: labels.confirmRemoveRole,
|
|
@@ -2019,12 +2166,12 @@ function UserPermissionsModal({
|
|
|
2019
2166
|
assignment.console_branch_id
|
|
2020
2167
|
);
|
|
2021
2168
|
},
|
|
2022
|
-
children: /* @__PURE__ */
|
|
2169
|
+
children: /* @__PURE__ */ jsx13(
|
|
2023
2170
|
Button5,
|
|
2024
2171
|
{
|
|
2025
2172
|
size: "small",
|
|
2026
2173
|
danger: true,
|
|
2027
|
-
icon: /* @__PURE__ */
|
|
2174
|
+
icon: /* @__PURE__ */ jsx13(DeleteOutlined, {}),
|
|
2028
2175
|
onClick: (e) => e.stopPropagation()
|
|
2029
2176
|
}
|
|
2030
2177
|
)
|
|
@@ -2042,33 +2189,33 @@ function UserPermissionsModal({
|
|
|
2042
2189
|
{}
|
|
2043
2190
|
)
|
|
2044
2191
|
).map(([group, perms]) => /* @__PURE__ */ jsxs10("div", { style: { marginBottom: 8 }, children: [
|
|
2045
|
-
/* @__PURE__ */
|
|
2046
|
-
/* @__PURE__ */
|
|
2192
|
+
/* @__PURE__ */ jsx13(Text6, { type: "secondary", style: { fontSize: 12 }, children: group }),
|
|
2193
|
+
/* @__PURE__ */ jsx13("div", { style: { display: "flex", flexWrap: "wrap", gap: 4, marginTop: 4 }, children: perms.map((perm) => /* @__PURE__ */ jsx13(Tag3, { color: "blue", children: perm.name }, perm.slug)) })
|
|
2047
2194
|
] }, group))
|
|
2048
2195
|
},
|
|
2049
2196
|
index
|
|
2050
2197
|
)) })
|
|
2051
2198
|
}
|
|
2052
2199
|
),
|
|
2053
|
-
/* @__PURE__ */
|
|
2200
|
+
/* @__PURE__ */ jsx13(
|
|
2054
2201
|
Card2,
|
|
2055
2202
|
{
|
|
2056
2203
|
size: "small",
|
|
2057
2204
|
title: /* @__PURE__ */ jsxs10(Space8, { children: [
|
|
2058
|
-
/* @__PURE__ */
|
|
2205
|
+
/* @__PURE__ */ jsx13(TeamOutlined, {}),
|
|
2059
2206
|
labels.teamMemberships,
|
|
2060
2207
|
" (",
|
|
2061
2208
|
permissions.team_memberships.length,
|
|
2062
2209
|
")"
|
|
2063
2210
|
] }),
|
|
2064
|
-
extra: onAddTeam && /* @__PURE__ */
|
|
2065
|
-
children: permissions.team_memberships.length === 0 ? /* @__PURE__ */
|
|
2211
|
+
extra: onAddTeam && /* @__PURE__ */ jsx13(Button5, { size: "small", icon: /* @__PURE__ */ jsx13(PlusOutlined2, {}), onClick: onAddTeam, children: labels.add }),
|
|
2212
|
+
children: permissions.team_memberships.length === 0 ? /* @__PURE__ */ jsx13(Empty, { description: labels.noTeamMemberships }) : /* @__PURE__ */ jsx13(Collapse, { ghost: true, children: permissions.team_memberships.map((membership, index) => /* @__PURE__ */ jsx13(
|
|
2066
2213
|
Collapse.Panel,
|
|
2067
2214
|
{
|
|
2068
2215
|
header: /* @__PURE__ */ jsxs10(Space8, { children: [
|
|
2069
|
-
/* @__PURE__ */
|
|
2070
|
-
/* @__PURE__ */
|
|
2071
|
-
membership.is_leader && /* @__PURE__ */
|
|
2216
|
+
/* @__PURE__ */ jsx13(TeamOutlined, {}),
|
|
2217
|
+
/* @__PURE__ */ jsx13(Text6, { strong: true, children: membership.team.name }),
|
|
2218
|
+
membership.is_leader && /* @__PURE__ */ jsx13(Tag3, { color: "gold", children: labels.teamLeader }),
|
|
2072
2219
|
/* @__PURE__ */ jsxs10(Tag3, { children: [
|
|
2073
2220
|
membership.permissions.length,
|
|
2074
2221
|
" ",
|
|
@@ -2086,26 +2233,26 @@ function UserPermissionsModal({
|
|
|
2086
2233
|
{}
|
|
2087
2234
|
)
|
|
2088
2235
|
).map(([group, perms]) => /* @__PURE__ */ jsxs10("div", { style: { marginBottom: 8 }, children: [
|
|
2089
|
-
/* @__PURE__ */
|
|
2090
|
-
/* @__PURE__ */
|
|
2236
|
+
/* @__PURE__ */ jsx13(Text6, { type: "secondary", style: { fontSize: 12 }, children: group }),
|
|
2237
|
+
/* @__PURE__ */ jsx13("div", { style: { display: "flex", flexWrap: "wrap", gap: 4, marginTop: 4 }, children: perms.map((perm) => /* @__PURE__ */ jsx13(Tag3, { color: "cyan", children: perm.name }, perm.slug)) })
|
|
2091
2238
|
] }, group))
|
|
2092
2239
|
},
|
|
2093
2240
|
index
|
|
2094
2241
|
)) })
|
|
2095
2242
|
}
|
|
2096
2243
|
),
|
|
2097
|
-
/* @__PURE__ */
|
|
2244
|
+
/* @__PURE__ */ jsx13(
|
|
2098
2245
|
Card2,
|
|
2099
2246
|
{
|
|
2100
2247
|
size: "small",
|
|
2101
2248
|
title: /* @__PURE__ */ jsxs10(Space8, { children: [
|
|
2102
|
-
/* @__PURE__ */
|
|
2249
|
+
/* @__PURE__ */ jsx13(SafetyOutlined2, {}),
|
|
2103
2250
|
labels.aggregatedPermissions,
|
|
2104
2251
|
" (",
|
|
2105
2252
|
permissions.aggregated_permissions.length,
|
|
2106
2253
|
")"
|
|
2107
2254
|
] }),
|
|
2108
|
-
children: permissions.aggregated_permissions.length === 0 ? /* @__PURE__ */
|
|
2255
|
+
children: permissions.aggregated_permissions.length === 0 ? /* @__PURE__ */ jsx13(Empty, { description: labels.noData }) : /* @__PURE__ */ jsx13(Collapse, { ghost: true, children: Object.entries(
|
|
2109
2256
|
permissions.aggregated_permissions.reduce(
|
|
2110
2257
|
(groups, perm) => {
|
|
2111
2258
|
const parts = perm.split(".");
|
|
@@ -2116,15 +2263,15 @@ function UserPermissionsModal({
|
|
|
2116
2263
|
},
|
|
2117
2264
|
{}
|
|
2118
2265
|
)
|
|
2119
|
-
).map(([group, perms]) => /* @__PURE__ */
|
|
2266
|
+
).map(([group, perms]) => /* @__PURE__ */ jsx13(
|
|
2120
2267
|
Collapse.Panel,
|
|
2121
2268
|
{
|
|
2122
2269
|
header: /* @__PURE__ */ jsxs10(Space8, { children: [
|
|
2123
|
-
/* @__PURE__ */
|
|
2124
|
-
/* @__PURE__ */
|
|
2125
|
-
/* @__PURE__ */
|
|
2270
|
+
/* @__PURE__ */ jsx13(SafetyOutlined2, {}),
|
|
2271
|
+
/* @__PURE__ */ jsx13(Text6, { strong: true, children: group }),
|
|
2272
|
+
/* @__PURE__ */ jsx13(Tag3, { color: "green", children: perms.length })
|
|
2126
2273
|
] }),
|
|
2127
|
-
children: /* @__PURE__ */
|
|
2274
|
+
children: /* @__PURE__ */ jsx13("div", { style: { display: "flex", flexWrap: "wrap", gap: 4 }, children: perms.map((perm) => /* @__PURE__ */ jsx13(Tag3, { color: "green", children: perm.split(".").pop() }, perm)) })
|
|
2128
2275
|
},
|
|
2129
2276
|
group
|
|
2130
2277
|
)) })
|
|
@@ -2149,21 +2296,21 @@ import {
|
|
|
2149
2296
|
} from "@ant-design/icons";
|
|
2150
2297
|
import {
|
|
2151
2298
|
Card as Card3,
|
|
2152
|
-
Typography as
|
|
2299
|
+
Typography as Typography8,
|
|
2153
2300
|
Button as Button6,
|
|
2154
2301
|
Space as Space9,
|
|
2155
2302
|
Tag as Tag4,
|
|
2156
2303
|
Table as Table2,
|
|
2157
2304
|
Tabs,
|
|
2158
2305
|
Input as Input2,
|
|
2159
|
-
Select as
|
|
2306
|
+
Select as Select7,
|
|
2160
2307
|
Popconfirm as Popconfirm3,
|
|
2161
2308
|
Empty as Empty2
|
|
2162
2309
|
} from "antd";
|
|
2163
|
-
import { useState as
|
|
2164
|
-
import { jsx as
|
|
2165
|
-
var { Title: Title3, Text:
|
|
2166
|
-
var
|
|
2310
|
+
import { useState as useState8, useMemo as useMemo7 } from "react";
|
|
2311
|
+
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2312
|
+
var { Title: Title3, Text: Text7, Link: AntLink } = Typography8;
|
|
2313
|
+
var defaultTranslations4 = {
|
|
2167
2314
|
email: "\u30E1\u30FC\u30EB",
|
|
2168
2315
|
primaryOrganization: "\u6240\u5C5E\u7D44\u7E54",
|
|
2169
2316
|
currentContext: "\u73FE\u5728\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8",
|
|
@@ -2210,9 +2357,9 @@ function UserDetailCard({
|
|
|
2210
2357
|
removeLoading = false,
|
|
2211
2358
|
translations: t = {}
|
|
2212
2359
|
}) {
|
|
2213
|
-
const labels = { ...
|
|
2214
|
-
const [permissionSearch, setPermissionSearch] =
|
|
2215
|
-
const [permissionTypeFilter, setPermissionTypeFilter] =
|
|
2360
|
+
const labels = { ...defaultTranslations4, ...t };
|
|
2361
|
+
const [permissionSearch, setPermissionSearch] = useState8("");
|
|
2362
|
+
const [permissionTypeFilter, setPermissionTypeFilter] = useState8("all");
|
|
2216
2363
|
const getScopeLabel = (assignment) => {
|
|
2217
2364
|
if (assignment.scope === "global") return labels.global;
|
|
2218
2365
|
if (assignment.scope === "org-wide") return assignment.org_name || labels.global;
|
|
@@ -2249,7 +2396,7 @@ function UserDetailCard({
|
|
|
2249
2396
|
const matchesType = permissionTypeFilter === "all" || p.type === permissionTypeFilter;
|
|
2250
2397
|
return matchesSearch && matchesType;
|
|
2251
2398
|
});
|
|
2252
|
-
const groupedAggregatedPermissions =
|
|
2399
|
+
const groupedAggregatedPermissions = useMemo7(
|
|
2253
2400
|
() => aggregatedPermissions.reduce((acc, perm) => {
|
|
2254
2401
|
const group = perm.split(".").slice(0, -1).join(".") || "other";
|
|
2255
2402
|
if (!acc[group]) acc[group] = [];
|
|
@@ -2262,7 +2409,7 @@ function UserDetailCard({
|
|
|
2262
2409
|
{
|
|
2263
2410
|
key: "permissions",
|
|
2264
2411
|
label: /* @__PURE__ */ jsxs11("span", { children: [
|
|
2265
|
-
/* @__PURE__ */
|
|
2412
|
+
/* @__PURE__ */ jsx14(KeyOutlined, {}),
|
|
2266
2413
|
" ",
|
|
2267
2414
|
labels.permissions
|
|
2268
2415
|
] }),
|
|
@@ -2284,29 +2431,29 @@ function UserDetailCard({
|
|
|
2284
2431
|
allPermissionsData.length,
|
|
2285
2432
|
")"
|
|
2286
2433
|
] }),
|
|
2287
|
-
/* @__PURE__ */
|
|
2434
|
+
/* @__PURE__ */ jsx14(Text7, { type: "secondary", style: { fontSize: 12 }, children: labels.permissionsDescription })
|
|
2288
2435
|
] }),
|
|
2289
2436
|
/* @__PURE__ */ jsxs11(Space9, { children: [
|
|
2290
|
-
onRefresh && /* @__PURE__ */
|
|
2291
|
-
/* @__PURE__ */
|
|
2292
|
-
/* @__PURE__ */
|
|
2437
|
+
onRefresh && /* @__PURE__ */ jsx14(Button6, { icon: /* @__PURE__ */ jsx14(ReloadOutlined2, {}), onClick: onRefresh }),
|
|
2438
|
+
/* @__PURE__ */ jsx14(Button6, { type: "default", children: labels.remove }),
|
|
2439
|
+
/* @__PURE__ */ jsx14(Button6, { type: "primary", icon: /* @__PURE__ */ jsx14(PlusOutlined3, {}), children: labels.addPermissions })
|
|
2293
2440
|
] })
|
|
2294
2441
|
]
|
|
2295
2442
|
}
|
|
2296
2443
|
),
|
|
2297
2444
|
/* @__PURE__ */ jsxs11("div", { style: { display: "flex", gap: 16, marginBottom: 16 }, children: [
|
|
2298
|
-
/* @__PURE__ */
|
|
2445
|
+
/* @__PURE__ */ jsx14(
|
|
2299
2446
|
Input2,
|
|
2300
2447
|
{
|
|
2301
2448
|
placeholder: labels.searchPermissions,
|
|
2302
|
-
prefix: /* @__PURE__ */
|
|
2449
|
+
prefix: /* @__PURE__ */ jsx14(KeyOutlined, {}),
|
|
2303
2450
|
value: permissionSearch,
|
|
2304
2451
|
onChange: (e) => setPermissionSearch(e.target.value),
|
|
2305
2452
|
style: { width: 300 }
|
|
2306
2453
|
}
|
|
2307
2454
|
),
|
|
2308
|
-
/* @__PURE__ */
|
|
2309
|
-
|
|
2455
|
+
/* @__PURE__ */ jsx14(
|
|
2456
|
+
Select7,
|
|
2310
2457
|
{
|
|
2311
2458
|
value: permissionTypeFilter,
|
|
2312
2459
|
onChange: setPermissionTypeFilter,
|
|
@@ -2319,7 +2466,7 @@ function UserDetailCard({
|
|
|
2319
2466
|
}
|
|
2320
2467
|
)
|
|
2321
2468
|
] }),
|
|
2322
|
-
/* @__PURE__ */
|
|
2469
|
+
/* @__PURE__ */ jsx14(
|
|
2323
2470
|
Table2,
|
|
2324
2471
|
{
|
|
2325
2472
|
dataSource: filteredPermissions,
|
|
@@ -2330,8 +2477,8 @@ function UserDetailCard({
|
|
|
2330
2477
|
dataIndex: "permission",
|
|
2331
2478
|
key: "permission",
|
|
2332
2479
|
render: (perm) => /* @__PURE__ */ jsxs11(Space9, { children: [
|
|
2333
|
-
/* @__PURE__ */
|
|
2334
|
-
/* @__PURE__ */
|
|
2480
|
+
/* @__PURE__ */ jsx14(KeyOutlined, { style: { color: "#faad14" } }),
|
|
2481
|
+
/* @__PURE__ */ jsx14(AntLink, { children: perm })
|
|
2335
2482
|
] })
|
|
2336
2483
|
},
|
|
2337
2484
|
{
|
|
@@ -2339,7 +2486,7 @@ function UserDetailCard({
|
|
|
2339
2486
|
dataIndex: "type",
|
|
2340
2487
|
key: "type",
|
|
2341
2488
|
width: 150,
|
|
2342
|
-
render: (type) => /* @__PURE__ */
|
|
2489
|
+
render: (type) => /* @__PURE__ */ jsx14(Tag4, { color: type === "role" ? "blue" : "green", children: type === "role" ? labels.viaRole : labels.viaTeam })
|
|
2343
2490
|
},
|
|
2344
2491
|
{
|
|
2345
2492
|
title: labels.attachedVia,
|
|
@@ -2347,9 +2494,9 @@ function UserDetailCard({
|
|
|
2347
2494
|
key: "attachedVia",
|
|
2348
2495
|
width: 200,
|
|
2349
2496
|
render: (via, record) => /* @__PURE__ */ jsxs11(Space9, { children: [
|
|
2350
|
-
record.type === "role" ? /* @__PURE__ */
|
|
2351
|
-
/* @__PURE__ */
|
|
2352
|
-
record.scope && record.scope !== "team" && /* @__PURE__ */
|
|
2497
|
+
record.type === "role" ? /* @__PURE__ */ jsx14(SafetyOutlined3, {}) : /* @__PURE__ */ jsx14(TeamOutlined2, {}),
|
|
2498
|
+
/* @__PURE__ */ jsx14(Text7, { children: via }),
|
|
2499
|
+
record.scope && record.scope !== "team" && /* @__PURE__ */ jsx14(Tag4, { color: getScopeColor(record.scope), style: { fontSize: 12 }, children: record.scope })
|
|
2353
2500
|
] })
|
|
2354
2501
|
}
|
|
2355
2502
|
]
|
|
@@ -2360,7 +2507,7 @@ function UserDetailCard({
|
|
|
2360
2507
|
{
|
|
2361
2508
|
key: "roles",
|
|
2362
2509
|
label: /* @__PURE__ */ jsxs11("span", { children: [
|
|
2363
|
-
/* @__PURE__ */
|
|
2510
|
+
/* @__PURE__ */ jsx14(SafetyOutlined3, {}),
|
|
2364
2511
|
" ",
|
|
2365
2512
|
labels.roles,
|
|
2366
2513
|
" (",
|
|
@@ -2378,12 +2525,12 @@ function UserDetailCard({
|
|
|
2378
2525
|
marginBottom: 16
|
|
2379
2526
|
},
|
|
2380
2527
|
children: [
|
|
2381
|
-
/* @__PURE__ */
|
|
2382
|
-
onAssignRole && /* @__PURE__ */
|
|
2528
|
+
/* @__PURE__ */ jsx14(Title3, { level: 5, style: { margin: 0 }, children: labels.roleAssignments }),
|
|
2529
|
+
onAssignRole && /* @__PURE__ */ jsx14(Button6, { type: "primary", icon: /* @__PURE__ */ jsx14(PlusOutlined3, {}), onClick: onAssignRole, children: labels.assignRole })
|
|
2383
2530
|
]
|
|
2384
2531
|
}
|
|
2385
2532
|
),
|
|
2386
|
-
roleAssignments.length === 0 ? /* @__PURE__ */
|
|
2533
|
+
roleAssignments.length === 0 ? /* @__PURE__ */ jsx14(Empty2, { description: labels.noRolesAssigned }) : /* @__PURE__ */ jsx14(
|
|
2387
2534
|
Table2,
|
|
2388
2535
|
{
|
|
2389
2536
|
dataSource: roleAssignments,
|
|
@@ -2393,9 +2540,9 @@ function UserDetailCard({
|
|
|
2393
2540
|
title: labels.roles,
|
|
2394
2541
|
key: "role",
|
|
2395
2542
|
render: (_, record) => /* @__PURE__ */ jsxs11(Space9, { children: [
|
|
2396
|
-
/* @__PURE__ */
|
|
2397
|
-
/* @__PURE__ */
|
|
2398
|
-
|
|
2543
|
+
/* @__PURE__ */ jsx14(SafetyOutlined3, { style: { color: "#1890ff" } }),
|
|
2544
|
+
/* @__PURE__ */ jsx14(
|
|
2545
|
+
Text7,
|
|
2399
2546
|
{
|
|
2400
2547
|
strong: true,
|
|
2401
2548
|
style: { color: "#1890ff", cursor: onRoleClick ? "pointer" : "default" },
|
|
@@ -2403,14 +2550,14 @@ function UserDetailCard({
|
|
|
2403
2550
|
children: record.role.name
|
|
2404
2551
|
}
|
|
2405
2552
|
),
|
|
2406
|
-
/* @__PURE__ */
|
|
2553
|
+
/* @__PURE__ */ jsx14(Tag4, { color: "default", children: record.role.slug })
|
|
2407
2554
|
] })
|
|
2408
2555
|
},
|
|
2409
2556
|
{
|
|
2410
2557
|
title: labels.global,
|
|
2411
2558
|
key: "scope",
|
|
2412
2559
|
width: 200,
|
|
2413
|
-
render: (_, record) => /* @__PURE__ */
|
|
2560
|
+
render: (_, record) => /* @__PURE__ */ jsx14(Tag4, { color: getScopeColor(record.scope), children: getScopeLabel(record) })
|
|
2414
2561
|
},
|
|
2415
2562
|
{
|
|
2416
2563
|
title: labels.level,
|
|
@@ -2422,7 +2569,7 @@ function UserDetailCard({
|
|
|
2422
2569
|
title: labels.permissions,
|
|
2423
2570
|
key: "permissions",
|
|
2424
2571
|
width: 150,
|
|
2425
|
-
render: (_, record) => /* @__PURE__ */ jsxs11(
|
|
2572
|
+
render: (_, record) => /* @__PURE__ */ jsxs11(Text7, { children: [
|
|
2426
2573
|
record.permissions.length,
|
|
2427
2574
|
" ",
|
|
2428
2575
|
labels.permissions.toLowerCase()
|
|
@@ -2432,7 +2579,7 @@ function UserDetailCard({
|
|
|
2432
2579
|
title: labels.actions,
|
|
2433
2580
|
key: "actions",
|
|
2434
2581
|
width: 100,
|
|
2435
|
-
render: (_, record) => onRemoveRole && /* @__PURE__ */
|
|
2582
|
+
render: (_, record) => onRemoveRole && /* @__PURE__ */ jsx14(
|
|
2436
2583
|
Popconfirm3,
|
|
2437
2584
|
{
|
|
2438
2585
|
title: labels.confirmRemoveRole,
|
|
@@ -2441,12 +2588,12 @@ function UserDetailCard({
|
|
|
2441
2588
|
record.console_org_id,
|
|
2442
2589
|
record.console_branch_id
|
|
2443
2590
|
),
|
|
2444
|
-
children: /* @__PURE__ */
|
|
2591
|
+
children: /* @__PURE__ */ jsx14(
|
|
2445
2592
|
Button6,
|
|
2446
2593
|
{
|
|
2447
2594
|
type: "text",
|
|
2448
2595
|
danger: true,
|
|
2449
|
-
icon: /* @__PURE__ */
|
|
2596
|
+
icon: /* @__PURE__ */ jsx14(DeleteOutlined2, {}),
|
|
2450
2597
|
loading: removeLoading
|
|
2451
2598
|
}
|
|
2452
2599
|
)
|
|
@@ -2461,7 +2608,7 @@ function UserDetailCard({
|
|
|
2461
2608
|
{
|
|
2462
2609
|
key: "teams",
|
|
2463
2610
|
label: /* @__PURE__ */ jsxs11("span", { children: [
|
|
2464
|
-
/* @__PURE__ */
|
|
2611
|
+
/* @__PURE__ */ jsx14(TeamOutlined2, {}),
|
|
2465
2612
|
" ",
|
|
2466
2613
|
labels.teams,
|
|
2467
2614
|
" (",
|
|
@@ -2469,8 +2616,8 @@ function UserDetailCard({
|
|
|
2469
2616
|
")"
|
|
2470
2617
|
] }),
|
|
2471
2618
|
children: /* @__PURE__ */ jsxs11("div", { children: [
|
|
2472
|
-
/* @__PURE__ */
|
|
2473
|
-
teamMemberships.length === 0 ? /* @__PURE__ */
|
|
2619
|
+
/* @__PURE__ */ jsx14(Title3, { level: 5, style: { marginBottom: 16 }, children: labels.teamMemberships }),
|
|
2620
|
+
teamMemberships.length === 0 ? /* @__PURE__ */ jsx14(Empty2, { description: labels.noTeamMemberships }) : /* @__PURE__ */ jsx14(
|
|
2474
2621
|
Table2,
|
|
2475
2622
|
{
|
|
2476
2623
|
dataSource: teamMemberships,
|
|
@@ -2480,9 +2627,9 @@ function UserDetailCard({
|
|
|
2480
2627
|
title: labels.teams,
|
|
2481
2628
|
key: "team",
|
|
2482
2629
|
render: (_, record) => /* @__PURE__ */ jsxs11(Space9, { children: [
|
|
2483
|
-
/* @__PURE__ */
|
|
2484
|
-
/* @__PURE__ */
|
|
2485
|
-
record.team.path && /* @__PURE__ */ jsxs11(
|
|
2630
|
+
/* @__PURE__ */ jsx14(TeamOutlined2, { style: { color: "#52c41a" } }),
|
|
2631
|
+
/* @__PURE__ */ jsx14(Text7, { strong: true, children: record.team.name }),
|
|
2632
|
+
record.team.path && /* @__PURE__ */ jsxs11(Text7, { type: "secondary", children: [
|
|
2486
2633
|
"(",
|
|
2487
2634
|
record.team.path,
|
|
2488
2635
|
")"
|
|
@@ -2493,13 +2640,13 @@ function UserDetailCard({
|
|
|
2493
2640
|
title: labels.teamLeader,
|
|
2494
2641
|
key: "leader",
|
|
2495
2642
|
width: 150,
|
|
2496
|
-
render: (_, record) => record.is_leader ? /* @__PURE__ */
|
|
2643
|
+
render: (_, record) => record.is_leader ? /* @__PURE__ */ jsx14(Tag4, { color: "gold", children: labels.teamLeader }) : /* @__PURE__ */ jsx14(Text7, { type: "secondary", children: "-" })
|
|
2497
2644
|
},
|
|
2498
2645
|
{
|
|
2499
2646
|
title: labels.permissions,
|
|
2500
2647
|
key: "permissions",
|
|
2501
2648
|
width: 150,
|
|
2502
|
-
render: (_, record) => /* @__PURE__ */ jsxs11(
|
|
2649
|
+
render: (_, record) => /* @__PURE__ */ jsxs11(Text7, { children: [
|
|
2503
2650
|
record.permissions.length,
|
|
2504
2651
|
" ",
|
|
2505
2652
|
labels.permissions.toLowerCase()
|
|
@@ -2513,7 +2660,7 @@ function UserDetailCard({
|
|
|
2513
2660
|
{
|
|
2514
2661
|
key: "aggregated",
|
|
2515
2662
|
label: /* @__PURE__ */ jsxs11("span", { children: [
|
|
2516
|
-
/* @__PURE__ */
|
|
2663
|
+
/* @__PURE__ */ jsx14(SafetyOutlined3, {}),
|
|
2517
2664
|
" ",
|
|
2518
2665
|
labels.aggregatedPermissions,
|
|
2519
2666
|
" (",
|
|
@@ -2521,9 +2668,9 @@ function UserDetailCard({
|
|
|
2521
2668
|
")"
|
|
2522
2669
|
] }),
|
|
2523
2670
|
children: /* @__PURE__ */ jsxs11("div", { children: [
|
|
2524
|
-
/* @__PURE__ */
|
|
2525
|
-
/* @__PURE__ */
|
|
2526
|
-
aggregatedPermissions.length === 0 ? /* @__PURE__ */
|
|
2671
|
+
/* @__PURE__ */ jsx14(Title3, { level: 5, style: { marginBottom: 16 }, children: labels.aggregatedPermissions }),
|
|
2672
|
+
/* @__PURE__ */ jsx14(Text7, { type: "secondary", style: { display: "block", marginBottom: 16 }, children: "\u3059\u3079\u3066\u306E\u30ED\u30FC\u30EB\u3068\u30C1\u30FC\u30E0\u304B\u3089\u96C6\u7D04\u3055\u308C\u305F\u6A29\u9650\u306E\u4E00\u89A7\u3067\u3059\u3002" }),
|
|
2673
|
+
aggregatedPermissions.length === 0 ? /* @__PURE__ */ jsx14(Empty2, { description: labels.noPermissions }) : /* @__PURE__ */ jsx14(
|
|
2527
2674
|
Table2,
|
|
2528
2675
|
{
|
|
2529
2676
|
dataSource: aggregatedPermissions.map((perm) => ({
|
|
@@ -2545,15 +2692,15 @@ function UserDetailCard({
|
|
|
2545
2692
|
value: g
|
|
2546
2693
|
})),
|
|
2547
2694
|
onFilter: (value, record) => record.group === value,
|
|
2548
|
-
render: (group) => /* @__PURE__ */
|
|
2695
|
+
render: (group) => /* @__PURE__ */ jsx14(Tag4, { icon: /* @__PURE__ */ jsx14(SafetyOutlined3, {}), color: "blue", children: group })
|
|
2549
2696
|
},
|
|
2550
2697
|
{
|
|
2551
2698
|
title: labels.permissions,
|
|
2552
2699
|
dataIndex: "permission",
|
|
2553
2700
|
key: "permission",
|
|
2554
2701
|
render: (perm) => /* @__PURE__ */ jsxs11(Space9, { children: [
|
|
2555
|
-
/* @__PURE__ */
|
|
2556
|
-
/* @__PURE__ */
|
|
2702
|
+
/* @__PURE__ */ jsx14(KeyOutlined, { style: { color: "#faad14" } }),
|
|
2703
|
+
/* @__PURE__ */ jsx14(Text7, { children: perm })
|
|
2557
2704
|
] })
|
|
2558
2705
|
},
|
|
2559
2706
|
{
|
|
@@ -2561,7 +2708,7 @@ function UserDetailCard({
|
|
|
2561
2708
|
dataIndex: "action",
|
|
2562
2709
|
key: "action",
|
|
2563
2710
|
width: 150,
|
|
2564
|
-
render: (action) => /* @__PURE__ */
|
|
2711
|
+
render: (action) => /* @__PURE__ */ jsx14(Tag4, { color: "green", children: action })
|
|
2565
2712
|
}
|
|
2566
2713
|
]
|
|
2567
2714
|
}
|
|
@@ -2570,7 +2717,7 @@ function UserDetailCard({
|
|
|
2570
2717
|
}
|
|
2571
2718
|
];
|
|
2572
2719
|
return /* @__PURE__ */ jsxs11("div", { children: [
|
|
2573
|
-
/* @__PURE__ */
|
|
2720
|
+
/* @__PURE__ */ jsx14(Card3, { size: "small", style: { marginBottom: 24 }, styles: { body: { padding: "16px 24px" } }, children: /* @__PURE__ */ jsxs11(
|
|
2574
2721
|
"div",
|
|
2575
2722
|
{
|
|
2576
2723
|
style: {
|
|
@@ -2580,44 +2727,44 @@ function UserDetailCard({
|
|
|
2580
2727
|
},
|
|
2581
2728
|
children: [
|
|
2582
2729
|
/* @__PURE__ */ jsxs11("div", { children: [
|
|
2583
|
-
/* @__PURE__ */
|
|
2584
|
-
/* @__PURE__ */
|
|
2730
|
+
/* @__PURE__ */ jsx14(Text7, { type: "secondary", style: { fontSize: 12, display: "block", marginBottom: 4 }, children: labels.email }),
|
|
2731
|
+
/* @__PURE__ */ jsx14(Text7, { copyable: true, style: { fontSize: 14 }, children: user?.email || "-" })
|
|
2585
2732
|
] }),
|
|
2586
2733
|
/* @__PURE__ */ jsxs11("div", { children: [
|
|
2587
|
-
/* @__PURE__ */
|
|
2734
|
+
/* @__PURE__ */ jsx14(Text7, { type: "secondary", style: { fontSize: 12, display: "block", marginBottom: 4 }, children: labels.primaryOrganization }),
|
|
2588
2735
|
user?.organization ? /* @__PURE__ */ jsxs11(Space9, { size: 4, children: [
|
|
2589
|
-
/* @__PURE__ */
|
|
2590
|
-
/* @__PURE__ */
|
|
2736
|
+
/* @__PURE__ */ jsx14(BankOutlined6, { style: { color: "#1890ff" } }),
|
|
2737
|
+
/* @__PURE__ */ jsx14(Text7, { style: { fontSize: 14 }, children: user.organization.name })
|
|
2591
2738
|
] }) : /* @__PURE__ */ jsxs11(Space9, { size: 4, children: [
|
|
2592
|
-
/* @__PURE__ */
|
|
2593
|
-
/* @__PURE__ */
|
|
2739
|
+
/* @__PURE__ */ jsx14(GlobalOutlined5, { style: { color: "#722ed1" } }),
|
|
2740
|
+
/* @__PURE__ */ jsx14(Text7, { style: { fontSize: 14 }, children: labels.global })
|
|
2594
2741
|
] })
|
|
2595
2742
|
] }),
|
|
2596
2743
|
/* @__PURE__ */ jsxs11("div", { children: [
|
|
2597
|
-
/* @__PURE__ */
|
|
2744
|
+
/* @__PURE__ */ jsx14(Text7, { type: "secondary", style: { fontSize: 12, display: "block", marginBottom: 4 }, children: labels.currentContext }),
|
|
2598
2745
|
/* @__PURE__ */ jsxs11(Space9, { size: 16, wrap: true, children: [
|
|
2599
2746
|
currentOrg && /* @__PURE__ */ jsxs11(Space9, { size: 4, children: [
|
|
2600
|
-
/* @__PURE__ */
|
|
2601
|
-
/* @__PURE__ */
|
|
2747
|
+
/* @__PURE__ */ jsx14(BankOutlined6, { style: { color: "#1890ff" } }),
|
|
2748
|
+
/* @__PURE__ */ jsx14(Text7, { style: { fontSize: 14 }, children: currentOrg.name })
|
|
2602
2749
|
] }),
|
|
2603
2750
|
currentBranch && /* @__PURE__ */ jsxs11(Space9, { size: 4, children: [
|
|
2604
|
-
/* @__PURE__ */
|
|
2605
|
-
/* @__PURE__ */
|
|
2751
|
+
/* @__PURE__ */ jsx14(BranchesOutlined4, { style: { color: "#52c41a" } }),
|
|
2752
|
+
/* @__PURE__ */ jsx14(Text7, { style: { fontSize: 14 }, children: currentBranch.name })
|
|
2606
2753
|
] })
|
|
2607
2754
|
] })
|
|
2608
2755
|
] }),
|
|
2609
2756
|
/* @__PURE__ */ jsxs11("div", { children: [
|
|
2610
|
-
/* @__PURE__ */
|
|
2611
|
-
/* @__PURE__ */
|
|
2757
|
+
/* @__PURE__ */ jsx14(Text7, { type: "secondary", style: { fontSize: 12, display: "block", marginBottom: 4 }, children: labels.created }),
|
|
2758
|
+
/* @__PURE__ */ jsx14(Text7, { style: { fontSize: 14 }, children: user?.created_at ? new Date(user.created_at).toLocaleDateString() : "-" })
|
|
2612
2759
|
] }),
|
|
2613
2760
|
/* @__PURE__ */ jsxs11("div", { children: [
|
|
2614
|
-
/* @__PURE__ */
|
|
2615
|
-
/* @__PURE__ */
|
|
2761
|
+
/* @__PURE__ */ jsx14(Text7, { type: "secondary", style: { fontSize: 12, display: "block", marginBottom: 4 }, children: labels.lastSignIn }),
|
|
2762
|
+
/* @__PURE__ */ jsx14(Text7, { style: { fontSize: 14 }, children: "-" })
|
|
2616
2763
|
] }),
|
|
2617
2764
|
/* @__PURE__ */ jsxs11("div", { children: [
|
|
2618
|
-
/* @__PURE__ */
|
|
2619
|
-
/* @__PURE__ */ jsxs11(
|
|
2620
|
-
/* @__PURE__ */
|
|
2765
|
+
/* @__PURE__ */ jsx14(Text7, { type: "secondary", style: { fontSize: 12, display: "block", marginBottom: 4 }, children: labels.roleAssignments }),
|
|
2766
|
+
/* @__PURE__ */ jsxs11(Text7, { style: { fontSize: 14 }, children: [
|
|
2767
|
+
/* @__PURE__ */ jsx14(Text7, { strong: true, children: roleAssignments.length }),
|
|
2621
2768
|
" ",
|
|
2622
2769
|
labels.roles.toLowerCase()
|
|
2623
2770
|
] })
|
|
@@ -2625,15 +2772,15 @@ function UserDetailCard({
|
|
|
2625
2772
|
]
|
|
2626
2773
|
}
|
|
2627
2774
|
) }),
|
|
2628
|
-
/* @__PURE__ */
|
|
2775
|
+
/* @__PURE__ */ jsx14(Card3, { children: /* @__PURE__ */ jsx14(Tabs, { defaultActiveKey: "permissions", items: tabItems }) })
|
|
2629
2776
|
] });
|
|
2630
2777
|
}
|
|
2631
2778
|
|
|
2632
2779
|
// src/ant/components/RoleCreateModal/RoleCreateModal.tsx
|
|
2633
2780
|
import { PlusOutlined as PlusOutlined4, GlobalOutlined as GlobalOutlined6, BankOutlined as BankOutlined7 } from "@ant-design/icons";
|
|
2634
|
-
import { Modal as
|
|
2635
|
-
import { jsx as
|
|
2636
|
-
var
|
|
2781
|
+
import { Modal as Modal6, Form as Form4, Input as Input3, InputNumber as InputNumber2, Select as Select8, Radio as Radio2, Button as Button7, Space as Space10 } from "antd";
|
|
2782
|
+
import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2783
|
+
var defaultTranslations5 = {
|
|
2637
2784
|
title: "\u30ED\u30FC\u30EB\u4F5C\u6210",
|
|
2638
2785
|
name: "\u540D\u524D",
|
|
2639
2786
|
slug: "\u30B9\u30E9\u30C3\u30B0",
|
|
@@ -2657,7 +2804,7 @@ function RoleCreateModal({
|
|
|
2657
2804
|
translations: t = {}
|
|
2658
2805
|
}) {
|
|
2659
2806
|
const [form] = Form4.useForm();
|
|
2660
|
-
const labels = { ...
|
|
2807
|
+
const labels = { ...defaultTranslations5, ...t };
|
|
2661
2808
|
const handleFinish = async (values) => {
|
|
2662
2809
|
await onSubmit(values);
|
|
2663
2810
|
form.resetFields();
|
|
@@ -2666,11 +2813,11 @@ function RoleCreateModal({
|
|
|
2666
2813
|
form.resetFields();
|
|
2667
2814
|
onCancel();
|
|
2668
2815
|
};
|
|
2669
|
-
return /* @__PURE__ */
|
|
2670
|
-
|
|
2816
|
+
return /* @__PURE__ */ jsx15(
|
|
2817
|
+
Modal6,
|
|
2671
2818
|
{
|
|
2672
2819
|
title: /* @__PURE__ */ jsxs12(Space10, { children: [
|
|
2673
|
-
/* @__PURE__ */
|
|
2820
|
+
/* @__PURE__ */ jsx15(PlusOutlined4, {}),
|
|
2674
2821
|
labels.title
|
|
2675
2822
|
] }),
|
|
2676
2823
|
open,
|
|
@@ -2685,67 +2832,67 @@ function RoleCreateModal({
|
|
|
2685
2832
|
onFinish: handleFinish,
|
|
2686
2833
|
initialValues: { level: 50, scope: "org", org_id: currentOrgId },
|
|
2687
2834
|
children: [
|
|
2688
|
-
/* @__PURE__ */
|
|
2835
|
+
/* @__PURE__ */ jsx15(
|
|
2689
2836
|
Form4.Item,
|
|
2690
2837
|
{
|
|
2691
2838
|
name: "scope",
|
|
2692
2839
|
label: labels.scope,
|
|
2693
2840
|
rules: [{ required: true, message: labels.required }],
|
|
2694
2841
|
children: /* @__PURE__ */ jsxs12(Radio2.Group, { children: [
|
|
2695
|
-
/* @__PURE__ */
|
|
2696
|
-
/* @__PURE__ */
|
|
2842
|
+
/* @__PURE__ */ jsx15(Radio2, { value: "global", children: /* @__PURE__ */ jsxs12(Space10, { children: [
|
|
2843
|
+
/* @__PURE__ */ jsx15(GlobalOutlined6, {}),
|
|
2697
2844
|
labels.global
|
|
2698
2845
|
] }) }),
|
|
2699
|
-
/* @__PURE__ */
|
|
2700
|
-
/* @__PURE__ */
|
|
2846
|
+
/* @__PURE__ */ jsx15(Radio2, { value: "org", children: /* @__PURE__ */ jsxs12(Space10, { children: [
|
|
2847
|
+
/* @__PURE__ */ jsx15(BankOutlined7, {}),
|
|
2701
2848
|
labels.orgRole
|
|
2702
2849
|
] }) })
|
|
2703
2850
|
] })
|
|
2704
2851
|
}
|
|
2705
2852
|
),
|
|
2706
|
-
/* @__PURE__ */
|
|
2853
|
+
/* @__PURE__ */ jsx15(Form4.Item, { noStyle: true, shouldUpdate: (prev, curr) => prev.scope !== curr.scope, children: ({ getFieldValue }) => getFieldValue("scope") === "org" && /* @__PURE__ */ jsx15(
|
|
2707
2854
|
Form4.Item,
|
|
2708
2855
|
{
|
|
2709
2856
|
name: "org_id",
|
|
2710
2857
|
label: labels.organization,
|
|
2711
2858
|
rules: [{ required: true, message: labels.required }],
|
|
2712
|
-
children: /* @__PURE__ */
|
|
2713
|
-
/* @__PURE__ */
|
|
2859
|
+
children: /* @__PURE__ */ jsx15(Select8, { placeholder: labels.organization, children: organizations.map((org) => /* @__PURE__ */ jsx15(Select8.Option, { value: String(org.id), children: /* @__PURE__ */ jsxs12(Space10, { children: [
|
|
2860
|
+
/* @__PURE__ */ jsx15(BankOutlined7, {}),
|
|
2714
2861
|
org.name
|
|
2715
2862
|
] }) }, org.id)) })
|
|
2716
2863
|
}
|
|
2717
2864
|
) }),
|
|
2718
|
-
/* @__PURE__ */
|
|
2865
|
+
/* @__PURE__ */ jsx15(
|
|
2719
2866
|
Form4.Item,
|
|
2720
2867
|
{
|
|
2721
2868
|
name: "name",
|
|
2722
2869
|
label: labels.name,
|
|
2723
2870
|
rules: [{ required: true, message: labels.required }],
|
|
2724
|
-
children: /* @__PURE__ */
|
|
2871
|
+
children: /* @__PURE__ */ jsx15(Input3, {})
|
|
2725
2872
|
}
|
|
2726
2873
|
),
|
|
2727
|
-
/* @__PURE__ */
|
|
2874
|
+
/* @__PURE__ */ jsx15(
|
|
2728
2875
|
Form4.Item,
|
|
2729
2876
|
{
|
|
2730
2877
|
name: "slug",
|
|
2731
2878
|
label: labels.slug,
|
|
2732
2879
|
rules: [{ required: true, message: labels.required }],
|
|
2733
|
-
children: /* @__PURE__ */
|
|
2880
|
+
children: /* @__PURE__ */ jsx15(Input3, {})
|
|
2734
2881
|
}
|
|
2735
2882
|
),
|
|
2736
|
-
/* @__PURE__ */
|
|
2737
|
-
/* @__PURE__ */
|
|
2883
|
+
/* @__PURE__ */ jsx15(Form4.Item, { name: "description", label: labels.description, children: /* @__PURE__ */ jsx15(Input3.TextArea, { rows: 3 }) }),
|
|
2884
|
+
/* @__PURE__ */ jsx15(
|
|
2738
2885
|
Form4.Item,
|
|
2739
2886
|
{
|
|
2740
2887
|
name: "level",
|
|
2741
2888
|
label: labels.level,
|
|
2742
2889
|
rules: [{ required: true, message: labels.required }],
|
|
2743
|
-
children: /* @__PURE__ */
|
|
2890
|
+
children: /* @__PURE__ */ jsx15(InputNumber2, { min: 1, max: 100, style: { width: "100%" } })
|
|
2744
2891
|
}
|
|
2745
2892
|
),
|
|
2746
|
-
/* @__PURE__ */
|
|
2747
|
-
/* @__PURE__ */
|
|
2748
|
-
/* @__PURE__ */
|
|
2893
|
+
/* @__PURE__ */ jsx15(Form4.Item, { children: /* @__PURE__ */ jsxs12(Space10, { children: [
|
|
2894
|
+
/* @__PURE__ */ jsx15(Button7, { type: "primary", htmlType: "submit", loading, children: labels.create }),
|
|
2895
|
+
/* @__PURE__ */ jsx15(Button7, { onClick: handleCancel, children: labels.cancel })
|
|
2749
2896
|
] }) })
|
|
2750
2897
|
]
|
|
2751
2898
|
}
|
|
@@ -2763,10 +2910,10 @@ import {
|
|
|
2763
2910
|
GlobalOutlined as GlobalOutlined7,
|
|
2764
2911
|
BankOutlined as BankOutlined8
|
|
2765
2912
|
} from "@ant-design/icons";
|
|
2766
|
-
import { Card as Card4, Typography as
|
|
2767
|
-
import { jsx as
|
|
2768
|
-
var { Text:
|
|
2769
|
-
var
|
|
2913
|
+
import { Card as Card4, Typography as Typography9, Button as Button8, Space as Space11, Tag as Tag5, Select as Select9, Table as Table3, Popconfirm as Popconfirm4 } from "antd";
|
|
2914
|
+
import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2915
|
+
var { Text: Text8 } = Typography9;
|
|
2916
|
+
var defaultTranslations6 = {
|
|
2770
2917
|
name: "\u540D\u524D",
|
|
2771
2918
|
scope: "\u30B9\u30B3\u30FC\u30D7",
|
|
2772
2919
|
level: "\u30EC\u30D9\u30EB",
|
|
@@ -2788,16 +2935,16 @@ function RolesListCard({
|
|
|
2788
2935
|
onDeleteClick,
|
|
2789
2936
|
translations: t = {}
|
|
2790
2937
|
}) {
|
|
2791
|
-
const labels = { ...
|
|
2938
|
+
const labels = { ...defaultTranslations6, ...t };
|
|
2792
2939
|
const columns = [
|
|
2793
2940
|
{
|
|
2794
2941
|
title: labels.name,
|
|
2795
2942
|
dataIndex: "name",
|
|
2796
2943
|
key: "name",
|
|
2797
2944
|
render: (name, record) => /* @__PURE__ */ jsxs13(Space11, { children: [
|
|
2798
|
-
/* @__PURE__ */
|
|
2799
|
-
/* @__PURE__ */
|
|
2800
|
-
/* @__PURE__ */
|
|
2945
|
+
/* @__PURE__ */ jsx16(SafetyOutlined4, { style: { color: "#1890ff" } }),
|
|
2946
|
+
/* @__PURE__ */ jsx16(Text8, { strong: true, children: name }),
|
|
2947
|
+
/* @__PURE__ */ jsx16(Tag5, { children: record.slug })
|
|
2801
2948
|
] })
|
|
2802
2949
|
},
|
|
2803
2950
|
{
|
|
@@ -2805,14 +2952,14 @@ function RolesListCard({
|
|
|
2805
2952
|
dataIndex: "console_org_id",
|
|
2806
2953
|
key: "scope",
|
|
2807
2954
|
width: 180,
|
|
2808
|
-
render: (_, record) => record.console_org_id ? /* @__PURE__ */
|
|
2955
|
+
render: (_, record) => record.console_org_id ? /* @__PURE__ */ jsx16(Tag5, { icon: /* @__PURE__ */ jsx16(BankOutlined8, {}), color: "blue", children: record.organization?.name || record.console_org_id }) : /* @__PURE__ */ jsx16(Tag5, { icon: /* @__PURE__ */ jsx16(GlobalOutlined7, {}), color: "purple", children: labels.global })
|
|
2809
2956
|
},
|
|
2810
2957
|
{
|
|
2811
2958
|
title: labels.level,
|
|
2812
2959
|
dataIndex: "level",
|
|
2813
2960
|
key: "level",
|
|
2814
2961
|
width: 100,
|
|
2815
|
-
render: (level) => /* @__PURE__ */
|
|
2962
|
+
render: (level) => /* @__PURE__ */ jsx16(Tag5, { color: "blue", children: level })
|
|
2816
2963
|
},
|
|
2817
2964
|
{
|
|
2818
2965
|
title: labels.description,
|
|
@@ -2825,8 +2972,8 @@ function RolesListCard({
|
|
|
2825
2972
|
key: "actions",
|
|
2826
2973
|
width: 180,
|
|
2827
2974
|
render: (_, record) => /* @__PURE__ */ jsxs13(Space11, { children: [
|
|
2828
|
-
/* @__PURE__ */
|
|
2829
|
-
/* @__PURE__ */
|
|
2975
|
+
/* @__PURE__ */ jsx16(Button8, { size: "small", icon: /* @__PURE__ */ jsx16(EyeOutlined, {}), onClick: () => onViewClick(record), children: labels.detail }),
|
|
2976
|
+
/* @__PURE__ */ jsx16(Popconfirm4, { title: labels.confirmDeleteRole, onConfirm: () => onDeleteClick(record), children: /* @__PURE__ */ jsx16(Button8, { size: "small", danger: true, icon: /* @__PURE__ */ jsx16(DeleteOutlined3, {}) }) })
|
|
2830
2977
|
] })
|
|
2831
2978
|
}
|
|
2832
2979
|
];
|
|
@@ -2834,34 +2981,34 @@ function RolesListCard({
|
|
|
2834
2981
|
Card4,
|
|
2835
2982
|
{
|
|
2836
2983
|
title: /* @__PURE__ */ jsxs13(Space11, { children: [
|
|
2837
|
-
/* @__PURE__ */
|
|
2984
|
+
/* @__PURE__ */ jsx16(SafetyOutlined4, {}),
|
|
2838
2985
|
"Roles"
|
|
2839
2986
|
] }),
|
|
2840
|
-
extra: /* @__PURE__ */
|
|
2987
|
+
extra: /* @__PURE__ */ jsx16(Button8, { type: "primary", icon: /* @__PURE__ */ jsx16(PlusOutlined5, {}), onClick: onCreateClick, children: "Create" }),
|
|
2841
2988
|
children: [
|
|
2842
|
-
/* @__PURE__ */
|
|
2843
|
-
|
|
2989
|
+
/* @__PURE__ */ jsx16("div", { style: { marginBottom: 16, display: "flex", gap: 16 }, children: /* @__PURE__ */ jsxs13(
|
|
2990
|
+
Select9,
|
|
2844
2991
|
{
|
|
2845
2992
|
value: scopeFilter,
|
|
2846
2993
|
onChange: onScopeFilterChange,
|
|
2847
2994
|
style: { minWidth: 200 },
|
|
2848
2995
|
children: [
|
|
2849
|
-
/* @__PURE__ */
|
|
2850
|
-
/* @__PURE__ */
|
|
2996
|
+
/* @__PURE__ */ jsx16(Select9.Option, { value: "all", children: /* @__PURE__ */ jsxs13(Space11, { children: [
|
|
2997
|
+
/* @__PURE__ */ jsx16(SafetyOutlined4, {}),
|
|
2851
2998
|
labels.all
|
|
2852
2999
|
] }) }),
|
|
2853
|
-
/* @__PURE__ */
|
|
2854
|
-
/* @__PURE__ */
|
|
3000
|
+
/* @__PURE__ */ jsx16(Select9.Option, { value: "global", children: /* @__PURE__ */ jsxs13(Space11, { children: [
|
|
3001
|
+
/* @__PURE__ */ jsx16(GlobalOutlined7, {}),
|
|
2855
3002
|
labels.global
|
|
2856
3003
|
] }) }),
|
|
2857
|
-
/* @__PURE__ */
|
|
2858
|
-
/* @__PURE__ */
|
|
3004
|
+
/* @__PURE__ */ jsx16(Select9.Option, { value: "org", children: /* @__PURE__ */ jsxs13(Space11, { children: [
|
|
3005
|
+
/* @__PURE__ */ jsx16(BankOutlined8, {}),
|
|
2859
3006
|
labels.orgRole
|
|
2860
3007
|
] }) })
|
|
2861
3008
|
]
|
|
2862
3009
|
}
|
|
2863
3010
|
) }),
|
|
2864
|
-
/* @__PURE__ */
|
|
3011
|
+
/* @__PURE__ */ jsx16(
|
|
2865
3012
|
Table3,
|
|
2866
3013
|
{
|
|
2867
3014
|
columns,
|
|
@@ -2878,11 +3025,11 @@ function RolesListCard({
|
|
|
2878
3025
|
|
|
2879
3026
|
// src/ant/components/PermissionsListCard/PermissionsListCard.tsx
|
|
2880
3027
|
import { KeyOutlined as KeyOutlined2, AppstoreOutlined } from "@ant-design/icons";
|
|
2881
|
-
import { Card as Card5, Typography as
|
|
2882
|
-
import { useState as
|
|
2883
|
-
import { jsx as
|
|
2884
|
-
var { Text:
|
|
2885
|
-
var
|
|
3028
|
+
import { Card as Card5, Typography as Typography10, Tag as Tag6, Table as Table4, Input as Input4, Space as Space12, Collapse as Collapse2 } from "antd";
|
|
3029
|
+
import { useState as useState9, useMemo as useMemo8 } from "react";
|
|
3030
|
+
import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3031
|
+
var { Text: Text9 } = Typography10;
|
|
3032
|
+
var defaultTranslations7 = {
|
|
2886
3033
|
searchPermissions: "\u6A29\u9650\u3092\u691C\u7D22",
|
|
2887
3034
|
name: "\u540D\u524D",
|
|
2888
3035
|
slug: "\u30B9\u30E9\u30C3\u30B0",
|
|
@@ -2896,16 +3043,16 @@ function PermissionsListCard({
|
|
|
2896
3043
|
translations: t = {},
|
|
2897
3044
|
onGroupLabelRender
|
|
2898
3045
|
}) {
|
|
2899
|
-
const [search, setSearch] =
|
|
2900
|
-
const labels = { ...
|
|
2901
|
-
const filteredPermissions =
|
|
3046
|
+
const [search, setSearch] = useState9("");
|
|
3047
|
+
const labels = { ...defaultTranslations7, ...t };
|
|
3048
|
+
const filteredPermissions = useMemo8(() => {
|
|
2902
3049
|
if (!search) return permissions;
|
|
2903
3050
|
const lowerSearch = search.toLowerCase();
|
|
2904
3051
|
return permissions.filter(
|
|
2905
3052
|
(p) => p.name.toLowerCase().includes(lowerSearch) || p.slug.toLowerCase().includes(lowerSearch) || (p.group || "").toLowerCase().includes(lowerSearch)
|
|
2906
3053
|
);
|
|
2907
3054
|
}, [permissions, search]);
|
|
2908
|
-
const groupedPermissions =
|
|
3055
|
+
const groupedPermissions = useMemo8(() => {
|
|
2909
3056
|
const grouped = {};
|
|
2910
3057
|
filteredPermissions.forEach((perm) => {
|
|
2911
3058
|
const group = perm.group || "other";
|
|
@@ -2924,25 +3071,25 @@ function PermissionsListCard({
|
|
|
2924
3071
|
dataIndex: "name",
|
|
2925
3072
|
key: "name",
|
|
2926
3073
|
render: (name) => /* @__PURE__ */ jsxs14(Space12, { children: [
|
|
2927
|
-
/* @__PURE__ */
|
|
2928
|
-
/* @__PURE__ */
|
|
3074
|
+
/* @__PURE__ */ jsx17(KeyOutlined2, { style: { color: "#52c41a" } }),
|
|
3075
|
+
/* @__PURE__ */ jsx17(Text9, { strong: true, children: name })
|
|
2929
3076
|
] })
|
|
2930
3077
|
},
|
|
2931
3078
|
{
|
|
2932
3079
|
title: labels.slug,
|
|
2933
3080
|
dataIndex: "slug",
|
|
2934
3081
|
key: "slug",
|
|
2935
|
-
render: (slug) => /* @__PURE__ */
|
|
3082
|
+
render: (slug) => /* @__PURE__ */ jsx17(Tag6, { color: "blue", children: slug })
|
|
2936
3083
|
},
|
|
2937
3084
|
{
|
|
2938
3085
|
title: labels.group,
|
|
2939
3086
|
dataIndex: "group",
|
|
2940
3087
|
key: "group",
|
|
2941
|
-
render: (group) => /* @__PURE__ */
|
|
3088
|
+
render: (group) => /* @__PURE__ */ jsx17(Tag6, { icon: /* @__PURE__ */ jsx17(AppstoreOutlined, {}), color: "purple", children: getGroupLabel(group || "other") })
|
|
2942
3089
|
}
|
|
2943
3090
|
];
|
|
2944
3091
|
return /* @__PURE__ */ jsxs14(Card5, { children: [
|
|
2945
|
-
/* @__PURE__ */
|
|
3092
|
+
/* @__PURE__ */ jsx17("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ jsx17(
|
|
2946
3093
|
Input4.Search,
|
|
2947
3094
|
{
|
|
2948
3095
|
placeholder: labels.searchPermissions,
|
|
@@ -2952,15 +3099,15 @@ function PermissionsListCard({
|
|
|
2952
3099
|
style: { maxWidth: 300 }
|
|
2953
3100
|
}
|
|
2954
3101
|
) }),
|
|
2955
|
-
/* @__PURE__ */
|
|
3102
|
+
/* @__PURE__ */ jsx17(Collapse2, { defaultActiveKey: groups, ghost: true, children: Object.entries(groupedPermissions).map(([group, perms]) => /* @__PURE__ */ jsx17(
|
|
2956
3103
|
Collapse2.Panel,
|
|
2957
3104
|
{
|
|
2958
3105
|
header: /* @__PURE__ */ jsxs14(Space12, { children: [
|
|
2959
|
-
/* @__PURE__ */
|
|
2960
|
-
/* @__PURE__ */
|
|
2961
|
-
/* @__PURE__ */
|
|
3106
|
+
/* @__PURE__ */ jsx17(AppstoreOutlined, { style: { color: "#722ed1" } }),
|
|
3107
|
+
/* @__PURE__ */ jsx17(Text9, { strong: true, children: getGroupLabel(group) }),
|
|
3108
|
+
/* @__PURE__ */ jsx17(Tag6, { children: perms.length })
|
|
2962
3109
|
] }),
|
|
2963
|
-
children: /* @__PURE__ */
|
|
3110
|
+
children: /* @__PURE__ */ jsx17(
|
|
2964
3111
|
Table4,
|
|
2965
3112
|
{
|
|
2966
3113
|
columns,
|
|
@@ -2974,16 +3121,16 @@ function PermissionsListCard({
|
|
|
2974
3121
|
},
|
|
2975
3122
|
group
|
|
2976
3123
|
)) }),
|
|
2977
|
-
filteredPermissions.length === 0 && !loading && /* @__PURE__ */
|
|
3124
|
+
filteredPermissions.length === 0 && !loading && /* @__PURE__ */ jsx17("div", { style: { textAlign: "center", padding: 40 }, children: /* @__PURE__ */ jsx17(Text9, { type: "secondary", children: labels.noData }) })
|
|
2978
3125
|
] });
|
|
2979
3126
|
}
|
|
2980
3127
|
|
|
2981
3128
|
// src/ant/components/TeamsListCard/TeamsListCard.tsx
|
|
2982
3129
|
import { TeamOutlined as TeamOutlined3, KeyOutlined as KeyOutlined3, UserOutlined as UserOutlined2 } from "@ant-design/icons";
|
|
2983
|
-
import { Card as Card6, Typography as
|
|
2984
|
-
import { jsx as
|
|
2985
|
-
var { Text:
|
|
2986
|
-
var
|
|
3130
|
+
import { Card as Card6, Typography as Typography11, Tag as Tag7, Table as Table5, Empty as Empty3 } from "antd";
|
|
3131
|
+
import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3132
|
+
var { Text: Text10 } = Typography11;
|
|
3133
|
+
var defaultTranslations8 = {
|
|
2987
3134
|
name: "\u540D\u524D",
|
|
2988
3135
|
memberCount: "\u30E1\u30F3\u30D0\u30FC\u6570",
|
|
2989
3136
|
permissions: "\u6A29\u9650",
|
|
@@ -2997,15 +3144,15 @@ function TeamsListCard({
|
|
|
2997
3144
|
loading = false,
|
|
2998
3145
|
translations: t = {}
|
|
2999
3146
|
}) {
|
|
3000
|
-
const labels = { ...
|
|
3147
|
+
const labels = { ...defaultTranslations8, ...t };
|
|
3001
3148
|
const columns = [
|
|
3002
3149
|
{
|
|
3003
3150
|
title: labels.name,
|
|
3004
3151
|
dataIndex: "name",
|
|
3005
3152
|
key: "name",
|
|
3006
3153
|
render: (name) => /* @__PURE__ */ jsxs15("span", { children: [
|
|
3007
|
-
/* @__PURE__ */
|
|
3008
|
-
/* @__PURE__ */
|
|
3154
|
+
/* @__PURE__ */ jsx18(TeamOutlined3, { style: { marginRight: 8, color: "#1890ff" } }),
|
|
3155
|
+
/* @__PURE__ */ jsx18(Text10, { strong: true, children: name })
|
|
3009
3156
|
] })
|
|
3010
3157
|
},
|
|
3011
3158
|
{
|
|
@@ -3013,13 +3160,13 @@ function TeamsListCard({
|
|
|
3013
3160
|
dataIndex: "member_count",
|
|
3014
3161
|
key: "member_count",
|
|
3015
3162
|
width: 120,
|
|
3016
|
-
render: (count) => /* @__PURE__ */
|
|
3163
|
+
render: (count) => /* @__PURE__ */ jsx18(Tag7, { icon: /* @__PURE__ */ jsx18(UserOutlined2, {}), children: count })
|
|
3017
3164
|
},
|
|
3018
3165
|
{
|
|
3019
3166
|
title: labels.permissions,
|
|
3020
3167
|
dataIndex: "permissions",
|
|
3021
3168
|
key: "permissions",
|
|
3022
|
-
render: (permissions) => /* @__PURE__ */
|
|
3169
|
+
render: (permissions) => /* @__PURE__ */ jsx18("span", { children: permissions.length > 0 ? /* @__PURE__ */ jsxs15(Tag7, { color: "blue", children: [
|
|
3023
3170
|
permissions.length,
|
|
3024
3171
|
" ",
|
|
3025
3172
|
labels.permissions
|
|
@@ -3029,16 +3176,16 @@ function TeamsListCard({
|
|
|
3029
3176
|
] }) })
|
|
3030
3177
|
}
|
|
3031
3178
|
];
|
|
3032
|
-
return /* @__PURE__ */
|
|
3179
|
+
return /* @__PURE__ */ jsx18(Card6, { children: teams.length === 0 ? /* @__PURE__ */ jsx18(
|
|
3033
3180
|
Empty3,
|
|
3034
3181
|
{
|
|
3035
3182
|
description: /* @__PURE__ */ jsxs15("span", { children: [
|
|
3036
3183
|
labels.noTeams,
|
|
3037
|
-
/* @__PURE__ */
|
|
3038
|
-
/* @__PURE__ */
|
|
3184
|
+
/* @__PURE__ */ jsx18("br", {}),
|
|
3185
|
+
/* @__PURE__ */ jsx18(Text10, { type: "secondary", style: { fontSize: 12 }, children: labels.teamsFromConsole })
|
|
3039
3186
|
] })
|
|
3040
3187
|
}
|
|
3041
|
-
) : /* @__PURE__ */
|
|
3188
|
+
) : /* @__PURE__ */ jsx18(
|
|
3042
3189
|
Table5,
|
|
3043
3190
|
{
|
|
3044
3191
|
columns,
|
|
@@ -3048,12 +3195,12 @@ function TeamsListCard({
|
|
|
3048
3195
|
pagination: { pageSize: 10 },
|
|
3049
3196
|
expandable: {
|
|
3050
3197
|
expandedRowRender: (record) => /* @__PURE__ */ jsxs15("div", { style: { padding: "8px 0" }, children: [
|
|
3051
|
-
/* @__PURE__ */ jsxs15(
|
|
3052
|
-
/* @__PURE__ */
|
|
3198
|
+
/* @__PURE__ */ jsxs15(Text10, { strong: true, style: { marginBottom: 8, display: "block" }, children: [
|
|
3199
|
+
/* @__PURE__ */ jsx18(KeyOutlined3, { style: { marginRight: 4 } }),
|
|
3053
3200
|
labels.teamPermissions,
|
|
3054
3201
|
":"
|
|
3055
3202
|
] }),
|
|
3056
|
-
record.permissions.length === 0 ? /* @__PURE__ */
|
|
3203
|
+
record.permissions.length === 0 ? /* @__PURE__ */ jsx18(Text10, { type: "secondary", children: labels.noData }) : /* @__PURE__ */ jsx18("div", { style: { display: "flex", flexWrap: "wrap", gap: 4 }, children: record.permissions.map((perm) => /* @__PURE__ */ jsx18(Tag7, { color: "cyan", children: perm }, perm)) })
|
|
3057
3204
|
] })
|
|
3058
3205
|
}
|
|
3059
3206
|
}
|
|
@@ -3065,8 +3212,8 @@ import { App, ConfigProvider, theme as theme3 } from "antd";
|
|
|
3065
3212
|
import enUS from "antd/locale/en_US";
|
|
3066
3213
|
import jaJP from "antd/locale/ja_JP";
|
|
3067
3214
|
import viVN from "antd/locale/vi_VN";
|
|
3068
|
-
import { useEffect as
|
|
3069
|
-
import { jsx as
|
|
3215
|
+
import { useEffect as useEffect7 } from "react";
|
|
3216
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
3070
3217
|
var antdLocales = {
|
|
3071
3218
|
ja: jaJP,
|
|
3072
3219
|
en: enUS,
|
|
@@ -3105,10 +3252,10 @@ function AntdThemeProvider({ children, variant = "dashboard", setDayjsLocale })
|
|
|
3105
3252
|
const antdLocale = antdLocales[locale] ?? jaJP;
|
|
3106
3253
|
const fontFamily = fontFamilies[locale] ?? fontFamilies.ja;
|
|
3107
3254
|
const colors = themeColors[variant];
|
|
3108
|
-
|
|
3255
|
+
useEffect7(() => {
|
|
3109
3256
|
setDayjsLocale?.(locale);
|
|
3110
3257
|
}, [locale, setDayjsLocale]);
|
|
3111
|
-
return /* @__PURE__ */
|
|
3258
|
+
return /* @__PURE__ */ jsx19(
|
|
3112
3259
|
ConfigProvider,
|
|
3113
3260
|
{
|
|
3114
3261
|
locale: antdLocale,
|
|
@@ -3237,7 +3384,7 @@ function AntdThemeProvider({ children, variant = "dashboard", setDayjsLocale })
|
|
|
3237
3384
|
}
|
|
3238
3385
|
}
|
|
3239
3386
|
},
|
|
3240
|
-
children: /* @__PURE__ */
|
|
3387
|
+
children: /* @__PURE__ */ jsx19(App, { children })
|
|
3241
3388
|
}
|
|
3242
3389
|
);
|
|
3243
3390
|
}
|
|
@@ -3246,6 +3393,7 @@ export {
|
|
|
3246
3393
|
BranchGate,
|
|
3247
3394
|
LocaleSwitcher,
|
|
3248
3395
|
OrgBranchSelectorModal,
|
|
3396
|
+
OrgGate,
|
|
3249
3397
|
OrganizationSwitcher,
|
|
3250
3398
|
DEFAULT_TEXTS as PROTABLE_DEFAULT_TEXTS,
|
|
3251
3399
|
PageContainer,
|