@instructure/quiz-core 22.10.2 → 22.11.1-rc.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (379) hide show
  1. package/es/banks/api/bankEntries.js +1 -1
  2. package/es/banks/api/banks.js +19 -98
  3. package/es/banks/api/copyingBanksPoller.js +1 -1
  4. package/es/banks/api/tagAssociations.js +1 -1
  5. package/es/banks/components/AddBankEntryModal/presenter.js +1 -1
  6. package/es/banks/components/AddToBankModal/presenter.js +1 -1
  7. package/es/banks/components/AsyncSearch/index.js +1 -1
  8. package/es/banks/components/Bank/presenter.js +1 -1
  9. package/es/banks/components/BankEntry/presenter.js +1 -1
  10. package/es/banks/components/BankEntryRow/presenter.js +1 -1
  11. package/es/banks/components/BankSearch/presenter.js +1 -1
  12. package/es/banks/components/Banks/presenter.js +1 -1
  13. package/es/banks/components/BanksList/presenter.js +1 -1
  14. package/es/banks/components/CopyMoveBankEntryModal/presenter.js +1 -1
  15. package/es/banks/components/CreateBankModal/presenter.js +1 -1
  16. package/es/banks/components/EditBankModal/presenter.js +1 -1
  17. package/es/banks/components/HeaderBreadCrumb/index.js +1 -1
  18. package/es/banks/components/HeaderMenu/presenter.js +1 -1
  19. package/es/banks/components/NavWrapper/presenter.js +1 -1
  20. package/es/banks/components/SharingModal/RootAccountSharing.js +1 -1
  21. package/es/banks/components/SharingModal/ShareList/index.js +1 -1
  22. package/es/banks/components/SharingModal/index.js +6 -3
  23. package/es/banks/components/SharingModal/presenter.js +208 -132
  24. package/es/building/api/items.js +121 -25
  25. package/es/building/api/quizEntries.js +79 -16
  26. package/es/building/api/quizzes.js +1 -1
  27. package/es/building/api/stimuli.js +1 -1
  28. package/es/building/components/QTIImportModal/index.js +1 -1
  29. package/es/building/components/layout/Sidebar/presenter.js +1 -1
  30. package/es/building/components/layout/header/BuildingButtons/presenter.js +1 -1
  31. package/es/building/components/resources/AddToBankOptions/index.js +1 -1
  32. package/es/building/components/resources/BanksTray/presenter.js +1 -1
  33. package/es/building/components/resources/DeleteStimulusModal/presenter.js +1 -1
  34. package/es/building/components/resources/ItemFeedbackModal/presenter.js +1 -1
  35. package/es/building/components/resources/MoveImmutableModal/presenter.js +1 -1
  36. package/es/building/components/resources/quiz/editButton/EditButton.js +1 -1
  37. package/es/building/components/resources/quiz/instructions/Edit/presenter.js +1 -1
  38. package/es/building/components/resources/quiz/instructions/Instructions/presenter.js +1 -1
  39. package/es/building/components/resources/quiz/instructions/Show/index.js +1 -1
  40. package/es/building/components/resources/quiz/title/Edit/index.js +1 -1
  41. package/es/building/components/resources/quiz/title/Title/presenter.js +1 -1
  42. package/es/building/components/resources/quizEntry/QuizEntry/presenter.js +1 -1
  43. package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/presenter.js +1 -1
  44. package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/index.js +1 -1
  45. package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +1 -1
  46. package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +1 -1
  47. package/es/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +1 -1
  48. package/es/building/components/resources/quizEntry/QuizEntryShow/presenter.js +22 -3
  49. package/es/common/actions/sharedBanks.js +13 -1
  50. package/es/common/actions/sharingModal.js +7 -0
  51. package/es/common/api/helpers.js +1 -1
  52. package/es/common/api/quizSessions.js +1 -1
  53. package/es/common/components/AccessCodeTextInput/index.js +1 -1
  54. package/es/common/components/ConfirmationModal/presenter.js +1 -1
  55. package/es/common/components/ImportModal/ImportFileSelector/index.js +1 -1
  56. package/es/common/components/ImportModal/presenter.js +1 -1
  57. package/es/common/components/Pin/presenter.js +1 -1
  58. package/es/common/components/PreviewFrame/index.js +1 -1
  59. package/es/common/components/PrintFontSizeModal/presenter.js +1 -1
  60. package/es/common/components/RceConfigProvider/rceConfigErrorMessages.js +1 -1
  61. package/es/common/components/SDKApp/index.js +1 -1
  62. package/es/common/components/alerts/presenter.js +1 -1
  63. package/es/common/components/layout/Page/index.js +1 -1
  64. package/es/common/components/layout/header/Calculator/presenter.js +1 -1
  65. package/es/common/components/layout/header/HeaderMenuButton/presenter.js +1 -1
  66. package/es/common/components/layout/header/Timer/presenter.js +1 -1
  67. package/es/common/components/layout/navbar/index.js +1 -1
  68. package/es/common/components/layout/sidebar/PositionSummary/index.js +1 -1
  69. package/es/common/components/layout/sidebar/Sidebar/Pin.js +1 -1
  70. package/es/common/components/layout/sidebar/Sidebar/index.js +1 -1
  71. package/es/common/components/layout/sidebar/SidebarItem/index.js +1 -1
  72. package/es/common/components/layout/sidebar/SidebarItem/presenter.js +1 -1
  73. package/es/common/components/layout/sidebar/Stimulus/Collection/presenter.js +1 -1
  74. package/es/common/components/layout/sidebar/Stimulus/Summary/presenter.js +1 -1
  75. package/es/common/components/layout/sidebar/Stimulus/presenter.js +1 -1
  76. package/es/common/components/resources/BankSelection/presenter.js +1 -1
  77. package/es/common/components/resources/WarningWrapper/index.js +1 -1
  78. package/es/common/components/resources/entry/EntrySave/presenter.js +1 -1
  79. package/es/common/components/resources/item/ItemEdit/presenter.js +1 -1
  80. package/es/common/components/resources/quiz/AddContent/Body/index.js +1 -1
  81. package/es/common/components/resources/quiz/AddContent/Body/presenter.js +135 -141
  82. package/es/common/components/resources/quiz/AddContent/Button/index.js +1 -1
  83. package/es/common/components/resources/quiz/AddContent/Modal/presenter.js +61 -73
  84. package/es/common/components/resources/quiz/AddContent/Popover/presenter.js +128 -119
  85. package/es/common/components/resources/quizSessionResult/Header/index.js +1 -1
  86. package/es/common/components/resources/quizSessionResult/Info/index.js +1 -1
  87. package/es/common/components/resources/sessionItemResult/ResultStimulus/index.js +1 -1
  88. package/es/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +1 -1
  89. package/es/common/components/resources/sessionItemResult/SessionItemResultsList/index.js +1 -1
  90. package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +1 -1
  91. package/es/common/components/resources/stimulus/StimulusEditInfo/presenter.js +1 -1
  92. package/es/common/components/resources/stimulus/StimulusShow/index.js +1 -1
  93. package/es/common/components/resources/stimulus/StimulusShowInfo/index.js +1 -1
  94. package/es/common/components/shared/FormattedDuration/index.js +1 -1
  95. package/es/common/components/shared/GenericAsyncSearch/GenericAsyncSearch.js +1 -1
  96. package/es/common/components/shared/InteractionTypes/index.js +1 -4
  97. package/es/common/components/shared/InteractionTypes/presenter.js +2 -4
  98. package/es/common/components/shared/Paginator/index.js +1 -1
  99. package/es/common/components/shared/PrintTrigger/presenter.js +1 -1
  100. package/es/common/components/shared/TagDisplay/index.js +1 -1
  101. package/es/common/components/shared/TagSelect/presenter.js +1 -1
  102. package/es/common/components/shared/TagWrapper/presenter.js +1 -1
  103. package/es/common/components/shared/TimeUnitsInput/index.js +1 -1
  104. package/es/common/components/shared/drag_and_drop/DragAndDropZone/index.js +1 -1
  105. package/es/common/components/shared/drag_and_drop/DragHandle/presenter.js +1 -1
  106. package/es/common/components/shared/return_button/ReturnButton.js +1 -1
  107. package/es/common/components/shared/spinner/Spinner.js +1 -1
  108. package/es/common/middleware/sharedBanksMiddleware.js +243 -0
  109. package/es/common/records/Bank.js +1 -1
  110. package/es/common/records/Item.js +3 -2
  111. package/es/common/records/Quiz.js +1 -1
  112. package/es/common/records/QuizAnalysis.js +1 -1
  113. package/es/common/records/QuizEntry.js +8 -1
  114. package/es/common/records/Stimulus.js +1 -1
  115. package/es/common/reducers/sharingModal.js +17 -0
  116. package/es/common/util/Fetcher.js +1 -1
  117. package/es/common/util/TimerService.js +1 -1
  118. package/es/common/util/formatTimespan.js +1 -1
  119. package/es/common/util/interactionTypeMetadata.js +1 -1
  120. package/es/common/util/interactionTypePropsHelper.js +1 -1
  121. package/es/common/util/maxContent.js +1 -1
  122. package/es/common/util/useRemoteComponent.js +127 -0
  123. package/es/common/util/warningHelpers.js +1 -1
  124. package/es/common/util/withDynamoPagination.js +13 -2
  125. package/es/configureStore.js +4 -1
  126. package/es/grading/api/quizEntryRegrades.js +1 -1
  127. package/es/index.js +5 -3
  128. package/es/moderating/api/quizSessionEvents.js +4 -2
  129. package/es/moderating/components/events/PageBlurredEvent.js +1 -1
  130. package/es/moderating/components/events/PageFocusedEvent.js +1 -1
  131. package/es/moderating/components/events/ResponseEvent.js +1 -1
  132. package/es/moderating/components/events/SessionStartEvent.js +1 -1
  133. package/es/moderating/components/events/SessionSubmitEvent.js +1 -1
  134. package/es/moderating/components/resources/AccommodationsModal/ExtraAttemptSettings/ExtraAttemptsInput/index.js +1 -1
  135. package/es/moderating/components/resources/AccommodationsModal/ExtraAttemptSettings/index.js +1 -1
  136. package/es/moderating/components/resources/AccommodationsModal/ExtraTimeMultiplier/index.js +1 -1
  137. package/es/moderating/components/resources/AccommodationsModal/ExtraTimeSettings/index.js +1 -1
  138. package/es/moderating/components/resources/AccommodationsModal/ReduceAnswerChoicesSettings/index.js +1 -1
  139. package/es/moderating/components/resources/AccommodationsModal/index.js +1 -1
  140. package/es/moderating/components/resources/ElapsedTime.js +1 -1
  141. package/es/moderating/components/resources/EventDetails.js +1 -1
  142. package/es/moderating/components/resources/ModerateTable/presenter.js +1 -1
  143. package/es/moderating/components/resources/ModerateTableRow/presenter.js +1 -1
  144. package/es/moderating/components/resources/OutstandingQuizzesModal/presenter.js +1 -1
  145. package/es/moderating/components/resources/RetryGradePassbackButton/presenter.js +1 -1
  146. package/es/moderating/components/resources/util/renderEventSummary.js +1 -1
  147. package/es/moderating/components/sidebar/ModerateTray/presenter.js +1 -1
  148. package/es/moderating/components/sidebar/ResetQuiz/presenter.js +1 -1
  149. package/es/reporting/components/MetricsListItem/index.js +1 -1
  150. package/es/reporting/components/charts/CentileDistribution/presenter.js +1 -1
  151. package/es/reporting/components/charts/Distribution/presenter.js +1 -1
  152. package/es/reporting/components/charts/QuintileDistribution/presenter.js +1 -1
  153. package/es/reporting/components/itemAnalysis/AnswerFrequencySummary/index.js +1 -1
  154. package/es/reporting/components/itemAnalysis/ItemAnalysisRow/presenter.js +1 -1
  155. package/es/reporting/components/quizAnalysis/QuizAnalysisOverview.js +1 -1
  156. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/presenter.js +1 -1
  157. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/presenter.js +1 -1
  158. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/CategorizationType.js +1 -1
  159. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingType.js +1 -1
  160. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +1 -1
  161. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/OrderingType.js +1 -1
  162. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +1 -1
  163. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +1 -1
  164. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +1 -1
  165. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/index.js +1 -1
  166. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/index.js +1 -1
  167. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/popoverContent.js +1 -1
  168. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +1 -1
  169. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +1 -1
  170. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +1 -1
  171. package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/presenter.js +1 -1
  172. package/es/reporting/components/resources/NewQuizAndItemAnalysis/ExportButton/index.js +1 -1
  173. package/es/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/presenter.js +1 -1
  174. package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/popoverContent.js +1 -1
  175. package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +1 -1
  176. package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/popoverContent.js +1 -1
  177. package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js +1 -1
  178. package/es/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +1 -1
  179. package/es/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/presenter.js +1 -3
  180. package/es/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +1 -1
  181. package/es/reporting/components/resources/QuizAndItemAnalysis/presenter.js +1 -1
  182. package/es/reporting/components/resources/ReportCard/index.js +1 -1
  183. package/es/reporting/components/resources/ReportList/index.js +1 -1
  184. package/es/reporting/components/resources/StudentAnalysis/ReportCard/presenter.js +1 -1
  185. package/es/reporting/components/resources/common/AnalysisUpdateDate/index.js +1 -1
  186. package/es/reporting/components/resources/common/ExportButton/index.js +1 -1
  187. package/es/reporting/components/resources/common/errorMessages.js +1 -1
  188. package/es/reporting/components/resources/common/utils.js +1 -1
  189. package/es/taking/api/taking.js +1 -1
  190. package/lib/banks/api/bankEntries.js +1 -1
  191. package/lib/banks/api/banks.js +18 -97
  192. package/lib/banks/api/copyingBanksPoller.js +1 -1
  193. package/lib/banks/api/tagAssociations.js +1 -1
  194. package/lib/banks/components/AddBankEntryModal/presenter.js +1 -1
  195. package/lib/banks/components/AddToBankModal/presenter.js +1 -1
  196. package/lib/banks/components/AsyncSearch/index.js +1 -1
  197. package/lib/banks/components/Bank/presenter.js +1 -1
  198. package/lib/banks/components/BankEntry/presenter.js +1 -1
  199. package/lib/banks/components/BankEntryRow/presenter.js +1 -1
  200. package/lib/banks/components/BankSearch/presenter.js +1 -1
  201. package/lib/banks/components/Banks/presenter.js +1 -1
  202. package/lib/banks/components/BanksList/presenter.js +1 -1
  203. package/lib/banks/components/CopyMoveBankEntryModal/presenter.js +1 -1
  204. package/lib/banks/components/CreateBankModal/presenter.js +1 -1
  205. package/lib/banks/components/EditBankModal/presenter.js +1 -1
  206. package/lib/banks/components/HeaderBreadCrumb/index.js +1 -1
  207. package/lib/banks/components/HeaderMenu/presenter.js +1 -1
  208. package/lib/banks/components/NavWrapper/presenter.js +1 -1
  209. package/lib/banks/components/SharingModal/RootAccountSharing.js +1 -1
  210. package/lib/banks/components/SharingModal/ShareList/index.js +1 -1
  211. package/lib/banks/components/SharingModal/index.js +5 -2
  212. package/lib/banks/components/SharingModal/presenter.js +206 -130
  213. package/lib/building/api/items.js +121 -24
  214. package/lib/building/api/quizEntries.js +79 -15
  215. package/lib/building/api/quizzes.js +2 -2
  216. package/lib/building/api/stimuli.js +1 -1
  217. package/lib/building/components/QTIImportModal/index.js +1 -1
  218. package/lib/building/components/layout/Sidebar/presenter.js +1 -1
  219. package/lib/building/components/layout/header/BuildingButtons/presenter.js +1 -1
  220. package/lib/building/components/resources/AddToBankOptions/index.js +1 -1
  221. package/lib/building/components/resources/BanksTray/presenter.js +1 -1
  222. package/lib/building/components/resources/DeleteStimulusModal/presenter.js +1 -1
  223. package/lib/building/components/resources/ItemFeedbackModal/presenter.js +1 -1
  224. package/lib/building/components/resources/MoveImmutableModal/presenter.js +1 -1
  225. package/lib/building/components/resources/quiz/editButton/EditButton.js +1 -1
  226. package/lib/building/components/resources/quiz/instructions/Edit/presenter.js +1 -1
  227. package/lib/building/components/resources/quiz/instructions/Instructions/presenter.js +1 -1
  228. package/lib/building/components/resources/quiz/instructions/Show/index.js +1 -1
  229. package/lib/building/components/resources/quiz/title/Edit/index.js +1 -1
  230. package/lib/building/components/resources/quiz/title/Title/presenter.js +1 -1
  231. package/lib/building/components/resources/quizEntry/QuizEntry/presenter.js +1 -1
  232. package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/presenter.js +1 -1
  233. package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/index.js +1 -1
  234. package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +1 -1
  235. package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +1 -1
  236. package/lib/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +1 -1
  237. package/lib/building/components/resources/quizEntry/QuizEntryShow/presenter.js +21 -2
  238. package/lib/common/actions/sharedBanks.js +13 -1
  239. package/lib/common/actions/sharingModal.js +13 -0
  240. package/lib/common/api/helpers.js +1 -1
  241. package/lib/common/api/quizSessions.js +1 -1
  242. package/lib/common/components/AccessCodeTextInput/index.js +1 -1
  243. package/lib/common/components/ConfirmationModal/presenter.js +1 -1
  244. package/lib/common/components/ImportModal/ImportFileSelector/index.js +1 -1
  245. package/lib/common/components/ImportModal/presenter.js +1 -1
  246. package/lib/common/components/Pin/presenter.js +1 -1
  247. package/lib/common/components/PreviewFrame/index.js +1 -1
  248. package/lib/common/components/PrintFontSizeModal/presenter.js +1 -1
  249. package/lib/common/components/RceConfigProvider/rceConfigErrorMessages.js +1 -1
  250. package/lib/common/components/SDKApp/index.js +2 -2
  251. package/lib/common/components/alerts/presenter.js +1 -1
  252. package/lib/common/components/layout/Page/index.js +1 -1
  253. package/lib/common/components/layout/header/Calculator/presenter.js +1 -1
  254. package/lib/common/components/layout/header/HeaderMenuButton/presenter.js +1 -1
  255. package/lib/common/components/layout/header/Timer/presenter.js +1 -1
  256. package/lib/common/components/layout/navbar/index.js +1 -1
  257. package/lib/common/components/layout/sidebar/PositionSummary/index.js +1 -1
  258. package/lib/common/components/layout/sidebar/Sidebar/Pin.js +1 -1
  259. package/lib/common/components/layout/sidebar/Sidebar/index.js +1 -1
  260. package/lib/common/components/layout/sidebar/SidebarItem/index.js +1 -1
  261. package/lib/common/components/layout/sidebar/SidebarItem/presenter.js +1 -1
  262. package/lib/common/components/layout/sidebar/Stimulus/Collection/presenter.js +1 -1
  263. package/lib/common/components/layout/sidebar/Stimulus/Summary/presenter.js +1 -1
  264. package/lib/common/components/layout/sidebar/Stimulus/presenter.js +1 -1
  265. package/lib/common/components/resources/BankSelection/presenter.js +1 -1
  266. package/lib/common/components/resources/WarningWrapper/index.js +1 -1
  267. package/lib/common/components/resources/entry/EntrySave/presenter.js +1 -1
  268. package/lib/common/components/resources/item/ItemEdit/presenter.js +1 -1
  269. package/lib/common/components/resources/quiz/AddContent/Body/index.js +1 -1
  270. package/lib/common/components/resources/quiz/AddContent/Body/presenter.js +138 -141
  271. package/lib/common/components/resources/quiz/AddContent/Button/index.js +1 -1
  272. package/lib/common/components/resources/quiz/AddContent/Modal/presenter.js +61 -75
  273. package/lib/common/components/resources/quiz/AddContent/Popover/presenter.js +129 -119
  274. package/lib/common/components/resources/quizSessionResult/Header/index.js +1 -1
  275. package/lib/common/components/resources/quizSessionResult/Info/index.js +1 -1
  276. package/lib/common/components/resources/sessionItemResult/ResultStimulus/index.js +1 -1
  277. package/lib/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +1 -1
  278. package/lib/common/components/resources/sessionItemResult/SessionItemResultsList/index.js +1 -1
  279. package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +1 -1
  280. package/lib/common/components/resources/stimulus/StimulusEditInfo/presenter.js +1 -1
  281. package/lib/common/components/resources/stimulus/StimulusShow/index.js +1 -1
  282. package/lib/common/components/resources/stimulus/StimulusShowInfo/index.js +1 -1
  283. package/lib/common/components/shared/FormattedDuration/index.js +1 -1
  284. package/lib/common/components/shared/GenericAsyncSearch/GenericAsyncSearch.js +1 -1
  285. package/lib/common/components/shared/InteractionTypes/index.js +1 -4
  286. package/lib/common/components/shared/InteractionTypes/presenter.js +2 -4
  287. package/lib/common/components/shared/Paginator/index.js +1 -1
  288. package/lib/common/components/shared/PrintTrigger/presenter.js +1 -1
  289. package/lib/common/components/shared/TagDisplay/index.js +1 -1
  290. package/lib/common/components/shared/TagSelect/presenter.js +1 -1
  291. package/lib/common/components/shared/TagWrapper/presenter.js +1 -1
  292. package/lib/common/components/shared/TimeUnitsInput/index.js +1 -1
  293. package/lib/common/components/shared/drag_and_drop/DragAndDropZone/index.js +1 -1
  294. package/lib/common/components/shared/drag_and_drop/DragHandle/presenter.js +1 -1
  295. package/lib/common/components/shared/return_button/ReturnButton.js +1 -1
  296. package/lib/common/components/shared/spinner/Spinner.js +1 -1
  297. package/lib/common/middleware/sharedBanksMiddleware.js +250 -0
  298. package/lib/common/records/Bank.js +1 -1
  299. package/lib/common/records/Item.js +3 -2
  300. package/lib/common/records/Quiz.js +1 -1
  301. package/lib/common/records/QuizAnalysis.js +1 -1
  302. package/lib/common/records/QuizEntry.js +8 -1
  303. package/lib/common/records/Stimulus.js +1 -1
  304. package/lib/common/reducers/sharingModal.js +23 -0
  305. package/lib/common/util/Fetcher.js +1 -1
  306. package/lib/common/util/TimerService.js +1 -1
  307. package/lib/common/util/formatTimespan.js +1 -1
  308. package/lib/common/util/interactionTypeMetadata.js +1 -1
  309. package/lib/common/util/interactionTypePropsHelper.js +1 -1
  310. package/lib/common/util/maxContent.js +1 -1
  311. package/lib/common/util/useRemoteComponent.js +134 -0
  312. package/lib/common/util/warningHelpers.js +1 -1
  313. package/lib/common/util/withDynamoPagination.js +13 -2
  314. package/lib/configureStore.js +4 -1
  315. package/lib/grading/api/quizEntryRegrades.js +1 -1
  316. package/lib/index.js +37 -0
  317. package/lib/moderating/api/quizSessionEvents.js +4 -2
  318. package/lib/moderating/components/events/PageBlurredEvent.js +1 -1
  319. package/lib/moderating/components/events/PageFocusedEvent.js +1 -1
  320. package/lib/moderating/components/events/ResponseEvent.js +1 -1
  321. package/lib/moderating/components/events/SessionStartEvent.js +1 -1
  322. package/lib/moderating/components/events/SessionSubmitEvent.js +1 -1
  323. package/lib/moderating/components/resources/AccommodationsModal/ExtraAttemptSettings/ExtraAttemptsInput/index.js +1 -1
  324. package/lib/moderating/components/resources/AccommodationsModal/ExtraAttemptSettings/index.js +1 -1
  325. package/lib/moderating/components/resources/AccommodationsModal/ExtraTimeMultiplier/index.js +1 -1
  326. package/lib/moderating/components/resources/AccommodationsModal/ExtraTimeSettings/index.js +1 -1
  327. package/lib/moderating/components/resources/AccommodationsModal/ReduceAnswerChoicesSettings/index.js +1 -1
  328. package/lib/moderating/components/resources/AccommodationsModal/index.js +1 -1
  329. package/lib/moderating/components/resources/ElapsedTime.js +1 -1
  330. package/lib/moderating/components/resources/EventDetails.js +1 -1
  331. package/lib/moderating/components/resources/ModerateTable/presenter.js +1 -1
  332. package/lib/moderating/components/resources/ModerateTableRow/presenter.js +1 -1
  333. package/lib/moderating/components/resources/OutstandingQuizzesModal/presenter.js +1 -1
  334. package/lib/moderating/components/resources/RetryGradePassbackButton/presenter.js +1 -1
  335. package/lib/moderating/components/resources/util/renderEventSummary.js +1 -1
  336. package/lib/moderating/components/sidebar/ModerateTray/presenter.js +1 -1
  337. package/lib/moderating/components/sidebar/ResetQuiz/presenter.js +1 -1
  338. package/lib/reporting/components/MetricsListItem/index.js +1 -1
  339. package/lib/reporting/components/charts/CentileDistribution/presenter.js +1 -1
  340. package/lib/reporting/components/charts/Distribution/presenter.js +1 -1
  341. package/lib/reporting/components/charts/QuintileDistribution/presenter.js +1 -1
  342. package/lib/reporting/components/itemAnalysis/AnswerFrequencySummary/index.js +1 -1
  343. package/lib/reporting/components/itemAnalysis/ItemAnalysisRow/presenter.js +1 -1
  344. package/lib/reporting/components/quizAnalysis/QuizAnalysisOverview.js +1 -1
  345. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/presenter.js +1 -1
  346. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/presenter.js +1 -1
  347. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/CategorizationType.js +1 -1
  348. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingType.js +1 -1
  349. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +1 -1
  350. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/OrderingType.js +1 -1
  351. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +1 -1
  352. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +1 -1
  353. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +1 -1
  354. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/index.js +1 -1
  355. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/index.js +1 -1
  356. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/popoverContent.js +1 -1
  357. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +1 -1
  358. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +1 -1
  359. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +1 -1
  360. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/presenter.js +1 -1
  361. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/ExportButton/index.js +1 -1
  362. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/presenter.js +1 -1
  363. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/popoverContent.js +1 -1
  364. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +1 -1
  365. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/popoverContent.js +1 -1
  366. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js +1 -1
  367. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +1 -1
  368. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/presenter.js +1 -3
  369. package/lib/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +1 -1
  370. package/lib/reporting/components/resources/QuizAndItemAnalysis/presenter.js +1 -1
  371. package/lib/reporting/components/resources/ReportCard/index.js +1 -1
  372. package/lib/reporting/components/resources/ReportList/index.js +1 -1
  373. package/lib/reporting/components/resources/StudentAnalysis/ReportCard/presenter.js +1 -1
  374. package/lib/reporting/components/resources/common/AnalysisUpdateDate/index.js +1 -1
  375. package/lib/reporting/components/resources/common/ExportButton/index.js +1 -1
  376. package/lib/reporting/components/resources/common/errorMessages.js +1 -1
  377. package/lib/reporting/components/resources/common/utils.js +1 -1
  378. package/lib/taking/api/taking.js +1 -1
  379. package/package.json +40 -32
@@ -1,5 +1,4 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
2
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
3
  import _createClass from "@babel/runtime/helpers/esm/createClass";
5
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
@@ -8,8 +7,6 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
8
7
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
9
8
  var _dec, _class, _SharingModalPresenter;
10
9
  import _regeneratorRuntime from "@babel/runtime/regenerator";
11
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
12
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
13
10
  function _callSuper(_this, derived, args) {
14
11
  function isNativeReflectConstruct() {
15
12
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
@@ -30,9 +27,10 @@ import PropTypes from 'prop-types';
30
27
  import { List, Map } from 'immutable';
31
28
  import ImmutablePropTypes from 'react-immutable-proptypes';
32
29
  import partial from 'lodash/partial';
33
- import { Modal, ModalHeader, ModalBody, ModalFooter, CAN_EDIT, READ_ONLY, REMOVED_ACCESS, SHARED_WITH_USER, SHARED_WITH_COURSE, SHARED_WITH_ACCOUNT, SimpleSelect, withStyleOverrides } from '@instructure/quiz-common';
30
+ import debounce from 'lodash/debounce';
31
+ import { Modal, ModalHeader, ModalBody, ModalFooter, CAN_EDIT, READ_ONLY, REMOVED_ACCESS, SHARED_WITH_USER, SHARED_WITH_COURSE, SHARED_WITH_ACCOUNT, SimpleSelect, withStyleOverrides, TextInput } from '@instructure/quiz-common';
34
32
  import { Heading } from '@instructure/ui-heading';
35
- import { Button, CloseButton } from '@instructure/ui-buttons';
33
+ import { Button, CloseButton, CondensedButton, IconButton } from '@instructure/ui-buttons';
36
34
  import { View } from '@instructure/ui-view';
37
35
  import { Grid } from '@instructure/ui-grid';
38
36
  import { Tabs } from '@instructure/ui-tabs';
@@ -45,30 +43,33 @@ import RootAccountSharing from './RootAccountSharing';
45
43
  import Spinner from '../../../common/components/shared/spinner/Spinner';
46
44
  import generateStyle from './styles';
47
45
  import generateComponentTheme from './theme';
48
- import t from '@instructure/quiz-i18n/es/format-message';
46
+ import t from '@instructure/quiz-i18n/format-message';
47
+ import { IconSearchLine, IconTroubleLine } from '@instructure/ui-icons';
49
48
  var noop = function noop() {};
50
49
  export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_SharingModalPresenter = /*#__PURE__*/function (_Component) {
51
- function SharingModalPresenter() {
50
+ // =============
51
+ // LIFECYCLE
52
+ // =============
53
+
54
+ function SharingModalPresenter(props) {
52
55
  var _this2;
53
56
  _classCallCheck(this, SharingModalPresenter);
54
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
55
- args[_key] = arguments[_key];
56
- }
57
- _this2 = _callSuper(this, SharingModalPresenter, [].concat(args));
57
+ _this2 = _callSuper(this, SharingModalPresenter, [props]);
58
58
  _defineProperty(_this2, "state", {
59
59
  accountPermission: null,
60
60
  shares: List(),
61
61
  newEntities: List(),
62
62
  searchSelection: [],
63
63
  searchPermission: READ_ONLY,
64
- entitiesWithChangedPermission: {},
65
- selectedTabIndex: 0
64
+ selectedTabIndex: 0,
65
+ value: '',
66
+ startingPoint: 0,
67
+ numOfResults: 0,
68
+ searchValue: '',
69
+ displayEntities: []
66
70
  });
67
71
  _defineProperty(_this2, "shareListRef", null);
68
72
  _defineProperty(_this2, "shareButtonRef", null);
69
- // =============
70
- // LIFECYCLE
71
- // =============
72
73
  _defineProperty(_this2, "checkForSharedBanks", function () {
73
74
  var size = _this2.props.sharedBanks.size;
74
75
  if (size >= 0 && size !== _this2.props.bank.sharedCount || size === 0) {
@@ -79,13 +80,70 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
79
80
  });
80
81
  }
81
82
  });
83
+ _defineProperty(_this2, "normalizeText", function (text) {
84
+ return text.normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLowerCase();
85
+ });
82
86
  // =============
83
87
  // HELPERS
84
88
  // =============
89
+ _defineProperty(_this2, "createFilteredList", function () {
90
+ var entities = _this2.state.shares;
91
+ var users = entities.filter(function (s) {
92
+ return s.get('entityType') === SHARED_WITH_USER;
93
+ });
94
+ var courses = entities.filter(function (s) {
95
+ return s.get('entityType') === SHARED_WITH_COURSE;
96
+ });
97
+ var accounts = entities.filter(function (s) {
98
+ return s.get('entityType') === SHARED_WITH_ACCOUNT;
99
+ });
100
+ switch (_this2.state.selectedTabIndex) {
101
+ case 0:
102
+ {
103
+ var displayedUsers = users.filter(function (item) {
104
+ return _this2.normalizeText(item.get('title')).includes(_this2.normalizeText(_this2.state.searchValue));
105
+ });
106
+ _this2.setState({
107
+ numOfResults: displayedUsers.size,
108
+ displayEntities: displayedUsers.slice(0, _this2.state.startingPoint + _this2.props.limit)
109
+ });
110
+ _this2.debouncedStopLoading();
111
+ break;
112
+ }
113
+ case 1:
114
+ {
115
+ var displayedCourses = courses.filter(function (item) {
116
+ return _this2.normalizeText(item.get('title')).includes(_this2.normalizeText(_this2.state.searchValue));
117
+ });
118
+ _this2.setState({
119
+ numOfResults: displayedCourses.size,
120
+ displayEntities: displayedCourses.slice(0, _this2.state.startingPoint + _this2.props.limit)
121
+ });
122
+ _this2.debouncedStopLoading();
123
+ break;
124
+ }
125
+ case 2:
126
+ {
127
+ var displayedAccounts = accounts.filter(function (item) {
128
+ return _this2.normalizeText(item.get('title')).includes(_this2.normalizeText(_this2.state.searchValue));
129
+ });
130
+ _this2.setState({
131
+ numOfResults: displayedAccounts.size,
132
+ displayEntities: displayedAccounts.slice(0, _this2.state.startingPoint + _this2.props.limit)
133
+ });
134
+ _this2.debouncedStopLoading();
135
+ break;
136
+ }
137
+ }
138
+ });
85
139
  _defineProperty(_this2, "handleTabChange", function (event, _ref) {
86
140
  var index = _ref.index;
87
141
  _this2.setState({
88
- selectedTabIndex: index
142
+ selectedTabIndex: index,
143
+ startingPoint: 0,
144
+ value: ''
145
+ }, function () {
146
+ _this2.checkForSharedBanks();
89
147
  });
90
148
  });
91
149
  _defineProperty(_this2, "modalDismissCleanup", function () {
@@ -99,30 +157,6 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
99
157
  // removes the creator's temporary sharedBank record
100
158
  _this2.props.removeSharedBank('-1');
101
159
  });
102
- _defineProperty(_this2, "numEntitiesToRemove", function () {
103
- var permissions = Object.values(_this2.state.entitiesWithChangedPermission);
104
- return permissions.reduce(function (count, val) {
105
- return val === REMOVED_ACCESS ? count + 1 : count;
106
- }, 0);
107
- });
108
- _defineProperty(_this2, "newEntitiesToSubmit", function () {
109
- var newEntities = _this2.state.newEntities.filter(function (entity) {
110
- return _this2.state.entitiesWithChangedPermission[entity.get('id')] !== REMOVED_ACCESS;
111
- });
112
-
113
- // special case if the creator tries to change their own permissions before
114
- // first share, since they don't have a SharedBank record to update
115
- var newCreatorPerm = _this2.state.entitiesWithChangedPermission['-1'];
116
- if (newCreatorPerm && newCreatorPerm !== CAN_EDIT) {
117
- var creatorSharedBank = _this2.props.sharedBanks.find(function (sharedBank) {
118
- return sharedBank.get('id') == '-1';
119
- });
120
- newEntities = newEntities.push(Map(_objectSpread(_objectSpread({}, creatorSharedBank.toJS()), {}, {
121
- permission: newCreatorPerm
122
- })));
123
- }
124
- return newEntities;
125
- });
126
160
  _defineProperty(_this2, "isSharedWithAccount", function () {
127
161
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this2.state;
128
162
  return [READ_ONLY, CAN_EDIT].includes(state.accountPermission);
@@ -134,50 +168,11 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
134
168
  _this2.props.updateSharedCount(null);
135
169
  _this2.modalDismissCleanup();
136
170
  });
137
- _defineProperty(_this2, "handleSubmit", function () {
138
- // calls the sharedBank api with the new entities you shared the current bank with
139
- var promises = [];
140
- if (_this2.state.accountPermission !== _this2.props.bank.accountPermission) {
141
- var updatedBank = _this2.props.bank.set('accountPermission', _this2.state.accountPermission);
142
- promises.push(_this2.props.updateBank(updatedBank));
143
- }
144
- _this2.newEntitiesToSubmit().forEach(function (entity) {
145
- _this2.props.onShare(entity.toJS());
146
- promises.push(_this2.props.shareBank(_this2.sharedBankForEntity(entity), _this2.props.getUserInfo));
147
- });
148
-
149
- // call the update api if any shared bank permission was updated
150
- Object.entries(_this2.state.entitiesWithChangedPermission).forEach(function (_ref2) {
151
- var _ref3 = _slicedToArray(_ref2, 2),
152
- sharedBankId = _ref3[0],
153
- permission = _ref3[1];
154
- var sharedBank = _this2.props.sharedBanks.find(function (sharedBank) {
155
- return sharedBank.get('id') === sharedBankId;
156
- });
157
- if (sharedBank && sharedBank.get('permission') !== permission && sharedBankId != '-1') {
158
- promises.push(_this2.props.updateSharedBankPermission(_this2.props.bank.id, sharedBankId, permission));
159
- }
160
- });
161
-
162
- // waits till all the calls to the shareBank and updateSharedBank apis have completed
163
- Promise.all(promises).then(function (values) {
164
- // calls getBank for the current bank to update the sharedCount
165
- _this2.props.getBank(_this2.props.bank.id);
166
- });
167
- _this2.setState({
168
- newEntities: List()
169
- });
170
- _this2.modalDismissCleanup(!!_this2.numEntitiesToRemove());
171
- });
172
171
  _defineProperty(_this2, "handleSearchSelectionChange", function (searchSelection) {
173
172
  _this2.setState({
174
173
  searchSelection: searchSelection
175
174
  });
176
175
  });
177
- _defineProperty(_this2, "updateEntitiesCount", function () {
178
- // state.shares is a list containing everyone in the list,
179
- _this2.props.updateSharedCount(_this2.state.shares.size - _this2.numEntitiesToRemove());
180
- });
181
176
  _defineProperty(_this2, "originalPermissionForEntity", function (entity) {
182
177
  var originalEntity = _this2.props.sharedBanks.find(function (sb) {
183
178
  return sb.get('id') == entity.get('id');
@@ -187,15 +182,15 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
187
182
  _defineProperty(_this2, "handleEntityRemove", function (entity, undoRemove) {
188
183
  _this2.confirmPermissionChange(entity, REMOVED_ACCESS);
189
184
  });
190
- _defineProperty(_this2, "handleSearchPermissionChange", function (e, _ref4) {
191
- var value = _ref4.value;
185
+ _defineProperty(_this2, "handleSearchPermissionChange", function (e, _ref2) {
186
+ var value = _ref2.value;
192
187
  _this2.setState({
193
188
  searchPermission: value
194
189
  });
195
190
  });
196
191
  _defineProperty(_this2, "handleSearchFilter", function (searchResults) {
197
192
  return searchResults.filter(function (result) {
198
- return !_this2.state.shares.some(function (entity) {
193
+ return !_this2.props.sharedBanks.some(function (entity) {
199
194
  return entity.get('entityId') === result.uuid;
200
195
  }) && (result.uuid !== _this2.props.bank.creator || _this2.props.bank.sharedCount > 0);
201
196
  });
@@ -221,7 +216,7 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
221
216
  });
222
217
  });
223
218
  _defineProperty(_this2, "updatePermission", /*#__PURE__*/function () {
224
- var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(entity, permission) {
219
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(entity, permission) {
225
220
  var _this2$props, updateSharedBankPermission, getBank, bank;
226
221
  return _regeneratorRuntime.wrap(function _callee$(_context) {
227
222
  while (1) switch (_context.prev = _context.next) {
@@ -238,7 +233,7 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
238
233
  }, _callee);
239
234
  }));
240
235
  return function (_x, _x2) {
241
- return _ref5.apply(this, arguments);
236
+ return _ref3.apply(this, arguments);
242
237
  };
243
238
  }());
244
239
  _defineProperty(_this2, "translatedPermissionLevel", function (permission) {
@@ -269,18 +264,24 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
269
264
  };
270
265
  });
271
266
  });
272
- _defineProperty(_this2, "handleAccountPermissionChange", function (e, _ref6) {
273
- var value = _ref6.value;
267
+ _defineProperty(_this2, "handleAccountPermissionChange", function (e, _ref4) {
268
+ var value = _ref4.value;
274
269
  return _this2.setState({
275
270
  accountPermission: value
276
271
  });
277
272
  });
278
- _defineProperty(_this2, "handleShareListRef", function (node) {
279
- _this2.shareListRef = node;
280
- });
281
273
  _defineProperty(_this2, "handleShareButtonRef", function (node) {
282
274
  _this2.shareButtonRef = node;
283
275
  });
276
+ _defineProperty(_this2, "handleChange", function (e, value) {
277
+ _this2.setState({
278
+ value: value
279
+ });
280
+ });
281
+ _defineProperty(_this2, "handleClear", function (e) {
282
+ e.stopPropagation();
283
+ _this2.handleChange(e, '');
284
+ });
284
285
  _defineProperty(_this2, "renderSearchSection", function (searchType) {
285
286
  if (_this2.props.bank.canEdit()) {
286
287
  return jsx(React.Fragment, null, jsx(Grid, {
@@ -319,15 +320,105 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
319
320
  }));
320
321
  }
321
322
  });
322
- _defineProperty(_this2, "renderShareList", function (entities) {
323
- return jsx(ShareList, {
324
- canEdit: _this2.props.bank.canEdit(),
325
- entities: entities,
326
- onPermissionChange: _this2.handleEntityPermissionChange,
327
- onEntityRemove: _this2.handleEntityRemove,
328
- sharedBanks: _this2.props.sharedBanks
323
+ _defineProperty(_this2, "renderShareList", function () {
324
+ if (_this2.props.loading) {
325
+ return jsx(View, {
326
+ height: "12em",
327
+ as: "div"
328
+ }, jsx(View, {
329
+ position: "absolute",
330
+ as: "div",
331
+ insetBlockEnd: "0"
332
+ }, jsx(Spinner, {
333
+ renderTitle: "Loading...",
334
+ size: "small",
335
+ fontSize: "medium"
336
+ })));
337
+ }
338
+ if (_this2.state.displayEntities.size > 0) {
339
+ return jsx(View, {
340
+ height: "12em",
341
+ overflowY: "auto",
342
+ overflowX: "hidden",
343
+ as: "div",
344
+ padding: "xx-small xx-small none"
345
+ }, jsx(ShareList, {
346
+ canEdit: _this2.props.bank.canEdit(),
347
+ entities: _this2.state.displayEntities,
348
+ onPermissionChange: _this2.handleEntityPermissionChange,
349
+ onEntityRemove: _this2.handleEntityRemove,
350
+ sharedBanks: _this2.props.sharedBanks
351
+ }), jsx("div", null, _this2.renderShowMoreButton()));
352
+ }
353
+ return jsx(View, {
354
+ height: "12em",
355
+ as: "div"
356
+ }, t('No results found'));
357
+ });
358
+ _defineProperty(_this2, "showMoreResult", function () {
359
+ _this2.setState({
360
+ startingPoint: _this2.state.startingPoint + _this2.props.limit
329
361
  });
330
362
  });
363
+ _defineProperty(_this2, "renderShowMoreButton", function () {
364
+ var shouldShowButton = _this2.state.startingPoint + _this2.props.limit < _this2.state.numOfResults;
365
+ if (!shouldShowButton) {
366
+ return null;
367
+ }
368
+ return jsx(View, {
369
+ css: {
370
+ display: shouldShowButton
371
+ },
372
+ background: "primary",
373
+ padding: "small none",
374
+ as: "div"
375
+ }, jsx(CondensedButton, {
376
+ onClick: function onClick(e) {
377
+ e.preventDefault();
378
+ e.stopPropagation();
379
+ _this2.showMoreResult();
380
+ }
381
+ }, t('Show more')));
382
+ });
383
+ _defineProperty(_this2, "renderClearButton", function () {
384
+ if (!_this2.state.value.length || _this2.state.readOnly || _this2.state.disabled) return null;
385
+ return jsx(IconButton, {
386
+ type: "button",
387
+ size: "small",
388
+ withBackground: false,
389
+ withBorder: false,
390
+ screenReaderLabel: "Clear search",
391
+ disabled: _this2.state.disabled || _this2.state.readOnly,
392
+ onClick: _this2.handleClear
393
+ }, jsx(IconTroubleLine, null));
394
+ });
395
+ _defineProperty(_this2, "renderSharedSearch", function () {
396
+ return jsx(View, {
397
+ margin: "none large none medium"
398
+ }, jsx(TextInput, {
399
+ size: 'medium',
400
+ placeholder: t('Search...'),
401
+ value: _this2.state.value,
402
+ onChange: _this2.handleChange,
403
+ interaction: 'enabled',
404
+ inputRef: function inputRef(el) {
405
+ return _this2.inputRef = el;
406
+ },
407
+ renderBeforeInput: jsx(IconSearchLine, {
408
+ inline: false
409
+ }),
410
+ renderAfterInput: _this2.renderClearButton(),
411
+ shouldNotWrap: true
412
+ }));
413
+ });
414
+ _this2.debouncedSearch = debounce(function () {
415
+ _this2.setState({
416
+ searchValue: _this2.state.value
417
+ });
418
+ }, 300);
419
+ _this2.debouncedStopLoading = debounce(function () {
420
+ if (_this2.props.loading != false) _this2.props.changeSharedBankLoading(false);
421
+ }, 300);
331
422
  return _this2;
332
423
  }
333
424
  _inherits(SharingModalPresenter, _Component);
@@ -354,6 +445,16 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
354
445
  var updatedBank = this.props.bank.set('accountPermission', this.state.accountPermission);
355
446
  this.props.updateBank(updatedBank, false);
356
447
  }
448
+ if (prevState.value !== this.state.value) {
449
+ if (this.props.loading == false) this.props.changeSharedBankLoading(true);
450
+ this.setState({
451
+ startingPoint: 0
452
+ });
453
+ this.debouncedSearch();
454
+ }
455
+ if (prevState.searchValue !== this.state.searchValue || prevState.startingPoint !== this.state.startingPoint || prevState.selectedTabIndex !== this.state.selectedTabIndex || prevState.shares.size !== this.state.shares.size) {
456
+ this.createFilteredList();
457
+ }
357
458
  }
358
459
  }, {
359
460
  key: "sharedBankForEntity",
@@ -401,7 +502,7 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
401
502
  as: "div",
402
503
  weight: "bold",
403
504
  lineHeight: "double"
404
- }, t('Currently shared with')), this.renderShareList(existingPeople)), jsx(Tabs.Panel, {
505
+ }, t('Currently shared with')), this.renderSharedSearch(), this.renderShareList()), jsx(Tabs.Panel, {
405
506
  renderTitle: t('Courses ({ coursesCount })', {
406
507
  coursesCount: existingCourses.size
407
508
  }),
@@ -411,7 +512,7 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
411
512
  as: "div",
412
513
  weight: "bold",
413
514
  lineHeight: "double"
414
- }, t('Currently shared with')), this.renderShareList(existingCourses)), ((currentUser === null || currentUser === void 0 ? void 0 : currentUser.bank_admin) || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.can_share_banks_with_subaccounts)) && jsx(Tabs.Panel, {
515
+ }, t('Currently shared with')), this.renderSharedSearch(), this.renderShareList()), ((currentUser === null || currentUser === void 0 ? void 0 : currentUser.bank_admin) || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.can_share_banks_with_subaccounts)) && jsx(Tabs.Panel, {
415
516
  renderTitle: t('Accounts ({ accountsCount })', {
416
517
  accountsCount: existingAccounts.size
417
518
  }),
@@ -421,37 +522,7 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
421
522
  as: "div",
422
523
  weight: "bold",
423
524
  lineHeight: "double"
424
- }, t('Currently shared with')), this.renderShareList(existingAccounts))));
425
- }
426
- }, {
427
- key: "renderOriginalDesignEntities",
428
- value: function renderOriginalDesignEntities(existingPeople, existingCourses) {
429
- return jsx("div", {
430
- className: "fs-mask"
431
- }, jsx(Text, {
432
- as: "div",
433
- weight: "bold"
434
- }, t('Currently shared with')), jsx(View, {
435
- as: "div",
436
- "data-automation": "sdk-shared-bank-user-list"
437
- }, !this.state.newEntities.isEmpty() && jsx(View, {
438
- as: "div",
439
- margin: "0 0 medium 0"
440
- }, this.renderShareList(this.state.newEntities)), jsx(Tabs, {
441
- onRequestTabChange: this.handleTabChange
442
- }, jsx(Tabs.Panel, {
443
- renderTitle: t('People ({ peopleCount })', {
444
- peopleCount: existingPeople.size
445
- }),
446
- isSelected: this.state.selectedTabIndex === 0,
447
- padding: "large small small small"
448
- }, this.renderShareList(existingPeople)), !existingCourses.isEmpty() && jsx(Tabs.Panel, {
449
- renderTitle: t('Courses ({ coursesCount })', {
450
- coursesCount: existingCourses.size
451
- }),
452
- isSelected: this.state.selectedTabIndex === 1,
453
- padding: "large small small small"
454
- }, this.renderShareList(existingCourses)))));
525
+ }, t('Currently shared with')), this.renderSharedSearch(), this.renderShareList())));
455
526
  }
456
527
  }, {
457
528
  key: "renderEntitiesSection",
@@ -534,7 +605,10 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
534
605
  updateSharedBankPermission: PropTypes.func.isRequired,
535
606
  updateSharedCount: PropTypes.func,
536
607
  withConfirm: PropTypes.func.isRequired,
537
- styles: PropTypes.object
608
+ styles: PropTypes.object,
609
+ limit: PropTypes.number,
610
+ loading: PropTypes.bool,
611
+ changeSharedBankLoading: PropTypes.func.isRequired
538
612
  }), _defineProperty(_SharingModalPresenter, "defaultProps", {
539
613
  bank: null,
540
614
  currentUser: null,
@@ -544,6 +618,8 @@ export var SharingModalPresenter = (_dec = withStyleOverrides(generateStyle, gen
544
618
  onDismiss: noop,
545
619
  onShare: function onShare() {},
546
620
  sharedBanks: List(),
547
- updateSharedCount: Function.prototype
621
+ updateSharedCount: Function.prototype,
622
+ limit: 10,
623
+ loading: false
548
624
  }), _SharingModalPresenter)) || _class);
549
625
  export default SharingModalPresenter;