@openedx/frontend-app-admin-console 1.0.0-alpha.6 → 1.0.0-alpha.8

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.
Files changed (91) hide show
  1. package/dist/authz-module/authz-home/index.js +21 -2
  2. package/dist/authz-module/authz-home/index.js.map +1 -1
  3. package/dist/authz-module/components/AddRoleButton.js +1 -1
  4. package/dist/authz-module/components/AddRoleButton.js.map +1 -1
  5. package/dist/authz-module/components/AuthZLayout.js +1 -1
  6. package/dist/authz-module/components/AuthZLayout.js.map +1 -1
  7. package/dist/authz-module/components/AuthZTitle.js +5 -3
  8. package/dist/authz-module/components/AuthZTitle.js.map +1 -1
  9. package/dist/authz-module/components/ExpandableButton.d.ts +17 -0
  10. package/dist/authz-module/components/ExpandableButton.js +16 -0
  11. package/dist/authz-module/components/ExpandableButton.js.map +1 -0
  12. package/dist/authz-module/components/TableCells.d.ts +5 -8
  13. package/dist/authz-module/components/TableCells.js +26 -59
  14. package/dist/authz-module/components/TableCells.js.map +1 -1
  15. package/dist/authz-module/components/TableControlBar/MultipleChoiceFilter.d.ts +1 -1
  16. package/dist/authz-module/components/TableControlBar/MultipleChoiceFilter.js +4 -3
  17. package/dist/authz-module/components/TableControlBar/MultipleChoiceFilter.js.map +1 -1
  18. package/dist/authz-module/components/TableControlBar/OrgFilter.js +2 -2
  19. package/dist/authz-module/components/TableControlBar/OrgFilter.js.map +1 -1
  20. package/dist/authz-module/components/TableControlBar/SearchFilter.d.ts +2 -1
  21. package/dist/authz-module/components/TableControlBar/SearchFilter.js +2 -1
  22. package/dist/authz-module/components/TableControlBar/SearchFilter.js.map +1 -1
  23. package/dist/authz-module/components/TableControlBar/TableControlBar.d.ts +4 -1
  24. package/dist/authz-module/components/TableControlBar/TableControlBar.js +24 -24
  25. package/dist/authz-module/components/TableControlBar/TableControlBar.js.map +1 -1
  26. package/dist/authz-module/components/TableControlBar/types.d.ts +1 -0
  27. package/dist/authz-module/components/TableControlBar/types.js.map +1 -1
  28. package/dist/authz-module/components/TableFooter/TableFooter.d.ts +14 -1
  29. package/dist/authz-module/components/TableFooter/TableFooter.js +3 -2
  30. package/dist/authz-module/components/TableFooter/TableFooter.js.map +1 -1
  31. package/dist/authz-module/components/constants.d.ts +1 -0
  32. package/dist/authz-module/components/constants.js +2 -1
  33. package/dist/authz-module/components/constants.js.map +1 -1
  34. package/dist/authz-module/components/messages.d.ts +0 -5
  35. package/dist/authz-module/components/messages.js +2 -7
  36. package/dist/authz-module/components/messages.js.map +1 -1
  37. package/dist/authz-module/constants.d.ts +14 -6
  38. package/dist/authz-module/constants.js +23 -6
  39. package/dist/authz-module/constants.js.map +1 -1
  40. package/dist/authz-module/data/api.d.ts +12 -4
  41. package/dist/authz-module/data/api.js +11 -2
  42. package/dist/authz-module/data/api.js.map +1 -1
  43. package/dist/authz-module/data/hooks.d.ts +8 -8
  44. package/dist/authz-module/data/hooks.js +15 -20
  45. package/dist/authz-module/data/hooks.js.map +1 -1
  46. package/dist/authz-module/hooks/useExclusiveRowExpansion.d.ts +7 -0
  47. package/dist/authz-module/hooks/useExclusiveRowExpansion.js +24 -0
  48. package/dist/authz-module/hooks/useExclusiveRowExpansion.js.map +1 -0
  49. package/dist/authz-module/index.scss +120 -6
  50. package/dist/authz-module/messages.d.ts +23 -0
  51. package/dist/authz-module/messages.js +18 -0
  52. package/dist/authz-module/messages.js.map +1 -1
  53. package/dist/authz-module/role-assignation-wizard/hooks/useScopeListData.js.map +1 -1
  54. package/dist/authz-module/team-members/TeamMembersTable.js +55 -17
  55. package/dist/authz-module/team-members/TeamMembersTable.js.map +1 -1
  56. package/dist/authz-module/team-members/components/AssignedRolesCell.d.ts +20 -0
  57. package/dist/authz-module/team-members/components/AssignedRolesCell.js +54 -0
  58. package/dist/authz-module/team-members/components/AssignedRolesCell.js.map +1 -0
  59. package/dist/authz-module/team-members/components/MoreRolesToggle.d.ts +14 -0
  60. package/dist/authz-module/team-members/components/MoreRolesToggle.js +25 -0
  61. package/dist/authz-module/team-members/components/MoreRolesToggle.js.map +1 -0
  62. package/dist/authz-module/team-members/components/TeamMemberCells.d.ts +17 -0
  63. package/dist/authz-module/team-members/components/TeamMemberCells.js +21 -0
  64. package/dist/authz-module/team-members/components/TeamMemberCells.js.map +1 -0
  65. package/dist/authz-module/team-members/components/TeamMemberViewActionCell.d.ts +18 -0
  66. package/dist/authz-module/team-members/components/TeamMemberViewActionCell.js +42 -0
  67. package/dist/authz-module/team-members/components/TeamMemberViewActionCell.js.map +1 -0
  68. package/dist/authz-module/team-members/components/UserAssignmentsSubTable.d.ts +16 -0
  69. package/dist/authz-module/team-members/components/UserAssignmentsSubTable.js +74 -0
  70. package/dist/authz-module/team-members/components/UserAssignmentsSubTable.js.map +1 -0
  71. package/dist/authz-module/team-members/index.d.ts +1 -0
  72. package/dist/authz-module/team-members/index.js +2 -0
  73. package/dist/authz-module/team-members/index.js.map +1 -0
  74. package/dist/authz-module/team-members/messages.d.ts +56 -1
  75. package/dist/authz-module/team-members/messages.js +59 -4
  76. package/dist/authz-module/team-members/messages.js.map +1 -1
  77. package/dist/authz-module/utils.d.ts +6 -0
  78. package/dist/authz-module/utils.js +12 -10
  79. package/dist/authz-module/utils.js.map +1 -1
  80. package/dist/components/LoadingPage.d.ts +3 -0
  81. package/dist/components/LoadingPage.js +9 -1
  82. package/dist/components/LoadingPage.js.map +1 -1
  83. package/dist/components/messages.d.ts +8 -0
  84. package/dist/components/messages.js +10 -0
  85. package/dist/components/messages.js.map +1 -0
  86. package/dist/types.d.ts +29 -20
  87. package/dist/types.js.map +1 -1
  88. package/package.json +1 -1
  89. package/dist/authz-module/components/ViewMoreLink.d.ts +0 -8
  90. package/dist/authz-module/components/ViewMoreLink.js +0 -8
  91. package/dist/authz-module/components/ViewMoreLink.js.map +0 -1
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Form, Icon, } from '@openedx/paragon';
3
3
  import { Search } from '@openedx/paragon/icons';
4
- const SearchFilter = ({ filterValue, setFilter, placeholder, }) => (_jsx(Form.Group, { className: "m-0", children: _jsx(Form.Control, { className: "mw-xs mr-0", trailingElement: _jsx(Icon, { src: Search }), value: filterValue || '', type: "text", onChange: e => {
4
+ import { validateSizeFormControl } from '../../utils';
5
+ const SearchFilter = ({ filterValue, setFilter, placeholder, size = 'sm' }) => (_jsx(Form.Group, { className: "m-0", size: validateSizeFormControl(size), children: _jsx(Form.Control, { className: "mw-xs mr-0", trailingElement: _jsx(Icon, { src: Search }), value: filterValue || '', type: "text", onChange: e => {
5
6
  setFilter(e.target.value || undefined); // Set undefined to remove the filter entirely
6
7
  }, placeholder: placeholder }) }));
7
8
  export default SearchFilter;
@@ -1 +1 @@
1
- {"version":3,"file":"SearchFilter.js","sourceRoot":"","sources":["../../../../src/authz-module/components/TableControlBar/SearchFilter.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,IAAI,EACJ,IAAI,GACL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAQhD,MAAM,YAAY,GAAG,CAAC,EACpB,WAAW,EAAE,SAAS,EAAE,WAAW,GACjB,EAAE,EAAE,CAAC,CACvB,KAAC,IAAI,CAAC,KAAK,IAAC,SAAS,EAAC,KAAK,YACzB,KAAC,IAAI,CAAC,OAAO,IACX,SAAS,EAAC,YAAY,EACtB,eAAe,EAAE,KAAC,IAAI,IAAC,GAAG,EAAE,MAAM,GAAI,EACtC,KAAK,EAAE,WAAW,IAAI,EAAE,EACxB,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,CAAC,CAAC,EAAE;YACZ,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,SAAS,CAAC,CAAC,CAAC,8CAA8C;QACxF,CAAC,EACD,WAAW,EAAE,WAAW,GACxB,GACS,CACd,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import {\n Form,\n Icon,\n} from '@openedx/paragon';\nimport { Search } from '@openedx/paragon/icons';\n\ninterface SearchFilterProps {\n filterValue: string;\n setFilter: (value: string) => void;\n placeholder: string;\n}\n\nconst SearchFilter = ({\n filterValue, setFilter, placeholder,\n}: SearchFilterProps) => (\n <Form.Group className=\"m-0\">\n <Form.Control\n className=\"mw-xs mr-0\"\n trailingElement={<Icon src={Search} />}\n value={filterValue || ''}\n type=\"text\"\n onChange={e => {\n setFilter(e.target.value || undefined); // Set undefined to remove the filter entirely\n }}\n placeholder={placeholder}\n />\n </Form.Group>\n);\n\nexport default SearchFilter;\n"]}
1
+ {"version":3,"file":"SearchFilter.js","sourceRoot":"","sources":["../../../../src/authz-module/components/TableControlBar/SearchFilter.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,IAAI,EACJ,IAAI,GACL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AASlE,MAAM,YAAY,GAAG,CAAC,EACpB,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,GAAG,IAAI,EAC9B,EAAE,EAAE,CAAC,CACvB,KAAC,IAAI,CAAC,KAAK,IAAC,SAAS,EAAC,KAAK,EAAC,IAAI,EAAE,uBAAuB,CAAC,IAAI,CAAC,YAC7D,KAAC,IAAI,CAAC,OAAO,IACX,SAAS,EAAC,YAAY,EACtB,eAAe,EAAE,KAAC,IAAI,IAAC,GAAG,EAAE,MAAM,GAAI,EACtC,KAAK,EAAE,WAAW,IAAI,EAAE,EACxB,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,CAAC,CAAC,EAAE;YACZ,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,SAAS,CAAC,CAAC,CAAC,8CAA8C;QACxF,CAAC,EACD,WAAW,EAAE,WAAW,GACxB,GACS,CACd,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import {\n Form,\n Icon,\n} from '@openedx/paragon';\nimport { Search } from '@openedx/paragon/icons';\nimport { validateSizeFormControl } from '@src/authz-module/utils';\n\ninterface SearchFilterProps {\n filterValue: string;\n setFilter: (value: string) => void;\n placeholder: string;\n size?: 'sm' | 'md' | 'lg';\n}\n\nconst SearchFilter = ({\n filterValue, setFilter, placeholder, size = 'sm'\n}: SearchFilterProps) => (\n <Form.Group className=\"m-0\" size={validateSizeFormControl(size)}>\n <Form.Control\n className=\"mw-xs mr-0\"\n trailingElement={<Icon src={Search} />}\n value={filterValue || ''}\n type=\"text\"\n onChange={e => {\n setFilter(e.target.value || undefined); // Set undefined to remove the filter entirely\n }}\n placeholder={placeholder}\n />\n </Form.Group>\n);\n\nexport default SearchFilter;\n"]}
@@ -1,5 +1,8 @@
1
+ import { type ReactNode } from 'react';
1
2
  interface TableControlBarProps {
2
3
  onFilterChange?: (filters: string[]) => void;
4
+ /** Optional count rendered right-aligned on the filter row, e.g. "Showing 10 users of 100." */
5
+ countLabel?: ReactNode;
3
6
  }
4
- declare const TableControlBar: ({ onFilterChange }: TableControlBarProps) => import("react").JSX.Element;
7
+ declare const TableControlBar: ({ onFilterChange, countLabel }: TableControlBarProps) => import("react").JSX.Element;
5
8
  export default TableControlBar;
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useContext, useEffect, useState } from 'react';
2
+ import { useContext, useEffect, useState, } from 'react';
3
3
  import { useIntl } from '@openedx/frontend-base';
4
4
  import { DataTableContext, Stack, TextFilter, Button, Chip, Alert, Icon, } from '@openedx/paragon';
5
- import { Business, Close, LocationOn, Person, Warning, } from '@openedx/paragon/icons';
5
+ import { AccountBalance, Close, LocationOn, Person, Warning, } from '@openedx/paragon/icons';
6
6
  import { MAX_TABLE_FILTERS_APPLIED } from '../../constants';
7
7
  import MultipleChoiceFilter from './MultipleChoiceFilter';
8
8
  import SearchFilter from './SearchFilter';
@@ -12,7 +12,7 @@ import OrgFilter from './OrgFilter';
12
12
  import ScopesFilter from './ScopesFilter';
13
13
  const FILTER_CHIPS_ICONS = {
14
14
  role: Person,
15
- organization: Business,
15
+ organization: AccountBalance,
16
16
  scope: LocationOn,
17
17
  };
18
18
  const FILTER_GROUP_TO_ID = {
@@ -20,7 +20,7 @@ const FILTER_GROUP_TO_ID = {
20
20
  organization: 'org',
21
21
  scope: 'scope',
22
22
  };
23
- const TableControlBar = ({ onFilterChange }) => {
23
+ const TableControlBar = ({ onFilterChange, countLabel }) => {
24
24
  const intl = useIntl();
25
25
  // applied filters in the order they were selected by the user, to display on the control bar as chips
26
26
  const [chronologicalFilters, setChronologicalFilters] = useState([]);
@@ -74,26 +74,26 @@ const TableControlBar = ({ onFilterChange }) => {
74
74
  setAllFilters([]);
75
75
  setChronologicalFilters([]);
76
76
  };
77
- return (_jsxs("div", { className: "authz-table-control-bar pgn__data-table-status-bar", children: [_jsx(Stack, { className: "mb-2 flex-wrap", gap: 2, direction: "horizontal", children: availableFilters.map((column) => {
78
- var _a;
79
- const { Filter } = column;
80
- if (Filter === RolesFilter) {
81
- return (_jsx(RolesFilter, Object.assign({}, column, { setFilter: handleSetFilters(column.setFilter), disabled: filtersLimitReached }), column.id || column.accessor));
82
- }
83
- if (Filter === OrgFilter) {
84
- return (_jsx(OrgFilter, Object.assign({}, column, { setFilter: handleSetFilters(column.setFilter), disabled: filtersLimitReached }), column.id || column.accessor));
85
- }
86
- if (Filter === MultipleChoiceFilter) {
87
- return (_jsx(MultipleChoiceFilter, Object.assign({}, column, { setFilter: handleSetFilters(column.setFilter), disabled: filtersLimitReached }), column.id || column.accessor));
88
- }
89
- if (Filter === ScopesFilter) {
90
- return (_jsx(ScopesFilter, Object.assign({}, column, { setFilter: handleSetFilters(column.setFilter), disabled: filtersLimitReached, filterValue: ((_a = state.filters.find(filter => filter.id === 'scope')) === null || _a === void 0 ? void 0 : _a.value) || null }), column.id || column.accessor));
91
- }
92
- if (Filter === TextFilter) {
93
- return (_jsx(SearchFilter, { filterValue: column.filterValue, setFilter: column.setFilter, placeholder: getSearchPlaceholder() }, column.id || column.accessor));
94
- }
95
- return null;
96
- }) }), chronologicalFilters.length > 0 && (_jsxs(Stack, { gap: 1, direction: "horizontal", className: "flex-wrap mb-2", children: [_jsx("span", { children: intl.formatMessage(messages['authz.table.controlbar.filterby.label']) }), chronologicalFilters.map((filter) => (_jsx(Chip, { iconBefore: FILTER_CHIPS_ICONS[filter.groupName || ''], iconAfter: Close, onIconAfterClick: () => handleCloseFilter(filter.groupName, filter.value), children: filter.displayName }, filter.value))), chronologicalFilters.length > 1 && (_jsx(Button, { className: "py-0", variant: "link", onClick: clearAllFilters, children: intl.formatMessage(messages['authz.table.controlbar.clearFilters']) }))] })), filtersLimitReached && (_jsx(Alert, { variant: "warning", className: "mb-2", children: _jsxs("span", { className: "d-flex flex-row", children: [_jsx(Icon, { src: Warning, className: "text-warning-400 mr-2" }), intl.formatMessage(messages['authz.table.controlbar.filters.limit.reached'])] }) }))] }));
77
+ return (_jsxs("div", { className: "authz-table-control-bar pgn__data-table-status-bar", children: [_jsxs(Stack, { className: "mb-2 flex-wrap", gap: 2, direction: "horizontal", children: [availableFilters.map((column) => {
78
+ var _a;
79
+ const { Filter } = column;
80
+ if (Filter === RolesFilter) {
81
+ return (_jsx(RolesFilter, Object.assign({}, column, { setFilter: handleSetFilters(column.setFilter), disabled: filtersLimitReached }), column.id || column.accessor));
82
+ }
83
+ if (Filter === OrgFilter) {
84
+ return (_jsx(OrgFilter, Object.assign({}, column, { setFilter: handleSetFilters(column.setFilter), disabled: filtersLimitReached }), column.id || column.accessor));
85
+ }
86
+ if (Filter === MultipleChoiceFilter) {
87
+ return (_jsx(MultipleChoiceFilter, Object.assign({}, column, { setFilter: handleSetFilters(column.setFilter), disabled: filtersLimitReached }), column.id || column.accessor));
88
+ }
89
+ if (Filter === ScopesFilter) {
90
+ return (_jsx(ScopesFilter, Object.assign({}, column, { setFilter: handleSetFilters(column.setFilter), disabled: filtersLimitReached, filterValue: ((_a = state.filters.find(filter => filter.id === 'scope')) === null || _a === void 0 ? void 0 : _a.value) || null }), column.id || column.accessor));
91
+ }
92
+ if (Filter === TextFilter) {
93
+ return (_jsx(SearchFilter, { filterValue: column.filterValue, setFilter: column.setFilter, placeholder: getSearchPlaceholder() }, column.id || column.accessor));
94
+ }
95
+ return null;
96
+ }), countLabel && _jsx("span", { className: "ml-auto text-gray-500", children: countLabel })] }), chronologicalFilters.length > 0 && (_jsxs(Stack, { gap: 1, direction: "horizontal", className: "flex-wrap mb-2", children: [_jsx("span", { children: intl.formatMessage(messages['authz.table.controlbar.filterby.label']) }), chronologicalFilters.map((filter) => (_jsx(Chip, { iconBefore: FILTER_CHIPS_ICONS[filter.groupName || ''], iconAfter: Close, onIconAfterClick: () => handleCloseFilter(filter.groupName, filter.value), children: filter.displayName }, filter.value))), chronologicalFilters.length > 1 && (_jsx(Button, { className: "py-0", variant: "link", onClick: clearAllFilters, children: intl.formatMessage(messages['authz.table.controlbar.clearFilters']) }))] })), filtersLimitReached && (_jsx(Alert, { variant: "warning", className: "mb-2", children: _jsxs("span", { className: "d-flex flex-row", children: [_jsx(Icon, { src: Warning, className: "text-warning-400 mr-2" }), intl.formatMessage(messages['authz.table.controlbar.filters.limit.reached'])] }) }))] }));
97
97
  };
98
98
  export default TableControlBar;
99
99
  //# sourceMappingURL=TableControlBar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableControlBar.js","sourceRoot":"","sources":["../../../../src/authz-module/components/TableControlBar/TableControlBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EACL,gBAAgB,EAChB,KAAK,EACL,UAAU,EACV,MAAM,EACN,IAAI,EACJ,KAAK,EACL,IAAI,GACL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,QAAQ,EAAE,KAAK,EAA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,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,YAExE,MAAM,CAAC,WAAW,IALd,MAAM,CAAC,KAAK,CAMZ,CACR,CAAC,EACD,oBAAoB,CAAC,MAAM,GAAG,CAAC,IAAI,CAClC,KAAC,MAAM,IAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAC,MAAM,EAAC,OAAO,EAAE,eAAe,YAC7D,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,qCAAqC,CAAC,CAAC,GAC7D,CACV,IACK,CACT,EACC,mBAAmB,IAAI,CACvB,KAAC,KAAK,IAAC,OAAO,EAAC,SAAS,EAAC,SAAS,EAAC,MAAM,YACvC,gBAAM,SAAS,EAAC,iBAAiB,aAC/B,KAAC,IAAI,IAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAC,uBAAuB,GAAG,EACvD,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,8CAA8C,CAAC,CAAC,IACxE,GACD,CACT,IAEG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { useContext, useEffect, useState } from 'react';\nimport { useIntl } from '@openedx/frontend-base';\nimport {\n DataTableContext,\n Stack,\n TextFilter,\n Button,\n Chip,\n Alert,\n Icon,\n} from '@openedx/paragon';\nimport {\n Business, Close, LocationOn, Person,\n Warning,\n} from '@openedx/paragon/icons';\n\nimport { MAX_TABLE_FILTERS_APPLIED } from '@src/authz-module/constants';\nimport MultipleChoiceFilter from './MultipleChoiceFilter';\nimport SearchFilter from './SearchFilter';\nimport messages from '@src/authz-module/components/messages';\nimport RolesFilter from './RolesFilter';\nimport OrgFilter from './OrgFilter';\nimport ScopesFilter from './ScopesFilter';\nimport { FilterChoice } from './types';\n\nconst FILTER_CHIPS_ICONS = {\n role: Person,\n organization: Business,\n scope: LocationOn,\n};\n\nconst FILTER_GROUP_TO_ID = {\n role: 'role',\n organization: 'org',\n scope: 'scope',\n};\n\ninterface TableControlBarProps {\n onFilterChange?: (filters: string[]) => void;\n}\n\nconst TableControlBar = ({ onFilterChange }: TableControlBarProps) => {\n const intl = useIntl();\n // applied filters in the order they were selected by the user, to display on the control bar as chips\n const [chronologicalFilters, setChronologicalFilters] = useState<FilterChoice[]>([]);\n const [filtersLimitReached, setFiltersLimitReached] = useState(false);\n const {\n columns,\n setAllFilters,\n state,\n // @ts-expect-error - Paragon's DataTableContext is not typed\n } = useContext<DataTableContext>(DataTableContext);\n\n useEffect(() => {\n if (state.filters.length > 0) {\n const formattedInitialFilters = state.filters.map((filter) => ({\n groupName: filter.id,\n value: filter.value[0] || '',\n displayName: filter.value[0] || '',\n }));\n setChronologicalFilters(formattedInitialFilters);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n setFiltersLimitReached(chronologicalFilters.length >= MAX_TABLE_FILTERS_APPLIED);\n if (onFilterChange) {\n onFilterChange(state.filters.map((filter) => filter.id) || []);\n }\n }, [chronologicalFilters, onFilterChange, state.filters]);\n\n const availableFilters = columns.filter((column) => column.canFilter)\n .sort((a, b) => (a.filterOrder || 0) - (b.filterOrder || 0));\n\n const columnTextFilterHeaders = columns\n .filter((column) => column.Filter === TextFilter)\n .map((column) => column.Header);\n\n const getSearchPlaceholder = () => intl.formatMessage(messages['authz.table.controlbar.search.by.fields'], {\n firstField: columnTextFilterHeaders[0] || '',\n secondField: columnTextFilterHeaders[1] || '',\n });\n\n const handleCloseFilter = (filterName, filterValue) => {\n const actualFilterId = FILTER_GROUP_TO_ID[filterName] || filterName;\n const filterGroup = state.filters.find((filter) => filter.id === actualFilterId);\n const newFilterValue = filterGroup?.value.filter(item => item !== filterValue) || [];\n setAllFilters(state.filters.map(item => (\n item.id !== actualFilterId ? item : { id: item.id, value: newFilterValue })));\n setChronologicalFilters((prevFilters) => prevFilters.filter((filter) => filter.value !== filterValue));\n };\n\n const handleSetFilters = (setFilter) => (allFilters: string[], newFilter: FilterChoice) => {\n setFilter(allFilters);\n setChronologicalFilters((prevFilters) => {\n if (!prevFilters.find((filter) => filter.value === newFilter.value)) {\n return [...prevFilters, newFilter];\n }\n return prevFilters.filter((filter) => filter.value !== newFilter.value);\n });\n };\n\n const clearAllFilters = () => {\n setAllFilters([]);\n setChronologicalFilters([]);\n };\n return (\n <div className=\"authz-table-control-bar pgn__data-table-status-bar\">\n <Stack className=\"mb-2 flex-wrap\" gap={2} direction=\"horizontal\">\n {availableFilters.map((column) => {\n const { Filter } = column;\n if (Filter === RolesFilter) {\n return (\n <RolesFilter\n key={column.id || column.accessor}\n {...column}\n setFilter={handleSetFilters(column.setFilter)}\n disabled={filtersLimitReached}\n />\n );\n }\n if (Filter === OrgFilter) {\n return (\n <OrgFilter\n key={column.id || column.accessor}\n {...column}\n setFilter={handleSetFilters(column.setFilter)}\n disabled={filtersLimitReached}\n />\n );\n }\n if (Filter === MultipleChoiceFilter) {\n return (\n <MultipleChoiceFilter\n key={column.id || column.accessor}\n {...column}\n setFilter={handleSetFilters(column.setFilter)}\n disabled={filtersLimitReached}\n />\n );\n }\n if (Filter === ScopesFilter) {\n return (\n <ScopesFilter\n key={column.id || column.accessor}\n {...column}\n setFilter={handleSetFilters(column.setFilter)}\n disabled={filtersLimitReached}\n filterValue={state.filters.find(filter => filter.id === 'scope')?.value || null}\n />\n );\n }\n\n if (Filter === TextFilter) {\n return (\n <SearchFilter\n key={column.id || column.accessor}\n filterValue={column.filterValue}\n setFilter={column.setFilter}\n placeholder={getSearchPlaceholder()}\n />\n );\n }\n return null;\n })}\n </Stack>\n\n {chronologicalFilters.length > 0 && (\n <Stack gap={1} direction=\"horizontal\" className=\"flex-wrap mb-2\">\n <span>{intl.formatMessage(messages['authz.table.controlbar.filterby.label'])}</span>\n {chronologicalFilters.map((filter) => (\n <Chip\n key={filter.value}\n iconBefore={FILTER_CHIPS_ICONS[filter.groupName || '']}\n iconAfter={Close}\n onIconAfterClick={() => handleCloseFilter(filter.groupName, filter.value)}\n >\n {filter.displayName}\n </Chip>\n ))}\n {chronologicalFilters.length > 1 && (\n <Button className=\"py-0\" variant=\"link\" onClick={clearAllFilters}>\n {intl.formatMessage(messages['authz.table.controlbar.clearFilters'])}\n </Button>\n )}\n </Stack>\n )}\n { filtersLimitReached && (\n <Alert variant=\"warning\" className=\"mb-2\">\n <span className=\"d-flex flex-row\">\n <Icon src={Warning} className=\"text-warning-400 mr-2\" />\n {intl.formatMessage(messages['authz.table.controlbar.filters.limit.reached'])}\n </span>\n </Alert>\n )}\n\n </div>\n );\n};\n\nexport default TableControlBar;\n"]}
1
+ {"version":3,"file":"TableControlBar.js","sourceRoot":"","sources":["../../../../src/authz-module/components/TableControlBar/TableControlBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAAE,SAAS,EAAE,QAAQ,GAChC,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EACL,gBAAgB,EAChB,KAAK,EACL,UAAU,EACV,MAAM,EACN,IAAI,EACJ,KAAK,EACL,IAAI,GACL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,cAAc,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EACzC,OAAO,GACR,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,QAAQ,MAAM,uCAAuC,CAAC;AAC7D,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAG1C,MAAM,kBAAkB,GAAG;IACzB,IAAI,EAAE,MAAM;IACZ,YAAY,EAAE,cAAc;IAC5B,KAAK,EAAE,UAAU;CAClB,CAAC;AAEF,MAAM,kBAAkB,GAAG;IACzB,IAAI,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S,EAAC,SAAS,EAAC,MAAM,YACvC,gBAAM,SAAS,EAAC,iBAAiB,aAC/B,KAAC,IAAI,IAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAC,uBAAuB,GAAG,EACvD,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,8CAA8C,CAAC,CAAC,IACxE,GACD,CACT,IAEG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import {\n useContext, useEffect, useState, type ReactNode,\n} from 'react';\nimport { useIntl } from '@openedx/frontend-base';\nimport {\n DataTableContext,\n Stack,\n TextFilter,\n Button,\n Chip,\n Alert,\n Icon,\n} from '@openedx/paragon';\nimport {\n AccountBalance, Close, LocationOn, Person,\n Warning,\n} from '@openedx/paragon/icons';\n\nimport { MAX_TABLE_FILTERS_APPLIED } from '@src/authz-module/constants';\nimport MultipleChoiceFilter from './MultipleChoiceFilter';\nimport SearchFilter from './SearchFilter';\nimport messages from '@src/authz-module/components/messages';\nimport RolesFilter from './RolesFilter';\nimport OrgFilter from './OrgFilter';\nimport ScopesFilter from './ScopesFilter';\nimport { FilterChoice } from './types';\n\nconst FILTER_CHIPS_ICONS = {\n role: Person,\n organization: AccountBalance,\n scope: LocationOn,\n};\n\nconst FILTER_GROUP_TO_ID = {\n role: 'role',\n organization: 'org',\n scope: 'scope',\n};\n\ninterface TableControlBarProps {\n onFilterChange?: (filters: string[]) => void;\n /** Optional count rendered right-aligned on the filter row, e.g. \"Showing 10 users of 100.\" */\n countLabel?: ReactNode;\n}\n\nconst TableControlBar = ({ onFilterChange, countLabel }: TableControlBarProps) => {\n const intl = useIntl();\n // applied filters in the order they were selected by the user, to display on the control bar as chips\n const [chronologicalFilters, setChronologicalFilters] = useState<FilterChoice[]>([]);\n const [filtersLimitReached, setFiltersLimitReached] = useState(false);\n const {\n columns,\n setAllFilters,\n state,\n // @ts-expect-error - Paragon's DataTableContext is not typed\n } = useContext<DataTableContext>(DataTableContext);\n\n useEffect(() => {\n if (state.filters.length > 0) {\n const formattedInitialFilters = state.filters.map((filter) => ({\n groupName: filter.id,\n value: filter.value[0] || '',\n displayName: filter.value[0] || '',\n }));\n setChronologicalFilters(formattedInitialFilters);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n setFiltersLimitReached(chronologicalFilters.length >= MAX_TABLE_FILTERS_APPLIED);\n if (onFilterChange) {\n onFilterChange(state.filters.map((filter) => filter.id) || []);\n }\n }, [chronologicalFilters, onFilterChange, state.filters]);\n\n const availableFilters = columns.filter((column) => column.canFilter)\n .sort((a, b) => (a.filterOrder || 0) - (b.filterOrder || 0));\n\n const columnTextFilterHeaders = columns\n .filter((column) => column.Filter === TextFilter)\n .map((column) => column.Header);\n\n const getSearchPlaceholder = () => intl.formatMessage(messages['authz.table.controlbar.search.by.fields'], {\n firstField: columnTextFilterHeaders[0] || '',\n secondField: columnTextFilterHeaders[1] || '',\n });\n\n const handleCloseFilter = (filterName, filterValue) => {\n const actualFilterId = FILTER_GROUP_TO_ID[filterName] || filterName;\n const filterGroup = state.filters.find((filter) => filter.id === actualFilterId);\n const newFilterValue = filterGroup?.value.filter(item => item !== filterValue) || [];\n setAllFilters(state.filters.map(item => (\n item.id !== actualFilterId ? item : { id: item.id, value: newFilterValue })));\n setChronologicalFilters((prevFilters) => prevFilters.filter((filter) => filter.value !== filterValue));\n };\n\n const handleSetFilters = (setFilter) => (allFilters: string[], newFilter: FilterChoice) => {\n setFilter(allFilters);\n setChronologicalFilters((prevFilters) => {\n if (!prevFilters.find((filter) => filter.value === newFilter.value)) {\n return [...prevFilters, newFilter];\n }\n return prevFilters.filter((filter) => filter.value !== newFilter.value);\n });\n };\n\n const clearAllFilters = () => {\n setAllFilters([]);\n setChronologicalFilters([]);\n };\n return (\n <div className=\"authz-table-control-bar pgn__data-table-status-bar\">\n <Stack className=\"mb-2 flex-wrap\" gap={2} direction=\"horizontal\">\n {availableFilters.map((column) => {\n const { Filter } = column;\n if (Filter === RolesFilter) {\n return (\n <RolesFilter\n key={column.id || column.accessor}\n {...column}\n setFilter={handleSetFilters(column.setFilter)}\n disabled={filtersLimitReached}\n />\n );\n }\n if (Filter === OrgFilter) {\n return (\n <OrgFilter\n key={column.id || column.accessor}\n {...column}\n setFilter={handleSetFilters(column.setFilter)}\n disabled={filtersLimitReached}\n />\n );\n }\n if (Filter === MultipleChoiceFilter) {\n return (\n <MultipleChoiceFilter\n key={column.id || column.accessor}\n {...column}\n setFilter={handleSetFilters(column.setFilter)}\n disabled={filtersLimitReached}\n />\n );\n }\n if (Filter === ScopesFilter) {\n return (\n <ScopesFilter\n key={column.id || column.accessor}\n {...column}\n setFilter={handleSetFilters(column.setFilter)}\n disabled={filtersLimitReached}\n filterValue={state.filters.find(filter => filter.id === 'scope')?.value || null}\n />\n );\n }\n\n if (Filter === TextFilter) {\n return (\n <SearchFilter\n key={column.id || column.accessor}\n filterValue={column.filterValue}\n setFilter={column.setFilter}\n placeholder={getSearchPlaceholder()}\n />\n );\n }\n return null;\n })}\n {countLabel && <span className=\"ml-auto text-gray-500\">{countLabel}</span>}\n </Stack>\n\n {chronologicalFilters.length > 0 && (\n <Stack gap={1} direction=\"horizontal\" className=\"flex-wrap mb-2\">\n <span>{intl.formatMessage(messages['authz.table.controlbar.filterby.label'])}</span>\n {chronologicalFilters.map((filter) => (\n <Chip\n key={filter.value}\n iconBefore={FILTER_CHIPS_ICONS[filter.groupName || '']}\n iconAfter={Close}\n onIconAfterClick={() => handleCloseFilter(filter.groupName, filter.value)}\n >\n {filter.displayName}\n </Chip>\n ))}\n {chronologicalFilters.length > 1 && (\n <Button className=\"py-0\" variant=\"link\" onClick={clearAllFilters}>\n {intl.formatMessage(messages['authz.table.controlbar.clearFilters'])}\n </Button>\n )}\n </Stack>\n )}\n { filtersLimitReached && (\n <Alert variant=\"warning\" className=\"mb-2\">\n <span className=\"d-flex flex-row\">\n <Icon src={Warning} className=\"text-warning-400 mr-2\" />\n {intl.formatMessage(messages['authz.table.controlbar.filters.limit.reached'])}\n </span>\n </Alert>\n )}\n\n </div>\n );\n};\n\nexport default TableControlBar;\n"]}
@@ -15,4 +15,5 @@ export interface MultipleChoiceFilterProps {
15
15
  onSearchChange?: (value: string) => void;
16
16
  iconSrc?: React.ComponentType | undefined;
17
17
  disabled?: boolean;
18
+ size?: 'sm' | 'md' | 'lg' | 'inline';
18
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/authz-module/components/TableControlBar/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface FilterChoice {\n groupName?: string;\n groupIcon?: React.ComponentType;\n displayName: string;\n value: string;\n description?: string;\n}\n\nexport interface MultipleChoiceFilterProps {\n filterButtonText: string;\n filterChoices: FilterChoice[];\n filterValue: string[] | undefined;\n setFilter: (value: string[], newItem: FilterChoice) => void;\n isGrouped?: boolean;\n isSearchable?: boolean;\n onSearchChange?: (value: string) => void;\n iconSrc?: React.ComponentType | undefined;\n disabled?: boolean;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/authz-module/components/TableControlBar/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface FilterChoice {\n groupName?: string;\n groupIcon?: React.ComponentType;\n displayName: string;\n value: string;\n description?: string;\n}\n\nexport interface MultipleChoiceFilterProps {\n filterButtonText: string;\n filterChoices: FilterChoice[];\n filterValue: string[] | undefined;\n setFilter: (value: string[], newItem: FilterChoice) => void;\n isGrouped?: boolean;\n isSearchable?: boolean;\n onSearchChange?: (value: string) => void;\n iconSrc?: React.ComponentType | undefined;\n disabled?: boolean;\n size?: 'sm' | 'md' | 'lg' | 'inline';\n}\n"]}
@@ -1,2 +1,15 @@
1
- declare const Footer: () => import("react").JSX.Element;
1
+ declare const defaultShowingMessage: {
2
+ id: string;
3
+ defaultMessage: string;
4
+ description: string;
5
+ };
6
+ interface FooterProps {
7
+ /**
8
+ * Overrides the "Showing X of Y." text — used by tables whose rows are not
9
+ * assignments (e.g. the team members table counts users). Receives `pageSize`
10
+ * and `itemCount`.
11
+ */
12
+ showingMessage?: typeof defaultShowingMessage;
13
+ }
14
+ declare const Footer: ({ showingMessage }: FooterProps) => import("react").JSX.Element;
2
15
  export default Footer;
@@ -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 Footer = () => {
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(messages['authz.table.footer.items.showing.text'], { 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
+ return (_jsxs(TableFooter, { children: [_jsx("span", { 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,MAAM,GAAG,GAAG,EAAE;IAClB,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,yBACG,aAAa,CAAC,QAAQ,CAAC,uCAAuC,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,GAClG,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 Footer = () => {\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>\n {formatMessage(messages['authz.table.footer.items.showing.text'], { 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
+ {"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,yBACG,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>\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"]}
@@ -10,4 +10,5 @@ export declare const RESOURCE_ICONS: {
10
10
  COURSE: any;
11
11
  LIBRARY: any;
12
12
  GLOBAL: any;
13
+ ORGANIZATION: any;
13
14
  };
@@ -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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Q,CAAC,wCAAwC,CAAC,CAAC;QACjF,SAAS,EAAE,MAAM;QACjB,WAAW,EAAE,gBAAgB;QAC7B,KAAK,EAAE,gBAAgB;QACvB,WAAW,EAAE,QAAQ;KACtB;IAED;QACE,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,0CAA0C,CAAC,CAAC;QACnF,SAAS,EAAE,YAAY;QACvB,WAAW,EAAE,eAAe;QAC5B,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,SAAS;KACvB;IACD;QACE,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,0CAA0C,CAAC,CAAC;QACnF,SAAS,EAAE,YAAY;QACvB,WAAW,EAAE,gBAAgB;QAC7B,KAAK,EAAE,gBAAgB;QACvB,WAAW,EAAE,SAAS;KACvB;IACD;QACE,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,0CAA0C,CAAC,CAAC;QACnF,SAAS,EAAE,YAAY;QACvB,WAAW,EAAE,qBAAqB;QAClC,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EAAE,SAAS;KACvB;IACD;QACE,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,0CAA0C,CAAC,CAAC;QACnF,SAAS,EAAE,YAAY;QACvB,WAAW,EAAE,cAAc;QAC3B,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,SAAS;KACvB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,QAAQ;CACjB,CAAC","sourcesContent":["import type { IntlShape } from '@openedx/frontend-base';\nimport { 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};\n"]}
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,C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QAAQ,CAAC,0CAA0C,CAAC,CAAC;QACnF,SAAS,EAAE,YAAY;QACvB,WAAW,EAAE,eAAe;QAC5B,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,SAAS;KACvB;IACD;QACE,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,0CAA0C,CAAC,CAAC;QACnF,SAAS,EAAE,YAAY;QACvB,WAAW,EAAE,gBAAgB;QAC7B,KAAK,EAAE,gBAAgB;QACvB,WAAW,EAAE,SAAS;KACvB;IACD;QACE,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,0CAA0C,CAAC,CAAC;QACnF,SAAS,EAAE,YAAY;QACvB,WAAW,EAAE,qBAAqB;QAClC,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EAAE,SAAS;KACvB;IACD;QACE,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,0CAA0C,CAAC,CAAC;QACnF,SAAS,EAAE,YAAY;QACvB,WAAW,EAAE,cAAc;QAC3B,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,SAAS;KACvB;CACF,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 Organizations',
61
- description: 'Label for the "All Organizations" message on the user assignments table when a user has a django managed role assigned.',
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","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,EAAE,6DAA6D;KAC3E;IACD,yBAAyB,EAAE;QACzB,EAAE,EAAE,yBAAyB;QAC7B,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,8CAA8C;KAC5D;IACD,qCAAqC,EAAE;QACrC,EAAE,EAAE,qCAAqC;QACzC,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,iDAAiD;KAC/D;IACD,+BAA+B,EAAE;QAC/B,EAAE,EAAE,+BAA+B;QACnC,cAAc,EAAE,QAAQ;QACxB,WAA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CAAqC,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 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,EAAE,6DAA6D;KAC3E;IACD,yBAAyB,EAAE;QACzB,EAAE,EAAE,yBAAyB;QAC7B,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,8CAA8C;KAC5D;IACD,qCAAqC,EAAE;QACrC,EAAE,EAAE,qCAAqC;QACzC,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,iDAAiD;KAC/D;IACD,+BAA+B,EAAE;QAC/B,EAAE,EAAE,+BAA+B;QACnC,cAAc,EAAE,QAAQ;QACxB,WAAW,EAAE,4CAA4C;KAC1D;IACD,yCAAyC,EAAE;QACzC,EAAE,EAAE,yCAAyC;QAC7C,cAAc,EAAE,yCAAyC;QACzD,WAAW,EAAE,4CAA4C;KAC1D;IACD,uCAAuC,EAAE;QACvC,EAAE,EAAE,uCAAuC;QAC3C,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,uCAAuC;KACrD;IACD,8CAA8C,EAAE;QAC9C,EAAE,EAAE,8CAA8C;QAClD,cAAc,EAAE,2FAA2F;QAC3G,WAAW,EAAE,mEAAmE;KACjF;IACD,8CAA8C,EAAE;QAC9C,EAAE,EAAE,8CAA8C;QAClD,cAAc,EAAE,+BAA+B;QAC/C,WAAW,EAAE,mEAAmE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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,14 +5,22 @@ 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
- export declare const SKELETON_ROWS: {
11
- username: string;
12
- name: string;
13
- email: string;
14
- roles: never[];
15
- }[];
16
24
  /** Absolute base path of the module; src/routes.tsx derives its route prefix from this. */
17
25
  export declare const AUTHZ_HOME_PATH = "/admin-console/authz";
18
26
  /** Segments nested under the authz splat route, relative to AUTHZ_HOME_PATH. */
@@ -23,14 +23,31 @@ 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
- export const SKELETON_ROWS = Array.from({ length: 10 }).map(() => ({
29
- username: 'skeleton',
30
- name: '',
31
- email: '',
32
- roles: [],
33
- }));
34
51
  /** Absolute base path of the module; src/routes.tsx derives its route prefix from this. */
35
52
  export const AUTHZ_HOME_PATH = '/admin-console/authz';
36
53
  /** Segments nested under the authz splat route, relative to AUTHZ_HOME_PATH. */
@@ -1 +1 @@
1
- {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AA;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\nexport const DEFAULT_TOAST_DELAY = 5000;\nexport const RETRY_TOAST_DELAY = 120_000; // 2 minutes\nexport const SKELETON_ROWS = Array.from({ length: 10 }).map(() => ({\n username: 'skeleton',\n name: '',\n email: '',\n roles: [],\n}));\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
+ {"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,K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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 GetAllRoleAssignmentsResponse {
51
- results: UserRole[];
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
- export declare const getAllRoleAssignments: (querySettings: QuerySettings) => Promise<GetAllRoleAssignmentsResponse>;
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
- export const getAllRoleAssignments = (querySettings) => __awaiter(void 0, void 0, void 0, function* () {
30
- const url = new URL(getApiUrl('/api/authz/v1/assignments/'));
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);