studiokit-scaffolding-js 7.0.11-alpha.7 → 7.0.12-next.1.3
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/lib/components/ActionList.d.ts +2 -2
- package/lib/components/ActionList.js +25 -78
- package/lib/components/AlertDialog.d.ts +3 -3
- package/lib/components/AlertDialog.js +8 -17
- package/lib/components/AlertWithIcon.js +17 -43
- package/lib/components/ConnectedModal.d.ts +1 -2
- package/lib/components/ConnectedModal.js +9 -33
- package/lib/components/Dropdowns/GroupsDropdown.d.ts +4 -4
- package/lib/components/Dropdowns/GroupsDropdown.js +31 -69
- package/lib/components/Dropdowns/ManagedNavDropdown.d.ts +2 -2
- package/lib/components/Dropdowns/ManagedNavDropdown.js +32 -77
- package/lib/components/Dropdowns/UserDropdown.js +21 -70
- package/lib/components/Dropdowns/index.js +2 -4
- package/lib/components/EntityOwnerList.d.ts +3 -3
- package/lib/components/EntityOwnerList.js +16 -58
- package/lib/components/Error.js +10 -25
- package/lib/components/ErrorBoundary.js +25 -85
- package/lib/components/ErrorMessage.d.ts +2 -2
- package/lib/components/ErrorMessage.js +5 -10
- package/lib/components/Forms/DateField.d.ts +2 -2
- package/lib/components/Forms/DateField.js +34 -85
- package/lib/components/Forms/TimeField.d.ts +2 -2
- package/lib/components/Forms/TimeField.js +36 -99
- package/lib/components/Forms/index.js +3 -12
- package/lib/components/Groups/CreateEditCopySaveButtons.js +10 -13
- package/lib/components/Groups/ExternalGroups/Attach.d.ts +6 -7
- package/lib/components/Groups/ExternalGroups/Attach.js +98 -135
- package/lib/components/Groups/ExternalGroups/Table.js +30 -59
- package/lib/components/Groups/RosterSyncInfo.js +19 -49
- package/lib/components/HOC/AccessibleAppComponent.d.ts +2 -2
- package/lib/components/HOC/AccessibleAppComponent.js +35 -83
- package/lib/components/HOC/ActivityRequiredComponent.d.ts +14 -14
- package/lib/components/HOC/ActivityRequiredComponent.js +21 -78
- package/lib/components/HOC/AsyncComponent.d.ts +9 -9
- package/lib/components/HOC/AsyncComponent.js +31 -122
- package/lib/components/HOC/AuthenticatedComponent.d.ts +4 -4
- package/lib/components/HOC/AuthenticatedComponent.js +28 -85
- package/lib/components/HOC/CollectionComponent.d.ts +12 -12
- package/lib/components/HOC/CollectionComponent.js +73 -133
- package/lib/components/HOC/CollectionFirstItemComponent.d.ts +13 -13
- package/lib/components/HOC/CollectionFirstItemComponent.js +24 -79
- package/lib/components/HOC/CollectionItemComponent.d.ts +9 -9
- package/lib/components/HOC/CollectionItemComponent.js +70 -131
- package/lib/components/HOC/ConnectedModalComponent.d.ts +9 -9
- package/lib/components/HOC/ConnectedModalComponent.js +45 -104
- package/lib/components/HOC/DataDependentComponent.d.ts +3 -55
- package/lib/components/HOC/DataDependentComponent.js +18 -75
- package/lib/components/HOC/EntityComponent.d.ts +13 -13
- package/lib/components/HOC/EntityComponent.js +30 -82
- package/lib/components/HOC/FullscreenModalComponent.d.ts +9 -9
- package/lib/components/HOC/FullscreenModalComponent.js +41 -101
- package/lib/components/HOC/GroupActivityRequiredComponent.d.ts +2 -2
- package/lib/components/HOC/GroupActivityRequiredComponent.js +11 -24
- package/lib/components/HOC/GuidComponent.d.ts +1 -1
- package/lib/components/HOC/GuidComponent.js +13 -59
- package/lib/components/HOC/ModelContextDependencyVerifyComponent.d.ts +28 -29
- package/lib/components/HOC/ModelContextDependencyVerifyComponent.js +19 -52
- package/lib/components/HOC/ModelErrorRedirectComponent.d.ts +10 -10
- package/lib/components/HOC/ModelErrorRedirectComponent.js +18 -65
- package/lib/components/HOC/SearchPersistorComponent.d.ts +4 -4
- package/lib/components/HOC/SearchPersistorComponent.js +87 -134
- package/lib/components/HOC/UnauthenticatedComponent.d.ts +12 -12
- package/lib/components/HOC/UnauthenticatedComponent.js +17 -74
- package/lib/components/HOC/UserComponent.d.ts +1 -1
- package/lib/components/HOC/UserComponent.js +5 -9
- package/lib/components/Icons/IconAlphaList.js +5 -19
- package/lib/components/Icons/IconExternalUser.js +5 -19
- package/lib/components/Icons/IconImpersonation.js +5 -19
- package/lib/components/Icons/IconStopImpersonating.js +5 -19
- package/lib/components/Icons/IconTable.js +4 -18
- package/lib/components/Icons/IconTableDeleteCol.js +5 -19
- package/lib/components/Icons/IconTableDeleteRow.js +5 -19
- package/lib/components/Icons/IconTableInsertCol.js +5 -19
- package/lib/components/Icons/IconTableInsertRow.js +5 -19
- package/lib/components/Impersonation/Button.d.ts +2 -2
- package/lib/components/Impersonation/Button.js +12 -56
- package/lib/components/Impersonation/Link.d.ts +2 -2
- package/lib/components/Impersonation/Link.js +12 -53
- package/lib/components/Impersonation/UserDetail.d.ts +2 -2
- package/lib/components/Impersonation/UserDetail.js +6 -14
- package/lib/components/Loading.js +4 -20
- package/lib/components/LockDownBrowser/Check.js +29 -87
- package/lib/components/LockDownBrowser/ExitButton.js +9 -13
- package/lib/components/LockDownBrowser/Launch.js +24 -47
- package/lib/components/Lti/Confirm.js +10 -32
- package/lib/components/Lti/CreateNonLtiGroupAlertDialog.d.ts +4 -2
- package/lib/components/Lti/CreateNonLtiGroupAlertDialog.js +25 -70
- package/lib/components/Lti/Launch.js +19 -44
- package/lib/components/Lti/LaunchGroup.js +12 -38
- package/lib/components/ManageTable.d.ts +1 -2
- package/lib/components/ManageTable.js +39 -56
- package/lib/components/ManageTableNoDataComponent.js +3 -21
- package/lib/components/NewVersionAlert.d.ts +2 -2
- package/lib/components/NewVersionAlert.js +30 -75
- package/lib/components/NotFound.js +9 -26
- package/lib/components/Notifications.d.ts +4 -4
- package/lib/components/Notifications.js +60 -101
- package/lib/components/PaginationNextButton.js +5 -20
- package/lib/components/PaginationPreviousButton.js +5 -20
- package/lib/components/Quill/CustomToolbar.d.ts +2 -2
- package/lib/components/Quill/CustomToolbar.js +62 -101
- package/lib/components/Quill/Formats/Image.d.ts +10 -25
- package/lib/components/Quill/Formats/Image.js +36 -52
- package/lib/components/Quill/Formats/List.d.ts +6 -3
- package/lib/components/Quill/Formats/List.js +26 -48
- package/lib/components/Quill/Formats/Video.d.ts +2 -1
- package/lib/components/Quill/Formats/Video.js +12 -30
- package/lib/components/Quill/ImageDropModule.d.ts +1 -1
- package/lib/components/Quill/ImageDropModule.js +33 -36
- package/lib/components/Quill/ImageWarning.d.ts +2 -2
- package/lib/components/Quill/ImageWarning.js +8 -33
- package/lib/components/Quill/ImageWithAltTextModal.d.ts +0 -1
- package/lib/components/Quill/ImageWithAltTextModal.js +42 -97
- package/lib/components/Quill/Specs/CustomImageSpec.d.ts +1 -1
- package/lib/components/Quill/Specs/CustomImageSpec.js +16 -32
- package/lib/components/Quill/Specs/CustomVideoSpec.d.ts +1 -1
- package/lib/components/Quill/Specs/CustomVideoSpec.js +14 -29
- package/lib/components/Quill/TableModule/Blots/BaseTableBlot.d.ts +2 -1
- package/lib/components/Quill/TableModule/Blots/BaseTableBlot.js +44 -60
- package/lib/components/Quill/TableModule/Blots/TableBlot.js +34 -52
- package/lib/components/Quill/TableModule/Blots/TableBodyBlot.js +35 -53
- package/lib/components/Quill/TableModule/Blots/TableCellBlot.d.ts +1 -1
- package/lib/components/Quill/TableModule/Blots/TableCellBlot.js +110 -129
- package/lib/components/Quill/TableModule/Blots/TableContainer.js +45 -59
- package/lib/components/Quill/TableModule/Blots/TableRowBlot.js +48 -64
- package/lib/components/Quill/TableModule/constants.js +5 -5
- package/lib/components/Quill/TableModule/index.css +25 -25
- package/lib/components/Quill/TableModule/index.d.ts +14 -5
- package/lib/components/Quill/TableModule/index.js +128 -129
- package/lib/components/Quill/TableModule/utils.js +28 -32
- package/lib/components/Quill/accessibilityFix.d.ts +0 -1
- package/lib/components/Quill/accessibilityFix.js +46 -64
- package/lib/components/Quill/index.js +13 -15
- package/lib/components/RefreshIndicator/Bordered.js +6 -31
- package/lib/components/RefreshIndicator/Inline.js +7 -31
- package/lib/components/RefreshIndicator/index.d.ts +2 -2
- package/lib/components/RefreshIndicator/index.js +39 -93
- package/lib/components/SearchControls.js +10 -30
- package/lib/components/SentryRoute.js +4 -22
- package/lib/components/Tables/RoleFilter.d.ts +3 -4
- package/lib/components/Tables/RoleFilter.js +16 -28
- package/lib/components/Tables/TextFilter.d.ts +2 -3
- package/lib/components/Tables/TextFilter.js +8 -15
- package/lib/components/UserRoles/Add.d.ts +3 -3
- package/lib/components/UserRoles/Add.js +62 -127
- package/lib/components/UserRoles/Context.js +2 -4
- package/lib/components/UserRoles/RoleCell.js +65 -94
- package/lib/components/UserRoles/Select.js +17 -51
- package/lib/components/UserRoles/Table.js +35 -57
- package/lib/components/UserRoles/index.d.ts +6 -6
- package/lib/components/UserRoles/index.js +192 -271
- package/lib/config/eslint/index.d.ts +2 -0
- package/lib/config/eslint/index.js +33 -0
- package/lib/config/eslint/lib/order.d.ts +3 -0
- package/lib/config/eslint/lib/order.js +31 -0
- package/lib/config/eslint/lib/prettier.d.ts +3 -0
- package/lib/config/eslint/lib/prettier.js +21 -0
- package/lib/config/eslint/lib/typescript.d.ts +2 -0
- package/lib/config/eslint/lib/typescript.js +118 -0
- package/lib/config/eslint/react.d.ts +2 -0
- package/lib/config/eslint/react.js +18 -0
- package/lib/constants/baseActivity.js +1 -1
- package/lib/constants/baseRole.js +1 -1
- package/lib/constants/configuration.d.ts +1 -1
- package/lib/constants/configuration.js +15 -15
- package/lib/constants/externalProviderType.js +1 -1
- package/lib/constants/fetchErrorData.js +1 -1
- package/lib/constants/index.js +13 -22
- package/lib/constants/lockDownBrowser.js +2 -2
- package/lib/constants/mockData.d.ts +4 -6
- package/lib/constants/mockData.js +35 -61
- package/lib/constants/modelStatus.js +1 -1
- package/lib/constants/notificationType.js +1 -1
- package/lib/constants/operatingSystem.js +1 -1
- package/lib/constants/shard.js +1 -1
- package/lib/constants/table.js +2 -2
- package/lib/constants/tier.js +1 -1
- package/lib/constants/userRole.d.ts +1 -2
- package/lib/constants/userRole.js +4 -16
- package/lib/css/components/_buttons.css +3 -3
- package/lib/css/components/_tables.css +5 -5
- package/lib/css/utils/_display.css +12 -19
- package/lib/css/utils/_general.css +1 -1
- package/lib/css/utils/_text.css +2 -1
- package/lib/endpointMappings.js +10 -22
- package/lib/hooks/useCollection.js +28 -30
- package/lib/hooks/useCollectionConfiguration.d.ts +0 -1
- package/lib/hooks/useCollectionConfiguration.js +61 -64
- package/lib/hooks/useCollectionItem.js +25 -28
- package/lib/hooks/useGuid.js +4 -5
- package/lib/hooks/usePrevious.js +5 -5
- package/lib/index.js +7 -19
- package/lib/redux/actionCreator.d.ts +6 -6
- package/lib/redux/actionCreator.js +21 -32
- package/lib/redux/actions/AuthAction.js +6 -6
- package/lib/redux/actions/ModalAction.d.ts +1 -1
- package/lib/redux/actions/ModalAction.js +1 -1
- package/lib/redux/actions/ModelAction.d.ts +1 -1
- package/lib/redux/actions/ModelAction.js +13 -23
- package/lib/redux/actions/NotificationAction.js +1 -1
- package/lib/redux/actions/SearchAction.js +1 -1
- package/lib/redux/actions/index.js +6 -15
- package/lib/redux/configureReducers.d.ts +2 -5
- package/lib/redux/configureReducers.js +20 -42
- package/lib/redux/configureStore.d.ts +2 -2
- package/lib/redux/configureStore.js +41 -69
- package/lib/redux/helpers.js +2 -1
- package/lib/redux/reducers/authReducer.js +4 -5
- package/lib/redux/reducers/index.js +6 -8
- package/lib/redux/reducers/modalsReducer.js +12 -33
- package/lib/redux/reducers/modelsReducer.d.ts +2 -2
- package/lib/redux/reducers/modelsReducer.js +48 -52
- package/lib/redux/reducers/notificationsReducer.js +9 -10
- package/lib/redux/reducers/searchReducer.js +6 -6
- package/lib/redux/sagas/appInsightsSaga.js +19 -61
- package/lib/redux/sagas/authSaga.js +246 -408
- package/lib/redux/sagas/caliperSaga.js +106 -216
- package/lib/redux/sagas/clockOffsetSaga.js +24 -68
- package/lib/redux/sagas/configurationSaga.js +8 -45
- package/lib/redux/sagas/downtimeApiErrorSaga.d.ts +0 -1
- package/lib/redux/sagas/downtimeApiErrorSaga.js +19 -63
- package/lib/redux/sagas/errorSaga.d.ts +0 -1
- package/lib/redux/sagas/errorSaga.js +22 -62
- package/lib/redux/sagas/googleAnalyticsSaga.js +25 -69
- package/lib/redux/sagas/identityProviderSaga.js +19 -68
- package/lib/redux/sagas/initialDataLoadSaga.js +12 -12
- package/lib/redux/sagas/lockDownBrowserErrorSaga.d.ts +0 -1
- package/lib/redux/sagas/lockDownBrowserErrorSaga.js +22 -80
- package/lib/redux/sagas/modelFetchSaga.js +247 -360
- package/lib/redux/sagas/noStoreSaga.d.ts +1 -1
- package/lib/redux/sagas/noStoreSaga.js +42 -88
- package/lib/redux/sagas/postLoginDataSaga.js +28 -71
- package/lib/redux/sagas/postLoginRedirectSaga.js +25 -66
- package/lib/redux/sagas/rootSaga.js +50 -127
- package/lib/redux/sagas/sentrySaga.js +26 -86
- package/lib/redux/sagas/userIdSaga.js +13 -53
- package/lib/services/codeProviderService.js +14 -24
- package/lib/services/dateService.js +5 -8
- package/lib/services/documentService.js +3 -3
- package/lib/services/fetchService.js +79 -130
- package/lib/services/persistenceService.d.ts +4 -4
- package/lib/services/persistenceService.js +20 -22
- package/lib/services/ticketProviderService.js +17 -27
- package/lib/services/tokenPersistenceService.js +3 -3
- package/lib/services/windowService.js +9 -9
- package/lib/startup.d.ts +1 -1
- package/lib/startup.js +31 -52
- package/lib/types/Artifact.js +1 -1
- package/lib/types/Collection.d.ts +3 -3
- package/lib/types/Notification.d.ts +2 -2
- package/lib/types/OptionalRecord.d.ts +1 -1
- package/lib/types/OwnerSchedule.d.ts +3 -1
- package/lib/types/PropertyOfType.d.ts +3 -3
- package/lib/types/RoleDescription.d.ts +0 -1
- package/lib/types/auth/index.js +8 -17
- package/lib/types/index.js +29 -38
- package/lib/types/net/ErrorHandler.d.ts +1 -1
- package/lib/types/net/FetchConfig.d.ts +1 -1
- package/lib/types/net/FetchErrorData.js +1 -1
- package/lib/types/net/FetchResult.d.ts +2 -2
- package/lib/types/net/HTTPMethod.d.ts +1 -1
- package/lib/types/net/HTTPStatusCode.js +1 -1
- package/lib/types/net/OAuthTokenOrNull.d.ts +1 -1
- package/lib/types/net/TokenAccessFunction.d.ts +1 -1
- package/lib/types/net/index.js +17 -26
- package/lib/utils/baseActivity.d.ts +2 -2
- package/lib/utils/baseActivity.js +14 -22
- package/lib/utils/baseRole.js +5 -5
- package/lib/utils/collection.js +145 -153
- package/lib/utils/cookies.js +11 -29
- package/lib/utils/date.js +97 -121
- package/lib/utils/dom.js +51 -50
- package/lib/utils/domainIdentifier.js +3 -7
- package/lib/utils/entityUserRole.js +1 -1
- package/lib/utils/error.d.ts +1 -1
- package/lib/utils/error.js +5 -5
- package/lib/utils/events.js +8 -10
- package/lib/utils/externalGroup.js +10 -10
- package/lib/utils/externalProviders.js +3 -3
- package/lib/utils/externalTerms.js +2 -6
- package/lib/utils/fetch.d.ts +1 -1
- package/lib/utils/fetch.js +92 -95
- package/lib/utils/group.js +6 -9
- package/lib/utils/groupDates.d.ts +1 -1
- package/lib/utils/groupDates.js +15 -15
- package/lib/utils/groupRoles.js +18 -22
- package/lib/utils/lockDownBrowser.js +4 -4
- package/lib/utils/logger.js +9 -8
- package/lib/utils/lti.js +2 -2
- package/lib/utils/model.d.ts +2 -2
- package/lib/utils/model.js +25 -29
- package/lib/utils/number.js +6 -12
- package/lib/utils/promise.d.ts +6 -1
- package/lib/utils/promise.js +20 -8
- package/lib/utils/quill.js +25 -39
- package/lib/utils/route.d.ts +2 -2
- package/lib/utils/route.js +32 -34
- package/lib/utils/search.d.ts +1 -1
- package/lib/utils/search.js +38 -41
- package/lib/utils/shard.js +15 -18
- package/lib/utils/sort.d.ts +3 -3
- package/lib/utils/sort.js +30 -34
- package/lib/utils/string.js +5 -6
- package/lib/utils/table.d.ts +3 -3
- package/lib/utils/table.js +10 -12
- package/lib/utils/timezone.js +8 -26
- package/lib/utils/url.d.ts +2 -1
- package/lib/utils/url.js +64 -118
- package/lib/utils/user.js +35 -40
- package/lib/utils/userAgent.js +5 -5
- package/lib/utils/userRole.d.ts +3 -3
- package/lib/utils/userRole.js +16 -22
- package/package.json +74 -67
- package/lib/config/eslint/index.cjs +0 -21
- package/lib/config/eslint/lib/order.cjs +0 -22
- package/lib/config/eslint/lib/prettier.cjs +0 -18
- package/lib/config/eslint/lib/typescript.cjs +0 -86
- package/lib/config/eslint/react.cjs +0 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
2
|
import { Model } from '../types';
|
|
3
3
|
export interface ActionListProps {
|
|
4
4
|
actions?: ListAction[];
|
|
@@ -11,7 +11,7 @@ export interface ListAction {
|
|
|
11
11
|
predicate: boolean;
|
|
12
12
|
action: () => void;
|
|
13
13
|
name: string;
|
|
14
|
-
icon: JSX.Element;
|
|
14
|
+
icon: React.JSX.Element;
|
|
15
15
|
className: string;
|
|
16
16
|
id: string;
|
|
17
17
|
isDefault?: boolean;
|
|
@@ -1,58 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
24
|
-
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
-
if (mod && mod.__esModule) return mod;
|
|
27
|
-
var result = {};
|
|
28
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
-
__setModuleDefault(result, mod);
|
|
30
|
-
return result;
|
|
31
|
-
};
|
|
32
|
-
var __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
33
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
34
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
35
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
36
|
-
r[k] = a[j];
|
|
37
|
-
return r;
|
|
38
|
-
};
|
|
39
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
40
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
41
|
-
};
|
|
42
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
3
|
exports.ActionList = void 0;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const core_1 = require("@material-ui/core");
|
|
7
|
+
const MoreVert_1 = tslib_1.__importDefault(require("@material-ui/icons/MoreVert"));
|
|
8
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
9
|
+
const ActionList = ({ actions = [], model = null, className, alwaysShowKebab }) => {
|
|
10
|
+
const anchorRef = react_1.default.useRef(null);
|
|
11
|
+
const [infoMenuAnchorElement, setInfoMenuAnchorElement] = (0, react_1.useState)(undefined);
|
|
12
|
+
const onActionItemClick = (action) => () => {
|
|
52
13
|
setInfoMenuAnchorElement(undefined);
|
|
53
14
|
action === null || action === void 0 ? void 0 : action();
|
|
54
|
-
};
|
|
55
|
-
|
|
15
|
+
};
|
|
16
|
+
const handleListKeyDown = (event) => {
|
|
56
17
|
var _a;
|
|
57
18
|
if (event.key === 'Tab' || event.key === 'Escape' || event.key === 'Esc') {
|
|
58
19
|
event.preventDefault();
|
|
@@ -60,35 +21,21 @@ var ActionList = function (_a) {
|
|
|
60
21
|
(_a = anchorRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
61
22
|
}
|
|
62
23
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
24
|
+
let allowedActions = actions.filter((a) => a.predicate);
|
|
25
|
+
const actionCount = allowedActions.length;
|
|
26
|
+
const defaultAction = actionCount === 1 && !alwaysShowKebab ? allowedActions[0] : allowedActions.find(a => !!a.isDefault);
|
|
66
27
|
if (defaultAction) {
|
|
67
|
-
allowedActions = allowedActions.filter(
|
|
28
|
+
allowedActions = allowedActions.filter(a => a !== defaultAction);
|
|
68
29
|
}
|
|
69
|
-
return (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
react_1.default.createElement(core_1.Popper, { open: !!infoMenuAnchorElement, anchorEl: infoMenuAnchorElement, placement: "bottom-end", className: "z-1" + (className ? " " + className : ''), transition: true }, function (_a) {
|
|
80
|
-
var TransitionProps = _a.TransitionProps, placement = _a.placement;
|
|
81
|
-
return (react_1.default.createElement(core_1.Grow, __assign({}, TransitionProps, { style: { transformOrigin: placement === 'bottom-end' ? 'top right' : 'bottom right' } }),
|
|
82
|
-
react_1.default.createElement(core_1.Paper, null,
|
|
83
|
-
react_1.default.createElement(core_1.ClickAwayListener, { onClickAway: onActionItemClick() },
|
|
84
|
-
react_1.default.createElement(core_1.MenuList, { id: "info-menu-" + model.id, autoFocusItem: !!infoMenuAnchorElement, onKeyDown: handleListKeyDown, className: "action-list shadow-large" }, allowedActions.map(function (a, index) {
|
|
85
|
-
return a.predicate
|
|
86
|
-
? __spreadArrays((index > 0 ? [react_1.default.createElement(core_1.Divider, null)] : []), [
|
|
87
|
-
react_1.default.createElement(core_1.MenuItem, { key: a.id, className: "action-list-menu mv1 pv2 " + a.className, onClick: onActionItemClick(a.action), color: "primary", disabled: a.disabled },
|
|
88
|
-
a.icon,
|
|
89
|
-
a.name)
|
|
90
|
-
]) : undefined;
|
|
91
|
-
}))))));
|
|
92
|
-
})))));
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: !!defaultAction && !!model && (actionCount > 1 || alwaysShowKebab) ? 'inline-flex' : 'di', children: [!!defaultAction && ((0, jsx_runtime_1.jsxs)(core_1.Button, { color: "primary", onClick: defaultAction.action, id: defaultAction.id, className: defaultAction.className || '', disabled: defaultAction.disabled, children: [defaultAction.icon, defaultAction.name] })), !!model && (actionCount > 1 || alwaysShowKebab) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(core_1.Button, { ref: anchorRef, onClick: event => {
|
|
31
|
+
setInfoMenuAnchorElement(event.currentTarget);
|
|
32
|
+
}, "aria-label": "Actions", "aria-haspopup": "true", "aria-controls": infoMenuAnchorElement ? `info-menu-${model.id}` : undefined, className: `action-list-text-button${defaultAction ? ' with-default-action' : ''}`, color: "primary", children: ["Actions", (0, jsx_runtime_1.jsx)(MoreVert_1.default, { color: "primary" })] }), (0, jsx_runtime_1.jsx)(core_1.IconButton, { ref: anchorRef, onClick: event => {
|
|
33
|
+
setInfoMenuAnchorElement(event.currentTarget);
|
|
34
|
+
}, "aria-label": "Actions", "aria-haspopup": "true", "aria-controls": infoMenuAnchorElement ? `info-menu-${model.id}` : undefined, className: `action-list-icon-button${defaultAction ? ' with-default-action' : ''}`, children: (0, jsx_runtime_1.jsx)(MoreVert_1.default, { color: "primary" }) }), (0, jsx_runtime_1.jsx)(core_1.Popper, { open: !!infoMenuAnchorElement, anchorEl: infoMenuAnchorElement, placement: "bottom-end", className: `z-1${className ? ` ${className}` : ''}`, transition: true, children: ({ TransitionProps, placement }) => ((0, jsx_runtime_1.jsx)(core_1.Grow, Object.assign({}, TransitionProps, { style: { transformOrigin: placement === 'bottom-end' ? 'top right' : 'bottom right' }, children: (0, jsx_runtime_1.jsx)(core_1.Paper, { children: (0, jsx_runtime_1.jsx)(core_1.ClickAwayListener, { onClickAway: onActionItemClick(), children: (0, jsx_runtime_1.jsx)(core_1.MenuList, { id: `info-menu-${model.id}`, autoFocusItem: !!infoMenuAnchorElement, onKeyDown: handleListKeyDown, className: "action-list shadow-large", children: allowedActions.map((a, index) => a.predicate
|
|
35
|
+
? [
|
|
36
|
+
...(index > 0 ? [(0, jsx_runtime_1.jsx)(core_1.Divider, {})] : []),
|
|
37
|
+
(0, jsx_runtime_1.jsxs)(core_1.MenuItem, { className: `action-list-menu mv1 pv2 ${a.className}`, onClick: onActionItemClick(a.action), color: "primary", disabled: a.disabled, children: [a.icon, a.name] }, a.id)
|
|
38
|
+
]
|
|
39
|
+
: undefined) }) }) }) }))) })] }))] }));
|
|
93
40
|
};
|
|
94
41
|
exports.ActionList = ActionList;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { FunctionComponent, MouseEventHandler } from 'react';
|
|
1
|
+
import React, { FunctionComponent, MouseEventHandler } from 'react';
|
|
2
2
|
export interface AlertDialogProps {
|
|
3
3
|
id?: string;
|
|
4
4
|
isOpen: boolean;
|
|
5
|
-
title: string | JSX.Element;
|
|
6
|
-
description?: string | JSX.Element
|
|
5
|
+
title: string | React.JSX.Element;
|
|
6
|
+
description?: string | React.JSX.Element;
|
|
7
7
|
onProceed?: MouseEventHandler<HTMLElement>;
|
|
8
8
|
proceedText?: string;
|
|
9
9
|
/** onCancel is needed for closing using the X button, clicking the backdrop, or clicking the cancel button*/
|
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.AlertDialog = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
react_1.default.createElement(react_bootstrap_1.Modal.Title, null, title)),
|
|
16
|
-
!!description && react_1.default.createElement(react_bootstrap_1.Modal.Body, null, description),
|
|
17
|
-
react_1.default.createElement(react_bootstrap_1.Modal.Footer, null,
|
|
18
|
-
!!onProceed && (react_1.default.createElement(Button_1.default, { id: "alert-dialog-proceed-btn", "aria-label": proceedText || 'Confirm', className: "btn-primary ttc fr mb1", color: "primary", onClick: onProceed }, proceedText || 'Confirm')),
|
|
19
|
-
!hideCancel && (react_1.default.createElement(Button_1.default, { id: "alert-dialog-cancel-btn", color: "primary", "aria-label": cancelText || 'Cancel', className: "btn-text ttc" + (onDestroy ? ' fr' : ' fl') + " " + (onProceed ? ' mr1' : ''), onClick: onCancel }, cancelText || 'Cancel')),
|
|
20
|
-
!!onDestroy && (react_1.default.createElement(Button_1.default, { id: "alert-dialog-destroy-btn", "aria-label": destroyText || 'Destroy', color: "secondary", className: "btn-text color-red ttc fl", onClick: onDestroy }, destroyText || 'Destroy')))));
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const Button_1 = tslib_1.__importDefault(require("@material-ui/core/Button"));
|
|
7
|
+
const react_bootstrap_1 = require("react-bootstrap");
|
|
8
|
+
const ConnectedModal_1 = tslib_1.__importDefault(require("./ConnectedModal"));
|
|
9
|
+
const AlertDialog = (props) => {
|
|
10
|
+
const { isOpen, title, description, onProceed, proceedText, onCancel, cancelText, hideCancel, onDestroy, destroyText, manualBackground } = props;
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)(ConnectedModal_1.default, { show: isOpen, onHide: onCancel, className: `z-9999${manualBackground ? ' bg-black-50' : ''}`, children: [(0, jsx_runtime_1.jsx)(react_bootstrap_1.Modal.Header, { closeButton: true, children: (0, jsx_runtime_1.jsx)(react_bootstrap_1.Modal.Title, { children: title }) }), !!description && (0, jsx_runtime_1.jsx)(react_bootstrap_1.Modal.Body, { children: description }), (0, jsx_runtime_1.jsxs)(react_bootstrap_1.Modal.Footer, { children: [!!onProceed && ((0, jsx_runtime_1.jsx)(Button_1.default, { id: "alert-dialog-proceed-btn", "aria-label": proceedText || 'Confirm', className: "btn-primary ttc fr mb1", color: "primary", onClick: onProceed, children: proceedText || 'Confirm' })), !hideCancel && ((0, jsx_runtime_1.jsx)(Button_1.default, { id: "alert-dialog-cancel-btn", color: "primary", "aria-label": cancelText || 'Cancel', className: `btn-text ttc${onDestroy ? ' fr' : ' fl'} ${onProceed ? ' mr1' : ''}`, onClick: onCancel, children: cancelText || 'Cancel' })), !!onDestroy && ((0, jsx_runtime_1.jsx)(Button_1.default, { id: "alert-dialog-destroy-btn", "aria-label": destroyText || 'Destroy', color: "secondary", className: "btn-text color-red ttc fl", onClick: onDestroy, children: destroyText || 'Destroy' }))] })] }));
|
|
21
12
|
};
|
|
22
13
|
exports.AlertDialog = AlertDialog;
|
|
@@ -1,58 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
-
};
|
|
27
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
3
|
exports.AlertWithIcon = void 0;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const CheckCircle_1 = tslib_1.__importDefault(require("@material-ui/icons/CheckCircle"));
|
|
7
|
+
const Error_1 = tslib_1.__importDefault(require("@material-ui/icons/Error"));
|
|
8
|
+
const Info_1 = tslib_1.__importDefault(require("@material-ui/icons/Info"));
|
|
9
|
+
const Warning_1 = tslib_1.__importDefault(require("@material-ui/icons/Warning"));
|
|
10
|
+
const react_bootstrap_1 = require("react-bootstrap");
|
|
35
11
|
function getIconForVariant(variant, iconClassName) {
|
|
36
|
-
|
|
12
|
+
const combinedIconClassName = `self-start mr2 ${iconClassName ? ` ${iconClassName}` : ''}`;
|
|
37
13
|
switch (variant) {
|
|
38
14
|
case 'success':
|
|
39
|
-
return
|
|
15
|
+
return (0, jsx_runtime_1.jsx)(CheckCircle_1.default, { className: combinedIconClassName });
|
|
40
16
|
case 'info':
|
|
41
|
-
return
|
|
17
|
+
return (0, jsx_runtime_1.jsx)(Info_1.default, { className: combinedIconClassName });
|
|
42
18
|
case 'warning':
|
|
43
|
-
return
|
|
19
|
+
return (0, jsx_runtime_1.jsx)(Warning_1.default, { className: combinedIconClassName });
|
|
44
20
|
case 'danger':
|
|
45
|
-
return
|
|
21
|
+
return (0, jsx_runtime_1.jsx)(Error_1.default, { className: combinedIconClassName });
|
|
46
22
|
default:
|
|
47
23
|
return null;
|
|
48
24
|
}
|
|
49
25
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
Icon,
|
|
56
|
-
props.children));
|
|
26
|
+
const AlertWithIcon = props => {
|
|
27
|
+
const { iconClassName, className, children, variant } = props, otherProps = tslib_1.__rest(props, ["iconClassName", "className", "children", "variant"]);
|
|
28
|
+
const combinedClassName = `alert-with-icon${className ? ` ${className}` : ''}`;
|
|
29
|
+
const Icon = getIconForVariant(variant, iconClassName);
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)(react_bootstrap_1.Alert, Object.assign({ className: combinedClassName, variant: variant }, otherProps, { children: [Icon, props.children] })));
|
|
57
31
|
};
|
|
58
32
|
exports.AlertWithIcon = AlertWithIcon;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { ModalProps } from 'react-bootstrap';
|
|
3
|
-
declare const _default: React.ComponentClass<ModalProps, any>;
|
|
4
2
|
/**
|
|
5
3
|
* Wrapped version of "react-bootstrap"'s `Modal` component. Uses `ConnectedModalComponent` to coordinate modal state in redux.
|
|
6
4
|
*/
|
|
5
|
+
declare const _default: import("react").ComponentClass<ModalProps, any>;
|
|
7
6
|
export default _default;
|
|
@@ -1,40 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
-
};
|
|
27
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_bootstrap_1 = require("react-bootstrap");
|
|
6
|
+
const ConnectedModalComponent_1 = tslib_1.__importDefault(require("./HOC/ConnectedModalComponent"));
|
|
7
|
+
const ConnectedModal = (_a) => {
|
|
8
|
+
var {
|
|
33
9
|
// exclude props that shouldn't be passed to the Modal
|
|
34
|
-
guid
|
|
35
|
-
return
|
|
10
|
+
guid, modals, isTopOpenFullscreenModal, dispatch } = _a, modalProps = tslib_1.__rest(_a, ["guid", "modals", "isTopOpenFullscreenModal", "dispatch"]);
|
|
11
|
+
return (0, jsx_runtime_1.jsx)(react_bootstrap_1.Modal, Object.assign({}, modalProps));
|
|
36
12
|
};
|
|
37
13
|
/**
|
|
38
14
|
* Wrapped version of "react-bootstrap"'s `Modal` component. Uses `ConnectedModalComponent` to coordinate modal state in redux.
|
|
39
15
|
*/
|
|
40
|
-
exports.default = ConnectedModalComponent_1.default(ConnectedModal);
|
|
16
|
+
exports.default = (0, ConnectedModalComponent_1.default)(ConnectedModal);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Component } from 'react';
|
|
2
2
|
import { ExternalTerm, Group, ModelCollection } from '../../types';
|
|
3
3
|
interface Props {
|
|
4
4
|
title: string;
|
|
@@ -10,8 +10,8 @@ interface Props {
|
|
|
10
10
|
declare class GroupsDropdown extends Component<Props> {
|
|
11
11
|
loadGroups: () => void;
|
|
12
12
|
didToggle: (isOpen: boolean) => void;
|
|
13
|
-
renderGroupMenu: (groups: Group[]) =>
|
|
14
|
-
render():
|
|
13
|
+
renderGroupMenu: (groups: Group[]) => import("react/jsx-runtime").JSX.Element[];
|
|
14
|
+
render(): import("react/jsx-runtime").JSX.Element | null;
|
|
15
15
|
}
|
|
16
|
-
declare const _default: import("react-redux").ConnectedComponent<typeof GroupsDropdown,
|
|
16
|
+
declare const _default: import("react-redux").ConnectedComponent<typeof GroupsDropdown, import("react-redux").Omit<import("react").ClassAttributes<GroupsDropdown> & Props, "externalTerms" | "groups">>;
|
|
17
17
|
export default _default;
|
|
@@ -1,86 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
18
|
-
}) : (function(o, m, k, k2) {
|
|
19
|
-
if (k2 === undefined) k2 = k;
|
|
20
|
-
o[k2] = m[k];
|
|
21
|
-
}));
|
|
22
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
23
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
24
|
-
}) : function(o, v) {
|
|
25
|
-
o["default"] = v;
|
|
26
|
-
});
|
|
27
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
actionCreator_1.dispatchModelFetchRequest({ modelName: 'groups' });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const react_bootstrap_1 = require("react-bootstrap");
|
|
6
|
+
const react_redux_1 = require("react-redux");
|
|
7
|
+
const react_router_bootstrap_1 = require("react-router-bootstrap");
|
|
8
|
+
const actionCreator_1 = require("../../redux/actionCreator");
|
|
9
|
+
const date_1 = require("../../utils/date");
|
|
10
|
+
const groupDates_1 = require("../../utils/groupDates");
|
|
11
|
+
const groupRoles_1 = require("../../utils/groupRoles");
|
|
12
|
+
const sort_1 = require("../../utils/sort");
|
|
13
|
+
const ManagedNavDropdown_1 = require("./ManagedNavDropdown");
|
|
14
|
+
class GroupsDropdown extends react_1.Component {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.loadGroups = () => {
|
|
18
|
+
(0, actionCreator_1.dispatchModelFetchRequest)({ modelName: 'groups' });
|
|
51
19
|
};
|
|
52
|
-
|
|
20
|
+
this.didToggle = (isOpen) => {
|
|
53
21
|
if (isOpen) {
|
|
54
|
-
|
|
22
|
+
this.loadGroups();
|
|
55
23
|
}
|
|
56
24
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return groups.sort(sort_1.sortByNameNatural).map(function (group) {
|
|
62
|
-
var groupURL = "/courses/" + group.id;
|
|
63
|
-
return (react_1.default.createElement(react_router_bootstrap_1.LinkContainer, { key: group.id, to: "" + groupURL },
|
|
64
|
-
react_1.default.createElement(react_bootstrap_1.Dropdown.Item, null, group.name)));
|
|
25
|
+
this.renderGroupMenu = (groups) => {
|
|
26
|
+
return groups.sort(sort_1.sortByNameNatural).map(group => {
|
|
27
|
+
const groupURL = `/courses/${group.id}`;
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(react_router_bootstrap_1.LinkContainer, { to: groupURL, children: (0, jsx_runtime_1.jsx)(react_bootstrap_1.Dropdown.Item, { children: group.name }) }, group.id));
|
|
65
29
|
});
|
|
66
30
|
};
|
|
67
|
-
return _this;
|
|
68
31
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
32
|
+
render() {
|
|
33
|
+
const { title, id, groups, externalTerms, anyRoleButLearner } = this.props;
|
|
34
|
+
const groupsFilteredByRole = anyRoleButLearner ? (0, groupRoles_1.groupsAsAnythingButLearner)(groups) : (0, groupRoles_1.groupsAsLearner)(groups);
|
|
35
|
+
const currentGroups = (0, groupDates_1.filterGroupsByEndDate)(groupsFilteredByRole, externalTerms, date_1.isNowBeforeDate);
|
|
73
36
|
if (currentGroups.length === 0) {
|
|
74
37
|
return null;
|
|
75
38
|
}
|
|
76
|
-
return (
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
var mapStateToProps = function (state) {
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(ManagedNavDropdown_1.ManagedNavDropdown, { title: title, id: id, didToggle: this.didToggle, children: this.renderGroupMenu(currentGroups) }));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const mapStateToProps = (state) => {
|
|
81
43
|
return {
|
|
82
44
|
groups: !!state.models && !!state.models.groups ? state.models.groups : {},
|
|
83
45
|
externalTerms: state.models.externalTerms
|
|
84
46
|
};
|
|
85
47
|
};
|
|
86
|
-
exports.default = react_redux_1.connect(mapStateToProps)(GroupsDropdown);
|
|
48
|
+
exports.default = (0, react_redux_1.connect)(mapStateToProps)(GroupsDropdown);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Component } from 'react';
|
|
2
2
|
import { NavDropdownProps } from 'react-bootstrap';
|
|
3
3
|
declare enum EVENT_SOURCE {
|
|
4
4
|
MOUSE_ENTER = "mouseEnter",
|
|
@@ -27,6 +27,6 @@ export declare class ManagedNavDropdown extends Component<ManagedNavDropdownProp
|
|
|
27
27
|
onMouseLeave: () => void;
|
|
28
28
|
onToggle: (nextIsOpen: boolean, event: any, source: Record<string, unknown>) => void;
|
|
29
29
|
didToggle: () => void;
|
|
30
|
-
render():
|
|
30
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
31
31
|
}
|
|
32
32
|
export {};
|