@abpjs/ui 0.2.0-next.21 → 0.2.0-next.22
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/CHANGELOG.md +8 -0
- package/dist/guard.d.ts +4 -5
- package/dist/guard.js +7 -12
- package/dist/guard.js.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.0-next.22
|
|
4
|
+
|
|
5
|
+
A prerelease under npm's `next` tag.
|
|
6
|
+
|
|
7
|
+
- guard: AbpGuard.HttpApi 0.8.3 is the minimum. An account's actions follow its `can` alone (no `guard.site.admin`
|
|
8
|
+
fallback), sign-up's directories come only from its settings (no `/directories` call), and `isSystemGroup` reads
|
|
9
|
+
`system` alone.
|
|
10
|
+
|
|
3
11
|
## 0.2.0-next.21
|
|
4
12
|
|
|
5
13
|
A prerelease under npm's `next` tag.
|
package/dist/guard.d.ts
CHANGED
|
@@ -1253,11 +1253,11 @@ interface GuardRoutes {
|
|
|
1253
1253
|
/** The area's pages under one base: `{base}/accounts`, `{base}/accounts/{id}`, `{base}/groups/{id}`… */
|
|
1254
1254
|
declare function guardRoutes(base?: string): GuardRoutes;
|
|
1255
1255
|
|
|
1256
|
-
/** What the person looking may do to this account, as AbpGuard.HttpApi answers it with the account
|
|
1256
|
+
/** What the person looking may do to this account, as AbpGuard.HttpApi answers it with the account. */
|
|
1257
1257
|
type AccountAction = keyof AccountCanDto;
|
|
1258
1258
|
/**
|
|
1259
1259
|
* Whether the person looking may do `action` to the account: the account's own `can` flags, the server's answer for this
|
|
1260
|
-
* person and this account
|
|
1260
|
+
* person and this account. While the account loads, nothing.
|
|
1261
1261
|
*/
|
|
1262
1262
|
declare function useAccountCan(detail: AccountDetailDto | undefined): (action: AccountAction) => boolean;
|
|
1263
1263
|
interface AccountScreenProps {
|
|
@@ -1365,7 +1365,7 @@ declare function DuplicatesPanel({ routes }: {
|
|
|
1365
1365
|
routes?: GuardRoutes;
|
|
1366
1366
|
}): react.JSX.Element | null;
|
|
1367
1367
|
|
|
1368
|
-
/** Whether a group is AbpGuard's own
|
|
1368
|
+
/** Whether a group is AbpGuard's own (admins, everyone), whose delete it refuses: the group says so. */
|
|
1369
1369
|
declare function isSystemGroup(group: GroupDto): boolean;
|
|
1370
1370
|
interface GroupScreenProps {
|
|
1371
1371
|
id: string;
|
|
@@ -1548,8 +1548,7 @@ interface SignUpScreenProps {
|
|
|
1548
1548
|
* Sign-up, for site admins: off by default. On, people create their own accounts in the internal directory chosen
|
|
1549
1549
|
* here, optionally only with an email in some domains; an account is active once its email is confirmed. Which places
|
|
1550
1550
|
* they may use is a grant like any other, to that directory's "everyone" group. The directories to choose from come
|
|
1551
|
-
* with the settings
|
|
1552
|
-
* server, from the directories' list.
|
|
1551
|
+
* with the settings, so the page works with the Directories feature off.
|
|
1553
1552
|
*/
|
|
1554
1553
|
declare function SignUpScreen({ directoriesPage }?: SignUpScreenProps): react.JSX.Element;
|
|
1555
1554
|
|
package/dist/guard.js
CHANGED
|
@@ -1062,7 +1062,6 @@ import {
|
|
|
1062
1062
|
useApiAction as useApiAction5,
|
|
1063
1063
|
useApiQuery as useApiQuery2,
|
|
1064
1064
|
useAreaRequest as useAreaRequest5,
|
|
1065
|
-
useCan,
|
|
1066
1065
|
useFormatters as useFormatters4,
|
|
1067
1066
|
useMe,
|
|
1068
1067
|
useNavigate
|
|
@@ -1276,8 +1275,7 @@ function SyncStatus({ d }) {
|
|
|
1276
1275
|
// src/areas/guard/AccountScreen.tsx
|
|
1277
1276
|
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1278
1277
|
function useAccountCan(detail) {
|
|
1279
|
-
|
|
1280
|
-
return (action) => detail?.can?.[action] ?? can("guard.site.admin");
|
|
1278
|
+
return (action) => detail?.can?.[action] ?? false;
|
|
1281
1279
|
}
|
|
1282
1280
|
var NO_ADDRESSES = { directoryEmail: null, directoryMailGoesHere: false, mailTo: null, addresses: [] };
|
|
1283
1281
|
function AccountScreen({ id, routes = guardRoutes() }) {
|
|
@@ -1483,7 +1481,7 @@ import {
|
|
|
1483
1481
|
useApiQuery as useApiQuery4,
|
|
1484
1482
|
useAreaListSource,
|
|
1485
1483
|
useAreaRequest as useAreaRequest6,
|
|
1486
|
-
useCan
|
|
1484
|
+
useCan,
|
|
1487
1485
|
useFormatters as useFormatters5,
|
|
1488
1486
|
useListState
|
|
1489
1487
|
} from "@abpjs/ui";
|
|
@@ -1540,7 +1538,7 @@ function AccountsScreen({ routes = guardRoutes(), source }) {
|
|
|
1540
1538
|
const tc = useGuardNs("common");
|
|
1541
1539
|
const ts = useGuardNs("status.account");
|
|
1542
1540
|
const fmt = useFormatters5();
|
|
1543
|
-
const can =
|
|
1541
|
+
const can = useCan();
|
|
1544
1542
|
const admin = can("guard.site.admin");
|
|
1545
1543
|
const served = useAreaListSource("guard", "/accounts/page", { sortFields: { lastSignIn: "lastLoginAt" } });
|
|
1546
1544
|
const list = useListState(source ?? served, { initial: { sort: { columnId: "username", direction: "asc" } } });
|
|
@@ -2408,9 +2406,8 @@ function GroupTwoFactorPanel({ group, onSaved }) {
|
|
|
2408
2406
|
|
|
2409
2407
|
// src/areas/guard/GroupScreen.tsx
|
|
2410
2408
|
import { Fragment as Fragment7, jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2411
|
-
var SYSTEM_GROUPS = ["00000000-0000-0000-0000-00000000a001", "00000000-0000-0000-0000-00000000a002"];
|
|
2412
2409
|
function isSystemGroup(group) {
|
|
2413
|
-
return group.system ??
|
|
2410
|
+
return group.system ?? false;
|
|
2414
2411
|
}
|
|
2415
2412
|
function GroupScreen({ id, routes = guardRoutes() }) {
|
|
2416
2413
|
const t = useGuardNs("groupDetail");
|
|
@@ -2731,7 +2728,7 @@ import {
|
|
|
2731
2728
|
useApiQuery as useApiQuery9,
|
|
2732
2729
|
useAreaListSource as useAreaListSource2,
|
|
2733
2730
|
useAreaRequest as useAreaRequest13,
|
|
2734
|
-
useCan as
|
|
2731
|
+
useCan as useCan2,
|
|
2735
2732
|
useListState as useListState2
|
|
2736
2733
|
} from "@abpjs/ui";
|
|
2737
2734
|
import { fromNamesValue as fromNamesValue3, splitList as splitList2 } from "@abpjs/ui/rules";
|
|
@@ -2741,7 +2738,7 @@ function GroupsScreen({ routes = guardRoutes(), source }) {
|
|
|
2741
2738
|
const t = useGuardNs("groups");
|
|
2742
2739
|
const tc = useGuardNs("common");
|
|
2743
2740
|
const written = useWrittenName();
|
|
2744
|
-
const can =
|
|
2741
|
+
const can = useCan2();
|
|
2745
2742
|
const admin = can("guard.site.admin");
|
|
2746
2743
|
const dirs = useApiQuery9("guard", "/directories");
|
|
2747
2744
|
const served = useAreaListSource2("guard", "/groups/page");
|
|
@@ -3483,8 +3480,6 @@ function SignUpScreen({ directoriesPage = true } = {}) {
|
|
|
3483
3480
|
const t = useGuardNs("signUpSettings");
|
|
3484
3481
|
const request = useAreaRequest16("guard");
|
|
3485
3482
|
const settings = useApiQuery12("guard", "/signup/settings");
|
|
3486
|
-
const older = settings.data != null && settings.data.directories == null;
|
|
3487
|
-
const directories = useApiQuery12("guard", older ? "/directories" : null);
|
|
3488
3483
|
const action = useApiAction10();
|
|
3489
3484
|
const [form, setForm] = useState14({ enabled: false, directoryId: "", domains: "" });
|
|
3490
3485
|
useEffect5(() => {
|
|
@@ -3492,7 +3487,7 @@ function SignUpScreen({ directoriesPage = true } = {}) {
|
|
|
3492
3487
|
if (s) setForm({ enabled: s.enabled, directoryId: s.directoryId ?? "", domains: s.emailDomains.join(", ") });
|
|
3493
3488
|
}, [settings.data]);
|
|
3494
3489
|
if (settings.error) return /* @__PURE__ */ jsx20(InlineAlert16, { tone: "danger", children: settings.error });
|
|
3495
|
-
const listed = settings.data?.directories ??
|
|
3490
|
+
const listed = settings.data?.directories ?? [];
|
|
3496
3491
|
const current = settings.data?.directoryId;
|
|
3497
3492
|
const internal = current && !listed.some((d) => d.id === current) && settings.data?.directoryName ? [...listed, { id: current, name: settings.data.directoryName }] : listed;
|
|
3498
3493
|
const chosen = internal.find((d) => d.id === form.directoryId);
|