@code0-tech/pictor 0.0.0-mvp.21 → 0.0.0-mvp.23
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/assets/components/alert/Alert.style.css +1 -1
- package/dist/assets/components/badge/Badge.style.css +1 -1
- package/dist/assets/components/breadcrumb/Breadcrumb.style.css +1 -1
- package/dist/assets/components/button/Button.style.css +1 -1
- package/dist/assets/components/button-group/ButtonGroup.style.css +1 -1
- package/dist/assets/components/card/Card.style.css +1 -1
- package/dist/assets/components/command/Command.style.css +1 -1
- package/dist/assets/components/d-flow/folder/DFlowFolder.style.css +1 -1
- package/dist/assets/components/d-flow/function/DFlowFunctionDefaultCard.style.css +1 -1
- package/dist/assets/components/d-flow/input/DFlowInputDataType.style.css +1 -1
- package/dist/assets/components/d-layout/DLayout.style.css +1 -1
- package/dist/assets/components/dialog/Dialog.style.css +1 -1
- package/dist/assets/components/file-tabs/FileTabs.style.css +1 -1
- package/dist/assets/components/form/Input.style.css +1 -1
- package/dist/assets/components/menu/Menu.style.css +1 -1
- package/dist/assets/components/segmented-control/SegmentedControl.style.css +1 -1
- package/dist/assets/components/tab/Tab.style.css +1 -1
- package/dist/assets/components/text/Text.style.css +1 -1
- package/dist/assets/components/toast/Toast.style.css +1 -1
- package/dist/assets/components/tooltip/Tooltip.style.css +1 -1
- package/dist/components/badge/Badge.d.ts +1 -0
- package/dist/components/badge/Badge.js +12 -11
- package/dist/components/button/Button.d.ts +1 -1
- package/dist/components/d-flow/input/DFlowInputDataType.js +32 -32
- package/dist/components/d-flow/suggestion/DFlowSuggestionMenu.js +22 -22
- package/dist/components/d-flow/suggestion/DFlowSuggestionMenu.util.js +11 -11
- package/dist/components/d-flow/suggestion/DFlowSuggestionSearchInput.d.ts +1 -1
- package/dist/components/d-flow/suggestion/DFlowSuggestionSearchInput.js +29 -16
- package/dist/components/d-flow/tab/DFlowTabDefault.js +59 -53
- package/dist/components/d-member/DNamespaceMember.service.js +6 -4
- package/dist/components/d-member/DNamespaceMember.view.js +13 -11
- package/dist/components/d-member/DNamespaceMemberCard.d.ts +10 -0
- package/dist/components/d-member/DNamespaceMemberCard.js +16 -0
- package/dist/components/d-member/DNamespaceMemberContent.d.ts +10 -0
- package/dist/components/d-member/DNamespaceMemberContent.js +176 -0
- package/dist/components/d-member/DNamespaceMemberList.d.ts +12 -0
- package/dist/components/d-member/DNamespaceMemberList.js +23 -0
- package/dist/components/d-member/index.d.ts +2 -0
- package/dist/components/d-member/index.js +6 -2
- package/dist/components/d-organization/DOrganizationCard.d.ts +3 -2
- package/dist/components/d-organization/DOrganizationList.d.ts +3 -4
- package/dist/components/d-organization/DOrganizationList.js +7 -7
- package/dist/components/d-organization/DOrganizatonContent.d.ts +5 -4
- package/dist/components/d-organization/DOrganizatonContent.js +40 -25
- package/dist/components/d-organization/index.js +22 -7
- package/dist/components/d-project/DNamespaceProjectCard.d.ts +5 -5
- package/dist/components/d-project/DNamespaceProjectCard.js +13 -11
- package/dist/components/d-project/DNamespaceProjectContent.d.ts +2 -1
- package/dist/components/d-project/DNamespaceProjectContent.js +36 -42
- package/dist/components/d-project/DNamespaceProjectList.d.ts +3 -3
- package/dist/components/d-project/DNamespaceProjectList.js +1 -1
- package/dist/components/d-project/index.js +11 -17
- package/dist/components/d-role/DNamespaceRole.view.d.ts +4 -1
- package/dist/components/d-role/DNamespaceRole.view.js +6 -3
- package/dist/components/d-role/DNamespaceRoleCard.d.ts +11 -0
- package/dist/components/d-role/DNamespaceRoleCard.js +17 -0
- package/dist/components/d-role/DNamespaceRoleContent.d.ts +10 -0
- package/dist/components/d-role/DNamespaceRoleContent.js +156 -0
- package/dist/components/d-role/DNamespaceRoleList.d.ts +12 -0
- package/dist/components/d-role/DNamespaceRoleList.js +24 -0
- package/dist/components/d-role/DNamespaceRolePermissions.d.ts +5 -0
- package/dist/components/d-role/DNamespaceRolePermissions.js +129 -0
- package/dist/components/d-role/index.d.ts +2 -0
- package/dist/components/d-role/index.js +6 -2
- package/dist/components/d-runtime/DRuntimeCard.d.ts +3 -1
- package/dist/components/d-runtime/DRuntimeCard.js +13 -12
- package/dist/components/d-runtime/DRuntimeContent.d.ts +3 -1
- package/dist/components/d-runtime/DRuntimeContent.js +25 -20
- package/dist/components/d-runtime/DRuntimeList.d.ts +5 -3
- package/dist/components/d-runtime/DRuntimeList.js +21 -15
- package/dist/components/d-user/DUser.service.d.ts +1 -0
- package/dist/components/d-user/DUser.service.js +5 -2
- package/dist/components/d-user/DUserCard.d.ts +2 -1
- package/dist/components/d-user/DUserContent.d.ts +2 -1
- package/dist/components/d-user/DUserContent.js +45 -45
- package/dist/components/d-user/DUserInput.d.ts +5 -0
- package/dist/components/d-user/DUserInput.js +97 -0
- package/dist/components/d-user/DUserList.d.ts +2 -3
- package/dist/components/d-user/DUserList.js +4 -4
- package/dist/components/d-user/DUserMenu.js +7 -6
- package/dist/components/d-user/index.d.ts +1 -0
- package/dist/components/d-user/index.js +11 -9
- package/dist/components/dialog/Dialog.d.ts +2 -1
- package/dist/components/dialog/Dialog.js +67 -59
- package/dist/components/form/EmailInput.js +12 -11
- package/dist/components/form/Input.d.ts +17 -5
- package/dist/components/form/Input.js +420 -137
- package/dist/components/form/Input.selection.hook.d.ts +17 -0
- package/dist/components/form/Input.selection.hook.js +78 -0
- package/dist/components/form/Input.syntax.hook.d.ts +27 -0
- package/dist/components/form/Input.syntax.hook.js +80 -0
- package/dist/components/form/Input.utils.d.ts +11 -0
- package/dist/components/form/Input.utils.js +33 -0
- package/dist/components/form/InputSuggestion.d.ts +14 -6
- package/dist/components/form/InputSuggestion.js +126 -72
- package/dist/components/form/InputSyntax.d.ts +19 -0
- package/dist/components/form/InputSyntax.js +52 -0
- package/dist/components/form/PasswordInput.js +11 -10
- package/dist/components/form/TextInput.js +11 -10
- package/dist/components/form/index.js +26 -27
- package/dist/components/form/inputSyntaxMapping.d.ts +3 -0
- package/dist/components/form/inputSyntaxMapping.js +42 -0
- package/dist/components/menu/Menu.d.ts +7 -3
- package/dist/components/menu/Menu.js +22 -22
- package/dist/components/tooltip/Tooltip.js +33 -33
- package/dist/index.js +200 -189
- package/package.json +16 -16
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { jsxs as r, jsx as e, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import g from "react";
|
|
3
|
+
import { Flex as o } from "../flex/Flex.js";
|
|
4
|
+
import { useService as a, useStore as d } from "../../utils/contextStore.js";
|
|
5
|
+
import "merge-props";
|
|
6
|
+
import { DNamespaceRoleReactiveService as x } from "./DNamespaceRole.service.js";
|
|
7
|
+
import { Text as n } from "../text/Text.js";
|
|
8
|
+
import { Button as u } from "../button/Button.js";
|
|
9
|
+
import { IconFolders as G, IconUsers as H, IconSettings as J } from "@tabler/icons-react";
|
|
10
|
+
import { DNamespaceRolePermissions as K } from "./DNamespaceRolePermissions.js";
|
|
11
|
+
import { DNamespaceMemberReactiveService as b } from "../d-member/DNamespaceMember.service.js";
|
|
12
|
+
import "../../_virtual/compiler-runtime.js";
|
|
13
|
+
import { Card as f } from "../card/Card.js";
|
|
14
|
+
import { DUserReactiveService as v } from "../d-user/DUser.service.js";
|
|
15
|
+
import '../../assets/components/dialog/Dialog.style.css';import '../../assets/components/form/Input.style.css';import '../../assets/components/menu/Menu.style.css';/* empty css */
|
|
16
|
+
import "@radix-ui/react-dropdown-menu";
|
|
17
|
+
import { Avatar as S } from "../avatar/Avatar.js";
|
|
18
|
+
import { Badge as m } from "../badge/Badge.js";
|
|
19
|
+
import p from "../card/CardSection.js";
|
|
20
|
+
import "@radix-ui/react-checkbox";
|
|
21
|
+
/* empty css */
|
|
22
|
+
import "../form/EmailInput.js";
|
|
23
|
+
import "../form/Input.js";
|
|
24
|
+
import "../form/InputSuggestion.js";
|
|
25
|
+
import "../form/NumberInput.js";
|
|
26
|
+
import "../form/PasswordInput.js";
|
|
27
|
+
import "@radix-ui/react-one-time-password-field";
|
|
28
|
+
import "@radix-ui/react-radio-group";
|
|
29
|
+
import "../form/SwitchInput.js";
|
|
30
|
+
import "../form/TextInput.js";
|
|
31
|
+
import { Spacing as z } from "../spacing/Spacing.js";
|
|
32
|
+
import { Tooltip as R, TooltipTrigger as A, TooltipPortal as j, TooltipContent as C, TooltipArrow as D } from "../tooltip/Tooltip.js";
|
|
33
|
+
import "@radix-ui/react-dialog";
|
|
34
|
+
/* empty css */
|
|
35
|
+
import { DNamespaceProjectReactiveService as w } from "../d-project/DNamespaceProject.service.js";
|
|
36
|
+
const De = (I) => {
|
|
37
|
+
const {
|
|
38
|
+
roleId: h,
|
|
39
|
+
onSetting: M = () => {
|
|
40
|
+
},
|
|
41
|
+
onMembersViewMore: P = () => {
|
|
42
|
+
},
|
|
43
|
+
onProjectsViewMore: N = () => {
|
|
44
|
+
}
|
|
45
|
+
} = I, T = a(x), k = d(x), B = a(w), V = d(w), F = a(b), U = d(b), W = a(v), E = d(v), i = g.useMemo(() => T.getById(h), [k, h]), s = g.useMemo(() => B.values({
|
|
46
|
+
namespaceId: i?.namespace?.id
|
|
47
|
+
}).filter((t) => i?.assignedProjects?.nodes?.map((l) => l?.id).includes(t.id)), [V, i]), c = g.useMemo(() => F.values({
|
|
48
|
+
namespaceId: i?.namespace?.id
|
|
49
|
+
}).filter((t) => t.roles?.nodes?.map((l) => l?.id).includes(i?.id)), [U, E, h]), q = i?.userAbilities?.deleteNamespaceRole || i?.userAbilities?.updateNamespaceRole || i?.userAbilities?.assignRoleAbilities || i?.userAbilities?.assignRoleProjects;
|
|
50
|
+
return /* @__PURE__ */ r(o, { align: "center", style: {
|
|
51
|
+
gap: "1.3rem"
|
|
52
|
+
}, justify: "space-between", children: [
|
|
53
|
+
/* @__PURE__ */ r(o, { align: "center", style: {
|
|
54
|
+
gap: "1.3rem"
|
|
55
|
+
}, children: [
|
|
56
|
+
/* @__PURE__ */ e(n, { size: "lg", hierarchy: "primary", display: "block", children: i?.name }),
|
|
57
|
+
/* @__PURE__ */ e(K, { abilities: i?.abilities })
|
|
58
|
+
] }),
|
|
59
|
+
/* @__PURE__ */ r(o, { align: "center", style: {
|
|
60
|
+
gap: "1.3rem"
|
|
61
|
+
}, children: [
|
|
62
|
+
/* @__PURE__ */ r(o, { style: {
|
|
63
|
+
flexDirection: "column",
|
|
64
|
+
gap: "0.35rem"
|
|
65
|
+
}, children: [
|
|
66
|
+
/* @__PURE__ */ e(n, { size: "xs", hierarchy: "tertiary", children: "Usage" }),
|
|
67
|
+
/* @__PURE__ */ r(o, { align: "center", style: {
|
|
68
|
+
gap: "0.35rem"
|
|
69
|
+
}, children: [
|
|
70
|
+
/* @__PURE__ */ r(R, { children: [
|
|
71
|
+
/* @__PURE__ */ e(A, { asChild: !0, children: /* @__PURE__ */ r(m, { border: !0, style: {
|
|
72
|
+
verticalAlign: "middle"
|
|
73
|
+
}, children: [
|
|
74
|
+
/* @__PURE__ */ e(G, { size: 16 }),
|
|
75
|
+
/* @__PURE__ */ e(n, { hierarchy: "tertiary", size: "xs", children: s.length })
|
|
76
|
+
] }) }),
|
|
77
|
+
/* @__PURE__ */ e(j, { children: /* @__PURE__ */ r(C, { side: "bottom", maw: "200px", children: [
|
|
78
|
+
/* @__PURE__ */ e(n, { children: "Assigned projects" }),
|
|
79
|
+
/* @__PURE__ */ e(D, {}),
|
|
80
|
+
s.length > 0 ? /* @__PURE__ */ r(y, { children: [
|
|
81
|
+
/* @__PURE__ */ e(z, { spacing: "xxs" }),
|
|
82
|
+
/* @__PURE__ */ r(f, { paddingSize: "xs", mb: -0.35, mx: -0.7, style: {
|
|
83
|
+
borderWidth: "2px"
|
|
84
|
+
}, children: [
|
|
85
|
+
s.slice(0, 1).map((t) => /* @__PURE__ */ e(p, { border: !0, children: /* @__PURE__ */ r(o, { align: "center", style: {
|
|
86
|
+
gap: "0.7rem"
|
|
87
|
+
}, children: [
|
|
88
|
+
/* @__PURE__ */ e(S, { bg: "transparent", identifier: t?.name ?? "" }),
|
|
89
|
+
/* @__PURE__ */ r(o, { style: {
|
|
90
|
+
flexDirection: "column",
|
|
91
|
+
gap: "0.35rem"
|
|
92
|
+
}, children: [
|
|
93
|
+
/* @__PURE__ */ e(n, { size: "xs", hierarchy: "secondary", children: t?.name }),
|
|
94
|
+
/* @__PURE__ */ e(n, { size: "xs", hierarchy: "tertiary", children: t?.description })
|
|
95
|
+
] })
|
|
96
|
+
] }) }, t.id)),
|
|
97
|
+
i && s.slice(1, s.length).length > 0 ? /* @__PURE__ */ e(p, { border: !0, display: "flex", p: 0.35, justify: "center", hover: !0, children: /* @__PURE__ */ r(u, { paddingSize: "xxs", variant: "none", onClick: () => N(i), children: [
|
|
98
|
+
/* @__PURE__ */ e(n, { size: "xs", children: "View more" }),
|
|
99
|
+
/* @__PURE__ */ e(m, { border: !0, children: s.slice(1, s.length).length })
|
|
100
|
+
] }) }) : null
|
|
101
|
+
] })
|
|
102
|
+
] }) : null
|
|
103
|
+
] }) })
|
|
104
|
+
] }),
|
|
105
|
+
/* @__PURE__ */ r(R, { children: [
|
|
106
|
+
/* @__PURE__ */ e(A, { asChild: !0, children: /* @__PURE__ */ r(m, { border: !0, style: {
|
|
107
|
+
verticalAlign: "middle"
|
|
108
|
+
}, children: [
|
|
109
|
+
/* @__PURE__ */ e(H, { size: 16 }),
|
|
110
|
+
/* @__PURE__ */ e(n, { hierarchy: "tertiary", size: "xs", children: c.length })
|
|
111
|
+
] }) }),
|
|
112
|
+
/* @__PURE__ */ e(j, { children: /* @__PURE__ */ r(C, { side: "bottom", maw: "200px", children: [
|
|
113
|
+
/* @__PURE__ */ e(n, { children: "Assigned members" }),
|
|
114
|
+
/* @__PURE__ */ e(D, {}),
|
|
115
|
+
c.length > 0 ? /* @__PURE__ */ r(y, { children: [
|
|
116
|
+
/* @__PURE__ */ e(z, { spacing: "xxs" }),
|
|
117
|
+
/* @__PURE__ */ r(f, { paddingSize: "xs", mb: -0.35, mx: -0.7, style: {
|
|
118
|
+
borderWidth: "2px"
|
|
119
|
+
}, children: [
|
|
120
|
+
c.slice(0, 1).map((t) => {
|
|
121
|
+
const l = W.getById(t.user?.id);
|
|
122
|
+
return /* @__PURE__ */ e(p, { border: !0, children: /* @__PURE__ */ r(o, { align: "center", style: {
|
|
123
|
+
gap: "0.7rem"
|
|
124
|
+
}, children: [
|
|
125
|
+
/* @__PURE__ */ e(S, { bg: "transparent", identifier: l?.username ?? "" }),
|
|
126
|
+
/* @__PURE__ */ r(o, { style: {
|
|
127
|
+
flexDirection: "column",
|
|
128
|
+
gap: "0.35rem"
|
|
129
|
+
}, children: [
|
|
130
|
+
/* @__PURE__ */ r(n, { size: "xs", hierarchy: "secondary", children: [
|
|
131
|
+
"@",
|
|
132
|
+
l?.username
|
|
133
|
+
] }),
|
|
134
|
+
/* @__PURE__ */ e(n, { size: "xs", hierarchy: "tertiary", children: l?.email })
|
|
135
|
+
] })
|
|
136
|
+
] }) }, t.id);
|
|
137
|
+
}),
|
|
138
|
+
i && c.slice(1, c.length).length > 0 ? /* @__PURE__ */ e(p, { border: !0, display: "flex", p: 0.35, justify: "center", hover: !0, children: /* @__PURE__ */ r(u, { paddingSize: "xxs", variant: "none", onClick: () => P(i), children: [
|
|
139
|
+
/* @__PURE__ */ e(n, { size: "xs", children: "View more" }),
|
|
140
|
+
/* @__PURE__ */ e(m, { border: !0, children: c.length - 1 })
|
|
141
|
+
] }) }) : null
|
|
142
|
+
] })
|
|
143
|
+
] }) : null
|
|
144
|
+
] }) })
|
|
145
|
+
] })
|
|
146
|
+
] })
|
|
147
|
+
] }),
|
|
148
|
+
q && /* @__PURE__ */ e(u, { color: "secondary", onClick: (t) => {
|
|
149
|
+
t.stopPropagation(), M(i);
|
|
150
|
+
}, children: /* @__PURE__ */ e(J, { size: 16 }) })
|
|
151
|
+
] })
|
|
152
|
+
] });
|
|
153
|
+
};
|
|
154
|
+
export {
|
|
155
|
+
De as DNamespaceRoleContent
|
|
156
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Namespace } from '@code0-tech/sagittarius-graphql-types';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { Card } from '../card/Card';
|
|
4
|
+
import { DNamespaceRoleView } from './DNamespaceRole.view';
|
|
5
|
+
export interface DNamespaceRoleListProps extends Omit<Card, "children" | "onSelect"> {
|
|
6
|
+
namespaceId: Namespace["id"];
|
|
7
|
+
filter?: (role: DNamespaceRoleView, index: number) => boolean;
|
|
8
|
+
onSetting?: (role: DNamespaceRoleView) => void;
|
|
9
|
+
onMembersViewMore?: (role: DNamespaceRoleView) => void;
|
|
10
|
+
onProjectsViewMore?: (role: DNamespaceRoleView) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const DNamespaceRoleList: React.FC<DNamespaceRoleListProps>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { DNamespaceRoleContent as f } from "./DNamespaceRoleContent.js";
|
|
3
|
+
import u from "react";
|
|
4
|
+
import { Card as S } from "../card/Card.js";
|
|
5
|
+
import { useService as v, useStore as R } from "../../utils/contextStore.js";
|
|
6
|
+
import "merge-props";
|
|
7
|
+
import { DNamespaceRoleReactiveService as t } from "./DNamespaceRole.service.js";
|
|
8
|
+
import M from "../card/CardSection.js";
|
|
9
|
+
const I = (i) => {
|
|
10
|
+
const {
|
|
11
|
+
namespaceId: o,
|
|
12
|
+
filter: m = () => !0,
|
|
13
|
+
onSetting: s,
|
|
14
|
+
onProjectsViewMore: c,
|
|
15
|
+
onMembersViewMore: n,
|
|
16
|
+
...a
|
|
17
|
+
} = i, p = v(t), d = R(t), l = u.useMemo(() => p.values({
|
|
18
|
+
namespaceId: o
|
|
19
|
+
}), [d, o]);
|
|
20
|
+
return /* @__PURE__ */ r(S, { ...a, children: l.filter(m).map((e) => e.id && /* @__PURE__ */ r(M, { border: !0, children: /* @__PURE__ */ r(f, { onSetting: s, onProjectsViewMore: c, onMembersViewMore: n, roleId: e?.id }) }, e.id)) });
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
I as DNamespaceRoleList
|
|
24
|
+
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { jsxs as s, jsx as n, Fragment as c } from "react/jsx-runtime";
|
|
2
|
+
import a from "react";
|
|
3
|
+
import { Flex as m } from "../flex/Flex.js";
|
|
4
|
+
import { Text as l } from "../text/Text.js";
|
|
5
|
+
import { Badge as A } from "../badge/Badge.js";
|
|
6
|
+
import { IconCheck as T } from "@tabler/icons-react";
|
|
7
|
+
import { Tooltip as _, TooltipTrigger as u, TooltipPortal as h, TooltipContent as C, TooltipArrow as R } from "../tooltip/Tooltip.js";
|
|
8
|
+
const f = {
|
|
9
|
+
ASSIGN_MEMBER_ROLES: "members",
|
|
10
|
+
INVITE_MEMBER: "members",
|
|
11
|
+
DELETE_MEMBER: "members",
|
|
12
|
+
CREATE_NAMESPACE_PROJECT: "projects",
|
|
13
|
+
UPDATE_NAMESPACE_PROJECT: "projects",
|
|
14
|
+
DELETE_NAMESPACE_PROJECT: "projects",
|
|
15
|
+
ASSIGN_ROLE_PROJECTS: "projects",
|
|
16
|
+
READ_NAMESPACE_PROJECT: "projects",
|
|
17
|
+
CREATE_NAMESPACE_ROLE: "roles",
|
|
18
|
+
UPDATE_NAMESPACE_ROLE: "roles",
|
|
19
|
+
ASSIGN_ROLE_ABILITIES: "roles",
|
|
20
|
+
CREATE_RUNTIME: "runtimes",
|
|
21
|
+
UPDATE_RUNTIME: "runtimes",
|
|
22
|
+
DELETE_RUNTIME: "runtimes",
|
|
23
|
+
ROTATE_RUNTIME_TOKEN: "runtimes",
|
|
24
|
+
ASSIGN_PROJECT_RUNTIMES: "runtimes",
|
|
25
|
+
CREATE_FLOW: "flows",
|
|
26
|
+
UPDATE_FLOW: "flows",
|
|
27
|
+
DELETE_FLOW: "flows",
|
|
28
|
+
CREATE_NAMESPACE_LICENSE: "license",
|
|
29
|
+
READ_NAMESPACE_LICENSE: "license",
|
|
30
|
+
DELETE_NAMESPACE_LICENSE: "license",
|
|
31
|
+
UPDATE_ORGANIZATION: "organization",
|
|
32
|
+
DELETE_ORGANIZATION: "organization",
|
|
33
|
+
NAMESPACE_ADMINISTRATOR: "admin"
|
|
34
|
+
}, p = {
|
|
35
|
+
members: "members",
|
|
36
|
+
projects: "projects",
|
|
37
|
+
roles: "roles",
|
|
38
|
+
runtimes: "runtimes",
|
|
39
|
+
flows: "flows",
|
|
40
|
+
license: "licenses",
|
|
41
|
+
organization: "the organization",
|
|
42
|
+
admin: "everything"
|
|
43
|
+
};
|
|
44
|
+
function d(e) {
|
|
45
|
+
return e.startsWith("CREATE_") ? "create" : e.startsWith("UPDATE_") ? "update" : e.startsWith("DELETE_") ? "delete" : e.startsWith("ASSIGN_") ? "assign" : e.startsWith("READ_") ? "read" : "manage";
|
|
46
|
+
}
|
|
47
|
+
function N(e) {
|
|
48
|
+
const r = Array.from(new Set(e));
|
|
49
|
+
return r.length === 1 ? r[0] : "manage";
|
|
50
|
+
}
|
|
51
|
+
function S(e) {
|
|
52
|
+
if (!e || e.length === 0) return [];
|
|
53
|
+
const r = /* @__PURE__ */ new Map();
|
|
54
|
+
for (const i of e) {
|
|
55
|
+
const o = f[i];
|
|
56
|
+
if (!o) continue;
|
|
57
|
+
const t = r.get(o) ?? [];
|
|
58
|
+
t.push(i), r.set(o, t);
|
|
59
|
+
}
|
|
60
|
+
return Array.from(r.entries()).map(([i, o]) => {
|
|
61
|
+
const t = o.map(d), E = N(t);
|
|
62
|
+
return {
|
|
63
|
+
category: i,
|
|
64
|
+
label: p[i],
|
|
65
|
+
abilities: o,
|
|
66
|
+
action: E
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function g(e) {
|
|
71
|
+
if (e.length === 0) return "No special permissions.";
|
|
72
|
+
const r = (t) => /* @__PURE__ */ s(c, { children: [
|
|
73
|
+
t.action,
|
|
74
|
+
" ",
|
|
75
|
+
/* @__PURE__ */ s(_, { children: [
|
|
76
|
+
/* @__PURE__ */ n(u, { asChild: !0, children: /* @__PURE__ */ n(A, { color: "info", style: {
|
|
77
|
+
verticalAlign: "middle"
|
|
78
|
+
}, children: /* @__PURE__ */ n(l, { style: {
|
|
79
|
+
color: "inherit"
|
|
80
|
+
}, children: t.label }) }) }),
|
|
81
|
+
/* @__PURE__ */ n(h, { children: /* @__PURE__ */ s(C, { side: "bottom", children: [
|
|
82
|
+
/* @__PURE__ */ n(m, { style: {
|
|
83
|
+
flexDirection: "column",
|
|
84
|
+
gap: "0.25rem"
|
|
85
|
+
}, children: t.abilities.map((E) => /* @__PURE__ */ s(m, { align: "center", style: {
|
|
86
|
+
gap: "0.35rem"
|
|
87
|
+
}, children: [
|
|
88
|
+
/* @__PURE__ */ n(T, { size: 16 }),
|
|
89
|
+
/* @__PURE__ */ n(l, { size: "xs", children: E })
|
|
90
|
+
] }, E)) }),
|
|
91
|
+
/* @__PURE__ */ n(R, {})
|
|
92
|
+
] }) })
|
|
93
|
+
] })
|
|
94
|
+
] });
|
|
95
|
+
if (e.length === 1) {
|
|
96
|
+
const t = e[0];
|
|
97
|
+
return /* @__PURE__ */ s(c, { children: [
|
|
98
|
+
"Can ",
|
|
99
|
+
r(t)
|
|
100
|
+
] });
|
|
101
|
+
}
|
|
102
|
+
const i = e.slice(0, -1), o = e[e.length - 1];
|
|
103
|
+
return /* @__PURE__ */ s(c, { children: [
|
|
104
|
+
"Can",
|
|
105
|
+
" ",
|
|
106
|
+
i.map((t, E) => /* @__PURE__ */ s(a.Fragment, { children: [
|
|
107
|
+
E > 0 && ", ",
|
|
108
|
+
r(t)
|
|
109
|
+
] }, t.category)),
|
|
110
|
+
" ",
|
|
111
|
+
"and ",
|
|
112
|
+
r(o)
|
|
113
|
+
] });
|
|
114
|
+
}
|
|
115
|
+
const b = (e) => {
|
|
116
|
+
const {
|
|
117
|
+
abilities: r
|
|
118
|
+
} = e, i = a.useMemo(() => S(r), [r]);
|
|
119
|
+
return /* @__PURE__ */ s(m, { style: {
|
|
120
|
+
flexDirection: "column",
|
|
121
|
+
gap: "0.35rem"
|
|
122
|
+
}, children: [
|
|
123
|
+
/* @__PURE__ */ n(l, { size: "xs", hierarchy: "tertiary", children: "Permissions" }),
|
|
124
|
+
/* @__PURE__ */ n(l, { size: "sm", hierarchy: "secondary", children: g(i) })
|
|
125
|
+
] });
|
|
126
|
+
};
|
|
127
|
+
export {
|
|
128
|
+
b as DNamespaceRolePermissions
|
|
129
|
+
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { DNamespaceRoleReactiveService as a } from "./DNamespaceRole.service.js";
|
|
2
|
-
import { DNamespaceRoleView as
|
|
2
|
+
import { DNamespaceRoleView as m } from "./DNamespaceRole.view.js";
|
|
3
|
+
import { DNamespaceRoleList as c } from "./DNamespaceRoleList.js";
|
|
4
|
+
import { DNamespaceRoleCard as s } from "./DNamespaceRoleCard.js";
|
|
3
5
|
export {
|
|
6
|
+
s as DNamespaceRoleCard,
|
|
7
|
+
c as DNamespaceRoleList,
|
|
4
8
|
a as DNamespaceRoleReactiveService,
|
|
5
|
-
|
|
9
|
+
m as DNamespaceRoleView
|
|
6
10
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Runtime } from '@code0-tech/sagittarius-graphql-types';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
|
+
import { DRuntimeView } from './DRuntime.view';
|
|
3
4
|
export interface DRuntimeCardProps {
|
|
4
5
|
runtimeId: Runtime['id'];
|
|
5
|
-
onSetting?: (
|
|
6
|
+
onSetting?: (runtime: DRuntimeView) => void;
|
|
7
|
+
minimized?: boolean;
|
|
6
8
|
}
|
|
7
9
|
export declare const DRuntimeCard: React.FC<DRuntimeCardProps>;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c } from "../../_virtual/compiler-runtime.js";
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { c as d } from "../../_virtual/compiler-runtime.js";
|
|
3
3
|
import { Card as p } from "../card/Card.js";
|
|
4
|
-
import { DRuntimeContent as
|
|
5
|
-
const
|
|
6
|
-
const t =
|
|
7
|
-
runtimeId:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
import { DRuntimeContent as f } from "./DRuntimeContent.js";
|
|
5
|
+
const R = (s) => {
|
|
6
|
+
const t = d.c(4), {
|
|
7
|
+
runtimeId: o,
|
|
8
|
+
minimized: m,
|
|
9
|
+
onSetting: r
|
|
10
|
+
} = s, n = m === void 0 ? !1 : m, e = r === void 0 ? u : r;
|
|
11
|
+
let i;
|
|
12
|
+
return t[0] !== n || t[1] !== e || t[2] !== o ? (i = /* @__PURE__ */ c(p, { children: /* @__PURE__ */ c(f, { minimized: n, runtimeId: o, onSetting: e }) }), t[0] = n, t[1] = e, t[2] = o, t[3] = i) : i = t[3], i;
|
|
12
13
|
};
|
|
13
|
-
function
|
|
14
|
+
function u() {
|
|
14
15
|
}
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
+
R as DRuntimeCard
|
|
17
18
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Runtime } from '@code0-tech/sagittarius-graphql-types';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
|
+
import { DRuntimeView } from './DRuntime.view';
|
|
3
4
|
export interface DRuntimeContentProps {
|
|
4
5
|
runtimeId: Runtime['id'];
|
|
5
|
-
onSetting?: (
|
|
6
|
+
onSetting?: (runtime: DRuntimeView) => void;
|
|
7
|
+
minimized?: boolean;
|
|
6
8
|
}
|
|
7
9
|
export declare const DRuntimeContent: React.FC<DRuntimeContentProps>;
|
|
@@ -1,37 +1,42 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import h from "react";
|
|
3
3
|
import { Text as n } from "../text/Text.js";
|
|
4
|
-
import { Flex as
|
|
5
|
-
import { IconSettings as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { useService as
|
|
4
|
+
import { Flex as i } from "../flex/Flex.js";
|
|
5
|
+
import { IconSettings as y } from "@tabler/icons-react";
|
|
6
|
+
import { Button as g } from "../button/Button.js";
|
|
7
|
+
import { useService as f, useStore as C } from "../../utils/contextStore.js";
|
|
8
8
|
import "merge-props";
|
|
9
|
-
import { DRuntimeReactiveService as
|
|
10
|
-
import { Badge as
|
|
9
|
+
import { DRuntimeReactiveService as s } from "./DRuntime.service.js";
|
|
10
|
+
import { Badge as l } from "../badge/Badge.js";
|
|
11
11
|
const v = (m) => {
|
|
12
12
|
const {
|
|
13
|
-
runtimeId:
|
|
14
|
-
|
|
13
|
+
runtimeId: o,
|
|
14
|
+
minimized: c = !1,
|
|
15
|
+
onSetting: a = () => {
|
|
15
16
|
}
|
|
16
|
-
} = m,
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
|
|
17
|
+
} = m, p = f(s), d = C(s), r = h.useMemo(() => p.getById(o), [d, o]);
|
|
18
|
+
return /* @__PURE__ */ t(i, { justify: "space-between", align: "center", style: {
|
|
19
|
+
gap: "1.3rem"
|
|
20
|
+
}, children: [
|
|
21
|
+
c ? /* @__PURE__ */ e(i, { align: "center", style: {
|
|
22
|
+
gap: "0.7rem"
|
|
23
|
+
}, children: /* @__PURE__ */ e(n, { size: "md", hierarchy: "secondary", display: "block", children: r?.name }) }) : /* @__PURE__ */ t(i, { style: {
|
|
19
24
|
flexDirection: "column",
|
|
20
25
|
gap: "0.35rem"
|
|
21
26
|
}, children: [
|
|
22
|
-
/* @__PURE__ */ e(n, { size: "lg", hierarchy: "
|
|
27
|
+
/* @__PURE__ */ e(n, { size: "lg", hierarchy: "secondary", display: "block", children: r?.name }),
|
|
23
28
|
/* @__PURE__ */ e(n, { size: "sm", hierarchy: "tertiary", display: "block", children: r?.description })
|
|
24
29
|
] }),
|
|
25
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ t(i, { align: "center", style: {
|
|
26
31
|
gap: "1.3rem"
|
|
27
32
|
}, children: [
|
|
28
|
-
/* @__PURE__ */ e(
|
|
33
|
+
/* @__PURE__ */ e(i, { align: "center", style: {
|
|
29
34
|
gap: "0.35rem",
|
|
30
35
|
flexWrap: "wrap"
|
|
31
|
-
}, children: r?.status === "CONNECTED" ? /* @__PURE__ */ e(
|
|
32
|
-
r?.userAbilities?.deleteRuntime || r?.userAbilities?.updateRuntime || r?.userAbilities?.rotateRuntimeToken ? /* @__PURE__ */ e(
|
|
33
|
-
u.stopPropagation(),
|
|
34
|
-
}, children: /* @__PURE__ */ e(
|
|
36
|
+
}, children: r?.status === "CONNECTED" ? /* @__PURE__ */ e(l, { color: "success", children: "CONNECTED" }) : /* @__PURE__ */ e(l, { color: "error", children: "DISCONNECTED" }) }),
|
|
37
|
+
!c && (r?.userAbilities?.deleteRuntime || r?.userAbilities?.updateRuntime || r?.userAbilities?.rotateRuntimeToken) ? /* @__PURE__ */ e(g, { color: "secondary", onClick: (u) => {
|
|
38
|
+
u.stopPropagation(), a(r);
|
|
39
|
+
}, children: /* @__PURE__ */ e(y, { size: 16 }) }) : null
|
|
35
40
|
] })
|
|
36
41
|
] });
|
|
37
42
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Namespace } from '@code0-tech/sagittarius-graphql-types';
|
|
2
2
|
import { DRuntimeView } from './DRuntime.view';
|
|
3
3
|
import { Card } from '../card/Card';
|
|
4
4
|
import { default as React } from 'react';
|
|
5
5
|
export interface DRuntimeListProps extends Omit<Card, "children" | "onSelect"> {
|
|
6
|
+
namespaceId?: Namespace["id"];
|
|
6
7
|
filter?: (runtime: DRuntimeView, index: number) => boolean;
|
|
7
|
-
onSelect?: (
|
|
8
|
-
onSetting?: (
|
|
8
|
+
onSelect?: (runtime: DRuntimeView) => void;
|
|
9
|
+
onSetting?: (runtime: DRuntimeView) => void;
|
|
10
|
+
minimized?: boolean;
|
|
9
11
|
}
|
|
10
12
|
export declare const DRuntimeList: React.FC<DRuntimeListProps>;
|
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { Card as
|
|
3
|
-
import
|
|
4
|
-
import { useService as
|
|
2
|
+
import { Card as a } from "../card/Card.js";
|
|
3
|
+
import S from "react";
|
|
4
|
+
import { useService as l, useStore as v } from "../../utils/contextStore.js";
|
|
5
5
|
import "merge-props";
|
|
6
|
-
import { DRuntimeReactiveService as
|
|
7
|
-
import
|
|
8
|
-
import { DRuntimeContent as
|
|
9
|
-
const k = (
|
|
6
|
+
import { DRuntimeReactiveService as m } from "./DRuntime.service.js";
|
|
7
|
+
import R from "../card/CardSection.js";
|
|
8
|
+
import { DRuntimeContent as C } from "./DRuntimeContent.js";
|
|
9
|
+
const k = (n) => {
|
|
10
10
|
const {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
namespaceId: t,
|
|
12
|
+
minimized: i = !1,
|
|
13
|
+
filter: c = () => !0,
|
|
14
|
+
onSetting: s,
|
|
15
|
+
onSelect: o,
|
|
16
|
+
...d
|
|
17
|
+
} = n, p = l(m), u = v(m), f = S.useMemo(() => p.values({
|
|
18
|
+
namespaceId: t
|
|
19
|
+
}), [u, t]);
|
|
20
|
+
return /* @__PURE__ */ r(a, { ...d, ...i ? {
|
|
21
|
+
paddingSize: "sm"
|
|
22
|
+
} : {}, children: f.filter(c).map((e) => e.id && /* @__PURE__ */ r(R, { border: !0, hover: !0, onClick: () => {
|
|
23
|
+
o && o(e);
|
|
24
|
+
}, children: /* @__PURE__ */ r(C, { minimized: i, onSetting: s, runtimeId: e?.id }) }, e.id)) });
|
|
19
25
|
};
|
|
20
26
|
export {
|
|
21
27
|
k as DRuntimeList
|
|
@@ -3,6 +3,7 @@ import { User, UsersEmailVerificationInput, UsersEmailVerificationPayload, Users
|
|
|
3
3
|
import { DUserView } from './DUser.view';
|
|
4
4
|
export declare abstract class DUserReactiveService extends ReactiveArrayService<DUserView> {
|
|
5
5
|
getById(id: User['id']): DUserView | undefined;
|
|
6
|
+
getByUsername(username: User['username']): DUserView | undefined;
|
|
6
7
|
abstract usersEmailVerification(payload: UsersEmailVerificationInput): Promise<UsersEmailVerificationPayload | undefined>;
|
|
7
8
|
abstract usersIdentityLink(payload: UsersIdentityLinkInput): Promise<UsersIdentityLinkPayload | undefined>;
|
|
8
9
|
abstract usersIdentityLogin(payload: UsersIdentityLoginInput): Promise<UsersIdentityLoginPayload | undefined>;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { ReactiveArrayService as
|
|
2
|
-
class a extends
|
|
1
|
+
import { ReactiveArrayService as t } from "../../utils/reactiveArrayService.js";
|
|
2
|
+
class a extends t {
|
|
3
3
|
//TODO: inject UI error handler for toasts
|
|
4
4
|
//no id's need to be injected here because the root query has a users field
|
|
5
5
|
getById(e) {
|
|
6
6
|
return this.values().find((r) => r.id === e);
|
|
7
7
|
}
|
|
8
|
+
getByUsername(e) {
|
|
9
|
+
return this.values().find((r) => r.username === e);
|
|
10
|
+
}
|
|
8
11
|
}
|
|
9
12
|
export {
|
|
10
13
|
a as DUserReactiveService
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { User } from '@code0-tech/sagittarius-graphql-types';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
|
+
import { DUserView } from './DUser.view';
|
|
3
4
|
export interface DUserCardProps {
|
|
4
5
|
userId: User['id'];
|
|
5
|
-
onRemove?: (
|
|
6
|
+
onRemove?: (user: DUserView) => void;
|
|
6
7
|
}
|
|
7
8
|
export declare const DUserCard: React.FC<DUserCardProps>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { User } from '@code0-tech/sagittarius-graphql-types';
|
|
3
|
+
import { DUserView } from './DUser.view';
|
|
3
4
|
export interface DUserContentProps {
|
|
4
5
|
userId: User['id'];
|
|
5
|
-
onRemove?: (
|
|
6
|
+
onRemove?: (user: DUserView) => void;
|
|
6
7
|
}
|
|
7
8
|
export declare const DUserContent: React.FC<DUserContentProps>;
|