studiokit-scaffolding-js 4.12.1 → 5.0.0
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 +1 -1
- package/lib/components/AlertDialog.d.ts +1 -2
- package/lib/components/AlertDialog.js +2 -1
- package/lib/components/AlertWithIcon.d.ts +1 -2
- package/lib/components/AlertWithIcon.js +2 -1
- package/lib/components/Dropdowns/GroupsDropdown.d.ts +2 -3
- package/lib/components/Dropdowns/GroupsDropdown.js +4 -7
- package/lib/components/Dropdowns/ManagedNavDropdown.d.ts +1 -1
- package/lib/components/Dropdowns/ManagedNavDropdown.js +0 -1
- package/lib/components/Dropdowns/UserDropdown.js +4 -4
- package/lib/components/EntityOwnerList.d.ts +1 -1
- package/lib/components/EntityOwnerList.js +2 -1
- package/lib/components/Error.js +1 -0
- package/lib/components/Forms/DateField.d.ts +1 -1
- package/lib/components/Forms/DateField.js +2 -1
- package/lib/components/Forms/TimeField.d.ts +1 -1
- package/lib/components/Forms/TimeField.js +2 -1
- package/lib/components/Groups/ExternalGroups/Attach.d.ts +1 -2
- package/lib/components/Groups/ExternalGroups/Attach.js +12 -11
- package/lib/components/Groups/ExternalGroups/Table.d.ts +1 -2
- package/lib/components/HOC/AccessibleAppComponent.js +2 -5
- package/lib/components/HOC/ActivityRequiredComponent.d.ts +1 -2
- package/lib/components/HOC/AsyncComponent.js +2 -5
- package/lib/components/HOC/AuthenticatedComponent.d.ts +1 -2
- package/lib/components/HOC/AuthenticatedComponent.js +3 -3
- package/lib/components/HOC/CollectionComponent.d.ts +3 -4
- package/lib/components/HOC/CollectionComponent.js +6 -6
- package/lib/components/HOC/CollectionFirstItemComponent.d.ts +1 -2
- package/lib/components/HOC/CollectionItemComponent.d.ts +2 -4
- package/lib/components/HOC/CollectionItemComponent.js +2 -2
- package/lib/components/HOC/DataDependentComponent.js +2 -5
- package/lib/components/HOC/GroupActivityRequiredComponent.d.ts +1 -2
- package/lib/components/HOC/ModelContextDependencyVerifyComponent.d.ts +1 -1
- package/lib/components/HOC/ModelErrorRedirectComponent.d.ts +1 -1
- package/lib/components/HOC/ModelErrorRedirectComponent.js +5 -8
- package/lib/components/Loading.d.ts +1 -2
- package/lib/components/Loading.js +4 -3
- package/lib/components/LockDownBrowser/Check.d.ts +1 -1
- package/lib/components/LockDownBrowser/Check.js +4 -1
- package/lib/components/LockDownBrowser/Launch.d.ts +1 -1
- package/lib/components/LockDownBrowser/Launch.js +6 -3
- package/lib/components/Lti/CreateNonLtiGroupAlertDialog.d.ts +1 -3
- package/lib/components/Lti/CreateNonLtiGroupAlertDialog.js +6 -6
- package/lib/components/Lti/Launch.js +5 -4
- package/lib/components/NotFound.d.ts +2 -2
- package/lib/components/NotFound.js +1 -0
- package/lib/components/Quill/Specs/CustomImageSpec.d.ts +1 -2
- package/lib/components/Quill/Specs/CustomImageSpec.js +2 -1
- package/lib/components/Quill/Specs/CustomVideoSpec.d.ts +1 -2
- package/lib/components/Quill/Specs/CustomVideoSpec.js +2 -1
- package/lib/components/RefreshIndicator/Bordered.d.ts +2 -2
- package/lib/components/RefreshIndicator/Bordered.js +4 -3
- package/lib/components/RefreshIndicator/Inline.d.ts +1 -2
- package/lib/components/RefreshIndicator/Inline.js +2 -1
- package/lib/components/RefreshIndicator/index.d.ts +1 -2
- package/lib/components/RefreshIndicator/index.js +2 -1
- package/lib/components/SearchControls.d.ts +2 -2
- package/lib/components/SearchControls.js +6 -5
- package/lib/components/UserRoles/Add.d.ts +1 -1
- package/lib/components/UserRoles/Add.js +10 -9
- package/lib/components/UserRoles/RoleCell.js +3 -3
- package/lib/components/UserRoles/index.d.ts +2 -3
- package/lib/components/UserRoles/index.js +29 -31
- package/lib/config/eslint/index.js +21 -0
- package/lib/config/eslint/lib/order.js +22 -0
- package/lib/config/eslint/lib/prettier.js +18 -0
- package/lib/config/eslint/lib/typescript.js +86 -0
- package/lib/config/eslint/react.js +9 -0
- package/lib/constants/baseActivity.d.ts +0 -1
- package/lib/constants/baseActivity.js +0 -1
- package/lib/constants/baseRole.d.ts +0 -1
- package/lib/constants/baseRole.js +0 -1
- package/lib/constants/configuration.d.ts +1 -2
- package/lib/constants/externalProviderType.d.ts +0 -1
- package/lib/constants/externalProviderType.js +0 -1
- package/lib/constants/index.d.ts +4 -2
- package/lib/constants/index.js +4 -2
- package/lib/constants/mockData.d.ts +3 -4
- package/lib/constants/mockData.js +14 -17
- package/lib/constants/modelStatus.d.ts +0 -1
- package/lib/constants/modelStatus.js +0 -1
- package/lib/constants/notificationType.d.ts +0 -1
- package/lib/constants/notificationType.js +0 -1
- package/lib/constants/shard.d.ts +0 -1
- package/lib/constants/shard.js +0 -1
- package/lib/constants/tier.d.ts +0 -1
- package/lib/constants/tier.js +0 -1
- package/lib/endpointMappings.d.ts +2 -1
- package/lib/endpointMappings.js +38 -1
- package/lib/hooks/useCollection.d.ts +1 -2
- package/lib/hooks/useCollectionConfiguration.d.ts +1 -2
- package/lib/hooks/useCollectionItem.d.ts +1 -2
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/redux/actionCreator.d.ts +3 -4
- package/lib/redux/actionCreator.js +3 -2
- package/lib/redux/actions.d.ts +27 -0
- package/lib/redux/actions.js +36 -1
- package/lib/redux/configureReducers.d.ts +1 -2
- package/lib/redux/configureReducers.js +2 -4
- package/lib/redux/configureStore.js +3 -4
- package/lib/redux/reducers/authReducer.d.ts +2 -0
- package/lib/redux/reducers/authReducer.js +47 -0
- package/lib/redux/reducers/fetchReducer.d.ts +56 -0
- package/lib/redux/reducers/fetchReducer.js +192 -0
- package/lib/redux/reducers/index.d.ts +3 -1
- package/lib/redux/reducers/index.js +5 -1
- package/lib/redux/sagas/authSaga.d.ts +21 -0
- package/lib/redux/sagas/authSaga.js +440 -0
- package/lib/redux/sagas/caliperSaga.d.ts +2 -2
- package/lib/redux/sagas/caliperSaga.js +9 -13
- package/lib/redux/sagas/clockOffsetSaga.d.ts +2 -1
- package/lib/redux/sagas/clockOffsetSaga.js +2 -2
- package/lib/redux/sagas/configurationSaga.d.ts +2 -1
- package/lib/redux/sagas/configurationSaga.js +2 -2
- package/lib/redux/sagas/errorSaga.js +2 -2
- package/lib/redux/sagas/fetchSaga.d.ts +97 -0
- package/lib/redux/sagas/fetchSaga.js +659 -0
- package/lib/redux/sagas/identityProviderSaga.js +7 -28
- package/lib/redux/sagas/initialDataLoadSaga.js +6 -6
- package/lib/redux/sagas/lockDownBrowserErrorSaga.js +2 -2
- package/lib/redux/sagas/noStoreSaga.d.ts +17 -0
- package/lib/redux/sagas/noStoreSaga.js +123 -0
- package/lib/redux/sagas/postLoginDataSaga.d.ts +2 -2
- package/lib/redux/sagas/postLoginDataSaga.js +6 -7
- package/lib/redux/sagas/postLoginRedirectSaga.d.ts +2 -2
- package/lib/redux/sagas/postLoginRedirectSaga.js +8 -30
- package/lib/redux/sagas/rootSaga.js +14 -11
- package/lib/redux/sagas/sentrySaga.d.ts +2 -1
- package/lib/redux/sagas/sentrySaga.js +4 -5
- package/lib/services/codeProviderService.d.ts +2 -3
- package/lib/services/codeProviderService.js +6 -9
- package/lib/services/dateService.d.ts +4 -0
- package/lib/services/dateService.js +16 -0
- package/lib/services/documentService.d.ts +1 -2
- package/lib/services/documentService.js +2 -2
- package/lib/services/fetchService.d.ts +30 -0
- package/lib/services/fetchService.js +165 -0
- package/lib/services/persistenceService.d.ts +2 -3
- package/lib/services/persistenceService.js +2 -3
- package/lib/services/ticketProviderService.d.ts +2 -3
- package/lib/services/ticketProviderService.js +7 -10
- package/lib/services/tokenPersistenceService.d.ts +2 -0
- package/lib/services/tokenPersistenceService.js +12 -0
- package/lib/services/windowService.d.ts +1 -2
- package/lib/services/windowService.js +2 -2
- package/lib/setupTests.js +10 -10
- package/lib/startup.d.ts +1 -2
- package/lib/types/AppConfiguration.d.ts +1 -1
- package/lib/types/Artifact.d.ts +1 -1
- package/lib/types/BaseReduxState.d.ts +4 -3
- package/lib/types/Client.d.ts +1 -1
- package/lib/types/Collection.d.ts +3 -3
- package/lib/types/Configuration.d.ts +1 -1
- package/lib/types/DeletableModel.d.ts +1 -1
- package/lib/types/ExternalGroup.d.ts +14 -0
- package/lib/types/ExternalProvider.d.ts +10 -0
- package/lib/types/ExternalProvider.js +2 -0
- package/lib/types/ExternalTerm.d.ts +9 -0
- package/lib/types/ExternalTerm.js +2 -0
- package/lib/types/Group.d.ts +2 -2
- package/lib/types/IdentityProvider.d.ts +1 -1
- package/lib/types/LtiLaunch.d.ts +1 -1
- package/lib/types/OwnerSchedule.d.ts +1 -1
- package/lib/types/UniTime.d.ts +1 -1
- package/lib/types/User.d.ts +1 -1
- package/lib/types/auth/AuthAction.d.ts +6 -0
- package/lib/types/auth/AuthAction.js +2 -0
- package/lib/types/auth/AuthState.d.ts +6 -0
- package/lib/types/auth/AuthState.js +2 -0
- package/lib/types/auth/ClientCredentials.d.ts +4 -0
- package/lib/types/auth/ClientCredentials.js +2 -0
- package/lib/types/auth/CodeProviderService.d.ts +4 -0
- package/lib/types/auth/CodeProviderService.js +2 -0
- package/lib/types/auth/Credentials.d.ts +4 -0
- package/lib/types/auth/Credentials.js +2 -0
- package/lib/types/auth/TicketProviderService.d.ts +5 -0
- package/lib/types/auth/TicketProviderService.js +2 -0
- package/lib/types/auth/TokenPersistenceService.d.ts +5 -0
- package/lib/types/auth/TokenPersistenceService.js +2 -0
- package/lib/types/auth/index.d.ts +7 -0
- package/lib/types/auth/index.js +19 -0
- package/lib/types/index.d.ts +7 -1
- package/lib/types/index.js +7 -1
- package/lib/types/net/EndpointConfig.d.ts +8 -0
- package/lib/types/net/EndpointConfig.js +2 -0
- package/lib/types/net/EndpointMapping.d.ts +7 -0
- package/lib/types/net/EndpointMapping.js +2 -0
- package/lib/types/net/EndpointMappings.d.ts +7 -0
- package/lib/types/net/EndpointMappings.js +2 -0
- package/lib/types/net/ErrorHandler.d.ts +3 -0
- package/lib/types/net/ErrorHandler.js +2 -0
- package/lib/types/net/FetchAction.d.ts +39 -0
- package/lib/types/net/FetchAction.js +2 -0
- package/lib/types/net/FetchConfig.d.ts +14 -0
- package/lib/types/net/FetchConfig.js +2 -0
- package/lib/types/net/FetchError.d.ts +7 -0
- package/lib/types/net/FetchError.js +5 -0
- package/lib/types/net/FetchResult.d.ts +10 -0
- package/lib/types/net/FetchResult.js +2 -0
- package/lib/types/net/HTTPMethod.d.ts +1 -0
- package/lib/types/net/HTTPMethod.js +2 -0
- package/lib/types/net/LoggerFunction.d.ts +1 -0
- package/lib/types/net/LoggerFunction.js +2 -0
- package/lib/types/net/Metadata.d.ts +9 -0
- package/lib/types/net/Metadata.js +5 -0
- package/lib/types/net/Model.d.ts +12 -0
- package/lib/types/net/Model.js +2 -0
- package/lib/types/net/ModelCollection.d.ts +13 -0
- package/lib/types/net/ModelCollection.js +2 -0
- package/lib/types/net/ModelsState.d.ts +8 -0
- package/lib/types/net/ModelsState.js +2 -0
- package/lib/types/net/OAuthToken.d.ts +12 -0
- package/lib/types/net/OAuthToken.js +5 -0
- package/lib/types/net/OAuthTokenResponse.d.ts +2 -0
- package/lib/types/net/OAuthTokenResponse.js +2 -0
- package/lib/types/net/TokenAccessFunction.d.ts +3 -0
- package/lib/types/net/TokenAccessFunction.js +2 -0
- package/lib/types/net/index.d.ts +17 -0
- package/lib/types/net/index.js +29 -0
- package/lib/utils/baseActivity.d.ts +1 -2
- package/lib/utils/baseActivity.js +4 -7
- package/lib/utils/baseRole.js +13 -16
- package/lib/utils/collection.d.ts +1 -2
- package/lib/utils/collection.js +12 -12
- package/lib/utils/externalGroup.d.ts +2 -1
- package/lib/utils/externalGroup.js +7 -11
- package/lib/utils/externalProviders.d.ts +1 -1
- package/lib/utils/externalProviders.js +2 -5
- package/lib/utils/externalTerms.d.ts +1 -1
- package/lib/utils/groupDates.d.ts +1 -3
- package/lib/utils/groupRoles.d.ts +1 -2
- package/lib/utils/groupRoles.js +5 -5
- package/lib/utils/model.d.ts +2 -2
- package/lib/utils/model.js +4 -7
- package/lib/utils/shard.js +7 -7
- package/lib/utils/url.d.ts +1 -1
- package/lib/utils/url.js +9 -12
- package/lib/utils/user.d.ts +1 -1
- package/lib/utils/user.js +6 -7
- package/package.json +15 -12
- package/lib/types/External.d.ts +0 -31
- /package/lib/types/{External.js → ExternalGroup.js} +0 -0
|
@@ -14,5 +14,4 @@ export interface AlertDialogProps {
|
|
|
14
14
|
destroyText?: string;
|
|
15
15
|
manualBackground?: boolean;
|
|
16
16
|
}
|
|
17
|
-
declare const AlertDialog: FunctionComponent<AlertDialogProps>;
|
|
18
|
-
export default AlertDialog;
|
|
17
|
+
export declare const AlertDialog: FunctionComponent<AlertDialogProps>;
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AlertDialog = void 0;
|
|
6
7
|
var Button_1 = __importDefault(require("@material-ui/core/Button"));
|
|
7
8
|
var react_1 = __importDefault(require("react"));
|
|
8
9
|
var react_bootstrap_1 = require("react-bootstrap");
|
|
@@ -18,4 +19,4 @@ var AlertDialog = function (props) {
|
|
|
18
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')),
|
|
19
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')))));
|
|
20
21
|
};
|
|
21
|
-
exports.
|
|
22
|
+
exports.AlertDialog = AlertDialog;
|
|
@@ -3,5 +3,4 @@ import { AlertProps } from 'react-bootstrap';
|
|
|
3
3
|
export interface AlertWithIconProps extends AlertProps {
|
|
4
4
|
iconClassName?: string;
|
|
5
5
|
}
|
|
6
|
-
declare const AlertWithIcon: FunctionComponent<AlertWithIconProps>;
|
|
7
|
-
export default AlertWithIcon;
|
|
6
|
+
export declare const AlertWithIcon: FunctionComponent<AlertWithIconProps>;
|
|
@@ -25,6 +25,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.AlertWithIcon = void 0;
|
|
28
29
|
var CheckCircle_1 = __importDefault(require("@material-ui/icons/CheckCircle"));
|
|
29
30
|
var Error_1 = __importDefault(require("@material-ui/icons/Error"));
|
|
30
31
|
var Info_1 = __importDefault(require("@material-ui/icons/Info"));
|
|
@@ -54,4 +55,4 @@ var AlertWithIcon = function (props) {
|
|
|
54
55
|
Icon,
|
|
55
56
|
props.children));
|
|
56
57
|
};
|
|
57
|
-
exports.
|
|
58
|
+
exports.AlertWithIcon = AlertWithIcon;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
import { ModelCollection } from '
|
|
3
|
-
import { ExternalTerm, Group } from '../../types';
|
|
2
|
+
import { ExternalTerm, Group, ModelCollection } from '../../types';
|
|
4
3
|
interface Props {
|
|
5
4
|
title: string;
|
|
6
5
|
id: string;
|
|
@@ -14,5 +13,5 @@ declare class GroupsDropdown extends Component<Props> {
|
|
|
14
13
|
renderGroupMenu: (groups: Group[]) => JSX.Element[] | null;
|
|
15
14
|
render(): JSX.Element | null;
|
|
16
15
|
}
|
|
17
|
-
declare const _default: import("react-redux").ConnectedComponent<typeof GroupsDropdown, Pick<React.ClassAttributes<GroupsDropdown> & Props, "id" | "
|
|
16
|
+
declare const _default: import("react-redux").ConnectedComponent<typeof GroupsDropdown, Pick<React.ClassAttributes<GroupsDropdown> & Props, "id" | "ref" | "title" | "key" | "anyRoleButLearner">>;
|
|
18
17
|
export default _default;
|
|
@@ -31,27 +31,24 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
31
31
|
__setModuleDefault(result, mod);
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
35
|
var react_1 = __importStar(require("react"));
|
|
39
36
|
var react_bootstrap_1 = require("react-bootstrap");
|
|
40
37
|
var react_redux_1 = require("react-redux");
|
|
41
38
|
var react_router_bootstrap_1 = require("react-router-bootstrap");
|
|
42
|
-
var studiokit_net_js_1 = require("studiokit-net-js");
|
|
43
39
|
var actionCreator_1 = require("../../redux/actionCreator");
|
|
40
|
+
var actions_1 = require("../../redux/actions");
|
|
44
41
|
var date_1 = require("../../utils/date");
|
|
45
42
|
var groupDates_1 = require("../../utils/groupDates");
|
|
46
43
|
var groupRoles_1 = require("../../utils/groupRoles");
|
|
47
44
|
var sort_1 = require("../../utils/sort");
|
|
48
|
-
var ManagedNavDropdown_1 =
|
|
45
|
+
var ManagedNavDropdown_1 = require("./ManagedNavDropdown");
|
|
49
46
|
var GroupsDropdown = /** @class */ (function (_super) {
|
|
50
47
|
__extends(GroupsDropdown, _super);
|
|
51
48
|
function GroupsDropdown() {
|
|
52
49
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
53
50
|
_this.loadGroups = function () {
|
|
54
|
-
actionCreator_1.dispatchAction(
|
|
51
|
+
actionCreator_1.dispatchAction(actions_1.NET_ACTION.DATA_REQUESTED, { modelName: 'groups' });
|
|
55
52
|
};
|
|
56
53
|
_this.didToggle = function (isOpen) {
|
|
57
54
|
if (isOpen) {
|
|
@@ -77,7 +74,7 @@ var GroupsDropdown = /** @class */ (function (_super) {
|
|
|
77
74
|
if (currentGroups.length === 0) {
|
|
78
75
|
return null;
|
|
79
76
|
}
|
|
80
|
-
return (react_1.default.createElement(ManagedNavDropdown_1.
|
|
77
|
+
return (react_1.default.createElement(ManagedNavDropdown_1.ManagedNavDropdown, { title: title, id: id, didToggle: this.didToggle }, this.renderGroupMenu(currentGroups)));
|
|
81
78
|
};
|
|
82
79
|
return GroupsDropdown;
|
|
83
80
|
}(react_1.Component));
|
|
@@ -48,15 +48,15 @@ exports.UserDropdown = void 0;
|
|
|
48
48
|
var Lock_1 = __importDefault(require("@material-ui/icons/Lock"));
|
|
49
49
|
var react_1 = __importStar(require("react"));
|
|
50
50
|
var react_bootstrap_1 = require("react-bootstrap");
|
|
51
|
-
var studiokit_auth_js_1 = require("studiokit-auth-js");
|
|
52
51
|
var uuid_1 = require("uuid");
|
|
53
52
|
var actionCreator_1 = require("../../redux/actionCreator");
|
|
53
|
+
var actions_1 = require("../../redux/actions");
|
|
54
54
|
var user_1 = require("../../utils/user");
|
|
55
55
|
var IconStopImpersonating_1 = require("../Icons/IconStopImpersonating");
|
|
56
56
|
var UserDetail_1 = require("../Impersonation/UserDetail");
|
|
57
|
-
var ManagedNavDropdown_1 =
|
|
57
|
+
var ManagedNavDropdown_1 = require("./ManagedNavDropdown");
|
|
58
58
|
var doLogOut = function () {
|
|
59
|
-
actionCreator_1.dispatchAction(
|
|
59
|
+
actionCreator_1.dispatchAction(actions_1.AUTH_ACTION.LOG_OUT_REQUESTED, {});
|
|
60
60
|
};
|
|
61
61
|
var UserDropdown = function (_a) {
|
|
62
62
|
var userInfo = _a.userInfo, children = _a.children, props = __rest(_a, ["userInfo", "children"]);
|
|
@@ -64,7 +64,7 @@ var UserDropdown = function (_a) {
|
|
|
64
64
|
var dropdownTitle = userInfo.isImpersonated ? (react_1.default.createElement(UserDetail_1.ImpersonationUserDetail, __assign({ userInfo: userInfo }, props))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
65
65
|
"Hi, ",
|
|
66
66
|
user_1.displayFirstName(userInfo)));
|
|
67
|
-
return (react_1.default.createElement(ManagedNavDropdown_1.
|
|
67
|
+
return (react_1.default.createElement(ManagedNavDropdown_1.ManagedNavDropdown, { id: "user-menu", className: "user-menu" + (userInfo.isImpersonated ? ' user-menu-impersonated' : ''), title: dropdownTitle },
|
|
68
68
|
children,
|
|
69
69
|
userInfo.isImpersonated && (react_1.default.createElement(react_bootstrap_1.NavDropdown.Item, { onSelect: function () { return user_1.stopImpersonation(guid); } },
|
|
70
70
|
react_1.default.createElement(IconStopImpersonating_1.IconStopImpersonating, { className: "menu-icon" }),
|
|
@@ -5,7 +5,7 @@ export interface EntityOwnerListProps {
|
|
|
5
5
|
canReadAnyUserGlobally: boolean;
|
|
6
6
|
displayAsInstructors?: boolean;
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export declare class EntityOwnerList extends Component<EntityOwnerListProps> {
|
|
9
9
|
renderOwner: (owner: User, className: string) => JSX.Element;
|
|
10
10
|
render(): JSX.Element;
|
|
11
11
|
}
|
|
@@ -32,6 +32,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
exports.EntityOwnerList = void 0;
|
|
35
36
|
var react_1 = __importStar(require("react"));
|
|
36
37
|
var react_router_dom_1 = require("react-router-dom");
|
|
37
38
|
var user_1 = require("../utils/user");
|
|
@@ -60,4 +61,4 @@ var EntityOwnerList = /** @class */ (function (_super) {
|
|
|
60
61
|
};
|
|
61
62
|
return EntityOwnerList;
|
|
62
63
|
}(react_1.Component));
|
|
63
|
-
exports.
|
|
64
|
+
exports.EntityOwnerList = EntityOwnerList;
|
package/lib/components/Error.js
CHANGED
|
@@ -26,4 +26,5 @@ var Error = function (props) {
|
|
|
26
26
|
react_1.default.createElement("a", { href: "mailto:tlt@purdue.edu" }, "tlt@purdue.edu")),
|
|
27
27
|
lockDownBrowserInfo.isClientLockDownBrowser && react_1.default.createElement(ExitButton_1.LockDownBrowserExitButton, null))))));
|
|
28
28
|
};
|
|
29
|
+
// required for use in Routes / AsyncComponent
|
|
29
30
|
exports.default = Error;
|
|
@@ -6,7 +6,7 @@ export interface DateFieldProps extends Pick<StandardTextFieldProps, Exclude<key
|
|
|
6
6
|
maxDate?: string;
|
|
7
7
|
onChange: (dateString: string, date?: Date) => void;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export declare class DateField extends Component<DateFieldProps> {
|
|
10
10
|
onChange: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>;
|
|
11
11
|
isDateValid: (dateString: string) => boolean;
|
|
12
12
|
render(): JSX.Element;
|
|
@@ -46,6 +46,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
46
46
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
47
47
|
};
|
|
48
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
+
exports.DateField = void 0;
|
|
49
50
|
var TextField_1 = __importDefault(require("@material-ui/core/TextField"));
|
|
50
51
|
var moment_1 = __importDefault(require("moment"));
|
|
51
52
|
var react_1 = __importStar(require("react"));
|
|
@@ -96,4 +97,4 @@ var DateField = /** @class */ (function (_super) {
|
|
|
96
97
|
};
|
|
97
98
|
return DateField;
|
|
98
99
|
}(react_1.Component));
|
|
99
|
-
exports.
|
|
100
|
+
exports.DateField = DateField;
|
|
@@ -4,7 +4,7 @@ export interface TimeFieldProps extends Pick<StandardTextFieldProps, Exclude<key
|
|
|
4
4
|
value?: string;
|
|
5
5
|
onChange: (timeString: string, time?: Date) => void;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export declare class TimeField extends Component<TimeFieldProps> {
|
|
8
8
|
onChange: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>;
|
|
9
9
|
isTimeValid: (timeString: string) => boolean;
|
|
10
10
|
render(): JSX.Element;
|
|
@@ -46,6 +46,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
46
46
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
47
47
|
};
|
|
48
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
+
exports.TimeField = void 0;
|
|
49
50
|
var TextField_1 = __importDefault(require("@material-ui/core/TextField"));
|
|
50
51
|
var Help_1 = __importDefault(require("@material-ui/icons/Help"));
|
|
51
52
|
var moment_1 = __importDefault(require("moment"));
|
|
@@ -109,4 +110,4 @@ var TimeField = /** @class */ (function (_super) {
|
|
|
109
110
|
};
|
|
110
111
|
return TimeField;
|
|
111
112
|
}(react_1.Component));
|
|
112
|
-
exports.
|
|
113
|
+
exports.TimeField = TimeField;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Dictionary } from 'lodash';
|
|
2
2
|
import { Component } from 'react';
|
|
3
|
-
import { ModelCollection } from '
|
|
4
|
-
import { ExternalGroup, GroupUserRole, LtiLaunch, OwnerSchedule, UniTimeGroup, UserInfo } from '../../../types';
|
|
3
|
+
import { ExternalGroup, GroupUserRole, LtiLaunch, ModelCollection, OwnerSchedule, UniTimeGroup, UserInfo } from '../../../types';
|
|
5
4
|
export interface ExternalGroupsAttachProps {
|
|
6
5
|
userInfo: UserInfo;
|
|
7
6
|
canReadExternalGroups: boolean;
|
|
@@ -21,15 +21,16 @@ var lodash_1 = require("lodash");
|
|
|
21
21
|
var react_1 = __importDefault(require("react"));
|
|
22
22
|
var react_2 = require("react");
|
|
23
23
|
var react_bootstrap_1 = require("react-bootstrap");
|
|
24
|
-
var studiokit_net_js_1 = require("studiokit-net-js");
|
|
25
24
|
var uuid_1 = require("uuid");
|
|
26
25
|
var constants_1 = require("../../../constants");
|
|
27
26
|
var actionCreator_1 = require("../../../redux/actionCreator");
|
|
27
|
+
var actions_1 = require("../../../redux/actions");
|
|
28
|
+
var noStoreSaga_1 = require("../../../redux/sagas/noStoreSaga");
|
|
28
29
|
var model_1 = require("../../../utils/model");
|
|
29
30
|
var shard_1 = require("../../../utils/shard");
|
|
30
31
|
var user_1 = require("../../../utils/user");
|
|
31
|
-
var AlertWithIcon_1 =
|
|
32
|
-
var Loading_1 =
|
|
32
|
+
var AlertWithIcon_1 = require("../../AlertWithIcon");
|
|
33
|
+
var Loading_1 = require("../../Loading");
|
|
33
34
|
var ExternalGroupsAttach = /** @class */ (function (_super) {
|
|
34
35
|
__extends(ExternalGroupsAttach, _super);
|
|
35
36
|
function ExternalGroupsAttach(props) {
|
|
@@ -86,8 +87,8 @@ var ExternalGroupsAttach = /** @class */ (function (_super) {
|
|
|
86
87
|
};
|
|
87
88
|
_this.getOwnerUniTimeGroups = function (ownerSchedule, userId, externalTermId) {
|
|
88
89
|
if (shard_1.isPurdueShard() && ownerSchedule.status === constants_1.MODEL_STATUS.UNINITIALIZED && !ownerSchedule.externalGroups) {
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
noStoreSaga_1.registerNoStoreActionHook(ownerSchedule.hookId, function (data) {
|
|
91
|
+
noStoreSaga_1.unregisterNoStoreActionHook(ownerSchedule.hookId);
|
|
91
92
|
if (data && data.errorData) {
|
|
92
93
|
_this.setState({ isShowingErrorAlert: true, isUniTimeScheduleLoadingDone: true });
|
|
93
94
|
}
|
|
@@ -95,7 +96,7 @@ var ExternalGroupsAttach = /** @class */ (function (_super) {
|
|
|
95
96
|
_this.setUserUniTimeGroups(userId, data.externalGroups);
|
|
96
97
|
}
|
|
97
98
|
});
|
|
98
|
-
actionCreator_1.dispatchAction(
|
|
99
|
+
actionCreator_1.dispatchAction(actions_1.NET_ACTION.DATA_REQUESTED, {
|
|
99
100
|
modelName: 'uniTimeInstructorSchedule',
|
|
100
101
|
queryParams: {
|
|
101
102
|
externalTermId: externalTermId,
|
|
@@ -155,7 +156,7 @@ var ExternalGroupsAttach = /** @class */ (function (_super) {
|
|
|
155
156
|
};
|
|
156
157
|
ExternalGroupsAttach.prototype.componentWillUnmount = function () {
|
|
157
158
|
var ownerSchedules = this.state.ownerSchedules;
|
|
158
|
-
lodash_1.forEach(ownerSchedules, function (os) { return
|
|
159
|
+
lodash_1.forEach(ownerSchedules, function (os) { return noStoreSaga_1.unregisterNoStoreActionHook(os.hookId); });
|
|
159
160
|
};
|
|
160
161
|
ExternalGroupsAttach.prototype.componentDidUpdate = function (prevProps) {
|
|
161
162
|
var prevExternalTermId = prevProps.externalTermId, prevGroupUserRoles = prevProps.groupUserRoles;
|
|
@@ -174,13 +175,13 @@ var ExternalGroupsAttach = /** @class */ (function (_super) {
|
|
|
174
175
|
var _a = this.state, ownerSchedules = _a.ownerSchedules, isUniTimeScheduleLoadingDone = _a.isUniTimeScheduleLoadingDone, isShowingErrorAlert = _a.isShowingErrorAlert;
|
|
175
176
|
var hasAnyExternalGroups = lodash_1.some(ownerSchedules, function (os) { return !!os.externalGroups && os.externalGroups.length > 0; });
|
|
176
177
|
return (react_1.default.createElement("div", null,
|
|
177
|
-
!isUniTimeScheduleLoadingDone && react_1.default.createElement(Loading_1.
|
|
178
|
+
!isUniTimeScheduleLoadingDone && react_1.default.createElement(Loading_1.Loading, null),
|
|
178
179
|
isUniTimeScheduleLoadingDone && (react_1.default.createElement("div", null,
|
|
179
|
-
!hasAnyExternalGroups && (react_1.default.createElement(AlertWithIcon_1.
|
|
180
|
+
!hasAnyExternalGroups && (react_1.default.createElement(AlertWithIcon_1.AlertWithIcon, { variant: "info" },
|
|
180
181
|
react_1.default.createElement("p", null, "No course sections eligible for roster sync."))),
|
|
181
|
-
!!disabledInfoMessage && hasAnyExternalGroups && (react_1.default.createElement(AlertWithIcon_1.
|
|
182
|
+
!!disabledInfoMessage && hasAnyExternalGroups && (react_1.default.createElement(AlertWithIcon_1.AlertWithIcon, { variant: "info" },
|
|
182
183
|
react_1.default.createElement("p", null, disabledInfoMessage))),
|
|
183
|
-
isShowingErrorAlert && (react_1.default.createElement(AlertWithIcon_1.
|
|
184
|
+
isShowingErrorAlert && (react_1.default.createElement(AlertWithIcon_1.AlertWithIcon, { variant: "warning", onClose: function () {
|
|
184
185
|
return _this.setState({
|
|
185
186
|
isShowingErrorAlert: false
|
|
186
187
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FunctionComponent, TableHTMLAttributes } from 'react';
|
|
2
|
-
import { ModelCollection } from '
|
|
3
|
-
import { ExternalGroup, Group, GroupUserRole, LtiLaunch, UniTimeGroup } from '../../../types';
|
|
2
|
+
import { ExternalGroup, Group, GroupUserRole, LtiLaunch, ModelCollection, UniTimeGroup } from '../../../types';
|
|
4
3
|
export interface ExternalGroupsTableProps extends TableHTMLAttributes<Element> {
|
|
5
4
|
group: Partial<Group>;
|
|
6
5
|
externalGroups: Array<ExternalGroup | LtiLaunch | UniTimeGroup>;
|
|
@@ -42,15 +42,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
42
42
|
__setModuleDefault(result, mod);
|
|
43
43
|
return result;
|
|
44
44
|
};
|
|
45
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
46
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
47
|
-
};
|
|
48
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
46
|
exports.setupAccessibleComponent = void 0;
|
|
50
47
|
var react_1 = __importStar(require("react"));
|
|
51
48
|
var react_router_dom_1 = require("react-router-dom");
|
|
52
49
|
var configuration_1 = require("../../constants/configuration");
|
|
53
|
-
var documentService_1 =
|
|
50
|
+
var documentService_1 = require("../../services/documentService");
|
|
54
51
|
function setupAccessibleComponent(WrappedComponent) {
|
|
55
52
|
return /** @class */ (function (_super) {
|
|
56
53
|
__extends(AccessibleComponent, _super);
|
|
@@ -106,7 +103,7 @@ function setupAccessibleComponent(WrappedComponent) {
|
|
|
106
103
|
// Do not reset focus if the new route matches the same router path
|
|
107
104
|
if (this.shouldResetFocus(prevProps.location.pathname, this.props.location.pathname)) {
|
|
108
105
|
if (!!this.root && !!this.root.current) {
|
|
109
|
-
documentService_1.
|
|
106
|
+
documentService_1.documentService.setActiveDocument(this.root.current);
|
|
110
107
|
}
|
|
111
108
|
}
|
|
112
109
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { ComponentClass, ComponentType } from 'react';
|
|
2
|
-
import { Model } from '
|
|
3
|
-
import { BaseReduxState, OptionalRecord } from '../../types';
|
|
2
|
+
import { BaseReduxState, Model, OptionalRecord } from '../../types';
|
|
4
3
|
import { ActivityOptions } from '../../utils/baseActivity';
|
|
5
4
|
export interface ActivityRequiredStateProps {
|
|
6
5
|
hasAccess: boolean;
|
|
@@ -78,13 +78,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
78
78
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
82
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
83
|
-
};
|
|
84
81
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
85
82
|
var react_1 = __importStar(require("react"));
|
|
86
83
|
var ErrorBoundary_1 = require("../ErrorBoundary");
|
|
87
|
-
var Loading_1 =
|
|
84
|
+
var Loading_1 = require("../Loading");
|
|
88
85
|
function asyncComponent(importComponent, showLoader) {
|
|
89
86
|
if (showLoader === void 0) { showLoader = true; }
|
|
90
87
|
return /** @class */ (function (_super) {
|
|
@@ -125,7 +122,7 @@ function asyncComponent(importComponent, showLoader) {
|
|
|
125
122
|
AsyncComponent.prototype.render = function () {
|
|
126
123
|
var ImportedComponent = this.state.component;
|
|
127
124
|
if (!ImportedComponent) {
|
|
128
|
-
return showLoader ? react_1.default.createElement(Loading_1.
|
|
125
|
+
return showLoader ? react_1.default.createElement(Loading_1.Loading, null) : null;
|
|
129
126
|
}
|
|
130
127
|
return (react_1.default.createElement(ErrorBoundary_1.ErrorBoundary, null,
|
|
131
128
|
react_1.default.createElement(ImportedComponent, __assign({}, this.props))));
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { ComponentClass, ComponentType } from 'react';
|
|
2
2
|
import { RouteComponentProps } from 'react-router-dom';
|
|
3
|
-
import { AuthState } from '
|
|
4
|
-
import { BaseReduxState } from '../../types';
|
|
3
|
+
import { AuthState, BaseReduxState } from '../../types';
|
|
5
4
|
export declare type AuthenticatedComponentStateProps = Pick<AuthState, 'isAuthenticating' | 'isAuthenticated'>;
|
|
6
5
|
export interface AuthenticatedComponentProps extends AuthenticatedComponentStateProps, RouteComponentProps {
|
|
7
6
|
}
|
|
@@ -58,7 +58,7 @@ exports.configureMapStateToProps = exports.configureAuthenticatedComponent = voi
|
|
|
58
58
|
var react_1 = __importStar(require("react"));
|
|
59
59
|
var react_redux_1 = require("react-redux");
|
|
60
60
|
var react_router_dom_1 = require("react-router-dom");
|
|
61
|
-
var persistenceService_1 =
|
|
61
|
+
var persistenceService_1 = require("../../services/persistenceService");
|
|
62
62
|
var configureAuthenticatedComponent = function (WrappedComponent) {
|
|
63
63
|
return /** @class */ (function (_super) {
|
|
64
64
|
__extends(AuthenticatedComponent, _super);
|
|
@@ -71,9 +71,9 @@ var configureAuthenticatedComponent = function (WrappedComponent) {
|
|
|
71
71
|
};
|
|
72
72
|
AuthenticatedComponent.prototype.persistReturnUrlIfNeeded = function () {
|
|
73
73
|
var pathname = this.props.location.pathname;
|
|
74
|
-
var returnUrl = persistenceService_1.
|
|
74
|
+
var returnUrl = persistenceService_1.persistenceService.getItem(persistenceService_1.returnUrlKey);
|
|
75
75
|
if (!returnUrl) {
|
|
76
|
-
void persistenceService_1.
|
|
76
|
+
void persistenceService_1.persistenceService.setItem(persistenceService_1.returnUrlKey, pathname);
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
79
|
AuthenticatedComponent.prototype.render = function () {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React, { ComponentClass, ComponentType } from 'react';
|
|
2
2
|
import { RouteComponentProps } from 'react-router';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { BaseReduxState } from '../../types';
|
|
3
|
+
import { MODEL_STATUS } from '../../constants/modelStatus';
|
|
4
|
+
import { BaseReduxState, Model } from '../../types';
|
|
6
5
|
import { CollectionCommonProps, CollectionCommonState, CollectionCreateParams, CollectionDeleteParams, CollectionLoadParams, CollectionMethodConfiguration, CollectionMethods, CollectionReduxResponse, CollectionUpdateParams } from '../../types/Collection';
|
|
7
6
|
import { GuidComponentWrappedProps } from './GuidComponent';
|
|
8
7
|
/** The props passed into `CollectionComponent` from the user and other HOCs. */
|
|
@@ -46,7 +45,7 @@ export declare function configureCollectionComponent<TModel extends Model, TOwnP
|
|
|
46
45
|
};
|
|
47
46
|
contextType?: React.Context<any> | undefined;
|
|
48
47
|
};
|
|
49
|
-
export declare const configureMapStateToProps: <TModel extends Model, TOwnProps extends Pick<CollectionComponentProps<TModel>, "match" | "
|
|
48
|
+
export declare const configureMapStateToProps: <TModel extends Model, TOwnProps extends Pick<CollectionComponentProps<TModel>, "match" | "queryParams" | "modelName" | "guid" | "location" | "history" | "staticContext" | "pathParams" | "disableAutoLoad">>(modelName: string) => (state: BaseReduxState, ownProps: TOwnProps & Partial<CollectionComponentProps<TModel>>) => import("../../types").CollectionSelectorMethodResponse<Model>;
|
|
50
49
|
/**
|
|
51
50
|
* HOC that provides "collection" related functionality, using redux `connect()`, react-router-dom `withRouter()`, and `GuidComponent`.
|
|
52
51
|
*
|
|
@@ -61,13 +61,13 @@ exports.configureMapStateToProps = exports.configureCollectionComponent = void 0
|
|
|
61
61
|
var react_1 = __importStar(require("react"));
|
|
62
62
|
var react_redux_1 = require("react-redux");
|
|
63
63
|
var react_router_1 = require("react-router");
|
|
64
|
-
var modelStatus_1 =
|
|
64
|
+
var modelStatus_1 = require("../../constants/modelStatus");
|
|
65
65
|
var collection_1 = require("../../utils/collection");
|
|
66
66
|
var model_1 = require("../../utils/model");
|
|
67
|
-
var Loading_1 =
|
|
67
|
+
var Loading_1 = require("../Loading");
|
|
68
68
|
var GuidComponent_1 = __importDefault(require("./GuidComponent"));
|
|
69
69
|
function configureCollectionComponent(WrappedComponent, LoaderComponent) {
|
|
70
|
-
if (LoaderComponent === void 0) { LoaderComponent = Loading_1.
|
|
70
|
+
if (LoaderComponent === void 0) { LoaderComponent = Loading_1.Loading; }
|
|
71
71
|
return /** @class */ (function (_super) {
|
|
72
72
|
__extends(CollectionComponent, _super);
|
|
73
73
|
function CollectionComponent(props) {
|
|
@@ -112,8 +112,8 @@ function configureCollectionComponent(WrappedComponent, LoaderComponent) {
|
|
|
112
112
|
};
|
|
113
113
|
_this.state = {
|
|
114
114
|
// initializing until model is loaded
|
|
115
|
-
modelStatus: modelStatus_1.
|
|
116
|
-
previousModelStatus: modelStatus_1.
|
|
115
|
+
modelStatus: modelStatus_1.MODEL_STATUS.UNINITIALIZED,
|
|
116
|
+
previousModelStatus: modelStatus_1.MODEL_STATUS.UNINITIALIZED,
|
|
117
117
|
fetchingId: undefined
|
|
118
118
|
};
|
|
119
119
|
return _this;
|
|
@@ -136,7 +136,7 @@ function configureCollectionComponent(WrappedComponent, LoaderComponent) {
|
|
|
136
136
|
CollectionComponent.prototype.render = function () {
|
|
137
137
|
var _a = this.props, history = _a.history, match = _a.match, location = _a.location, staticContext = _a.staticContext, otherProps = __rest(_a, ["history", "match", "location", "staticContext"]);
|
|
138
138
|
var _b = this.state, modelStatus = _b.modelStatus, previousModelStatus = _b.previousModelStatus, fetchingId = _b.fetchingId;
|
|
139
|
-
if (modelStatus === modelStatus_1.
|
|
139
|
+
if (modelStatus === modelStatus_1.MODEL_STATUS.UNINITIALIZED) {
|
|
140
140
|
return react_1.default.createElement(LoaderComponent, null);
|
|
141
141
|
}
|
|
142
142
|
return (react_1.default.createElement(WrappedComponent, __assign({}, otherProps, { modelStatus: modelStatus, previousModelStatus: previousModelStatus, fetchingId: fetchingId, load: this.load, stopPeriodicLoad: this.stopPeriodicLoad, create: this.create, update: this.update, delete: this.delete })));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { ComponentClass, ComponentType } from 'react';
|
|
2
|
-
import { Model } from '
|
|
3
|
-
import { CollectionItemReduxResponse } from '../../types/Collection';
|
|
2
|
+
import { CollectionItemReduxResponse, Model } from '../../types';
|
|
4
3
|
import { CollectionComponentWrappedProps } from './CollectionComponent';
|
|
5
4
|
/** The props passed into `WrappedComponent`. */
|
|
6
5
|
export interface CollectionFirstItemComponentWrappedProps<TModel extends Model> extends Omit<CollectionComponentWrappedProps<TModel>, 'model'>, CollectionItemReduxResponse<TModel> {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React, { ComponentClass, ComponentType } from 'react';
|
|
2
2
|
import { RouteComponentProps } from 'react-router';
|
|
3
|
-
import { Model } from 'studiokit-net-js';
|
|
4
3
|
import { MODEL_STATUS } from '../../constants/modelStatus';
|
|
5
|
-
import { BaseReduxState } from '../../types';
|
|
6
|
-
import { CollectionCommonProps, CollectionCommonState, CollectionCreateParams, CollectionItemDeleteParams, CollectionItemLoadParams, CollectionItemMethods, CollectionItemReduxResponse, CollectionItemUpdateParams, CollectionMethodConfiguration } from '../../types/Collection';
|
|
4
|
+
import { BaseReduxState, CollectionCommonProps, CollectionCommonState, CollectionCreateParams, CollectionItemDeleteParams, CollectionItemLoadParams, CollectionItemMethods, CollectionItemReduxResponse, CollectionItemUpdateParams, CollectionMethodConfiguration, Model } from '../../types';
|
|
7
5
|
import { GuidComponentWrappedProps } from './GuidComponent';
|
|
8
6
|
/** The props passed into `CollectionItemComponent` from the user and other HOCs. */
|
|
9
7
|
export interface CollectionItemComponentProps<TModel extends Model> extends CollectionCommonProps, GuidComponentWrappedProps, RouteComponentProps, CollectionItemReduxResponse<TModel> {
|
|
@@ -46,7 +44,7 @@ export declare function configureCollectionItemComponent<TModel extends Model, T
|
|
|
46
44
|
};
|
|
47
45
|
contextType?: React.Context<any> | undefined;
|
|
48
46
|
};
|
|
49
|
-
export declare const configureMapStateToProps: <TModel extends Model, TOwnProps extends Pick<CollectionItemComponentProps<TModel>, "match" | "
|
|
47
|
+
export declare const configureMapStateToProps: <TModel extends Model, TOwnProps extends Pick<CollectionItemComponentProps<TModel>, "match" | "queryParams" | "modelName" | "guid" | "location" | "history" | "staticContext" | "pathParams" | "disableAutoLoad">>(modelName: string) => (state: BaseReduxState, ownProps: TOwnProps) => import("../../types").CollectionSelectorMethodResponse<Model>;
|
|
50
48
|
/**
|
|
51
49
|
* HOC that provides "collection" related functionality for a single item in a collection, using redux `connect()`, react-router-dom `withRouter()`, and `GuidComponent`.
|
|
52
50
|
*
|
|
@@ -64,10 +64,10 @@ var react_router_1 = require("react-router");
|
|
|
64
64
|
var modelStatus_1 = require("../../constants/modelStatus");
|
|
65
65
|
var collection_1 = require("../../utils/collection");
|
|
66
66
|
var model_1 = require("../../utils/model");
|
|
67
|
-
var Loading_1 =
|
|
67
|
+
var Loading_1 = require("../Loading");
|
|
68
68
|
var GuidComponent_1 = __importDefault(require("./GuidComponent"));
|
|
69
69
|
function configureCollectionItemComponent(WrappedComponent, LoaderComponent) {
|
|
70
|
-
if (LoaderComponent === void 0) { LoaderComponent = Loading_1.
|
|
70
|
+
if (LoaderComponent === void 0) { LoaderComponent = Loading_1.Loading; }
|
|
71
71
|
return /** @class */ (function (_super) {
|
|
72
72
|
__extends(CollectionItemComponent, _super);
|
|
73
73
|
function CollectionItemComponent(props) {
|
|
@@ -53,14 +53,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
53
53
|
}
|
|
54
54
|
return t;
|
|
55
55
|
};
|
|
56
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
57
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
58
|
-
};
|
|
59
56
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
57
|
exports.configureMapStateToProps = exports.configureDataDependentComponent = void 0;
|
|
61
58
|
var react_1 = __importStar(require("react"));
|
|
62
59
|
var react_redux_1 = require("react-redux");
|
|
63
|
-
var Loading_1 =
|
|
60
|
+
var Loading_1 = require("../Loading");
|
|
64
61
|
var configureDataDependentComponent = function (WrappedComponent) {
|
|
65
62
|
return /** @class */ (function (_super) {
|
|
66
63
|
__extends(DataDependentComponent, _super);
|
|
@@ -69,7 +66,7 @@ var configureDataDependentComponent = function (WrappedComponent) {
|
|
|
69
66
|
}
|
|
70
67
|
DataDependentComponent.prototype.render = function () {
|
|
71
68
|
var _a = this.props, hasData = _a.hasData, ownProps = __rest(_a, ["hasData"]);
|
|
72
|
-
return this.props.hasData ? react_1.default.createElement(WrappedComponent, __assign({}, ownProps)) : react_1.default.createElement(Loading_1.
|
|
69
|
+
return this.props.hasData ? react_1.default.createElement(WrappedComponent, __assign({}, ownProps)) : react_1.default.createElement(Loading_1.Loading, null);
|
|
73
70
|
};
|
|
74
71
|
return DataDependentComponent;
|
|
75
72
|
}(react_1.Component));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ComponentClass, ComponentType } from 'react';
|
|
2
|
-
import { Model } from '
|
|
3
|
-
import { BaseReduxState } from '../../types/BaseReduxState';
|
|
2
|
+
import { BaseReduxState, Model } from '../../types';
|
|
4
3
|
import { ActivityOptions } from '../../utils/baseActivity';
|
|
5
4
|
import { ActivityRequiredStateProps } from './ActivityRequiredComponent';
|
|
6
5
|
import { CollectionItemComponentWrappedProps } from './CollectionItemComponent';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ComponentType } from 'react';
|
|
3
3
|
import { RouteComponentProps } from 'react-router';
|
|
4
|
-
import { Model } from '
|
|
4
|
+
import { Model } from '../../types';
|
|
5
5
|
export interface ModelContextDependencyVerifyComponentProps {
|
|
6
6
|
model: Model;
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ComponentType } from 'react';
|
|
2
|
-
import { Model } from '
|
|
2
|
+
import { Model } from '../../types';
|
|
3
3
|
import { CollectionComponentWrappedProps } from './CollectionComponent';
|
|
4
4
|
import { CollectionItemComponentWrappedProps } from './CollectionItemComponent';
|
|
5
5
|
/**
|
|
@@ -42,13 +42,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
42
42
|
__setModuleDefault(result, mod);
|
|
43
43
|
return result;
|
|
44
44
|
};
|
|
45
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
46
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
47
|
-
};
|
|
48
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
46
|
var react_1 = __importStar(require("react"));
|
|
50
47
|
var react_router_dom_1 = require("react-router-dom");
|
|
51
|
-
var modelStatus_1 =
|
|
48
|
+
var modelStatus_1 = require("../../constants/modelStatus");
|
|
52
49
|
/**
|
|
53
50
|
* This component exists as a child to CollectionItemComponent to
|
|
54
51
|
* redirect the user to a 404/500 page if errors occur while fetching data.
|
|
@@ -69,14 +66,14 @@ function modelErrorRedirectComponent(WrappedComponent) {
|
|
|
69
66
|
}
|
|
70
67
|
ModelErrorRedirectComponent.prototype.render = function () {
|
|
71
68
|
var _a = this.props, model = _a.model, modelStatus = _a.modelStatus, previousModelStatus = _a.previousModelStatus;
|
|
72
|
-
var notFoundRoute = previousModelStatus === modelStatus_1.
|
|
73
|
-
modelStatus === modelStatus_1.
|
|
69
|
+
var notFoundRoute = previousModelStatus === modelStatus_1.MODEL_STATUS.UNINITIALIZED &&
|
|
70
|
+
modelStatus === modelStatus_1.MODEL_STATUS.ERROR &&
|
|
74
71
|
model._metadata &&
|
|
75
72
|
model._metadata.hasError &&
|
|
76
73
|
model._metadata.lastFetchErrorData &&
|
|
77
74
|
model._metadata.lastFetchErrorData.code === 404;
|
|
78
|
-
var errorRoute = previousModelStatus === modelStatus_1.
|
|
79
|
-
modelStatus === modelStatus_1.
|
|
75
|
+
var errorRoute = previousModelStatus === modelStatus_1.MODEL_STATUS.UNINITIALIZED &&
|
|
76
|
+
modelStatus === modelStatus_1.MODEL_STATUS.ERROR &&
|
|
80
77
|
model._metadata &&
|
|
81
78
|
model._metadata.hasError &&
|
|
82
79
|
model._metadata.lastFetchErrorData &&
|