@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.
- package/es/banks/api/bankEntries.js +1 -1
- package/es/banks/api/banks.js +19 -98
- package/es/banks/api/copyingBanksPoller.js +1 -1
- package/es/banks/api/tagAssociations.js +1 -1
- package/es/banks/components/AddBankEntryModal/presenter.js +1 -1
- package/es/banks/components/AddToBankModal/presenter.js +1 -1
- package/es/banks/components/AsyncSearch/index.js +1 -1
- package/es/banks/components/Bank/presenter.js +1 -1
- package/es/banks/components/BankEntry/presenter.js +1 -1
- package/es/banks/components/BankEntryRow/presenter.js +1 -1
- package/es/banks/components/BankSearch/presenter.js +1 -1
- package/es/banks/components/Banks/presenter.js +1 -1
- package/es/banks/components/BanksList/presenter.js +1 -1
- package/es/banks/components/CopyMoveBankEntryModal/presenter.js +1 -1
- package/es/banks/components/CreateBankModal/presenter.js +1 -1
- package/es/banks/components/EditBankModal/presenter.js +1 -1
- package/es/banks/components/HeaderBreadCrumb/index.js +1 -1
- package/es/banks/components/HeaderMenu/presenter.js +1 -1
- package/es/banks/components/NavWrapper/presenter.js +1 -1
- package/es/banks/components/SharingModal/RootAccountSharing.js +1 -1
- package/es/banks/components/SharingModal/ShareList/index.js +1 -1
- package/es/banks/components/SharingModal/index.js +6 -3
- package/es/banks/components/SharingModal/presenter.js +208 -132
- package/es/building/api/items.js +121 -25
- package/es/building/api/quizEntries.js +79 -16
- package/es/building/api/quizzes.js +1 -1
- package/es/building/api/stimuli.js +1 -1
- package/es/building/components/QTIImportModal/index.js +1 -1
- package/es/building/components/layout/Sidebar/presenter.js +1 -1
- package/es/building/components/layout/header/BuildingButtons/presenter.js +1 -1
- package/es/building/components/resources/AddToBankOptions/index.js +1 -1
- package/es/building/components/resources/BanksTray/presenter.js +1 -1
- package/es/building/components/resources/DeleteStimulusModal/presenter.js +1 -1
- package/es/building/components/resources/ItemFeedbackModal/presenter.js +1 -1
- package/es/building/components/resources/MoveImmutableModal/presenter.js +1 -1
- package/es/building/components/resources/quiz/editButton/EditButton.js +1 -1
- package/es/building/components/resources/quiz/instructions/Edit/presenter.js +1 -1
- package/es/building/components/resources/quiz/instructions/Instructions/presenter.js +1 -1
- package/es/building/components/resources/quiz/instructions/Show/index.js +1 -1
- package/es/building/components/resources/quiz/title/Edit/index.js +1 -1
- package/es/building/components/resources/quiz/title/Title/presenter.js +1 -1
- package/es/building/components/resources/quizEntry/QuizEntry/presenter.js +1 -1
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/presenter.js +1 -1
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/index.js +1 -1
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +1 -1
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +1 -1
- package/es/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +1 -1
- package/es/building/components/resources/quizEntry/QuizEntryShow/presenter.js +22 -3
- package/es/common/actions/sharedBanks.js +13 -1
- package/es/common/actions/sharingModal.js +7 -0
- package/es/common/api/helpers.js +1 -1
- package/es/common/api/quizSessions.js +1 -1
- package/es/common/components/AccessCodeTextInput/index.js +1 -1
- package/es/common/components/ConfirmationModal/presenter.js +1 -1
- package/es/common/components/ImportModal/ImportFileSelector/index.js +1 -1
- package/es/common/components/ImportModal/presenter.js +1 -1
- package/es/common/components/Pin/presenter.js +1 -1
- package/es/common/components/PreviewFrame/index.js +1 -1
- package/es/common/components/PrintFontSizeModal/presenter.js +1 -1
- package/es/common/components/RceConfigProvider/rceConfigErrorMessages.js +1 -1
- package/es/common/components/SDKApp/index.js +1 -1
- package/es/common/components/alerts/presenter.js +1 -1
- package/es/common/components/layout/Page/index.js +1 -1
- package/es/common/components/layout/header/Calculator/presenter.js +1 -1
- package/es/common/components/layout/header/HeaderMenuButton/presenter.js +1 -1
- package/es/common/components/layout/header/Timer/presenter.js +1 -1
- package/es/common/components/layout/navbar/index.js +1 -1
- package/es/common/components/layout/sidebar/PositionSummary/index.js +1 -1
- package/es/common/components/layout/sidebar/Sidebar/Pin.js +1 -1
- package/es/common/components/layout/sidebar/Sidebar/index.js +1 -1
- package/es/common/components/layout/sidebar/SidebarItem/index.js +1 -1
- package/es/common/components/layout/sidebar/SidebarItem/presenter.js +1 -1
- package/es/common/components/layout/sidebar/Stimulus/Collection/presenter.js +1 -1
- package/es/common/components/layout/sidebar/Stimulus/Summary/presenter.js +1 -1
- package/es/common/components/layout/sidebar/Stimulus/presenter.js +1 -1
- package/es/common/components/resources/BankSelection/presenter.js +1 -1
- package/es/common/components/resources/WarningWrapper/index.js +1 -1
- package/es/common/components/resources/entry/EntrySave/presenter.js +1 -1
- package/es/common/components/resources/item/ItemEdit/presenter.js +1 -1
- package/es/common/components/resources/quiz/AddContent/Body/index.js +1 -1
- package/es/common/components/resources/quiz/AddContent/Body/presenter.js +135 -141
- package/es/common/components/resources/quiz/AddContent/Button/index.js +1 -1
- package/es/common/components/resources/quiz/AddContent/Modal/presenter.js +61 -73
- package/es/common/components/resources/quiz/AddContent/Popover/presenter.js +128 -119
- package/es/common/components/resources/quizSessionResult/Header/index.js +1 -1
- package/es/common/components/resources/quizSessionResult/Info/index.js +1 -1
- package/es/common/components/resources/sessionItemResult/ResultStimulus/index.js +1 -1
- package/es/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +1 -1
- package/es/common/components/resources/sessionItemResult/SessionItemResultsList/index.js +1 -1
- package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +1 -1
- package/es/common/components/resources/stimulus/StimulusEditInfo/presenter.js +1 -1
- package/es/common/components/resources/stimulus/StimulusShow/index.js +1 -1
- package/es/common/components/resources/stimulus/StimulusShowInfo/index.js +1 -1
- package/es/common/components/shared/FormattedDuration/index.js +1 -1
- package/es/common/components/shared/GenericAsyncSearch/GenericAsyncSearch.js +1 -1
- package/es/common/components/shared/InteractionTypes/index.js +1 -4
- package/es/common/components/shared/InteractionTypes/presenter.js +2 -4
- package/es/common/components/shared/Paginator/index.js +1 -1
- package/es/common/components/shared/PrintTrigger/presenter.js +1 -1
- package/es/common/components/shared/TagDisplay/index.js +1 -1
- package/es/common/components/shared/TagSelect/presenter.js +1 -1
- package/es/common/components/shared/TagWrapper/presenter.js +1 -1
- package/es/common/components/shared/TimeUnitsInput/index.js +1 -1
- package/es/common/components/shared/drag_and_drop/DragAndDropZone/index.js +1 -1
- package/es/common/components/shared/drag_and_drop/DragHandle/presenter.js +1 -1
- package/es/common/components/shared/return_button/ReturnButton.js +1 -1
- package/es/common/components/shared/spinner/Spinner.js +1 -1
- package/es/common/middleware/sharedBanksMiddleware.js +243 -0
- package/es/common/records/Bank.js +1 -1
- package/es/common/records/Item.js +3 -2
- package/es/common/records/Quiz.js +1 -1
- package/es/common/records/QuizAnalysis.js +1 -1
- package/es/common/records/QuizEntry.js +8 -1
- package/es/common/records/Stimulus.js +1 -1
- package/es/common/reducers/sharingModal.js +17 -0
- package/es/common/util/Fetcher.js +1 -1
- package/es/common/util/TimerService.js +1 -1
- package/es/common/util/formatTimespan.js +1 -1
- package/es/common/util/interactionTypeMetadata.js +1 -1
- package/es/common/util/interactionTypePropsHelper.js +1 -1
- package/es/common/util/maxContent.js +1 -1
- package/es/common/util/useRemoteComponent.js +127 -0
- package/es/common/util/warningHelpers.js +1 -1
- package/es/common/util/withDynamoPagination.js +13 -2
- package/es/configureStore.js +4 -1
- package/es/grading/api/quizEntryRegrades.js +1 -1
- package/es/index.js +5 -3
- package/es/moderating/api/quizSessionEvents.js +4 -2
- package/es/moderating/components/events/PageBlurredEvent.js +1 -1
- package/es/moderating/components/events/PageFocusedEvent.js +1 -1
- package/es/moderating/components/events/ResponseEvent.js +1 -1
- package/es/moderating/components/events/SessionStartEvent.js +1 -1
- package/es/moderating/components/events/SessionSubmitEvent.js +1 -1
- package/es/moderating/components/resources/AccommodationsModal/ExtraAttemptSettings/ExtraAttemptsInput/index.js +1 -1
- package/es/moderating/components/resources/AccommodationsModal/ExtraAttemptSettings/index.js +1 -1
- package/es/moderating/components/resources/AccommodationsModal/ExtraTimeMultiplier/index.js +1 -1
- package/es/moderating/components/resources/AccommodationsModal/ExtraTimeSettings/index.js +1 -1
- package/es/moderating/components/resources/AccommodationsModal/ReduceAnswerChoicesSettings/index.js +1 -1
- package/es/moderating/components/resources/AccommodationsModal/index.js +1 -1
- package/es/moderating/components/resources/ElapsedTime.js +1 -1
- package/es/moderating/components/resources/EventDetails.js +1 -1
- package/es/moderating/components/resources/ModerateTable/presenter.js +1 -1
- package/es/moderating/components/resources/ModerateTableRow/presenter.js +1 -1
- package/es/moderating/components/resources/OutstandingQuizzesModal/presenter.js +1 -1
- package/es/moderating/components/resources/RetryGradePassbackButton/presenter.js +1 -1
- package/es/moderating/components/resources/util/renderEventSummary.js +1 -1
- package/es/moderating/components/sidebar/ModerateTray/presenter.js +1 -1
- package/es/moderating/components/sidebar/ResetQuiz/presenter.js +1 -1
- package/es/reporting/components/MetricsListItem/index.js +1 -1
- package/es/reporting/components/charts/CentileDistribution/presenter.js +1 -1
- package/es/reporting/components/charts/Distribution/presenter.js +1 -1
- package/es/reporting/components/charts/QuintileDistribution/presenter.js +1 -1
- package/es/reporting/components/itemAnalysis/AnswerFrequencySummary/index.js +1 -1
- package/es/reporting/components/itemAnalysis/ItemAnalysisRow/presenter.js +1 -1
- package/es/reporting/components/quizAnalysis/QuizAnalysisOverview.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/CategorizationType.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingType.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/OrderingType.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/index.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/index.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/popoverContent.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/ExportButton/index.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/popoverContent.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/popoverContent.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/presenter.js +1 -3
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +1 -1
- package/es/reporting/components/resources/QuizAndItemAnalysis/presenter.js +1 -1
- package/es/reporting/components/resources/ReportCard/index.js +1 -1
- package/es/reporting/components/resources/ReportList/index.js +1 -1
- package/es/reporting/components/resources/StudentAnalysis/ReportCard/presenter.js +1 -1
- package/es/reporting/components/resources/common/AnalysisUpdateDate/index.js +1 -1
- package/es/reporting/components/resources/common/ExportButton/index.js +1 -1
- package/es/reporting/components/resources/common/errorMessages.js +1 -1
- package/es/reporting/components/resources/common/utils.js +1 -1
- package/es/taking/api/taking.js +1 -1
- package/lib/banks/api/bankEntries.js +1 -1
- package/lib/banks/api/banks.js +18 -97
- package/lib/banks/api/copyingBanksPoller.js +1 -1
- package/lib/banks/api/tagAssociations.js +1 -1
- package/lib/banks/components/AddBankEntryModal/presenter.js +1 -1
- package/lib/banks/components/AddToBankModal/presenter.js +1 -1
- package/lib/banks/components/AsyncSearch/index.js +1 -1
- package/lib/banks/components/Bank/presenter.js +1 -1
- package/lib/banks/components/BankEntry/presenter.js +1 -1
- package/lib/banks/components/BankEntryRow/presenter.js +1 -1
- package/lib/banks/components/BankSearch/presenter.js +1 -1
- package/lib/banks/components/Banks/presenter.js +1 -1
- package/lib/banks/components/BanksList/presenter.js +1 -1
- package/lib/banks/components/CopyMoveBankEntryModal/presenter.js +1 -1
- package/lib/banks/components/CreateBankModal/presenter.js +1 -1
- package/lib/banks/components/EditBankModal/presenter.js +1 -1
- package/lib/banks/components/HeaderBreadCrumb/index.js +1 -1
- package/lib/banks/components/HeaderMenu/presenter.js +1 -1
- package/lib/banks/components/NavWrapper/presenter.js +1 -1
- package/lib/banks/components/SharingModal/RootAccountSharing.js +1 -1
- package/lib/banks/components/SharingModal/ShareList/index.js +1 -1
- package/lib/banks/components/SharingModal/index.js +5 -2
- package/lib/banks/components/SharingModal/presenter.js +206 -130
- package/lib/building/api/items.js +121 -24
- package/lib/building/api/quizEntries.js +79 -15
- package/lib/building/api/quizzes.js +2 -2
- package/lib/building/api/stimuli.js +1 -1
- package/lib/building/components/QTIImportModal/index.js +1 -1
- package/lib/building/components/layout/Sidebar/presenter.js +1 -1
- package/lib/building/components/layout/header/BuildingButtons/presenter.js +1 -1
- package/lib/building/components/resources/AddToBankOptions/index.js +1 -1
- package/lib/building/components/resources/BanksTray/presenter.js +1 -1
- package/lib/building/components/resources/DeleteStimulusModal/presenter.js +1 -1
- package/lib/building/components/resources/ItemFeedbackModal/presenter.js +1 -1
- package/lib/building/components/resources/MoveImmutableModal/presenter.js +1 -1
- package/lib/building/components/resources/quiz/editButton/EditButton.js +1 -1
- package/lib/building/components/resources/quiz/instructions/Edit/presenter.js +1 -1
- package/lib/building/components/resources/quiz/instructions/Instructions/presenter.js +1 -1
- package/lib/building/components/resources/quiz/instructions/Show/index.js +1 -1
- package/lib/building/components/resources/quiz/title/Edit/index.js +1 -1
- package/lib/building/components/resources/quiz/title/Title/presenter.js +1 -1
- package/lib/building/components/resources/quizEntry/QuizEntry/presenter.js +1 -1
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/presenter.js +1 -1
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/index.js +1 -1
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +1 -1
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +1 -1
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +1 -1
- package/lib/building/components/resources/quizEntry/QuizEntryShow/presenter.js +21 -2
- package/lib/common/actions/sharedBanks.js +13 -1
- package/lib/common/actions/sharingModal.js +13 -0
- package/lib/common/api/helpers.js +1 -1
- package/lib/common/api/quizSessions.js +1 -1
- package/lib/common/components/AccessCodeTextInput/index.js +1 -1
- package/lib/common/components/ConfirmationModal/presenter.js +1 -1
- package/lib/common/components/ImportModal/ImportFileSelector/index.js +1 -1
- package/lib/common/components/ImportModal/presenter.js +1 -1
- package/lib/common/components/Pin/presenter.js +1 -1
- package/lib/common/components/PreviewFrame/index.js +1 -1
- package/lib/common/components/PrintFontSizeModal/presenter.js +1 -1
- package/lib/common/components/RceConfigProvider/rceConfigErrorMessages.js +1 -1
- package/lib/common/components/SDKApp/index.js +2 -2
- package/lib/common/components/alerts/presenter.js +1 -1
- package/lib/common/components/layout/Page/index.js +1 -1
- package/lib/common/components/layout/header/Calculator/presenter.js +1 -1
- package/lib/common/components/layout/header/HeaderMenuButton/presenter.js +1 -1
- package/lib/common/components/layout/header/Timer/presenter.js +1 -1
- package/lib/common/components/layout/navbar/index.js +1 -1
- package/lib/common/components/layout/sidebar/PositionSummary/index.js +1 -1
- package/lib/common/components/layout/sidebar/Sidebar/Pin.js +1 -1
- package/lib/common/components/layout/sidebar/Sidebar/index.js +1 -1
- package/lib/common/components/layout/sidebar/SidebarItem/index.js +1 -1
- package/lib/common/components/layout/sidebar/SidebarItem/presenter.js +1 -1
- package/lib/common/components/layout/sidebar/Stimulus/Collection/presenter.js +1 -1
- package/lib/common/components/layout/sidebar/Stimulus/Summary/presenter.js +1 -1
- package/lib/common/components/layout/sidebar/Stimulus/presenter.js +1 -1
- package/lib/common/components/resources/BankSelection/presenter.js +1 -1
- package/lib/common/components/resources/WarningWrapper/index.js +1 -1
- package/lib/common/components/resources/entry/EntrySave/presenter.js +1 -1
- package/lib/common/components/resources/item/ItemEdit/presenter.js +1 -1
- package/lib/common/components/resources/quiz/AddContent/Body/index.js +1 -1
- package/lib/common/components/resources/quiz/AddContent/Body/presenter.js +138 -141
- package/lib/common/components/resources/quiz/AddContent/Button/index.js +1 -1
- package/lib/common/components/resources/quiz/AddContent/Modal/presenter.js +61 -75
- package/lib/common/components/resources/quiz/AddContent/Popover/presenter.js +129 -119
- package/lib/common/components/resources/quizSessionResult/Header/index.js +1 -1
- package/lib/common/components/resources/quizSessionResult/Info/index.js +1 -1
- package/lib/common/components/resources/sessionItemResult/ResultStimulus/index.js +1 -1
- package/lib/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +1 -1
- package/lib/common/components/resources/sessionItemResult/SessionItemResultsList/index.js +1 -1
- package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +1 -1
- package/lib/common/components/resources/stimulus/StimulusEditInfo/presenter.js +1 -1
- package/lib/common/components/resources/stimulus/StimulusShow/index.js +1 -1
- package/lib/common/components/resources/stimulus/StimulusShowInfo/index.js +1 -1
- package/lib/common/components/shared/FormattedDuration/index.js +1 -1
- package/lib/common/components/shared/GenericAsyncSearch/GenericAsyncSearch.js +1 -1
- package/lib/common/components/shared/InteractionTypes/index.js +1 -4
- package/lib/common/components/shared/InteractionTypes/presenter.js +2 -4
- package/lib/common/components/shared/Paginator/index.js +1 -1
- package/lib/common/components/shared/PrintTrigger/presenter.js +1 -1
- package/lib/common/components/shared/TagDisplay/index.js +1 -1
- package/lib/common/components/shared/TagSelect/presenter.js +1 -1
- package/lib/common/components/shared/TagWrapper/presenter.js +1 -1
- package/lib/common/components/shared/TimeUnitsInput/index.js +1 -1
- package/lib/common/components/shared/drag_and_drop/DragAndDropZone/index.js +1 -1
- package/lib/common/components/shared/drag_and_drop/DragHandle/presenter.js +1 -1
- package/lib/common/components/shared/return_button/ReturnButton.js +1 -1
- package/lib/common/components/shared/spinner/Spinner.js +1 -1
- package/lib/common/middleware/sharedBanksMiddleware.js +250 -0
- package/lib/common/records/Bank.js +1 -1
- package/lib/common/records/Item.js +3 -2
- package/lib/common/records/Quiz.js +1 -1
- package/lib/common/records/QuizAnalysis.js +1 -1
- package/lib/common/records/QuizEntry.js +8 -1
- package/lib/common/records/Stimulus.js +1 -1
- package/lib/common/reducers/sharingModal.js +23 -0
- package/lib/common/util/Fetcher.js +1 -1
- package/lib/common/util/TimerService.js +1 -1
- package/lib/common/util/formatTimespan.js +1 -1
- package/lib/common/util/interactionTypeMetadata.js +1 -1
- package/lib/common/util/interactionTypePropsHelper.js +1 -1
- package/lib/common/util/maxContent.js +1 -1
- package/lib/common/util/useRemoteComponent.js +134 -0
- package/lib/common/util/warningHelpers.js +1 -1
- package/lib/common/util/withDynamoPagination.js +13 -2
- package/lib/configureStore.js +4 -1
- package/lib/grading/api/quizEntryRegrades.js +1 -1
- package/lib/index.js +37 -0
- package/lib/moderating/api/quizSessionEvents.js +4 -2
- package/lib/moderating/components/events/PageBlurredEvent.js +1 -1
- package/lib/moderating/components/events/PageFocusedEvent.js +1 -1
- package/lib/moderating/components/events/ResponseEvent.js +1 -1
- package/lib/moderating/components/events/SessionStartEvent.js +1 -1
- package/lib/moderating/components/events/SessionSubmitEvent.js +1 -1
- package/lib/moderating/components/resources/AccommodationsModal/ExtraAttemptSettings/ExtraAttemptsInput/index.js +1 -1
- package/lib/moderating/components/resources/AccommodationsModal/ExtraAttemptSettings/index.js +1 -1
- package/lib/moderating/components/resources/AccommodationsModal/ExtraTimeMultiplier/index.js +1 -1
- package/lib/moderating/components/resources/AccommodationsModal/ExtraTimeSettings/index.js +1 -1
- package/lib/moderating/components/resources/AccommodationsModal/ReduceAnswerChoicesSettings/index.js +1 -1
- package/lib/moderating/components/resources/AccommodationsModal/index.js +1 -1
- package/lib/moderating/components/resources/ElapsedTime.js +1 -1
- package/lib/moderating/components/resources/EventDetails.js +1 -1
- package/lib/moderating/components/resources/ModerateTable/presenter.js +1 -1
- package/lib/moderating/components/resources/ModerateTableRow/presenter.js +1 -1
- package/lib/moderating/components/resources/OutstandingQuizzesModal/presenter.js +1 -1
- package/lib/moderating/components/resources/RetryGradePassbackButton/presenter.js +1 -1
- package/lib/moderating/components/resources/util/renderEventSummary.js +1 -1
- package/lib/moderating/components/sidebar/ModerateTray/presenter.js +1 -1
- package/lib/moderating/components/sidebar/ResetQuiz/presenter.js +1 -1
- package/lib/reporting/components/MetricsListItem/index.js +1 -1
- package/lib/reporting/components/charts/CentileDistribution/presenter.js +1 -1
- package/lib/reporting/components/charts/Distribution/presenter.js +1 -1
- package/lib/reporting/components/charts/QuintileDistribution/presenter.js +1 -1
- package/lib/reporting/components/itemAnalysis/AnswerFrequencySummary/index.js +1 -1
- package/lib/reporting/components/itemAnalysis/ItemAnalysisRow/presenter.js +1 -1
- package/lib/reporting/components/quizAnalysis/QuizAnalysisOverview.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/presenter.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/presenter.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/CategorizationType.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingType.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/OrderingType.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/index.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/index.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/popoverContent.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/presenter.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/ExportButton/index.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/presenter.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/popoverContent.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/popoverContent.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/presenter.js +1 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +1 -1
- package/lib/reporting/components/resources/QuizAndItemAnalysis/presenter.js +1 -1
- package/lib/reporting/components/resources/ReportCard/index.js +1 -1
- package/lib/reporting/components/resources/ReportList/index.js +1 -1
- package/lib/reporting/components/resources/StudentAnalysis/ReportCard/presenter.js +1 -1
- package/lib/reporting/components/resources/common/AnalysisUpdateDate/index.js +1 -1
- package/lib/reporting/components/resources/common/ExportButton/index.js +1 -1
- package/lib/reporting/components/resources/common/errorMessages.js +1 -1
- package/lib/reporting/components/resources/common/utils.js +1 -1
- package/lib/taking/api/taking.js +1 -1
- 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
|
|
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/
|
|
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
|
-
|
|
50
|
+
// =============
|
|
51
|
+
// LIFECYCLE
|
|
52
|
+
// =============
|
|
53
|
+
|
|
54
|
+
function SharingModalPresenter(props) {
|
|
52
55
|
var _this2;
|
|
53
56
|
_classCallCheck(this, SharingModalPresenter);
|
|
54
|
-
|
|
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
|
-
|
|
65
|
-
|
|
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,
|
|
191
|
-
var 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.
|
|
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
|
|
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
|
|
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,
|
|
273
|
-
var 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 (
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
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;
|