@openedx/frontend-app-admin-console 1.0.0-alpha.6 → 1.0.0-alpha.7
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/authz-home/index.js +20 -1
- 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/AuthZTitle.js +5 -3
- 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/TableCells.d.ts +5 -8
- package/dist/authz-module/components/TableCells.js +26 -59
- package/dist/authz-module/components/TableCells.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/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/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 +14 -6
- package/dist/authz-module/constants.js +23 -6
- 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 +120 -2
- 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/hooks/useScopeListData.js.map +1 -1
- package/dist/authz-module/team-members/TeamMembersTable.js +55 -17
- 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 +5 -0
- package/dist/authz-module/utils.js +10 -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/types.d.ts +29 -20
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/authz-module/team-members/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/authz-module/team-members/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,gDAAgD,EAAE;QAChD,EAAE,EAAE,gDAAgD;QACpD,cAAc,EAAE,UAAU;QAC1B,WAAW,EAAE,2CAA2C;KACzD;IACD,2CAA2C,EAAE;QAC3C,EAAE,EAAE,2CAA2C;QAC/C,cAAc,EAAE,iBAAiB;QACjC,WAAW,EAAE,sDAAsD;KACpE;IACD,6CAA6C,EAAE;QAC7C,EAAE,EAAE,6CAA6C;QACjD,cAAc,EAAE,OAAO;QACvB,WAAW,EAAE,wCAAwC;KACtD;IACD,oDAAoD,EAAE;QACpD,EAAE,EAAE,oDAAoD;QACxD,cAAc,EAAE,cAAc;QAC9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;QAChD,cAAc,EAAE,gBAAgB;QAChC,WAAW,EAAE,uFAAuF;KACrG;IACD,6CAA6C,EAAE;QAC7C,EAAE,EAAE,6CAA6C;QACjD,cAAc,EAAE,0EAA0E;QAC1F,WAAW,EAAE,0FAA0F;KACxG;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n 'authz.team.members.table.column.username.title': {\n id: 'authz.team.members.table.column.username.title',\n defaultMessage: 'Username',\n description: 'Team members table username column header',\n },\n 'authz.team.members.table.username.current': {\n id: 'authz.team.members.table.username.current',\n defaultMessage: '{username} (Me)',\n description: 'Indicates the current user in the team members table',\n },\n 'authz.team.members.table.column.email.title': {\n id: 'authz.team.members.table.column.email.title',\n defaultMessage: 'Email',\n description: 'Team members table email column header',\n },\n 'authz.team.members.table.column.organization.title': {\n id: 'authz.team.members.table.column.organization.title',\n defaultMessage: 'Organization',\n description: 'Team members table organization column header',\n },\n 'authz.team.members.table.column.scope.title': {\n id: 'authz.team.members.table.column.scope.title',\n defaultMessage: 'Scope',\n description: 'Team members table scope column header',\n },\n 'authz.team.members.table.column.role.title': {\n id: 'authz.team.members.table.column.role.title',\n defaultMessage: 'Role',\n description: 'Team members table role column header',\n },\n 'authz.team.members.table.column.actions.title': {\n id: 'authz.team.members.table.column.actions.title',\n defaultMessage: 'Actions',\n description: 'Team members table actions column header',\n },\n 'authz.team.members.table.column.assigned.roles.title': {\n id: 'authz.team.members.table.column.assigned.roles.title',\n defaultMessage: 'Assigned roles',\n description: 'Team members table assigned roles column header',\n },\n 'authz.team.members.table.assigned.roles': {\n id: 'authz.team.members.table.assigned.roles',\n defaultMessage: '{role} in {scope}',\n description: 'One role assignment on a team member row, e.g. \"Course Admin in Introduction to Data Analysis\". {role} is the role badge and {scope} the course or library it applies to, so both the order and the connecting word can be changed per language.',\n },\n 'authz.team.members.table.more.roles': {\n id: 'authz.team.members.table.more.roles',\n defaultMessage: '+{count, plural, one {# more role} other {# more roles}}',\n description: 'Link expanding a team member row to reveal their remaining roles. The count excludes the role already shown in the collapsed row.',\n },\n 'authz.team.members.table.hide.roles': {\n id: 'authz.team.members.table.hide.roles',\n defaultMessage: 'Hide roles',\n description: 'Link collapsing an expanded team member row',\n },\n 'authz.team.members.subtable.column.role.title': {\n id: 'authz.team.members.subtable.column.role.title',\n defaultMessage: 'Role',\n description: 'Role column header of the nested assignments table inside an expanded team member row',\n },\n 'authz.team.members.subtable.column.scope.title': {\n id: 'authz.team.members.subtable.column.scope.title',\n defaultMessage: 'Scope',\n description: 'Scope column header of the nested assignments table inside an expanded team member row',\n },\n 'authz.team.members.subtable.column.organization.title': {\n id: 'authz.team.members.subtable.column.organization.title',\n defaultMessage: 'Organization',\n description: 'Organization column header of the nested assignments table inside an expanded team member row',\n },\n 'authz.team.members.subtable.showing.text': {\n id: 'authz.team.members.subtable.showing.text',\n defaultMessage: 'Showing {shown} of {total}',\n description: 'Footer of the nested assignments table stating how many of the user total number of roles are listed',\n },\n 'authz.team.members.subtable.view.all.roles': {\n id: 'authz.team.members.subtable.view.all.roles',\n defaultMessage: 'View all roles',\n description: 'Link taking the user to the full profile listing every role assigned to a team member',\n },\n 'authz.team.members.table.showing.users.text': {\n id: 'authz.team.members.table.showing.users.text',\n defaultMessage: 'Showing {pageSize, plural, one {# user} other {# users}} of {itemCount}.',\n description: 'Text stating how many team members are listed on the current page out of the total count',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -17,6 +17,11 @@ export declare const getCellHeader: (columnId: string, columnTitle: string, filt
|
|
|
17
17
|
displayName: string;
|
|
18
18
|
toString(): string;
|
|
19
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Picks the course or library icon for a scope from the scope key itself.
|
|
22
|
+
*/
|
|
23
|
+
export declare const getScopeResourceIcon: (scope: string) => any;
|
|
24
|
+
/** Unrecognised scopes fall back to the course permission, as `getScopeContextType` does. */
|
|
20
25
|
export declare const getScopeManageAction: (scope: string) => string;
|
|
21
26
|
export declare const getScopeManageActionPermission: (scope: string) => {
|
|
22
27
|
action: string;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Icon } from '@openedx/paragon';
|
|
3
3
|
import { FilterList } from '@openedx/paragon/icons';
|
|
4
|
+
import { RESOURCE_ICONS } from './components/constants';
|
|
5
|
+
import { CONTEXT_TYPES, getScopeContextType } from './constants';
|
|
4
6
|
import { CONTENT_COURSE_PERMISSIONS, CONTENT_LIBRARY_PERMISSIONS } from './roles-permissions';
|
|
5
7
|
/**
|
|
6
8
|
* Returns a header value for a DataTable column that shows a filter icon
|
|
@@ -25,16 +27,14 @@ export const getCellHeader = (columnId, columnTitle, filtersApplied) => {
|
|
|
25
27
|
}
|
|
26
28
|
return columnTitle;
|
|
27
29
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return CONTENT_COURSE_PERMISSIONS.MANAGE_COURSE_TEAM;
|
|
37
|
-
};
|
|
30
|
+
/**
|
|
31
|
+
* Picks the course or library icon for a scope from the scope key itself.
|
|
32
|
+
*/
|
|
33
|
+
export const getScopeResourceIcon = (scope) => (getScopeContextType(scope) === CONTEXT_TYPES.LIBRARY ? RESOURCE_ICONS.LIBRARY : RESOURCE_ICONS.COURSE);
|
|
34
|
+
/** Unrecognised scopes fall back to the course permission, as `getScopeContextType` does. */
|
|
35
|
+
export const getScopeManageAction = (scope) => (getScopeContextType(scope) === CONTEXT_TYPES.LIBRARY
|
|
36
|
+
? CONTENT_LIBRARY_PERMISSIONS.MANAGE_LIBRARY_TEAM
|
|
37
|
+
: CONTENT_COURSE_PERMISSIONS.MANAGE_COURSE_TEAM);
|
|
38
38
|
export const getScopeManageActionPermission = (scope) => {
|
|
39
39
|
const action = getScopeManageAction(scope);
|
|
40
40
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/authz-module/utils.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAE9F;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAE,WAAmB,EAAE,cAAwB,EAAE,EAAE;IAC/F,IAAI,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,CAC3B,gBAAM,SAAS,EAAC,oCAAoC,aAClD,KAAC,IAAI,IAAC,GAAG,EAAE,UAAU,EAAE,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,MAAM,GAAG,EACnD,WAAW,IACP,CACR,CAAC;QACF,cAAc,CAAC,WAAW,GAAG,kBAAkB,QAAQ,EAAE,CAAC;QAC1D,cAAc,CAAC,QAAQ,GAAG,GAAG,EAAE,CAAC,kBAAkB,QAAQ,EAAE,CAAC;QAC7D,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAa,EAAE,EAAE
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/authz-module/utils.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,E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AO;QACL,MAAM;QACN,KAAK;KACN,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Icon } from '@openedx/paragon';\nimport { FilterList } from '@openedx/paragon/icons';\nimport { RESOURCE_ICONS } from './components/constants';\nimport { CONTEXT_TYPES, getScopeContextType } from './constants';\nimport { CONTENT_COURSE_PERMISSIONS, CONTENT_LIBRARY_PERMISSIONS } from './roles-permissions';\n\n/**\n * Returns a header value for a DataTable column that shows a filter icon\n * when the column has an active filter.\n *\n * When a filter is active, returns a **component function** with a custom\n * toString() override. This is necessary because Paragon's TableRow builds\n * cell keys via: `${cell.column.Header}${row.id}`\n *\n * - A JSX element stringifies to \"[object Object]\", causing duplicate keys.\n * - A function with a custom toString() produces a unique string per column.\n *\n * react-table's render('Header') calls the function as a component, so the\n * JSX is still rendered correctly in the table header.\n */\nexport const getCellHeader = (columnId: string, columnTitle: string, filtersApplied: string[]) => {\n if (filtersApplied.includes(columnId)) {\n const FilteredHeader = () => (\n <span className=\"d-flex flex-row align-items-center\">\n <Icon src={FilterList} size=\"sm\" className=\"mr-2\" />\n {columnTitle}\n </span>\n );\n FilteredHeader.displayName = `FilteredHeader_${columnId}`;\n FilteredHeader.toString = () => `FilteredHeader_${columnId}`;\n return FilteredHeader;\n }\n return columnTitle;\n};\n\n/**\n * Picks the course or library icon for a scope from the scope key itself.\n */\nexport const getScopeResourceIcon = (scope: string) => (\n getScopeContextType(scope) === CONTEXT_TYPES.LIBRARY ? RESOURCE_ICONS.LIBRARY : RESOURCE_ICONS.COURSE\n);\n\n/** Unrecognised scopes fall back to the course permission, as `getScopeContextType` does. */\nexport const getScopeManageAction = (scope: string) => (\n getScopeContextType(scope) === CONTEXT_TYPES.LIBRARY\n ? CONTENT_LIBRARY_PERMISSIONS.MANAGE_LIBRARY_TEAM\n : CONTENT_COURSE_PERMISSIONS.MANAGE_COURSE_TEAM\n);\n\nexport const getScopeManageActionPermission = (scope: string) => {\n const action = getScopeManageAction(scope);\n return {\n action,\n scope,\n };\n};\n"]}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
2
3
|
import { Spinner, Container } from '@openedx/paragon';
|
|
3
|
-
|
|
4
|
+
import messages from './messages';
|
|
5
|
+
/**
|
|
6
|
+
* Full-page loading state.
|
|
7
|
+
*/
|
|
8
|
+
const LoadingPage = () => {
|
|
9
|
+
const intl = useIntl();
|
|
10
|
+
return (_jsx(Container, { className: "d-flex vh-100", children: _jsx(Spinner, { variant: "primary", animation: "border", screenReaderText: intl.formatMessage(messages['loading.page.screenreader.text']), className: "mb-3 m-auto" }) }));
|
|
11
|
+
};
|
|
4
12
|
export default LoadingPage;
|
|
5
13
|
//# sourceMappingURL=LoadingPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingPage.js","sourceRoot":"","sources":["../../src/components/LoadingPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"LoadingPage.js","sourceRoot":"","sources":["../../src/components/LoadingPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,GAAG,GAAG,EAAE;IACvB,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IAEvB,OAAO,CACL,KAAC,SAAS,IAAC,SAAS,EAAC,eAAe,YAClC,KAAC,OAAO,IACN,OAAO,EAAC,SAAS,EACjB,SAAS,EAAC,QAAQ,EAClB,gBAAgB,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,gCAAgC,CAAC,CAAC,EAChF,SAAS,EAAC,aAAa,GACvB,GACQ,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { useIntl } from '@openedx/frontend-base';\nimport { Spinner, Container } from '@openedx/paragon';\nimport messages from './messages';\n\n/**\n * Full-page loading state.\n */\nconst LoadingPage = () => {\n const intl = useIntl();\n\n return (\n <Container className=\"d-flex vh-100\">\n <Spinner\n variant=\"primary\"\n animation=\"border\"\n screenReaderText={intl.formatMessage(messages['loading.page.screenreader.text'])}\n className=\"mb-3 m-auto\"\n />\n </Container>\n );\n};\n\nexport default LoadingPage;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
+
const messages = defineMessages({
|
|
3
|
+
'loading.page.screenreader.text': {
|
|
4
|
+
id: 'loading.page.screenreader.text',
|
|
5
|
+
defaultMessage: 'Loading',
|
|
6
|
+
description: 'Announced by screen readers while a full-page loading spinner is shown.',
|
|
7
|
+
},
|
|
8
|
+
});
|
|
9
|
+
export default messages;
|
|
10
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/components/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,gCAAgC,EAAE;QAChC,EAAE,EAAE,gCAAgC;QACpC,cAAc,EAAE,SAAS;QACzB,WAAW,EAAE,yEAAyE;KACvF;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n 'loading.page.screenreader.text': {\n id: 'loading.page.screenreader.text',\n defaultMessage: 'Loading',\n description: 'Announced by screen readers while a full-page loading spinner is shown.',\n },\n});\n\nexport default messages;\n"]}
|
package/dist/types.d.ts
CHANGED
|
@@ -5,26 +5,6 @@ export interface PermissionValidationRequest {
|
|
|
5
5
|
export interface PermissionValidationResponse extends PermissionValidationRequest {
|
|
6
6
|
allowed: boolean;
|
|
7
7
|
}
|
|
8
|
-
export interface TeamMember {
|
|
9
|
-
username: string;
|
|
10
|
-
fullName: string;
|
|
11
|
-
email: string;
|
|
12
|
-
roles: string[];
|
|
13
|
-
createdAt: string;
|
|
14
|
-
scope: {
|
|
15
|
-
resource: string;
|
|
16
|
-
type: 'COURSE' | 'LIBRARY' | 'GLOBAL';
|
|
17
|
-
};
|
|
18
|
-
organization: string;
|
|
19
|
-
role: string;
|
|
20
|
-
}
|
|
21
|
-
export interface LibraryMetadata {
|
|
22
|
-
id: string;
|
|
23
|
-
org: string;
|
|
24
|
-
title: string;
|
|
25
|
-
slug: string;
|
|
26
|
-
allowPublicRead: boolean;
|
|
27
|
-
}
|
|
28
8
|
export interface RoleMetadata {
|
|
29
9
|
role: string;
|
|
30
10
|
name: string;
|
|
@@ -91,3 +71,32 @@ export interface RoleToDelete {
|
|
|
91
71
|
export type UserRoleWithPermissions = UserRole & {
|
|
92
72
|
canManageScope?: boolean;
|
|
93
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* A single role assignment nested under a team member in the user-grouped listing.
|
|
76
|
+
* Mirrors `results[].assignments[]` of `GET /api/authz/v1/users/`.
|
|
77
|
+
*/
|
|
78
|
+
export interface TeamMemberAssignment {
|
|
79
|
+
role: string;
|
|
80
|
+
org: string;
|
|
81
|
+
/** Scope external key (e.g. `course-v1:Org+Course+Run`). Identifies the scope and is
|
|
82
|
+
* what the scope filter sends back to the API — not shown to the user. */
|
|
83
|
+
scope: string;
|
|
84
|
+
/** Human-readable scope name shown in the table. The API returns an empty string for
|
|
85
|
+
* glob scopes and for scopes whose backing course or library no longer exists, so
|
|
86
|
+
* callers fall back to `scope`. */
|
|
87
|
+
scopeDisplayName: string;
|
|
88
|
+
permissionCount: number;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A team member as returned by the user-grouped assignments endpoint: one entry per
|
|
92
|
+
* user, carrying the first few of their assignments. `assignmentCount` counts every
|
|
93
|
+
* assignment behind that slice, so it can exceed `assignments.length`. Both are scoped
|
|
94
|
+
* to the active role, org and scope filters and to what the caller may view.
|
|
95
|
+
*/
|
|
96
|
+
export interface TeamMember {
|
|
97
|
+
username: string;
|
|
98
|
+
fullName: string;
|
|
99
|
+
email: string;
|
|
100
|
+
assignmentCount: number;
|
|
101
|
+
assignments: TeamMemberAssignment[];
|
|
102
|
+
}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface PermissionValidationRequest {\n action: string;\n scope?: string;\n}\n\nexport interface PermissionValidationResponse extends PermissionValidationRequest {\n allowed: boolean;\n}\n\
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface PermissionValidationRequest {\n action: string;\n scope?: string;\n}\n\nexport interface PermissionValidationResponse extends PermissionValidationRequest {\n allowed: boolean;\n}\n\nexport interface RoleMetadata {\n role: string;\n name: string;\n description: string;\n contextType: string;\n disabled?: boolean;\n}\n// TODO: remove unnecessary fields when libraries gets removed\nexport interface Role extends RoleMetadata {\n scope: string;\n userCount: number;\n permissions: string[];\n}\n\nexport interface ResourceMetadata {\n key: string;\n label: string;\n description: string;\n icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>;\n}\n\nexport interface PermissionMetadata {\n key: string;\n resource: string;\n label?: string;\n description?: string;\n icon?: React.ComponentType<React.SVGProps<SVGSVGElement>>;\n}\n\nexport type PermissionItem = ResourceMetadata & {\n perms: PermissionMetadata[];\n};\n\nexport interface Org {\n id: string;\n name: string;\n shortName: string;\n}\n\nexport interface Scope {\n externalKey: string;\n displayName: string;\n description?: string;\n org: Org | null;\n}\n\n// Permissions Matrix\n\nexport type EnrichedPermission = PermissionMetadata & {\n actionKey: string;\n};\n\nexport type PermissionWithRoles = EnrichedPermission & {\n roles: Record<string, boolean>;\n};\n\nexport type PermissionsResourceGrouped = ResourceMetadata & {\n permissions: PermissionWithRoles[];\n};\n\nexport interface UserRole {\n isSuperadmin?: boolean;\n role: string;\n org: string;\n scope: string;\n permissionCount: number;\n fullName?: string;\n username?: string;\n email?: string;\n}\n\nexport interface RoleToDelete {\n role: string;\n name?: string;\n scope: string;\n}\n\nexport type UserRoleWithPermissions = UserRole & {\n canManageScope?: boolean;\n};\n\n/**\n * A single role assignment nested under a team member in the user-grouped listing.\n * Mirrors `results[].assignments[]` of `GET /api/authz/v1/users/`.\n */\nexport interface TeamMemberAssignment {\n role: string;\n org: string;\n /** Scope external key (e.g. `course-v1:Org+Course+Run`). Identifies the scope and is\n * what the scope filter sends back to the API — not shown to the user. */\n scope: string;\n /** Human-readable scope name shown in the table. The API returns an empty string for\n * glob scopes and for scopes whose backing course or library no longer exists, so\n * callers fall back to `scope`. */\n scopeDisplayName: string;\n permissionCount: number;\n}\n\n/**\n * A team member as returned by the user-grouped assignments endpoint: one entry per\n * user, carrying the first few of their assignments. `assignmentCount` counts every\n * assignment behind that slice, so it can exceed `assignments.length`. Both are scoped\n * to the active role, org and scope filters and to what the caller may view.\n */\nexport interface TeamMember {\n username: string;\n fullName: string;\n email: string;\n assignmentCount: number;\n assignments: TeamMemberAssignment[];\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface ViewMoreLinkProps {
|
|
3
|
-
label: string;
|
|
4
|
-
onClick: () => void;
|
|
5
|
-
iconSrc?: React.ComponentType | undefined;
|
|
6
|
-
}
|
|
7
|
-
declare const ViewMoreLink: ({ label, onClick, iconSrc }: ViewMoreLinkProps) => React.JSX.Element;
|
|
8
|
-
export default ViewMoreLink;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Hyperlink, Icon } from '@openedx/paragon';
|
|
3
|
-
const ViewMoreLink = ({ label, onClick, iconSrc }) => (_jsxs(Hyperlink, { destination: undefined, onClick: e => {
|
|
4
|
-
e.preventDefault();
|
|
5
|
-
onClick();
|
|
6
|
-
}, children: [label, iconSrc && (_jsx(Icon, { src: iconSrc }))] }));
|
|
7
|
-
export default ViewMoreLink;
|
|
8
|
-
//# sourceMappingURL=ViewMoreLink.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ViewMoreLink.js","sourceRoot":"","sources":["../../../src/authz-module/components/ViewMoreLink.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAQnD,MAAM,YAAY,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAqB,EAAE,EAAE,CAAC,CACvE,MAAC,SAAS,IACR,WAAW,EAAE,SAAS,EACtB,OAAO,EAAE,CAAC,CAAC,EAAE;QACX,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,OAAO,EAAE,CAAC;IACZ,CAAC,aAEA,KAAK,EACL,OAAO,IAAI,CACV,KAAC,IAAI,IACH,GAAG,EAAE,OAAO,GACZ,CACH,IACS,CACb,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import React from 'react';\nimport { Hyperlink, Icon } from '@openedx/paragon';\n\ninterface ViewMoreLinkProps {\n label: string;\n onClick: () => void;\n iconSrc?: React.ComponentType | undefined;\n}\n\nconst ViewMoreLink = ({ label, onClick, iconSrc }: ViewMoreLinkProps) => (\n <Hyperlink\n destination={undefined}\n onClick={e => {\n e.preventDefault();\n onClick();\n }}\n >\n {label}\n {iconSrc && (\n <Icon\n src={iconSrc}\n />\n )}\n </Hyperlink>\n);\n\nexport default ViewMoreLink;\n"]}
|