@protobase/ui 0.44.4 → 0.44.5
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/organizations/messages.js +4 -2
- package/dist/organizations/organizations-page.js +33 -18
- package/dist/package.js +1 -1
- package/dist/shell/assets/{app-By06l4Sd.js → app-ymsJ5ibs.js} +6 -6
- package/dist/shell/assets/{index-7kqOfiyQ.js → index-CwSG7SDY.js} +2 -2
- package/dist/shell/assets/{records-map-CPjNQELa.js → records-map-l7fuf560.js} +2 -2
- package/dist/shell/assets/{shared-protobase-ui-iAXtn7yM.js → shared-protobase-ui-D2EOXEVm.js} +2 -2
- package/dist/shell/index.html +3 -3
- package/dist/shell/protobase.shell.json +1 -1
- package/dist/shell/protobase.sw.js +2 -2
- package/dist/shell-source-maps/assets/app-ymsJ5ibs.js.map +1 -0
- package/dist/shell-source-maps/assets/{index-7kqOfiyQ.js.map → index-CwSG7SDY.js.map} +1 -1
- package/dist/shell-source-maps/assets/{records-map-CPjNQELa.js.map → records-map-l7fuf560.js.map} +1 -1
- package/dist/shell-source-maps/assets/{shared-protobase-ui-iAXtn7yM.js.map → shared-protobase-ui-D2EOXEVm.js.map} +1 -1
- package/package.json +4 -4
- package/dist/shell-source-maps/assets/app-By06l4Sd.js.map +0 -1
|
@@ -78,7 +78,8 @@ const text = defineMessages({
|
|
|
78
78
|
newOrganization: "New organization",
|
|
79
79
|
newOrganizationDescription: "You become its owner, with every role, and work in it once it is made.",
|
|
80
80
|
invitationsForYou: "Invitations for you",
|
|
81
|
-
invitationsForYouDescription: "
|
|
81
|
+
invitationsForYouDescription: "Accept one to become a member and work there.",
|
|
82
|
+
accept: "Accept",
|
|
82
83
|
anOrganization: "An organization",
|
|
83
84
|
noAppRoles: "no app roles",
|
|
84
85
|
until: (date) => `Until ${date}`,
|
|
@@ -165,7 +166,8 @@ const text = defineMessages({
|
|
|
165
166
|
newOrganization: "Nieuwe organisatie",
|
|
166
167
|
newOrganizationDescription: "Je wordt de eigenaar, met elke rol, en werkt erin zodra die is gemaakt.",
|
|
167
168
|
invitationsForYou: "Uitnodigingen voor jou",
|
|
168
|
-
invitationsForYouDescription: "
|
|
169
|
+
invitationsForYouDescription: "Accepteer er een om lid te worden en daar te werken.",
|
|
170
|
+
accept: "Accepteren",
|
|
169
171
|
anOrganization: "Een organisatie",
|
|
170
172
|
noAppRoles: "geen app-rollen",
|
|
171
173
|
until: (date) => `Tot ${date}`,
|
|
@@ -63,35 +63,50 @@ const NewOrganization = ({ basePath }) => {
|
|
|
63
63
|
})]
|
|
64
64
|
});
|
|
65
65
|
};
|
|
66
|
-
|
|
66
|
+
/** The invitations for the person's own address, each to accept, which opens the app in its organization. */
|
|
67
|
+
const YourInvitations = ({ basePath }) => {
|
|
67
68
|
const { session, organizations } = useAuth();
|
|
68
69
|
const [invitations, setInvitations] = useState([]);
|
|
70
|
+
const { busy, error, run } = useAction();
|
|
69
71
|
useEffect(() => {
|
|
70
72
|
session.organizations.myInvitations().then(setInvitations, () => setInvitations([]));
|
|
71
73
|
}, [session]);
|
|
72
74
|
if (invitations.length === 0) return null;
|
|
73
75
|
const roles = organizations?.roles ?? [];
|
|
74
|
-
|
|
76
|
+
const accept = (invitationId) => run(async () => {
|
|
77
|
+
await session.organizations.acceptMine(invitationId);
|
|
78
|
+
reopenIn(basePath);
|
|
79
|
+
});
|
|
80
|
+
return /* @__PURE__ */ jsxs(AccountSection, {
|
|
75
81
|
title: text("invitationsForYou"),
|
|
76
82
|
description: text("invitationsForYouDescription"),
|
|
77
|
-
children: /* @__PURE__ */ jsx("ul", {
|
|
83
|
+
children: [/* @__PURE__ */ jsx(SectionError, { message: error }), /* @__PURE__ */ jsx("ul", {
|
|
78
84
|
className: "divide-y rounded-md border",
|
|
79
85
|
children: invitations.map((invitation) => /* @__PURE__ */ jsxs("li", {
|
|
80
|
-
className: "px-3 py-2.5",
|
|
81
|
-
children: [
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
86
|
+
className: "flex items-center gap-3 px-3 py-2.5",
|
|
87
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
88
|
+
className: "min-w-0 flex-1",
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ jsx("span", {
|
|
91
|
+
className: "font-medium",
|
|
92
|
+
children: invitation.organizationName ?? text("anOrganization")
|
|
93
|
+
}),
|
|
94
|
+
": ",
|
|
95
|
+
invitation.appRoles.map((name) => roleLabel(roles, name)).join(", ") || text("noAppRoles"),
|
|
96
|
+
/* @__PURE__ */ jsx("span", {
|
|
97
|
+
className: "block text-xs text-muted-foreground",
|
|
98
|
+
children: text("until", new Date(invitation.expiresAt).toLocaleDateString(formatTag()))
|
|
99
|
+
})
|
|
100
|
+
]
|
|
101
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
102
|
+
size: "sm",
|
|
103
|
+
variant: "primary",
|
|
104
|
+
loading: busy,
|
|
105
|
+
onClick: () => void accept(invitation.id),
|
|
106
|
+
children: text("accept")
|
|
107
|
+
})]
|
|
93
108
|
}, invitation.id))
|
|
94
|
-
})
|
|
109
|
+
})]
|
|
95
110
|
});
|
|
96
111
|
};
|
|
97
112
|
/**
|
|
@@ -127,7 +142,7 @@ const OrganizationsPage = ({ state, basePath }) => {
|
|
|
127
142
|
}, organization.id))
|
|
128
143
|
})]
|
|
129
144
|
}),
|
|
130
|
-
/* @__PURE__ */ jsx(YourInvitations, {}),
|
|
145
|
+
/* @__PURE__ */ jsx(YourInvitations, { basePath }),
|
|
131
146
|
mayCreate && /* @__PURE__ */ jsx(NewOrganization, { basePath }),
|
|
132
147
|
(state.current?.globalRoles.length ?? 0) > 0 && /* @__PURE__ */ jsx(AllOrganizations, {
|
|
133
148
|
basePath,
|
package/dist/package.js
CHANGED