@openedx/frontend-app-admin-console 1.0.0-alpha.1 → 1.0.0-alpha.11
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/authz-module/audit-user/index.js +6 -13
- package/dist/authz-module/audit-user/index.js.map +1 -1
- package/dist/authz-module/authz-home/index.js +21 -2
- package/dist/authz-module/authz-home/index.js.map +1 -1
- package/dist/authz-module/components/AddRoleButton.js +1 -1
- package/dist/authz-module/components/AddRoleButton.js.map +1 -1
- package/dist/authz-module/components/AuthZLayout.d.ts +7 -6
- package/dist/authz-module/components/AuthZLayout.js +9 -3
- package/dist/authz-module/components/AuthZLayout.js.map +1 -1
- package/dist/authz-module/components/AuthZTitle.d.ts +3 -2
- package/dist/authz-module/components/AuthZTitle.js +9 -7
- package/dist/authz-module/components/AuthZTitle.js.map +1 -1
- package/dist/authz-module/components/ExpandableButton.d.ts +17 -0
- package/dist/authz-module/components/ExpandableButton.js +16 -0
- package/dist/authz-module/components/ExpandableButton.js.map +1 -0
- package/dist/authz-module/components/PermissionTable.js +5 -1
- package/dist/authz-module/components/PermissionTable.js.map +1 -1
- package/dist/authz-module/components/TableCells.d.ts +5 -9
- package/dist/authz-module/components/TableCells.js +35 -65
- package/dist/authz-module/components/TableCells.js.map +1 -1
- package/dist/authz-module/components/TableControlBar/MultipleChoiceFilter.d.ts +1 -1
- package/dist/authz-module/components/TableControlBar/MultipleChoiceFilter.js +4 -3
- package/dist/authz-module/components/TableControlBar/MultipleChoiceFilter.js.map +1 -1
- package/dist/authz-module/components/TableControlBar/OrgFilter.js +2 -2
- package/dist/authz-module/components/TableControlBar/OrgFilter.js.map +1 -1
- package/dist/authz-module/components/TableControlBar/SearchFilter.d.ts +2 -1
- package/dist/authz-module/components/TableControlBar/SearchFilter.js +2 -1
- package/dist/authz-module/components/TableControlBar/SearchFilter.js.map +1 -1
- package/dist/authz-module/components/TableControlBar/TableControlBar.d.ts +4 -1
- package/dist/authz-module/components/TableControlBar/TableControlBar.js +24 -24
- package/dist/authz-module/components/TableControlBar/TableControlBar.js.map +1 -1
- package/dist/authz-module/components/TableControlBar/types.d.ts +1 -0
- package/dist/authz-module/components/TableControlBar/types.js.map +1 -1
- package/dist/authz-module/components/TableFooter/TableFooter.d.ts +14 -1
- package/dist/authz-module/components/TableFooter/TableFooter.js +3 -2
- package/dist/authz-module/components/TableFooter/TableFooter.js.map +1 -1
- package/dist/authz-module/components/constants.d.ts +1 -0
- package/dist/authz-module/components/constants.js +2 -1
- package/dist/authz-module/components/constants.js.map +1 -1
- package/dist/authz-module/components/messages.d.ts +0 -5
- package/dist/authz-module/components/messages.js +2 -7
- package/dist/authz-module/components/messages.js.map +1 -1
- package/dist/authz-module/constants.d.ts +18 -8
- package/dist/authz-module/constants.js +30 -11
- package/dist/authz-module/constants.js.map +1 -1
- package/dist/authz-module/data/api.d.ts +12 -4
- package/dist/authz-module/data/api.js +11 -2
- package/dist/authz-module/data/api.js.map +1 -1
- package/dist/authz-module/data/hooks.d.ts +8 -8
- package/dist/authz-module/data/hooks.js +15 -20
- package/dist/authz-module/data/hooks.js.map +1 -1
- package/dist/authz-module/hooks/useExclusiveRowExpansion.d.ts +7 -0
- package/dist/authz-module/hooks/useExclusiveRowExpansion.js +24 -0
- package/dist/authz-module/hooks/useExclusiveRowExpansion.js.map +1 -0
- package/dist/authz-module/index.scss +150 -13
- package/dist/authz-module/messages.d.ts +23 -0
- package/dist/authz-module/messages.js +18 -0
- package/dist/authz-module/messages.js.map +1 -1
- package/dist/authz-module/role-assignation-wizard/AssignRoleWizard.js +1 -1
- package/dist/authz-module/role-assignation-wizard/AssignRoleWizard.js.map +1 -1
- package/dist/authz-module/role-assignation-wizard/AssignRoleWizardPage.js +4 -4
- package/dist/authz-module/role-assignation-wizard/AssignRoleWizardPage.js.map +1 -1
- package/dist/authz-module/role-assignation-wizard/components/ScopeFilterBar.js +1 -1
- package/dist/authz-module/role-assignation-wizard/components/ScopeFilterBar.js.map +1 -1
- package/dist/authz-module/role-assignation-wizard/hooks/useScopeListData.js.map +1 -1
- package/dist/authz-module/roles-permissions/RolesPermissions.js +3 -3
- package/dist/authz-module/roles-permissions/RolesPermissions.js.map +1 -1
- package/dist/authz-module/team-members/TeamMembersTable.js +102 -58
- package/dist/authz-module/team-members/TeamMembersTable.js.map +1 -1
- package/dist/authz-module/team-members/components/AssignedRolesCell.d.ts +20 -0
- package/dist/authz-module/team-members/components/AssignedRolesCell.js +54 -0
- package/dist/authz-module/team-members/components/AssignedRolesCell.js.map +1 -0
- package/dist/authz-module/team-members/components/MoreRolesToggle.d.ts +14 -0
- package/dist/authz-module/team-members/components/MoreRolesToggle.js +25 -0
- package/dist/authz-module/team-members/components/MoreRolesToggle.js.map +1 -0
- package/dist/authz-module/team-members/components/TeamMemberCells.d.ts +17 -0
- package/dist/authz-module/team-members/components/TeamMemberCells.js +21 -0
- package/dist/authz-module/team-members/components/TeamMemberCells.js.map +1 -0
- package/dist/authz-module/team-members/components/TeamMemberViewActionCell.d.ts +18 -0
- package/dist/authz-module/team-members/components/TeamMemberViewActionCell.js +42 -0
- package/dist/authz-module/team-members/components/TeamMemberViewActionCell.js.map +1 -0
- package/dist/authz-module/team-members/components/UserAssignmentsSubTable.d.ts +16 -0
- package/dist/authz-module/team-members/components/UserAssignmentsSubTable.js +74 -0
- package/dist/authz-module/team-members/components/UserAssignmentsSubTable.js.map +1 -0
- package/dist/authz-module/team-members/index.d.ts +1 -0
- package/dist/authz-module/team-members/index.js +2 -0
- package/dist/authz-module/team-members/index.js.map +1 -0
- package/dist/authz-module/team-members/messages.d.ts +56 -1
- package/dist/authz-module/team-members/messages.js +59 -4
- package/dist/authz-module/team-members/messages.js.map +1 -1
- package/dist/authz-module/utils.d.ts +6 -0
- package/dist/authz-module/utils.js +12 -10
- package/dist/authz-module/utils.js.map +1 -1
- package/dist/components/LoadingPage.d.ts +3 -0
- package/dist/components/LoadingPage.js +9 -1
- package/dist/components/LoadingPage.js.map +1 -1
- package/dist/components/messages.d.ts +8 -0
- package/dist/components/messages.js +10 -0
- package/dist/components/messages.js.map +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/routes.d.ts +3 -1
- package/dist/routes.js +17 -4
- package/dist/routes.js.map +1 -1
- package/dist/style.scss +19 -2
- package/dist/types.d.ts +29 -20
- package/dist/types.js.map +1 -1
- package/package.json +6 -3
- package/dist/authz-module/components/ViewMoreLink.d.ts +0 -8
- package/dist/authz-module/components/ViewMoreLink.js +0 -8
- package/dist/authz-module/components/ViewMoreLink.js.map +0 -1
|
@@ -3,13 +3,14 @@ import { useContext } from 'react';
|
|
|
3
3
|
import { useIntl } from '@openedx/frontend-base';
|
|
4
4
|
import { DataTableContext, Pagination, TableFooter } from '@openedx/paragon';
|
|
5
5
|
import messages from '../messages';
|
|
6
|
-
const
|
|
6
|
+
const defaultShowingMessage = messages['authz.table.footer.items.showing.text'];
|
|
7
|
+
const Footer = ({ showingMessage }) => {
|
|
7
8
|
const { formatMessage } = useIntl();
|
|
8
9
|
const { pageCount, gotoPage, state, itemCount, rows,
|
|
9
10
|
// @ts-expect-error - Paragon's DataTableContext is not typed
|
|
10
11
|
} = useContext(DataTableContext);
|
|
11
12
|
const { pageIndex } = state;
|
|
12
|
-
return (_jsxs(TableFooter, { children: [_jsx("span", { children: formatMessage(
|
|
13
|
+
return (_jsxs(TableFooter, { children: [_jsx("span", { className: "small", children: formatMessage(showingMessage !== null && showingMessage !== void 0 ? showingMessage : defaultShowingMessage, { pageSize: rows.length, itemCount }) }), _jsx(Pagination, { variant: "reduced", currentPage: pageIndex + 1, pageCount: pageCount, paginationLabel: formatMessage(messages['authz.table.footer.pagination.label']), onPageSelect: (pageNum) => gotoPage(pageNum - 1) })] }));
|
|
13
14
|
};
|
|
14
15
|
export default Footer;
|
|
15
16
|
//# sourceMappingURL=TableFooter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableFooter.js","sourceRoot":"","sources":["../../../../src/authz-module/components/TableFooter/TableFooter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,QAAQ,MAAM,uCAAuC,CAAC;AAE7D,MAAM,
|
|
1
|
+
{"version":3,"file":"TableFooter.js","sourceRoot":"","sources":["../../../../src/authz-module/components/TableFooter/TableFooter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,QAAQ,MAAM,uCAAuC,CAAC;AAE7D,MAAM,qBAAqB,GAAG,QAAQ,CAAC,uCAAuC,CAAC,CAAC;AAWhF,MAAM,MAAM,GAAG,CAAC,EAAE,cAAc,EAAe,EAAE,EAAE;IACjD,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,EACJ,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI;IAC7C,6DAA6D;MAC5D,GAAG,UAAU,CAAmB,gBAAgB,CAAC,CAAC;IACnD,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC5B,OAAO,CACL,MAAC,WAAW,eACV,eAAM,SAAS,EAAC,OAAO,YACpB,aAAa,CAAC,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,GACxF,EACP,KAAC,UAAU,IACT,OAAO,EAAC,SAAS,EACjB,WAAW,EAAE,SAAS,GAAG,CAAC,EAC1B,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,aAAa,CAAC,QAAQ,CAAC,qCAAqC,CAAC,CAAC,EAC/E,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,GAAG,CAAC,CAAC,GAChD,IACU,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { useContext } from 'react';\nimport { useIntl } from '@openedx/frontend-base';\nimport { DataTableContext, Pagination, TableFooter } from '@openedx/paragon';\nimport messages from '@src/authz-module/components/messages';\n\nconst defaultShowingMessage = messages['authz.table.footer.items.showing.text'];\n\ninterface FooterProps {\n /**\n * Overrides the \"Showing X of Y.\" text — used by tables whose rows are not\n * assignments (e.g. the team members table counts users). Receives `pageSize`\n * and `itemCount`.\n */\n showingMessage?: typeof defaultShowingMessage;\n}\n\nconst Footer = ({ showingMessage }: FooterProps) => {\n const { formatMessage } = useIntl();\n const {\n pageCount, gotoPage, state, itemCount, rows,\n // @ts-expect-error - Paragon's DataTableContext is not typed\n } = useContext<DataTableContext>(DataTableContext);\n const { pageIndex } = state;\n return (\n <TableFooter>\n <span className=\"small\">\n {formatMessage(showingMessage ?? defaultShowingMessage, { pageSize: rows.length, itemCount })}\n </span>\n <Pagination\n variant=\"reduced\"\n currentPage={pageIndex + 1}\n pageCount={pageCount}\n paginationLabel={formatMessage(messages['authz.table.footer.pagination.label'])}\n onPageSelect={(pageNum) => gotoPage(pageNum - 1)}\n />\n </TableFooter>\n );\n};\n\nexport default Footer;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Language, LibraryBooks, School } from '@openedx/paragon/icons';
|
|
1
|
+
import { AccountBalance, Language, LibraryBooks, School } from '@openedx/paragon/icons';
|
|
2
2
|
import messages from './messages';
|
|
3
3
|
export const getRolesFiltersOptions = (intl) => [
|
|
4
4
|
{
|
|
@@ -76,5 +76,6 @@ export const RESOURCE_ICONS = {
|
|
|
76
76
|
COURSE: School,
|
|
77
77
|
LIBRARY: LibraryBooks,
|
|
78
78
|
GLOBAL: Language,
|
|
79
|
+
ORGANIZATION: AccountBalance,
|
|
79
80
|
};
|
|
80
81
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/authz-module/components/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/authz-module/components/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxF,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,IAAe,EAAE,EAAE,CAAC;IACzD;QACE,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,uCAAuC,CAAC,CAAC;QAChF,SAAS,EAAE,QAAQ;QACnB,WAAW,EAAE,aAAa;QAC1B,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,QAAQ;KACtB;IACD;QACE,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,uCAAuC,CAAC,CAAC;QAChF,SAAS,EAAE,QAAQ;QACnB,WAAW,EAAE,cAAc;QAC3B,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,QAAQ;KACtB;IAED;QACE,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,wCAAwC,CAAC,CAAC;QACjF,SAAS,EAAE,MAAM;QACjB,WAAW,EAAE,cAAc;QAC3B,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,QAAQ;KACtB;IACD;QACE,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,wCAAwC,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ACF,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,cAAc;CAC7B,CAAC","sourcesContent":["import type { IntlShape } from '@openedx/frontend-base';\nimport { AccountBalance, Language, LibraryBooks, School } from '@openedx/paragon/icons';\nimport messages from './messages';\n\nexport const getRolesFiltersOptions = (intl: IntlShape) => [\n {\n groupName: intl.formatMessage(messages['authz.team.members.table.group.global']),\n groupIcon: Language,\n displayName: 'Super Admin',\n value: 'super_admin',\n contextType: 'global',\n },\n {\n groupName: intl.formatMessage(messages['authz.team.members.table.group.global']),\n groupIcon: Language,\n displayName: 'Global Staff',\n value: 'global_staff',\n contextType: 'global',\n },\n\n {\n groupName: intl.formatMessage(messages['authz.team.members.table.group.courses']),\n groupIcon: School,\n displayName: 'Course Admin',\n value: 'course_admin',\n contextType: 'course',\n },\n {\n groupName: intl.formatMessage(messages['authz.team.members.table.group.courses']),\n groupIcon: School,\n displayName: 'Course Staff',\n value: 'course_staff',\n contextType: 'course',\n },\n {\n groupName: intl.formatMessage(messages['authz.team.members.table.group.courses']),\n groupIcon: School,\n displayName: 'Course Editor',\n value: 'course_editor',\n contextType: 'course',\n },\n {\n groupName: intl.formatMessage(messages['authz.team.members.table.group.courses']),\n groupIcon: School,\n displayName: 'Course Auditor',\n value: 'course_auditor',\n contextType: 'course',\n },\n\n {\n groupName: intl.formatMessage(messages['authz.team.members.table.group.libraries']),\n groupIcon: LibraryBooks,\n displayName: 'Library Admin',\n value: 'library_admin',\n contextType: 'library',\n },\n {\n groupName: intl.formatMessage(messages['authz.team.members.table.group.libraries']),\n groupIcon: LibraryBooks,\n displayName: 'Library Author',\n value: 'library_author',\n contextType: 'library',\n },\n {\n groupName: intl.formatMessage(messages['authz.team.members.table.group.libraries']),\n groupIcon: LibraryBooks,\n displayName: 'Library Contributor',\n value: 'library_contributor',\n contextType: 'library',\n },\n {\n groupName: intl.formatMessage(messages['authz.team.members.table.group.libraries']),\n groupIcon: LibraryBooks,\n displayName: 'Library User',\n value: 'library_user',\n contextType: 'library',\n },\n];\n\nexport const RESOURCE_ICONS = {\n COURSE: School,\n LIBRARY: LibraryBooks,\n GLOBAL: Language,\n ORGANIZATION: AccountBalance,\n};\n"]}
|
|
@@ -84,11 +84,6 @@ declare const messages: {
|
|
|
84
84
|
defaultMessage: string;
|
|
85
85
|
description: string;
|
|
86
86
|
};
|
|
87
|
-
'authz.table.username.current': {
|
|
88
|
-
id: string;
|
|
89
|
-
defaultMessage: string;
|
|
90
|
-
description: string;
|
|
91
|
-
};
|
|
92
87
|
'authz.table.column.actions.view.title': {
|
|
93
88
|
id: string;
|
|
94
89
|
defaultMessage: string;
|
|
@@ -57,8 +57,8 @@ const messages = defineMessages({
|
|
|
57
57
|
},
|
|
58
58
|
'authz.user.table.org.all.organizations.label': {
|
|
59
59
|
id: 'authz.user.table.org.all.organizations.label',
|
|
60
|
-
defaultMessage: 'All
|
|
61
|
-
description: '
|
|
60
|
+
defaultMessage: 'All platform',
|
|
61
|
+
description: 'Shown in place of an organization for a role that is not limited to one organization: a wildcard org, or a Django-managed role.',
|
|
62
62
|
},
|
|
63
63
|
'authz.user.table.scope.global.label': {
|
|
64
64
|
id: 'authz.user.table.scope.global.label',
|
|
@@ -85,11 +85,6 @@ const messages = defineMessages({
|
|
|
85
85
|
defaultMessage: 'View all permissions',
|
|
86
86
|
description: 'Text for the link to view all permissions in the user table',
|
|
87
87
|
},
|
|
88
|
-
'authz.table.username.current': {
|
|
89
|
-
id: 'authz.table.username.current',
|
|
90
|
-
defaultMessage: '(Me)',
|
|
91
|
-
description: 'Indicates the current user in the team members table',
|
|
92
|
-
},
|
|
93
88
|
'authz.table.column.actions.view.title': {
|
|
94
89
|
id: 'authz.table.column.actions.view.title',
|
|
95
90
|
defaultMessage: 'View',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceR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sBAAsB;QACtC,WAAW,EAAE,6DAA6D;KAC3E;IACD,sDAAsD,EAAE;QACtD,EAAE,EAAE,sDAAsD;QAC1D,cAAc,EAAE,sBAAsB;QACtC,WAAW,EAAE,6DAA6D;KAC3E;IACD,qCAAqC,EAAE;QACrC,EAAE,EAAE,qCAAqC;QACzC,cAAc,EAAE,kBAAkB;QAClC,WAAW,EAAE,yCAAyC;KACvD;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n 'authz.role.card.permission.for.role.status.granted': {\n id: 'authz.role.card.permission.for.role.status.granted',\n defaultMessage: 'Permission granted in {roleName} role',\n description: 'Label for granted status of a permission in the permissions table',\n },\n 'authz.role.card.permission.for.role.status.not.granted': {\n id: 'authz.role.card.permission.for.role.status.not.granted',\n defaultMessage: 'Permission not granted in {roleName} role',\n description: 'Label for not granted status of a permission in the permissions table',\n },\n 'authz.role.card.permission.for.role.status.disabled': {\n id: 'authz.role.card.permission.for.role.status.disabled',\n defaultMessage: 'We are expanding our permissions system. This role is currently unavailable but will be part of an upcoming update.',\n description: 'Tooltip message for disabled roles in the permissions table',\n },\n 'authz.anchor.button.alt': {\n id: 'authz.anchor.button.alt',\n defaultMessage: 'Scroll to top',\n description: 'Alt text for the scroll to top anchor button',\n },\n 'authz.table.controlbar.clearFilters': {\n id: 'authz.table.controlbar.clearFilters',\n defaultMessage: 'Clear filters',\n description: 'Button to clear all active filters in the table',\n },\n 'authz.table.controlbar.search': {\n id: 'authz.table.controlbar.search',\n defaultMessage: 'Search',\n description: 'Search placeholder for two specific fields',\n },\n 'authz.table.controlbar.search.by.fields': {\n id: 'authz.table.controlbar.search.by.fields',\n defaultMessage: 'Search by {firstField} or {secondField}',\n description: 'Search placeholder for two specific fields',\n },\n 'authz.table.controlbar.filterby.label': {\n id: 'authz.table.controlbar.filterby.label',\n defaultMessage: 'Filtered by: ',\n description: 'Label for active filters in the table',\n },\n 'authz.table.controlbar.filters.limit.reached': {\n id: 'authz.table.controlbar.filters.limit.reached',\n defaultMessage: '10 filter limit reached. Remove one of the applied filters so you can select another one.',\n description: 'Message displayed when the user reaches the applied filters limit',\n },\n 'authz.table.controlbar.filters.items.showing': {\n id: 'authz.table.controlbar.filters.limit.reached',\n defaultMessage: 'Showing {current} of {total}.',\n description: 'Message displayed when the user reaches the applied filters limit',\n },\n 'authz.table.footer.items.showing.text': {\n id: 'authz.table.footer.items.showing.text',\n defaultMessage: 'Showing {pageSize} of {itemCount}.',\n description: 'Text in the table footer indicating how many items are being shown out of the total count.',\n },\n 'authz.user.table.org.all.organizations.label': {\n id: 'authz.user.table.org.all.organizations.label',\n defaultMessage: 'All Organizations',\n description: 'Label for the \"All Organizations\" message on the user assignments table when a user has a django managed role assigned.',\n },\n 'authz.user.table.scope.global.label': {\n id: 'authz.user.table.scope.global.label',\n defaultMessage: 'Global',\n description: 'Label for the \"Global\" scope in the user assignments table when a user has a django managed role assigned.',\n },\n 'authz.user.table.permissions.access.label': {\n id: 'authz.user.table.permissions.access.label',\n defaultMessage: '{accessType, select, total {Total Access} partial {Partial Access} other {No Access}}',\n description: 'Label for the permissions access level in the user assignments table, can be Total or Partial.',\n },\n 'authz.user.table.permissions.available.count': {\n id: 'authz.user.table.permissions.available.count',\n defaultMessage: '{count, plural, one {# permission available} other {# permissions available}}',\n description: 'Text showing the number of permissions available, with proper pluralization',\n },\n 'authz.user.table.delete.action.alt': {\n id: 'authz.user.table.delete.action.alt',\n defaultMessage: 'Delete role action',\n description: 'Alt description for delete button',\n },\n 'authz.user.table.view_all_permissions.link.text': {\n id: 'authz.user.table.view_all_permissions.link.text',\n defaultMessage: 'View all permissions',\n description: 'Text for the link to view all permissions in the user table',\n },\n 'authz.table.username.current': {\n id: 'authz.table.username.current',\n defaultMessage: '(Me)',\n description: 'Indicates the current user in the team members table',\n },\n\n 'authz.table.column.actions.view.title': {\n id: 'authz.table.column.actions.view.title',\n defaultMessage: 'View',\n description: 'Team members table view action text',\n },\n 'authz.team.members.table.group.courses': {\n id: 'authz.team.members.table.group.courses',\n defaultMessage: 'Courses',\n description: 'Label for the \"Courses\" group in the team members table filters',\n },\n 'authz.team.members.table.group.libraries': {\n id: 'authz.team.members.table.group.libraries',\n defaultMessage: 'Libraries',\n description: 'Label for the \"Libraries\" group in the team members table filters',\n },\n 'authz.team.members.table.group.global': {\n id: 'authz.team.members.table.group.global',\n defaultMessage: 'Global',\n description: 'Label for the \"Global\" group in the team members table filters',\n },\n 'authz.table.controlbar.filters.more.results': {\n id: 'authz.table.controlbar.filters.more.results',\n defaultMessage: 'Search to show more',\n description: 'Message displayed when there are more results available than currently shown',\n },\n 'authz.team.remove.user.modal.title': {\n id: 'authz.team.remove.user.modal.title',\n defaultMessage: 'Remove role?',\n description: 'AuthZ team management remove user modal title',\n },\n 'authz.manage.cancel.button': {\n id: 'authz.manage.cancel.button',\n defaultMessage: 'Cancel',\n description: 'AuthZ cancel button title',\n },\n 'authz.manage.remove.button': {\n id: 'authz.manage.remove.button',\n defaultMessage: 'Remove',\n description: 'AuthZ remove button title',\n },\n 'authz.manage.removing.button': {\n id: 'authz.manage.removing.button',\n defaultMessage: 'Removing',\n description: 'AuthZ removing button title',\n },\n 'authz.team.remove.user.modal.body.1': {\n id: 'authz.team.remove.user.modal.body.1',\n defaultMessage: 'Are you sure you want to remove the {role} role from the user “{userName}” in the scope {scope}?',\n description: 'AuthZ team management remove user modal body',\n },\n 'authz.team.remove.user.modal.body.2': {\n id: 'authz.team.remove.user.modal.body.2',\n defaultMessage: \"This is the user's only role in this scope. Removing it will revoke their access completely, and they will no longer appear in the scope's member list.\",\n description: 'AuthZ team management remove user modal body',\n },\n 'authz.team.remove.user.modal.body.3': {\n id: 'authz.team.remove.user.modal.body.3',\n defaultMessage: 'Are you sure you want to proceed?',\n description: 'AuthZ team management remove user modal body',\n },\n 'authz.user.table.delete.action.djangorole.tooltip': {\n id: 'authz.user.table.delete.action.djangorole.tooltip',\n defaultMessage: 'You can’t remove this role here. Please go to Django Admin to manage it.',\n description: 'Tooltip for delete button when hovering over Django roles',\n },\n 'authz.user.table.delete.action.adminrole.tooltip': {\n id: 'authz.user.table.delete.action.adminrole.tooltip',\n defaultMessage: 'You can’t remove your own admin role. This prevents a resource from being left without an admin. Another user with the required permissions can revoke it.',\n description: 'Tooltip for delete button when hovering over Admin roles',\n },\n 'authz.table.actions.course.disabled.tooltip': {\n id: 'authz.table.actions.course.disabled.tooltip',\n defaultMessage: 'This course hasn’t moved to the new roles experience yet. Manage its team in Studio instead.',\n description: 'Tooltip for disabled action buttons on rows of courses where the course authoring flag is off, pointing users to Studio to manage the course team',\n },\n 'authz.user.table.view_all_permissions.link.text.close': {\n id: 'authz.user.table.view_all_permissions.link.text.close',\n defaultMessage: 'Hide all permissions',\n description: 'Text for the link to hide all permissions in the user table',\n },\n 'authz.user.table.view_all_permissions.link.text.open': {\n id: 'authz.user.table.view_all_permissions.link.text.open',\n defaultMessage: 'View all permissions',\n description: 'Text for the link to view all permissions in the user table',\n },\n 'authz.table.footer.pagination.label': {\n id: 'authz.table.footer.pagination.label',\n defaultMessage: 'Table pagination',\n description: 'Label for the table pagination controls',\n },\n});\n\nexport default messages;\n"]}
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/authz-module/components/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,oDAAoD,EAAE;QACpD,EAAE,EAAE,oDAAoD;QACxD,cAAc,EAAE,uCAAuC;QACvD,WAAW,EAAE,mEAAmE;KACjF;IACD,wDAAwD,EAAE;QACxD,EAAE,EAAE,wDAAwD;QAC5D,cAAc,EAAE,2CAA2C;QAC3D,WAAW,EAAE,uEAAuE;KACrF;IACD,qDAAqD,EAAE;QACrD,EAAE,EAAE,qDAAqD;QACzD,cAAc,EAAE,qHAAqH;QACrI,WAAW,EA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C,EAAE;QACrC,EAAE,EAAE,qCAAqC;QACzC,cAAc,EAAE,kGAAkG;QAClH,WAAW,EAAE,8CAA8C;KAC5D;IACD,qCAAqC,EAAE;QACrC,EAAE,EAAE,qCAAqC;QACzC,cAAc,EAAE,yJAAyJ;QACzK,WAAW,EAAE,8CAA8C;KAC5D;IACD,qCAAqC,EAAE;QACrC,EAAE,EAAE,qCAAqC;QACzC,cAAc,EAAE,mCAAmC;QACnD,WAAW,EAAE,8CAA8C;KAC5D;IACD,mDAAmD,EAAE;QACnD,EAAE,EAAE,mDAAmD;QACvD,cAAc,EAAE,0EAA0E;QAC1F,WAAW,EAAE,2DAA2D;KACzE;IACD,kDAAkD,EAAE;QAClD,EAAE,EAAE,kDAAkD;QACtD,cAAc,EAAE,4JAA4J;QAC5K,WAAW,EAAE,0DAA0D;KACxE;IACD,6CAA6C,EAAE;QAC7C,EAAE,EAAE,6CAA6C;QACjD,cAAc,EAAE,8FAA8F;QAC9G,WAAW,EAAE,mJAAmJ;KACjK;IACD,uDAAuD,EAAE;QACvD,EAAE,EAAE,uDAAuD;QAC3D,cAAc,EAAE,sBAAsB;QACtC,WAAW,EAAE,6DAA6D;KAC3E;IACD,sDAAsD,EAAE;QACtD,EAAE,EAAE,sDAAsD;QAC1D,cAAc,EAAE,sBAAsB;QACtC,WAAW,EAAE,6DAA6D;KAC3E;IACD,qCAAqC,EAAE;QACrC,EAAE,EAAE,qCAAqC;QACzC,cAAc,EAAE,kBAAkB;QAClC,WAAW,EAAE,yCAAyC;KACvD;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n 'authz.role.card.permission.for.role.status.granted': {\n id: 'authz.role.card.permission.for.role.status.granted',\n defaultMessage: 'Permission granted in {roleName} role',\n description: 'Label for granted status of a permission in the permissions table',\n },\n 'authz.role.card.permission.for.role.status.not.granted': {\n id: 'authz.role.card.permission.for.role.status.not.granted',\n defaultMessage: 'Permission not granted in {roleName} role',\n description: 'Label for not granted status of a permission in the permissions table',\n },\n 'authz.role.card.permission.for.role.status.disabled': {\n id: 'authz.role.card.permission.for.role.status.disabled',\n defaultMessage: 'We are expanding our permissions system. This role is currently unavailable but will be part of an upcoming update.',\n description: 'Tooltip message for disabled roles in the permissions table',\n },\n 'authz.anchor.button.alt': {\n id: 'authz.anchor.button.alt',\n defaultMessage: 'Scroll to top',\n description: 'Alt text for the scroll to top anchor button',\n },\n 'authz.table.controlbar.clearFilters': {\n id: 'authz.table.controlbar.clearFilters',\n defaultMessage: 'Clear filters',\n description: 'Button to clear all active filters in the table',\n },\n 'authz.table.controlbar.search': {\n id: 'authz.table.controlbar.search',\n defaultMessage: 'Search',\n description: 'Search placeholder for two specific fields',\n },\n 'authz.table.controlbar.search.by.fields': {\n id: 'authz.table.controlbar.search.by.fields',\n defaultMessage: 'Search by {firstField} or {secondField}',\n description: 'Search placeholder for two specific fields',\n },\n 'authz.table.controlbar.filterby.label': {\n id: 'authz.table.controlbar.filterby.label',\n defaultMessage: 'Filtered by: ',\n description: 'Label for active filters in the table',\n },\n 'authz.table.controlbar.filters.limit.reached': {\n id: 'authz.table.controlbar.filters.limit.reached',\n defaultMessage: '10 filter limit reached. Remove one of the applied filters so you can select another one.',\n description: 'Message displayed when the user reaches the applied filters limit',\n },\n 'authz.table.controlbar.filters.items.showing': {\n id: 'authz.table.controlbar.filters.limit.reached',\n defaultMessage: 'Showing {current} of {total}.',\n description: 'Message displayed when the user reaches the applied filters limit',\n },\n 'authz.table.footer.items.showing.text': {\n id: 'authz.table.footer.items.showing.text',\n defaultMessage: 'Showing {pageSize} of {itemCount}.',\n description: 'Text in the table footer indicating how many items are being shown out of the total count.',\n },\n 'authz.user.table.org.all.organizations.label': {\n id: 'authz.user.table.org.all.organizations.label',\n defaultMessage: 'All platform',\n description: 'Shown in place of an organization for a role that is not limited to one organization: a wildcard org, or a Django-managed role.',\n },\n 'authz.user.table.scope.global.label': {\n id: 'authz.user.table.scope.global.label',\n defaultMessage: 'Global',\n description: 'Label for the \"Global\" scope in the user assignments table when a user has a django managed role assigned.',\n },\n 'authz.user.table.permissions.access.label': {\n id: 'authz.user.table.permissions.access.label',\n defaultMessage: '{accessType, select, total {Total Access} partial {Partial Access} other {No Access}}',\n description: 'Label for the permissions access level in the user assignments table, can be Total or Partial.',\n },\n 'authz.user.table.permissions.available.count': {\n id: 'authz.user.table.permissions.available.count',\n defaultMessage: '{count, plural, one {# permission available} other {# permissions available}}',\n description: 'Text showing the number of permissions available, with proper pluralization',\n },\n 'authz.user.table.delete.action.alt': {\n id: 'authz.user.table.delete.action.alt',\n defaultMessage: 'Delete role action',\n description: 'Alt description for delete button',\n },\n 'authz.user.table.view_all_permissions.link.text': {\n id: 'authz.user.table.view_all_permissions.link.text',\n defaultMessage: 'View all permissions',\n description: 'Text for the link to view all permissions in the user table',\n },\n\n 'authz.table.column.actions.view.title': {\n id: 'authz.table.column.actions.view.title',\n defaultMessage: 'View',\n description: 'Team members table view action text',\n },\n 'authz.team.members.table.group.courses': {\n id: 'authz.team.members.table.group.courses',\n defaultMessage: 'Courses',\n description: 'Label for the \"Courses\" group in the team members table filters',\n },\n 'authz.team.members.table.group.libraries': {\n id: 'authz.team.members.table.group.libraries',\n defaultMessage: 'Libraries',\n description: 'Label for the \"Libraries\" group in the team members table filters',\n },\n 'authz.team.members.table.group.global': {\n id: 'authz.team.members.table.group.global',\n defaultMessage: 'Global',\n description: 'Label for the \"Global\" group in the team members table filters',\n },\n 'authz.table.controlbar.filters.more.results': {\n id: 'authz.table.controlbar.filters.more.results',\n defaultMessage: 'Search to show more',\n description: 'Message displayed when there are more results available than currently shown',\n },\n 'authz.team.remove.user.modal.title': {\n id: 'authz.team.remove.user.modal.title',\n defaultMessage: 'Remove role?',\n description: 'AuthZ team management remove user modal title',\n },\n 'authz.manage.cancel.button': {\n id: 'authz.manage.cancel.button',\n defaultMessage: 'Cancel',\n description: 'AuthZ cancel button title',\n },\n 'authz.manage.remove.button': {\n id: 'authz.manage.remove.button',\n defaultMessage: 'Remove',\n description: 'AuthZ remove button title',\n },\n 'authz.manage.removing.button': {\n id: 'authz.manage.removing.button',\n defaultMessage: 'Removing',\n description: 'AuthZ removing button title',\n },\n 'authz.team.remove.user.modal.body.1': {\n id: 'authz.team.remove.user.modal.body.1',\n defaultMessage: 'Are you sure you want to remove the {role} role from the user “{userName}” in the scope {scope}?',\n description: 'AuthZ team management remove user modal body',\n },\n 'authz.team.remove.user.modal.body.2': {\n id: 'authz.team.remove.user.modal.body.2',\n defaultMessage: \"This is the user's only role in this scope. Removing it will revoke their access completely, and they will no longer appear in the scope's member list.\",\n description: 'AuthZ team management remove user modal body',\n },\n 'authz.team.remove.user.modal.body.3': {\n id: 'authz.team.remove.user.modal.body.3',\n defaultMessage: 'Are you sure you want to proceed?',\n description: 'AuthZ team management remove user modal body',\n },\n 'authz.user.table.delete.action.djangorole.tooltip': {\n id: 'authz.user.table.delete.action.djangorole.tooltip',\n defaultMessage: 'You can’t remove this role here. Please go to Django Admin to manage it.',\n description: 'Tooltip for delete button when hovering over Django roles',\n },\n 'authz.user.table.delete.action.adminrole.tooltip': {\n id: 'authz.user.table.delete.action.adminrole.tooltip',\n defaultMessage: 'You can’t remove your own admin role. This prevents a resource from being left without an admin. Another user with the required permissions can revoke it.',\n description: 'Tooltip for delete button when hovering over Admin roles',\n },\n 'authz.table.actions.course.disabled.tooltip': {\n id: 'authz.table.actions.course.disabled.tooltip',\n defaultMessage: 'This course hasn’t moved to the new roles experience yet. Manage its team in Studio instead.',\n description: 'Tooltip for disabled action buttons on rows of courses where the course authoring flag is off, pointing users to Studio to manage the course team',\n },\n 'authz.user.table.view_all_permissions.link.text.close': {\n id: 'authz.user.table.view_all_permissions.link.text.close',\n defaultMessage: 'Hide all permissions',\n description: 'Text for the link to hide all permissions in the user table',\n },\n 'authz.user.table.view_all_permissions.link.text.open': {\n id: 'authz.user.table.view_all_permissions.link.text.open',\n defaultMessage: 'View all permissions',\n description: 'Text for the link to view all permissions in the user table',\n },\n 'authz.table.footer.pagination.label': {\n id: 'authz.table.footer.pagination.label',\n defaultMessage: 'Table pagination',\n description: 'Label for the table pagination controls',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -5,19 +5,30 @@ export declare const CONTEXT_TYPES: {
|
|
|
5
5
|
export type ContextType = typeof CONTEXT_TYPES[keyof typeof CONTEXT_TYPES];
|
|
6
6
|
export declare const getOrgAggregateScopeKey: (contextType: ContextType, orgSlug: string) => string;
|
|
7
7
|
export declare const getPlatformAggregateScopeKey: (contextType: ContextType) => string;
|
|
8
|
+
/** The `org` an assignment carries when it spans every organization. */
|
|
9
|
+
export declare const ALL_ORGS_KEY = "*";
|
|
10
|
+
/**
|
|
11
|
+
* The kind of resource a scope points at, read from the scope key itself rather than from
|
|
12
|
+
* the role that grants it, so it does not depend on role naming staying conventional.
|
|
13
|
+
*/
|
|
14
|
+
export declare const getScopeContextType: (scope: string) => ContextType;
|
|
15
|
+
/**
|
|
16
|
+
* Tells whether a scope is one of the wildcard scopes, and which level it aggregates.
|
|
17
|
+
*
|
|
18
|
+
* Returns `null` for a scope pointing at a single course or library. The org slug is
|
|
19
|
+
* needed to recognize an org-level aggregate, since its key embeds the slug.
|
|
20
|
+
*/
|
|
21
|
+
export declare const getAggregateScopeType: (scope: string, org?: string | null) => "platform" | "org" | null;
|
|
8
22
|
export declare const DEFAULT_TOAST_DELAY = 5000;
|
|
9
23
|
export declare const RETRY_TOAST_DELAY = 120000;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
email: string;
|
|
14
|
-
roles: never[];
|
|
15
|
-
}[];
|
|
24
|
+
/** Absolute base path of the module; src/routes.tsx derives its route prefix from this. */
|
|
25
|
+
export declare const AUTHZ_HOME_PATH = "/admin-console/authz";
|
|
26
|
+
/** Segments nested under the authz splat route, relative to AUTHZ_HOME_PATH. */
|
|
16
27
|
export declare const ROUTES: {
|
|
17
|
-
HOME_PATH: string;
|
|
18
28
|
AUDIT_USER_PATH: string;
|
|
19
29
|
ASSIGN_ROLE_WIZARD_PATH: string;
|
|
20
30
|
};
|
|
31
|
+
export declare const buildAuditUserPath: (username: string) => string;
|
|
21
32
|
export declare const buildWizardPath: (options?: {
|
|
22
33
|
users?: string;
|
|
23
34
|
from?: string;
|
|
@@ -30,7 +41,6 @@ export declare enum RoleOperationErrorStatus {
|
|
|
30
41
|
ROLE_REMOVAL_ERROR = "role_removal_error"
|
|
31
42
|
}
|
|
32
43
|
export declare const MAX_TABLE_FILTERS_APPLIED = 10;
|
|
33
|
-
export declare const AUTHZ_HOME_PATH = "/authz";
|
|
34
44
|
export declare const MAP_ROLE_KEY_TO_LABEL: Record<string, string>;
|
|
35
45
|
export declare const DJANGO_MANAGED_ROLES: string[];
|
|
36
46
|
export declare const TABLE_DEFAULT_PAGE_SIZE = 10;
|
|
@@ -23,21 +23,41 @@ export const getPlatformAggregateScopeKey = (contextType) => {
|
|
|
23
23
|
throw new Error(`Unknown contextType: "${contextType}"`);
|
|
24
24
|
return scope;
|
|
25
25
|
};
|
|
26
|
+
/** The `org` an assignment carries when it spans every organization. */
|
|
27
|
+
export const ALL_ORGS_KEY = '*';
|
|
28
|
+
/**
|
|
29
|
+
* The kind of resource a scope points at, read from the scope key itself rather than from
|
|
30
|
+
* the role that grants it, so it does not depend on role naming staying conventional.
|
|
31
|
+
*/
|
|
32
|
+
export const getScopeContextType = (scope) => (scope.startsWith('lib') ? CONTEXT_TYPES.LIBRARY : CONTEXT_TYPES.COURSE);
|
|
33
|
+
/**
|
|
34
|
+
* Tells whether a scope is one of the wildcard scopes, and which level it aggregates.
|
|
35
|
+
*
|
|
36
|
+
* Returns `null` for a scope pointing at a single course or library. The org slug is
|
|
37
|
+
* needed to recognize an org-level aggregate, since its key embeds the slug.
|
|
38
|
+
*/
|
|
39
|
+
export const getAggregateScopeType = (scope, org) => {
|
|
40
|
+
const contextType = getScopeContextType(scope);
|
|
41
|
+
if (scope === getPlatformAggregateScopeKey(contextType)) {
|
|
42
|
+
return 'platform';
|
|
43
|
+
}
|
|
44
|
+
if (org && scope === getOrgAggregateScopeKey(contextType, org)) {
|
|
45
|
+
return 'org';
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
};
|
|
26
49
|
export const DEFAULT_TOAST_DELAY = 5000;
|
|
27
50
|
export const RETRY_TOAST_DELAY = 120000; // 2 minutes
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
email: '',
|
|
32
|
-
roles: [],
|
|
33
|
-
}));
|
|
51
|
+
/** Absolute base path of the module; src/routes.tsx derives its route prefix from this. */
|
|
52
|
+
export const AUTHZ_HOME_PATH = '/admin-console/authz';
|
|
53
|
+
/** Segments nested under the authz splat route, relative to AUTHZ_HOME_PATH. */
|
|
34
54
|
export const ROUTES = {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
ASSIGN_ROLE_WIZARD_PATH: '/assign-role',
|
|
55
|
+
AUDIT_USER_PATH: 'user/:username',
|
|
56
|
+
ASSIGN_ROLE_WIZARD_PATH: 'assign-role',
|
|
38
57
|
};
|
|
58
|
+
export const buildAuditUserPath = (username) => `${AUTHZ_HOME_PATH}/user/${encodeURIComponent(username)}`;
|
|
39
59
|
export const buildWizardPath = (options) => {
|
|
40
|
-
const base = `${
|
|
60
|
+
const base = `${AUTHZ_HOME_PATH}/${ROUTES.ASSIGN_ROLE_WIZARD_PATH}`;
|
|
41
61
|
if (!options)
|
|
42
62
|
return base;
|
|
43
63
|
const params = new URLSearchParams();
|
|
@@ -57,7 +77,6 @@ export var RoleOperationErrorStatus;
|
|
|
57
77
|
RoleOperationErrorStatus["ROLE_REMOVAL_ERROR"] = "role_removal_error";
|
|
58
78
|
})(RoleOperationErrorStatus || (RoleOperationErrorStatus = {}));
|
|
59
79
|
export const MAX_TABLE_FILTERS_APPLIED = 10;
|
|
60
|
-
export const AUTHZ_HOME_PATH = '/authz';
|
|
61
80
|
export const MAP_ROLE_KEY_TO_LABEL = {
|
|
62
81
|
library_admin: 'Library Admin',
|
|
63
82
|
library_author: 'Library Author',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/authz-module/constants.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACR,CAAC;AAIX,MAAM,4BAA4B,GAAG;IACnC,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,aAAa,OAAO,IAAI;IACrE,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,OAAO,IAAI;CACjE,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,WAAwB,EAAE,OAAe,EAAU,EAAE;IAC3F,MAAM,OAAO,GAAG,4BAA4B,CAAC,WAAW,CAAC,CAAC;IAC1D,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,WAAW,GAAG,CAAC,CAAC;IACvE,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,MAAM,6BAA6B,GAAG;IACpC,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,aAAa;IACrC,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,OAAO;CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,WAAwB,EAAU,EAAE;IAC/E,MAAM,KAAK,GAAG,6BAA6B,CAAC,WAAW,CAAC,CAAC;IACzD,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,WAAW,GAAG,CAAC,CAAC;IACrE,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/auth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AAC;IACtD,IAAI,OAAO,CAAC,IAAI;QAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IAChC,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,CAAN,IAAY,wBAMX;AAND,WAAY,wBAAwB;IAClC,6DAAiC,CAAA;IACjC,2EAA+C,CAAA;IAC/C,+EAAmD,CAAA;IACnD,2EAA+C,CAAA;IAC/C,qEAAyC,CAAA;AAC3C,CAAC,EANW,wBAAwB,KAAxB,wBAAwB,QAMnC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C,MAAM,CAAC,MAAM,qBAAqB,GAA2B;IAC3D,aAAa,EAAE,eAAe;IAC9B,cAAc,EAAE,gBAAgB;IAChC,mBAAmB,EAAE,qBAAqB;IAC1C,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,cAAc;IAC5B,aAAa,EAAE,eAAe;IAC9B,cAAc,EAAE,gBAAgB;IAChC,kBAAkB,EAAE,aAAa;IACjC,oBAAoB,EAAE,cAAc;CACrC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE1C,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAC1C,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC","sourcesContent":["// Resource Type Definitions\nexport const CONTEXT_TYPES = {\n LIBRARY: 'library',\n COURSE: 'course',\n} as const;\n\nexport type ContextType = typeof CONTEXT_TYPES[keyof typeof CONTEXT_TYPES];\n\nconst ORG_AGGREGATE_SCOPE_BUILDERS = {\n [CONTEXT_TYPES.COURSE]: (orgSlug: string) => `course-v1:${orgSlug}+*`,\n [CONTEXT_TYPES.LIBRARY]: (orgSlug: string) => `lib:${orgSlug}:*`,\n};\n\nexport const getOrgAggregateScopeKey = (contextType: ContextType, orgSlug: string): string => {\n const builder = ORG_AGGREGATE_SCOPE_BUILDERS[contextType];\n if (!builder) throw new Error(`Unknown contextType: \"${contextType}\"`);\n return builder(orgSlug);\n};\n\nconst PLATFORM_AGGREGATE_SCOPE_KEYS = {\n [CONTEXT_TYPES.COURSE]: 'course-v1:*',\n [CONTEXT_TYPES.LIBRARY]: 'lib:*',\n};\n\nexport const getPlatformAggregateScopeKey = (contextType: ContextType): string => {\n const scope = PLATFORM_AGGREGATE_SCOPE_KEYS[contextType];\n if (!scope) throw new Error(`Unknown contextType: \"${contextType}\"`);\n return scope;\n};\n\n/** The `org` an assignment carries when it spans every organization. */\nexport const ALL_ORGS_KEY = '*';\n\n/**\n * The kind of resource a scope points at, read from the scope key itself rather than from\n * the role that grants it, so it does not depend on role naming staying conventional.\n */\nexport const getScopeContextType = (scope: string): ContextType => (\n scope.startsWith('lib') ? CONTEXT_TYPES.LIBRARY : CONTEXT_TYPES.COURSE\n);\n\n/**\n * Tells whether a scope is one of the wildcard scopes, and which level it aggregates.\n *\n * Returns `null` for a scope pointing at a single course or library. The org slug is\n * needed to recognize an org-level aggregate, since its key embeds the slug.\n */\nexport const getAggregateScopeType = (scope: string, org?: string | null): 'platform' | 'org' | null => {\n const contextType = getScopeContextType(scope);\n if (scope === getPlatformAggregateScopeKey(contextType)) {\n return 'platform';\n }\n if (org && scope === getOrgAggregateScopeKey(contextType, org)) {\n return 'org';\n }\n return null;\n};\n\nexport const DEFAULT_TOAST_DELAY = 5000;\nexport const RETRY_TOAST_DELAY = 120_000; // 2 minutes\n\n/** Absolute base path of the module; src/routes.tsx derives its route prefix from this. */\nexport const AUTHZ_HOME_PATH = '/admin-console/authz';\n\n/** Segments nested under the authz splat route, relative to AUTHZ_HOME_PATH. */\nexport const ROUTES = {\n AUDIT_USER_PATH: 'user/:username',\n ASSIGN_ROLE_WIZARD_PATH: 'assign-role',\n};\n\nexport const buildAuditUserPath = (username: string) => `${AUTHZ_HOME_PATH}/user/${encodeURIComponent(username)}`;\n\nexport const buildWizardPath = (options?: { users?: string; from?: string }) => {\n const base = `${AUTHZ_HOME_PATH}/${ROUTES.ASSIGN_ROLE_WIZARD_PATH}`;\n if (!options) return base;\n const params = new URLSearchParams();\n if (options.users) params.set('users', options.users);\n if (options.from) params.set('from', options.from);\n const query = params.toString();\n return query ? `${base}?${query}` : base;\n};\n\nexport enum RoleOperationErrorStatus {\n USER_NOT_FOUND = 'user_not_found',\n USER_ALREADY_HAS_ROLE = 'user_already_has_role',\n USER_DOES_NOT_HAVE_ROLE = 'user_does_not_have_role',\n ROLE_ASSIGNMENT_ERROR = 'role_assignment_error',\n ROLE_REMOVAL_ERROR = 'role_removal_error',\n}\n\nexport const MAX_TABLE_FILTERS_APPLIED = 10;\n\nexport const MAP_ROLE_KEY_TO_LABEL: Record<string, string> = {\n library_admin: 'Library Admin',\n library_author: 'Library Author',\n library_contributor: 'Library Contributor',\n library_user: 'Library User',\n course_admin: 'Course Admin',\n course_staff: 'Course Staff',\n course_editor: 'Course Editor',\n course_auditor: 'Course Auditor',\n 'django.superuser': 'Super Admin',\n 'django.globalstaff': 'Global Staff',\n};\n\nexport const DJANGO_MANAGED_ROLES = ['django.superuser', 'django.globalstaff'];\n\nexport const TABLE_DEFAULT_PAGE_SIZE = 10;\n\nexport const DEFAULT_FILTER_PAGE_SIZE = 5;\nexport const ADMIN_ROLES = ['course_admin', 'library_admin'];\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Org, Scope, UserRole } from '../../types';
|
|
1
|
+
import { Org, Scope, TeamMember, UserRole } from '../../types';
|
|
2
2
|
export interface QuerySettings {
|
|
3
3
|
roles: string | null;
|
|
4
4
|
scopes: string | null;
|
|
@@ -47,8 +47,8 @@ export interface AssignTeamMembersRoleRequest {
|
|
|
47
47
|
role: string;
|
|
48
48
|
scopes: string[];
|
|
49
49
|
}
|
|
50
|
-
export interface
|
|
51
|
-
results:
|
|
50
|
+
export interface GetTeamMembersAssignmentsResponse {
|
|
51
|
+
results: TeamMember[];
|
|
52
52
|
count: number;
|
|
53
53
|
next: string | null;
|
|
54
54
|
previous: string | null;
|
|
@@ -102,7 +102,15 @@ export interface CourseAuthoringFlagStates {
|
|
|
102
102
|
export declare const assignTeamMembersRole: (data: AssignTeamMembersRoleRequest) => Promise<PutAssignTeamMembersRoleResponse>;
|
|
103
103
|
export declare const validateUsers: (data: ValidateUsersRequest) => Promise<ValidateUsersResponse>;
|
|
104
104
|
export declare const revokeUserRoles: (data: RevokeUserRolesRequest) => Promise<DeleteRevokeUserRolesResponse>;
|
|
105
|
-
|
|
105
|
+
/**
|
|
106
|
+
* Fetches team members grouped by user: one entry per user carrying the first few of
|
|
107
|
+
* their role assignments plus `assignmentCount`, the number behind that slice.
|
|
108
|
+
*
|
|
109
|
+
* The role, org and scope filters apply to assignments before they are grouped, so they
|
|
110
|
+
* decide both which users come back and which of each user's assignments are listed and
|
|
111
|
+
* counted.
|
|
112
|
+
*/
|
|
113
|
+
export declare const getTeamMembersAssignments: (querySettings: QuerySettings) => Promise<GetTeamMembersAssignmentsResponse>;
|
|
106
114
|
export declare const getOrgs: (search?: string, page?: number, pageSize?: number) => Promise<GetOrgsResponse>;
|
|
107
115
|
export declare const getScopes: (params: GetScopesParams) => Promise<GetScopesResponse>;
|
|
108
116
|
export declare const getCourseAuthoringFlagStates: () => Promise<CourseAuthoringFlagStates>;
|
|
@@ -26,8 +26,16 @@ export const revokeUserRoles = (data) => __awaiter(void 0, void 0, void 0, funct
|
|
|
26
26
|
const res = yield getAuthenticatedHttpClient().delete(url.toString());
|
|
27
27
|
return camelCaseObject(res.data);
|
|
28
28
|
});
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Fetches team members grouped by user: one entry per user carrying the first few of
|
|
31
|
+
* their role assignments plus `assignmentCount`, the number behind that slice.
|
|
32
|
+
*
|
|
33
|
+
* The role, org and scope filters apply to assignments before they are grouped, so they
|
|
34
|
+
* decide both which users come back and which of each user's assignments are listed and
|
|
35
|
+
* counted.
|
|
36
|
+
*/
|
|
37
|
+
export const getTeamMembersAssignments = (querySettings) => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
+
const url = new URL(getApiUrl('/api/authz/v1/users/'));
|
|
31
39
|
if (querySettings.roles) {
|
|
32
40
|
url.searchParams.set('roles', querySettings.roles);
|
|
33
41
|
}
|
|
@@ -44,6 +52,7 @@ export const getAllRoleAssignments = (querySettings) => __awaiter(void 0, void 0
|
|
|
44
52
|
url.searchParams.set('sort_by', querySettings.sortBy);
|
|
45
53
|
url.searchParams.set('order', querySettings.order);
|
|
46
54
|
}
|
|
55
|
+
// The endpoint defaults `assignments_limit` to 3; set it only to change that default.
|
|
47
56
|
url.searchParams.set('page_size', querySettings.pageSize.toString());
|
|
48
57
|
url.searchParams.set('page', (querySettings.pageIndex + 1).toString());
|
|
49
58
|
const { data } = yield getAuthenticatedHttpClient().get(url);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/authz-module/data/api.ts"],"names":[],"mappings":";;;;;;;;;AAIA,OAAO,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AA4G5C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,IAAkC,EACS,EAAE;IAC7C,MAAM,GAAG,GAAG,MAAM,0BAA0B,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,4BAA4B,CAAC,EAAE,IAAI,CAAC,CAAC;IAClG,OAAO,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACn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AAC;IACD,IAAI,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,MAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,KAAK,CAAA,EAAE,CAAC;QAClD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;QACtD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,KAAK,KAAI,EAAE,CAAC,CAAC;IAC5D,CAAC;IACD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,CAAA,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,QAAQ,0CAAE,QAAQ,EAAE,KAAI,EAAE,CAAC,CAAC;IAC7E,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,SAAS,mCAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IAE/E,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,0BAA0B,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7D,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC,CAAA,CAAC","sourcesContent":["import {\n Org, Scope,\n UserRole,\n} from '@src/types';\nimport { camelCaseObject, getAuthenticatedHttpClient } from '@openedx/frontend-base';\nimport { getApiUrl } from '@src/data/utils';\n\nexport interface QuerySettings {\n roles: string | null;\n scopes: string | null;\n organizations: string | null;\n search: string | null;\n order: string | null;\n sortBy: string | null;\n pageSize: number;\n pageIndex: number;\n}\n\nexport interface GetUserAssignmentsResponse {\n results: UserRole[];\n count: number;\n next: string | null;\n previous: string | null;\n}\n\nexport interface RevokeUserRolesRequest {\n users: string;\n role: string;\n scope: string;\n querySettings?: QuerySettings;\n}\n\nexport interface DeleteRevokeUserRolesResponse {\n completed: {\n userIdentifiers: string;\n status: string;\n }[];\n errors: {\n userIdentifiers: string;\n error: string;\n }[];\n}\n\nexport interface PutAssignTeamMembersRoleResponse {\n completed: { userIdentifier: string; status: string }[];\n errors: { userIdentifier: string; scope: string; error: string }[];\n}\n\nexport interface AssignTeamMembersRoleRequest {\n users: string[];\n role: string;\n scopes: string[];\n}\n\nexport interface GetAllRoleAssignmentsResponse {\n results: UserRole[];\n count: number;\n next: string | null;\n previous: string | null;\n}\n\nexport interface GetOrgsResponse {\n count: number;\n next: string | null;\n previous: string | null;\n results: Org[];\n}\n\nexport interface GetScopesResponse {\n count: number;\n next: string | null;\n previous: string | null;\n results: Scope[];\n}\nexport interface ValidateUsersRequest {\n users: string[];\n}\n\nexport interface ValidateUsersResponse {\n validUsers: string[];\n invalidUsers: string[];\n summary: {\n total: number;\n validCount: number;\n invalidCount: number;\n };\n}\n\nexport interface GetScopesParams {\n scopeType?: string;\n search?: string;\n orgs?: string[];\n page?: number;\n pageSize?: number;\n managementPermissionOnly?: boolean;\n}\n\nexport interface WaffleFlagOverrides {\n on: string[];\n off: string[];\n}\n\n/**\n * Enablement state of the course-authoring waffle flag across scopes.\n * `orgOverrides`/`courseOverrides` list the org short names / course ids whose\n * override differs from `global` (explicitly forced `on` or `off`).\n */\nexport interface CourseAuthoringFlagStates {\n global: boolean;\n orgOverrides: WaffleFlagOverrides;\n courseOverrides: WaffleFlagOverrides;\n}\n\nexport const assignTeamMembersRole = async (\n data: AssignTeamMembersRoleRequest,\n): Promise<PutAssignTeamMembersRoleResponse> => {\n const res = await getAuthenticatedHttpClient().put(getApiUrl('/api/authz/v1/roles/users/'), data);\n return camelCaseObject(res.data);\n};\n\nexport const validateUsers = async (\n data: ValidateUsersRequest,\n): Promise<ValidateUsersResponse> => {\n const res = await getAuthenticatedHttpClient().post(\n getApiUrl('/api/authz/v1/users/validate/'),\n data,\n );\n return camelCaseObject(res.data);\n};\n\nexport const revokeUserRoles = async (\n data: RevokeUserRolesRequest,\n): Promise<DeleteRevokeUserRolesResponse> => {\n const url = new URL(getApiUrl('/api/authz/v1/roles/users/'));\n url.searchParams.append('users', data.users);\n url.searchParams.append('role', data.role);\n url.searchParams.append('scope', data.scope);\n\n // If this is not transformed to string, it shows a 404 with the token CSRF acquisition request\n const res = await getAuthenticatedHttpClient().delete(url.toString());\n return camelCaseObject(res.data);\n};\n\nexport const getAllRoleAssignments = async (querySettings: QuerySettings): Promise<GetAllRoleAssignmentsResponse> => {\n const url = new URL(getApiUrl('/api/authz/v1/assignments/'));\n\n if (querySettings.roles) {\n url.searchParams.set('roles', querySettings.roles);\n }\n if (querySettings.scopes) {\n url.searchParams.set('scopes', querySettings.scopes);\n }\n if (querySettings.organizations) {\n url.searchParams.set('orgs', querySettings.organizations);\n }\n if (querySettings.search) {\n url.searchParams.set('search', querySettings.search);\n }\n if (querySettings.sortBy && querySettings.order) {\n url.searchParams.set('sort_by', querySettings.sortBy);\n url.searchParams.set('order', querySettings.order);\n }\n url.searchParams.set('page_size', querySettings.pageSize.toString());\n url.searchParams.set('page', (querySettings.pageIndex + 1).toString());\n\n const { data } = await getAuthenticatedHttpClient().get(url);\n return camelCaseObject(data);\n};\n\nexport const getOrgs = async (search?: string, page?: number, pageSize?: number): Promise<GetOrgsResponse> => {\n const url = new URL(getApiUrl('/api/authz/v1/orgs/'));\n if (search !== undefined) {\n url.searchParams.set('search', search);\n }\n if (page !== undefined) {\n url.searchParams.set('page', page.toString());\n }\n if (pageSize !== undefined) {\n url.searchParams.set('page_size', pageSize.toString());\n }\n const { data } = await getAuthenticatedHttpClient().get(url);\n return camelCaseObject(data);\n};\n\nexport const getScopes = async (params: GetScopesParams): Promise<GetScopesResponse> => {\n const url = new URL(getApiUrl('/api/authz/v1/scopes/'));\n if (params.search) url.searchParams.set('search', params.search);\n if (params.scopeType) url.searchParams.set('scope_type', params.scopeType);\n if (params.orgs?.length) url.searchParams.set('orgs', params.orgs.join(','));\n if (params.managementPermissionOnly) url.searchParams.set('management_permission_only', 'true');\n url.searchParams.set('page', (params.page ?? 1).toString());\n url.searchParams.set('page_size', (params.pageSize ?? 10).toString());\n const { data } = await getAuthenticatedHttpClient().get(url);\n return camelCaseObject(data);\n};\n\nexport const getCourseAuthoringFlagStates = async (): Promise<CourseAuthoringFlagStates> => {\n const { data } = await getAuthenticatedHttpClient().get(getApiUrl('/api/authz/v1/waffle-flag-states/'));\n return camelCaseObject(data);\n};\n\nexport const getUserAssignedRoles = async (username?: string, querySettings?: QuerySettings): Promise<GetUserAssignmentsResponse> => {\n const url = new URL(getApiUrl(`/api/authz/v1/users/${username}/assignments/`));\n\n if (querySettings?.roles) {\n url.searchParams.set('roles', querySettings.roles);\n }\n if (querySettings?.organizations) {\n url.searchParams.set('orgs', querySettings.organizations);\n }\n if (querySettings?.search) {\n url.searchParams.set('search', querySettings.search);\n }\n if (querySettings?.sortBy && querySettings?.order) {\n url.searchParams.set('sort_by', querySettings.sortBy);\n url.searchParams.set('order', querySettings?.order || '');\n }\n url.searchParams.set('page_size', querySettings?.pageSize?.toString() || '');\n url.searchParams.set('page', ((querySettings?.pageIndex ?? 0) + 1).toString());\n\n const { data } = await getAuthenticatedHttpClient().get(url);\n return camelCaseObject(data);\n};\n"]}
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/authz-module/data/api.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AA4G5C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,IAAkC,EACS,EAAE;IAC7C,MAAM,GAAG,GAAG,MAAM,0BAA0B,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,4BAA4B,CAAC,EAAE,IAAI,CAAC,CAAC;IAClG,OAAO,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACnC,CA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AC,MAAM,CAAC,CAAC;IACvD,CAAC;IACD,IAAI,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,MAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,KAAK,CAAA,EAAE,CAAC;QAClD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;QACtD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,KAAK,KAAI,EAAE,CAAC,CAAC;IAC5D,CAAC;IACD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,CAAA,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,QAAQ,0CAAE,QAAQ,EAAE,KAAI,EAAE,CAAC,CAAC;IAC7E,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,SAAS,mCAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IAE/E,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,0BAA0B,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7D,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC,CAAA,CAAC","sourcesContent":["import {\n Org, Scope, TeamMember, UserRole,\n} from '@src/types';\nimport { camelCaseObject, getAuthenticatedHttpClient } from '@openedx/frontend-base';\nimport { getApiUrl } from '@src/data/utils';\n\nexport interface QuerySettings {\n roles: string | null;\n scopes: string | null;\n organizations: string | null;\n search: string | null;\n order: string | null;\n sortBy: string | null;\n pageSize: number;\n pageIndex: number;\n}\n\nexport interface GetUserAssignmentsResponse {\n results: UserRole[];\n count: number;\n next: string | null;\n previous: string | null;\n}\n\nexport interface RevokeUserRolesRequest {\n users: string;\n role: string;\n scope: string;\n querySettings?: QuerySettings;\n}\n\nexport interface DeleteRevokeUserRolesResponse {\n completed: {\n userIdentifiers: string;\n status: string;\n }[];\n errors: {\n userIdentifiers: string;\n error: string;\n }[];\n}\n\nexport interface PutAssignTeamMembersRoleResponse {\n completed: { userIdentifier: string; status: string }[];\n errors: { userIdentifier: string; scope: string; error: string }[];\n}\n\nexport interface AssignTeamMembersRoleRequest {\n users: string[];\n role: string;\n scopes: string[];\n}\n\nexport interface GetTeamMembersAssignmentsResponse {\n results: TeamMember[];\n count: number;\n next: string | null;\n previous: string | null;\n}\n\nexport interface GetOrgsResponse {\n count: number;\n next: string | null;\n previous: string | null;\n results: Org[];\n}\n\nexport interface GetScopesResponse {\n count: number;\n next: string | null;\n previous: string | null;\n results: Scope[];\n}\nexport interface ValidateUsersRequest {\n users: string[];\n}\n\nexport interface ValidateUsersResponse {\n validUsers: string[];\n invalidUsers: string[];\n summary: {\n total: number;\n validCount: number;\n invalidCount: number;\n };\n}\n\nexport interface GetScopesParams {\n scopeType?: string;\n search?: string;\n orgs?: string[];\n page?: number;\n pageSize?: number;\n managementPermissionOnly?: boolean;\n}\n\nexport interface WaffleFlagOverrides {\n on: string[];\n off: string[];\n}\n\n/**\n * Enablement state of the course-authoring waffle flag across scopes.\n * `orgOverrides`/`courseOverrides` list the org short names / course ids whose\n * override differs from `global` (explicitly forced `on` or `off`).\n */\nexport interface CourseAuthoringFlagStates {\n global: boolean;\n orgOverrides: WaffleFlagOverrides;\n courseOverrides: WaffleFlagOverrides;\n}\n\nexport const assignTeamMembersRole = async (\n data: AssignTeamMembersRoleRequest,\n): Promise<PutAssignTeamMembersRoleResponse> => {\n const res = await getAuthenticatedHttpClient().put(getApiUrl('/api/authz/v1/roles/users/'), data);\n return camelCaseObject(res.data);\n};\n\nexport const validateUsers = async (\n data: ValidateUsersRequest,\n): Promise<ValidateUsersResponse> => {\n const res = await getAuthenticatedHttpClient().post(\n getApiUrl('/api/authz/v1/users/validate/'),\n data,\n );\n return camelCaseObject(res.data);\n};\n\nexport const revokeUserRoles = async (\n data: RevokeUserRolesRequest,\n): Promise<DeleteRevokeUserRolesResponse> => {\n const url = new URL(getApiUrl('/api/authz/v1/roles/users/'));\n url.searchParams.append('users', data.users);\n url.searchParams.append('role', data.role);\n url.searchParams.append('scope', data.scope);\n\n // If this is not transformed to string, it shows a 404 with the token CSRF acquisition request\n const res = await getAuthenticatedHttpClient().delete(url.toString());\n return camelCaseObject(res.data);\n};\n\n/**\n * Fetches team members grouped by user: one entry per user carrying the first few of\n * their role assignments plus `assignmentCount`, the number behind that slice.\n *\n * The role, org and scope filters apply to assignments before they are grouped, so they\n * decide both which users come back and which of each user's assignments are listed and\n * counted.\n */\nexport const getTeamMembersAssignments = async (querySettings: QuerySettings): Promise<GetTeamMembersAssignmentsResponse> => {\n const url = new URL(getApiUrl('/api/authz/v1/users/'));\n\n if (querySettings.roles) {\n url.searchParams.set('roles', querySettings.roles);\n }\n if (querySettings.scopes) {\n url.searchParams.set('scopes', querySettings.scopes);\n }\n if (querySettings.organizations) {\n url.searchParams.set('orgs', querySettings.organizations);\n }\n if (querySettings.search) {\n url.searchParams.set('search', querySettings.search);\n }\n if (querySettings.sortBy && querySettings.order) {\n url.searchParams.set('sort_by', querySettings.sortBy);\n url.searchParams.set('order', querySettings.order);\n }\n // The endpoint defaults `assignments_limit` to 3; set it only to change that default.\n url.searchParams.set('page_size', querySettings.pageSize.toString());\n url.searchParams.set('page', (querySettings.pageIndex + 1).toString());\n\n const { data } = await getAuthenticatedHttpClient().get(url);\n return camelCaseObject(data);\n};\n\nexport const getOrgs = async (search?: string, page?: number, pageSize?: number): Promise<GetOrgsResponse> => {\n const url = new URL(getApiUrl('/api/authz/v1/orgs/'));\n if (search !== undefined) {\n url.searchParams.set('search', search);\n }\n if (page !== undefined) {\n url.searchParams.set('page', page.toString());\n }\n if (pageSize !== undefined) {\n url.searchParams.set('page_size', pageSize.toString());\n }\n const { data } = await getAuthenticatedHttpClient().get(url);\n return camelCaseObject(data);\n};\n\nexport const getScopes = async (params: GetScopesParams): Promise<GetScopesResponse> => {\n const url = new URL(getApiUrl('/api/authz/v1/scopes/'));\n if (params.search) url.searchParams.set('search', params.search);\n if (params.scopeType) url.searchParams.set('scope_type', params.scopeType);\n if (params.orgs?.length) url.searchParams.set('orgs', params.orgs.join(','));\n if (params.managementPermissionOnly) url.searchParams.set('management_permission_only', 'true');\n url.searchParams.set('page', (params.page ?? 1).toString());\n url.searchParams.set('page_size', (params.pageSize ?? 10).toString());\n const { data } = await getAuthenticatedHttpClient().get(url);\n return camelCaseObject(data);\n};\n\nexport const getCourseAuthoringFlagStates = async (): Promise<CourseAuthoringFlagStates> => {\n const { data } = await getAuthenticatedHttpClient().get(getApiUrl('/api/authz/v1/waffle-flag-states/'));\n return camelCaseObject(data);\n};\n\nexport const getUserAssignedRoles = async (username?: string, querySettings?: QuerySettings): Promise<GetUserAssignmentsResponse> => {\n const url = new URL(getApiUrl(`/api/authz/v1/users/${username}/assignments/`));\n\n if (querySettings?.roles) {\n url.searchParams.set('roles', querySettings.roles);\n }\n if (querySettings?.organizations) {\n url.searchParams.set('orgs', querySettings.organizations);\n }\n if (querySettings?.search) {\n url.searchParams.set('search', querySettings.search);\n }\n if (querySettings?.sortBy && querySettings?.order) {\n url.searchParams.set('sort_by', querySettings.sortBy);\n url.searchParams.set('order', querySettings?.order || '');\n }\n url.searchParams.set('page_size', querySettings?.pageSize?.toString() || '');\n url.searchParams.set('page', ((querySettings?.pageIndex ?? 0) + 1).toString());\n\n const { data } = await getAuthenticatedHttpClient().get(url);\n return camelCaseObject(data);\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssignTeamMembersRoleRequest,
|
|
1
|
+
import { AssignTeamMembersRoleRequest, GetTeamMembersAssignmentsResponse, GetOrgsResponse, GetScopesResponse, QuerySettings, RevokeUserRolesRequest, GetUserAssignmentsResponse, ValidateUsersRequest, GetScopesParams, CourseAuthoringFlagStates } from './api';
|
|
2
2
|
/**
|
|
3
3
|
* React Query hook to add new team members to a specific scope or manage the corresponding roles.
|
|
4
4
|
* It provides a mutation function to add users with specified roles to the team or assign new roles.
|
|
@@ -32,18 +32,18 @@ export declare const useRevokeUserRoles: () => import("@tanstack/react-query").U
|
|
|
32
32
|
data: RevokeUserRolesRequest;
|
|
33
33
|
}, unknown>;
|
|
34
34
|
/**
|
|
35
|
-
* React Query hook to fetch
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
35
|
+
* React Query hook to fetch team members grouped by user, with support for
|
|
36
|
+
* filtering, sorting, and pagination. Each result is one user carrying the first few of
|
|
37
|
+
* their role assignments plus how many there are; see `getTeamMembersAssignments` for
|
|
38
|
+
* how filters narrow both.
|
|
39
39
|
*
|
|
40
|
-
* @param querySettings -
|
|
40
|
+
* @param querySettings - Parameters for filtering by roles, scopes,
|
|
41
41
|
* organizations, search term, sorting, and pagination.
|
|
42
42
|
*
|
|
43
43
|
* @example
|
|
44
|
-
* const { data:
|
|
44
|
+
* const { data: teamMembers } = useTeamMembersAssignments({ roles: 'editor', pageSize: 20 });
|
|
45
45
|
*/
|
|
46
|
-
export declare const
|
|
46
|
+
export declare const useTeamMembersAssignments: (querySettings: QuerySettings) => import("@tanstack/react-query").UseQueryResult<GetTeamMembersAssignmentsResponse, Error>;
|
|
47
47
|
/**
|
|
48
48
|
* React Query hook to fetch a paginated, searchable list of organizations.
|
|
49
49
|
* Results are cached for 30 minutes — suitable for both filter dropdowns and full listings.
|
|
@@ -9,10 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { useInfiniteQuery, useMutation, useQuery, useQueryClient, } from '@tanstack/react-query';
|
|
11
11
|
import { appId } from '../../constants';
|
|
12
|
-
import { assignTeamMembersRole,
|
|
12
|
+
import { assignTeamMembersRole, getTeamMembersAssignments, getOrgs, getScopes, revokeUserRoles, getUserAssignedRoles, validateUsers, getCourseAuthoringFlagStates, } from './api';
|
|
13
13
|
const authzQueryKeys = {
|
|
14
14
|
all: [appId, 'authz'],
|
|
15
|
-
|
|
15
|
+
teamMembersAssignments: (querySettings) => [...authzQueryKeys.all, 'teamMembersAssignments', querySettings],
|
|
16
16
|
orgs: (search, page, pageSize) => [...authzQueryKeys.all, 'organizations', search, page, pageSize],
|
|
17
17
|
scopes: (params) => [...authzQueryKeys.all, 'scopes', params],
|
|
18
18
|
userRoles: (username, querySettings) => [...authzQueryKeys.all, 'userRoles', username, querySettings],
|
|
@@ -34,7 +34,7 @@ export const useAssignTeamMembersRole = () => {
|
|
|
34
34
|
if (!error) {
|
|
35
35
|
queryClient.invalidateQueries({ queryKey: [...authzQueryKeys.all, 'userRoles'] });
|
|
36
36
|
queryClient.invalidateQueries({
|
|
37
|
-
predicate: (query) => query.queryKey.includes('
|
|
37
|
+
predicate: (query) => query.queryKey.includes('teamMembersAssignments'),
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
},
|
|
@@ -67,33 +67,28 @@ export const useRevokeUserRoles = () => {
|
|
|
67
67
|
predicate: (query) => query.queryKey.includes('userRoles'),
|
|
68
68
|
});
|
|
69
69
|
queryClient.invalidateQueries({
|
|
70
|
-
predicate: (query) => query.queryKey.includes('
|
|
70
|
+
predicate: (query) => query.queryKey.includes('teamMembersAssignments'),
|
|
71
71
|
});
|
|
72
72
|
},
|
|
73
73
|
});
|
|
74
74
|
};
|
|
75
75
|
/**
|
|
76
|
-
* React Query hook to fetch
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
76
|
+
* React Query hook to fetch team members grouped by user, with support for
|
|
77
|
+
* filtering, sorting, and pagination. Each result is one user carrying the first few of
|
|
78
|
+
* their role assignments plus how many there are; see `getTeamMembersAssignments` for
|
|
79
|
+
* how filters narrow both.
|
|
80
80
|
*
|
|
81
|
-
* @param querySettings -
|
|
81
|
+
* @param querySettings - Parameters for filtering by roles, scopes,
|
|
82
82
|
* organizations, search term, sorting, and pagination.
|
|
83
83
|
*
|
|
84
84
|
* @example
|
|
85
|
-
* const { data:
|
|
85
|
+
* const { data: teamMembers } = useTeamMembersAssignments({ roles: 'editor', pageSize: 20 });
|
|
86
86
|
*/
|
|
87
|
-
export const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
retry: false,
|
|
93
|
-
refetchOnWindowFocus: false,
|
|
94
|
-
});
|
|
95
|
-
return result;
|
|
96
|
-
};
|
|
87
|
+
export const useTeamMembersAssignments = (querySettings) => (useQuery({
|
|
88
|
+
queryKey: authzQueryKeys.teamMembersAssignments(querySettings),
|
|
89
|
+
queryFn: () => getTeamMembersAssignments(querySettings),
|
|
90
|
+
staleTime: 1000 * 60 * 30, // refetch after 30 minutes
|
|
91
|
+
}));
|
|
97
92
|
/**
|
|
98
93
|
* React Query hook to fetch a paginated, searchable list of organizations.
|
|
99
94
|
* Results are cached for 30 minutes — suitable for both filter dropdowns and full listings.
|