@instructure/quiz-core 17.60.1-rc.8 → 17.61.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/CHANGELOG.md CHANGED
@@ -3,6 +3,29 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [17.61.0](https://gerrit.instructure.com/quizzes-ui/compare/v17.60.0...v17.61.0) (2023-08-01)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **bankSharing:** only show Share with Institution setting for bank_admins ([e62c706](https://gerrit.instructure.com/quizzes-ui/commits/e62c7066fff45755442bc69d5d792f30a6be5e58))
12
+ * **propType:** fix propType warning for SDKApp children ([ff7af50](https://gerrit.instructure.com/quizzes-ui/commits/ff7af501322014cdcd574bd746a95a0b9f2179ef))
13
+
14
+
15
+ ### Features
16
+
17
+ * **alerts:** allow children of sdkApp to trigger alerts ([e0e053e](https://gerrit.instructure.com/quizzes-ui/commits/e0e053e208208aca5300cc46f951aac89fc4708b))
18
+ * Add getAnalysesStatus fetch ([bd8e84b](https://gerrit.instructure.com/quizzes-ui/commits/bd8e84b98936ae8e08450357146920b76b08380a))
19
+ * Add getItemAnalyses fetch ([bdeab6e](https://gerrit.instructure.com/quizzes-ui/commits/bdeab6ecedb1d4c4575562092261ff564075bdfc))
20
+ * Add getQuizAnalysis fetch ([5c27f4a](https://gerrit.instructure.com/quizzes-ui/commits/5c27f4a8c12775f307878e51617205342093f78e))
21
+ * **item_banks:** add duplicate item bank buttons to UI ([74e6a5a](https://gerrit.instructure.com/quizzes-ui/commits/74e6a5a81e4b8238adfa4b8463bbfd919c32d00d))
22
+ * **quizAndItemAnalysis:** add metrics and date to report card component ([8649b9f](https://gerrit.instructure.com/quizzes-ui/commits/8649b9f0a0d7ce1333bf3ccf3b9be06f4034d4dc))
23
+ * **Reports:** Add redux slice for analyses ([5bf12b9](https://gerrit.instructure.com/quizzes-ui/commits/5bf12b92e1e3659352915a53dd27f51965b2c3e7))
24
+
25
+
26
+
27
+
28
+
6
29
  # [17.60.0](https://gerrit.instructure.com/quizzes-ui/compare/v17.59.0...v17.60.0) (2023-07-18)
7
30
 
8
31
 
@@ -9,7 +9,7 @@ import { BuildingButtons as BuildingButtonsPresenter } from "./presenter.js";
9
9
  import { getActiveQuiz } from "../../../../../common/selectors/quizzes.js";
10
10
  import { featureOn } from "../../../../../common/util/featureCheck.js";
11
11
  import { startQuizExportJob } from "../../../../../common/actions/quizExport.js";
12
- import { addInfo } from "../../../../../common/actions/alerts.js";
12
+ import { addAlert, addInfo } from "../../../../../common/actions/alerts.js";
13
13
  export function mapStateToProps(state) {
14
14
  var quiz = getActiveQuiz(state);
15
15
  return {
@@ -26,6 +26,7 @@ export function mapStateToProps(state) {
26
26
 
27
27
  var mapDispatchToProps = function mapDispatchToProps(dispatch) {
28
28
  return {
29
+ addAlert: bindActionCreators(addAlert, dispatch),
29
30
  addInfo: bindActionCreators(addInfo, dispatch),
30
31
  openBanksTray: bindActionCreators(setUI.bind(void 0, BUILD_TRAY_OPEN, true), dispatch),
31
32
  setBanksTrayButtonRef: bindActionCreators(partial(setUI, BUILD_TRAY_BUTTON_REF), dispatch),
@@ -71,7 +71,7 @@ export var BuildingButtons = (_dec = themeable(theme, styles), _dec(_class = (_t
71
71
  _this.props.contentExport({
72
72
  contextUuid: contextUuid,
73
73
  exportSettings: exportSettings
74
- });
74
+ }, _this.props.addAlert);
75
75
 
76
76
  _this.props.startExport(activeQuizId);
77
77
  }
@@ -202,6 +202,7 @@ export var BuildingButtons = (_dec = themeable(theme, styles), _dec(_class = (_t
202
202
  return BuildingButtons;
203
203
  }(Component), _class2.propTypes = {
204
204
  app: PropTypes.string,
205
+ addAlert: PropTypes.func.isRequired,
205
206
  addInfo: PropTypes.func,
206
207
  activeQuizId: PropTypes.string,
207
208
  canExport: PropTypes.bool.isRequired,
@@ -1,7 +1,6 @@
1
1
  import { v4 as uuid } from 'uuid';
2
2
  import { ADD_ALERT, REMOVE_ALERT, DEFAULT_ALERT_TIME } from '@instructure/quiz-common';
3
-
4
- function addAlert(_ref) {
3
+ export function addAlert(_ref) {
5
4
  var message = _ref.message,
6
5
  variant = _ref.variant,
7
6
  _ref$removeIn = _ref.removeIn,
@@ -18,7 +17,6 @@ function addAlert(_ref) {
18
17
  }
19
18
  };
20
19
  }
21
-
22
20
  export function addError(message, removeIn, guid) {
23
21
  return addAlert({
24
22
  message: message,
@@ -18,6 +18,7 @@ import { Provider } from "../../react-redux.js";
18
18
  import store from "../../../reduxStore.js";
19
19
  import { getLocale } from '@instructure/quiz-common';
20
20
  import { set } from "../../actions/ui.js";
21
+ import { addAlert } from "../../actions/alerts.js";
21
22
  import { setAPIEndpoint, setCanvasOrigin, setUserToken } from "../../actions/config.js";
22
23
  import { setContextUuid, setOutcomesEndpoint, setOutcomesToken } from "../../actions/outcomes.js";
23
24
  import { addFeatures, removeFeatures } from "../../actions/features.js";
@@ -53,6 +54,10 @@ export var SDKApp = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
53
54
  // so we dont implicitly share state
54
55
  // this.store = this.configureStore()
55
56
 
57
+ _this.addAlert = function (opts) {
58
+ _this.store.dispatch(addAlert(opts));
59
+ };
60
+
56
61
  _this.store = store;
57
62
 
58
63
  _this.setLocale();
@@ -154,7 +159,9 @@ export var SDKApp = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
154
159
  }, /*#__PURE__*/React.createElement("div", {
155
160
  className: styles.sdk,
156
161
  "data-automation": "sdk-app"
157
- }, _ref, props.children)))));
162
+ }, _ref, typeof props.children === 'function' ? props.children({
163
+ addAlert: this.addAlert
164
+ }) : props.children)))));
158
165
  }
159
166
  }]);
160
167
 
@@ -163,7 +170,7 @@ export var SDKApp = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
163
170
  }(Component), _class2.propTypes = {
164
171
  apiEndpoint: PropTypes.string.isRequired,
165
172
  appContainer: CustomPropTypes.selectors.isRequired,
166
- children: PropTypes.node.isRequired,
173
+ children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
167
174
  contextUuid: PropTypes.string,
168
175
  gradeByQuestionEnabled: PropTypes.bool,
169
176
  itemBankSharingEnabled: PropTypes.bool,
@@ -50,6 +50,7 @@ function mapStateToProps(state) {
50
50
 
51
51
  var mapDispatchToProps = function mapDispatchToProps(dispatch) {
52
52
  return {
53
+ addAlert: (0, _redux.bindActionCreators)(_alerts.addAlert, dispatch),
53
54
  addInfo: (0, _redux.bindActionCreators)(_alerts.addInfo, dispatch),
54
55
  openBanksTray: (0, _redux.bindActionCreators)(_ui.set.bind(void 0, _quizCommon.BUILD_TRAY_OPEN, true), dispatch),
55
56
  setBanksTrayButtonRef: (0, _redux.bindActionCreators)((0, _partial.default)(_ui.set, _quizCommon.BUILD_TRAY_BUTTON_REF), dispatch),
@@ -96,7 +96,7 @@ var BuildingButtons = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
96
96
  _this.props.contentExport({
97
97
  contextUuid: contextUuid,
98
98
  exportSettings: exportSettings
99
- });
99
+ }, _this.props.addAlert);
100
100
 
101
101
  _this.props.startExport(activeQuizId);
102
102
  }
@@ -226,6 +226,7 @@ var BuildingButtons = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
226
226
  return BuildingButtons;
227
227
  }(_react.Component), _class2.propTypes = {
228
228
  app: _propTypes.default.string,
229
+ addAlert: _propTypes.default.func.isRequired,
229
230
  addInfo: _propTypes.default.func,
230
231
  activeQuizId: _propTypes.default.string,
231
232
  canExport: _propTypes.default.bool.isRequired,
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.addAlert = addAlert;
6
7
  exports.addError = addError;
7
8
  exports.addStickyError = addStickyError;
8
9
  exports.addSuccess = addSuccess;
@@ -37,6 +37,8 @@ var _quizCommon = require("@instructure/quiz-common");
37
37
 
38
38
  var _ui = require("../../actions/ui.js");
39
39
 
40
+ var _alerts = require("../../actions/alerts.js");
41
+
40
42
  var _config = require("../../actions/config.js");
41
43
 
42
44
  var _outcomes = require("../../actions/outcomes.js");
@@ -84,6 +86,10 @@ var SDKApp = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_
84
86
  // so we dont implicitly share state
85
87
  // this.store = this.configureStore()
86
88
 
89
+ _this.addAlert = function (opts) {
90
+ _this.store.dispatch((0, _alerts.addAlert)(opts));
91
+ };
92
+
87
93
  _this.store = _reduxStore.default;
88
94
 
89
95
  _this.setLocale();
@@ -185,7 +191,9 @@ var SDKApp = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_
185
191
  }, /*#__PURE__*/_react.default.createElement("div", {
186
192
  className: styles.sdk,
187
193
  "data-automation": "sdk-app"
188
- }, _ref, props.children)))));
194
+ }, _ref, typeof props.children === 'function' ? props.children({
195
+ addAlert: this.addAlert
196
+ }) : props.children)))));
189
197
  }
190
198
  }]);
191
199
  SDKApp.displayName = "SDKApp";
@@ -193,7 +201,7 @@ var SDKApp = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_
193
201
  }(_react.Component), _class2.propTypes = {
194
202
  apiEndpoint: _propTypes.default.string.isRequired,
195
203
  appContainer: _CustomPropTypes.default.selectors.isRequired,
196
- children: _propTypes.default.node.isRequired,
204
+ children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]).isRequired,
197
205
  contextUuid: _propTypes.default.string,
198
206
  gradeByQuestionEnabled: _propTypes.default.bool,
199
207
  itemBankSharingEnabled: _propTypes.default.bool,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "17.60.1-rc.8+5c27f4a8c",
3
+ "version": "17.61.0",
4
4
  "license": "MIT",
5
5
  "description": "The Quiz React SDK by Instructure Inc.",
6
6
  "author": "Instructure, Inc. Engineering and Product Design",
@@ -41,11 +41,11 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@instructure/outcomes-ui": "^2.1.8",
44
- "@instructure/quiz-common": "17.60.1-rc.8+5c27f4a8c",
45
- "@instructure/quiz-i18n": "17.60.1-rc.8+5c27f4a8c",
46
- "@instructure/quiz-interactions": "17.60.1-rc.8+5c27f4a8c",
47
- "@instructure/quiz-number-input": "17.60.1-rc.8+5c27f4a8c",
48
- "@instructure/quiz-rce": "17.60.1-rc.8+5c27f4a8c",
44
+ "@instructure/quiz-common": "^17.61.0",
45
+ "@instructure/quiz-i18n": "^17.61.0",
46
+ "@instructure/quiz-interactions": "^17.61.0",
47
+ "@instructure/quiz-number-input": "^17.61.0",
48
+ "@instructure/quiz-rce": "^17.61.0",
49
49
  "@instructure/ui-a11y-content": "^7.20.0",
50
50
  "@instructure/ui-alerts": "^7.20.0",
51
51
  "@instructure/ui-avatar": "^7.20.0",
@@ -106,7 +106,7 @@
106
106
  "eventemitter3": "^3.1.0",
107
107
  "humps": "^2.0.0",
108
108
  "immutable": "^3.8.1",
109
- "instructure-validations": "17.60.1-rc.8+5c27f4a8c",
109
+ "instructure-validations": "^17.61.0",
110
110
  "ipaddr.js": "^1.5.4",
111
111
  "isomorphic-fetch": "^2.2.0",
112
112
  "isuuid": "^0.1.0",
@@ -138,7 +138,7 @@
138
138
  "uuid": "^3.2.1"
139
139
  },
140
140
  "devDependencies": {
141
- "@instructure/quiz-scripts": "17.60.0",
141
+ "@instructure/quiz-scripts": "^17.61.0",
142
142
  "@instructure/ui-axe-check": "^7.20.0",
143
143
  "@instructure/ui-babel-preset": "^7.20.0",
144
144
  "@instructure/ui-karma-config": "^7.20.0",
@@ -157,7 +157,7 @@
157
157
  "intl": "^1.2.4",
158
158
  "jquery": "^2.2.3",
159
159
  "most-subject": "^5.3.0",
160
- "quiz-presets": "17.60.1-rc.8+5c27f4a8c",
160
+ "quiz-presets": "^17.61.0",
161
161
  "react": "^16.8.6",
162
162
  "react-addons-test-utils": "^15.6.2",
163
163
  "react-dom": "^16.8.6",
@@ -173,5 +173,5 @@
173
173
  "publishConfig": {
174
174
  "access": "public"
175
175
  },
176
- "gitHead": "5c27f4a8c12775f307878e51617205342093f78e"
176
+ "gitHead": "fab3bffde3be24175a6bab765ea425ae5b0e8d9b"
177
177
  }