MOBILE-4616 chore: Import popovers during runtime

main
Pau Ferrer Ocaña 2024-07-18 12:48:19 +02:00
parent 7cf5d9b692
commit 072f0b8fd4
35 changed files with 101 additions and 51 deletions

View File

@ -21,7 +21,6 @@ import { CoreCommentsComponentsModule } from '@features/comments/components/comp
import { CoreTagComponentsModule } from '@features/tag/components/components.module'; import { CoreTagComponentsModule } from '@features/tag/components/components.module';
import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/components.module'; import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/components.module';
import { AddonBlogEntryOptionsMenuComponent } from './components/entry-options-menu';
import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module'; import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module';
import { ADDON_BLOG_MAINMENU_PAGE_NAME } from './constants'; import { ADDON_BLOG_MAINMENU_PAGE_NAME } from './constants';
import { canLeaveGuard } from '@guards/can-leave'; import { canLeaveGuard } from '@guards/can-leave';
@ -62,7 +61,6 @@ import { canLeaveGuard } from '@guards/can-leave';
], ],
declarations: [ declarations: [
AddonBlogIndexPage, AddonBlogIndexPage,
AddonBlogEntryOptionsMenuComponent,
], ],
providers: [ providers: [
{ {

View File

@ -11,12 +11,17 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { PopoverController } from '@singletons'; import { PopoverController } from '@singletons';
@Component({ @Component({
selector: 'addon-blog-entry-options-menu', selector: 'addon-blog-entry-options-menu',
templateUrl: './entry-options-menu.html', templateUrl: 'entry-options-menu.html',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class AddonBlogEntryOptionsMenuComponent { export class AddonBlogEntryOptionsMenuComponent {

View File

@ -13,7 +13,6 @@
// limitations under the License. // limitations under the License.
import { ContextLevel } from '@/core/constants'; import { ContextLevel } from '@/core/constants';
import { AddonBlogEntryOptionsMenuComponent } from '@addons/blog/components/entry-options-menu';
import { ADDON_BLOG_ENTRY_UPDATED } from '@addons/blog/constants'; import { ADDON_BLOG_ENTRY_UPDATED } from '@addons/blog/constants';
import { AddonBlog, AddonBlogFilter, AddonBlogPost, AddonBlogProvider } from '@addons/blog/services/blog'; import { AddonBlog, AddonBlogFilter, AddonBlogPost, AddonBlogProvider } from '@addons/blog/services/blog';
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
@ -328,6 +327,9 @@ export class AddonBlogIndexPage implements OnInit, OnDestroy {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
const { AddonBlogEntryOptionsMenuComponent } =
await import('@addons/blog/components/entry-options-menu/entry-options-menu');
const popoverData = await CorePopovers.open<string>({ const popoverData = await CorePopovers.open<string>({
component: AddonBlogEntryOptionsMenuComponent, component: AddonBlogEntryOptionsMenuComponent,
event, event,

View File

@ -43,7 +43,6 @@ import { CoreNavigator } from '@services/navigator';
import { CanLeave } from '@guards/can-leave'; import { CanLeave } from '@guards/can-leave';
import { CoreForms } from '@singletons/form'; import { CoreForms } from '@singletons/form';
import { CoreReminders, CoreRemindersService, CoreRemindersUnits } from '@features/reminders/services/reminders'; import { CoreReminders, CoreRemindersService, CoreRemindersUnits } from '@features/reminders/services/reminders';
import { CoreRemindersSetReminderMenuComponent } from '@features/reminders/components/set-reminder-menu/set-reminder-menu';
import moment from 'moment-timezone'; import moment from 'moment-timezone';
import { ADDON_CALENDAR_COMPONENT } from '@addons/calendar/constants'; import { ADDON_CALENDAR_COMPONENT } from '@addons/calendar/constants';
import { ContextLevel } from '@/core/constants'; import { ContextLevel } from '@/core/constants';
@ -638,6 +637,9 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave {
const formData = this.form.value; const formData = this.form.value;
const eventTime = moment(formData.timestart).unix(); const eventTime = moment(formData.timestart).unix();
const { CoreRemindersSetReminderMenuComponent } =
await import('@features/reminders/components/set-reminder-menu/set-reminder-menu');
const reminderTime = await CorePopovers.open<{timeBefore: number}>({ const reminderTime = await CorePopovers.open<{timeBefore: number}>({
component: CoreRemindersSetReminderMenuComponent, component: CoreRemindersSetReminderMenuComponent,
componentProps: { componentProps: {

View File

@ -39,7 +39,6 @@ import { CoreRoutedItemsManagerSourcesTracker } from '@classes/items-management/
import { AddonCalendarEventsSource } from '@addons/calendar/classes/events-source'; import { AddonCalendarEventsSource } from '@addons/calendar/classes/events-source';
import { CoreSwipeNavigationItemsManager } from '@classes/items-management/swipe-navigation-items-manager'; import { CoreSwipeNavigationItemsManager } from '@classes/items-management/swipe-navigation-items-manager';
import { CoreReminders, CoreRemindersService } from '@features/reminders/services/reminders'; import { CoreReminders, CoreRemindersService } from '@features/reminders/services/reminders';
import { CoreRemindersSetReminderMenuComponent } from '@features/reminders/components/set-reminder-menu/set-reminder-menu';
import { CoreLocalNotifications } from '@services/local-notifications'; import { CoreLocalNotifications } from '@services/local-notifications';
import { CorePlatform } from '@services/platform'; import { CorePlatform } from '@services/platform';
import { CoreConfig } from '@services/config'; import { CoreConfig } from '@services/config';
@ -385,6 +384,9 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy {
return; return;
} }
const { CoreRemindersSetReminderMenuComponent } =
await import('@features/reminders/components/set-reminder-menu/set-reminder-menu');
const reminderTime = await CorePopovers.open<{timeBefore: number}>({ const reminderTime = await CorePopovers.open<{timeBefore: number}>({
component: CoreRemindersSetReminderMenuComponent, component: CoreRemindersSetReminderMenuComponent,
componentProps: { componentProps: {

View File

@ -18,7 +18,6 @@ import {
CoreReminders, CoreReminders,
CoreRemindersService, CoreRemindersService,
} from '@features/reminders/services/reminders'; } from '@features/reminders/services/reminders';
import { CoreRemindersSetReminderMenuComponent } from '@features/reminders/components/set-reminder-menu/set-reminder-menu';
/** /**
* Page that displays the calendar settings. * Page that displays the calendar settings.
@ -51,6 +50,9 @@ export class AddonCalendarSettingsPage implements OnInit {
e.stopImmediatePropagation(); e.stopImmediatePropagation();
e.preventDefault(); e.preventDefault();
const { CoreRemindersSetReminderMenuComponent } =
await import('@features/reminders/components/set-reminder-menu/set-reminder-menu');
const reminderTime = await CorePopovers.open<{timeBefore: number}>({ const reminderTime = await CorePopovers.open<{timeBefore: number}>({
component: CoreRemindersSetReminderMenuComponent, component: CoreRemindersSetReminderMenuComponent,
componentProps: { componentProps: {

View File

@ -27,7 +27,7 @@ import {
import { AddonModDataHelper } from '../../services/data-helper'; import { AddonModDataHelper } from '../../services/data-helper';
import { AddonModDataOffline } from '../../services/data-offline'; import { AddonModDataOffline } from '../../services/data-offline';
import { CorePopovers } from '@services/popovers'; import { CorePopovers } from '@services/popovers';
import { AddonModDataActionsMenuComponent, AddonModDataActionsMenuItem } from '../actionsmenu/actionsmenu'; import { AddonModDataActionsMenuItem } from '../actionsmenu/actionsmenu';
import { import {
ADDON_MOD_DATA_ENTRY_CHANGED, ADDON_MOD_DATA_ENTRY_CHANGED,
ADDON_MOD_DATA_PAGE_NAME, ADDON_MOD_DATA_PAGE_NAME,
@ -202,6 +202,8 @@ export class AddonModDataActionComponent implements OnInit {
}); });
} }
const { AddonModDataActionsMenuComponent } = await import('../actionsmenu/actionsmenu');
await CorePopovers.openWithoutResult({ await CorePopovers.openWithoutResult({
component: AddonModDataActionsMenuComponent, component: AddonModDataActionsMenuComponent,
componentProps: { items }, componentProps: { items },

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { PopoverController } from '@singletons'; import { PopoverController } from '@singletons';
@ -21,6 +22,10 @@ import { PopoverController } from '@singletons';
@Component({ @Component({
selector: 'addon-mod-data-actionsmenu', selector: 'addon-mod-data-actionsmenu',
templateUrl: 'actionsmenu.html', templateUrl: 'actionsmenu.html',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class AddonModDataActionsMenuComponent { export class AddonModDataActionsMenuComponent {

View File

@ -17,12 +17,10 @@ import { CoreSharedModule } from '@/core/shared.module';
import { CoreCourseComponentsModule } from '@features/course/components/components.module'; import { CoreCourseComponentsModule } from '@features/course/components/components.module';
import { AddonModDataIndexComponent } from './index'; import { AddonModDataIndexComponent } from './index';
import { CoreCompileHtmlComponentModule } from '@features/compile/components/compile-html/compile-html.module'; import { CoreCompileHtmlComponentModule } from '@features/compile/components/compile-html/compile-html.module';
import { AddonModDataActionsMenuComponent } from './actionsmenu/actionsmenu';
@NgModule({ @NgModule({
declarations: [ declarations: [
AddonModDataIndexComponent, AddonModDataIndexComponent,
AddonModDataActionsMenuComponent,
], ],
imports: [ imports: [
CoreSharedModule, CoreSharedModule,
@ -31,7 +29,6 @@ import { AddonModDataActionsMenuComponent } from './actionsmenu/actionsmenu';
], ],
exports: [ exports: [
AddonModDataIndexComponent, AddonModDataIndexComponent,
AddonModDataActionsMenuComponent,
], ],
}) })
export class AddonModDataComponentsModule {} export class AddonModDataComponentsModule {}

View File

@ -20,17 +20,13 @@ import { CoreSharedModule } from '@/core/shared.module';
import { CoreTagComponentsModule } from '@features/tag/components/components.module'; import { CoreTagComponentsModule } from '@features/tag/components/components.module';
import { CoreRatingComponentsModule } from '@features/rating/components/components.module'; import { CoreRatingComponentsModule } from '@features/rating/components/components.module';
import { AddonModForumDiscussionOptionsMenuComponent } from './discussion-options-menu/discussion-options-menu';
import { AddonModForumIndexComponent } from './index/index'; import { AddonModForumIndexComponent } from './index/index';
import { AddonModForumPostComponent } from './post/post'; import { AddonModForumPostComponent } from './post/post';
import { AddonModForumPostOptionsMenuComponent } from './post-options-menu/post-options-menu';
@NgModule({ @NgModule({
declarations: [ declarations: [
AddonModForumDiscussionOptionsMenuComponent,
AddonModForumIndexComponent, AddonModForumIndexComponent,
AddonModForumPostComponent, AddonModForumPostComponent,
AddonModForumPostOptionsMenuComponent,
], ],
imports: [ imports: [
CoreSharedModule, CoreSharedModule,

View File

@ -20,6 +20,7 @@ import { CoreEvents } from '@singletons/events';
import { AddonModForum, AddonModForumDiscussion } from '../../services/forum'; import { AddonModForum, AddonModForumDiscussion } from '../../services/forum';
import { ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT } from '../../constants'; import { ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT } from '../../constants';
import { CoreToasts } from '@services/toasts'; import { CoreToasts } from '@services/toasts';
import { CoreSharedModule } from '@/core/shared.module';
/** /**
* This component is meant to display a popover with the discussion options. * This component is meant to display a popover with the discussion options.
@ -27,6 +28,10 @@ import { CoreToasts } from '@services/toasts';
@Component({ @Component({
selector: 'addon-forum-discussion-options-menu', selector: 'addon-forum-discussion-options-menu',
templateUrl: 'discussion-options-menu.html', templateUrl: 'discussion-options-menu.html',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class AddonModForumDiscussionOptionsMenuComponent implements OnInit { export class AddonModForumDiscussionOptionsMenuComponent implements OnInit {

View File

@ -41,7 +41,6 @@ import { CoreUser } from '@features/user/services/user';
import { CoreDomUtils } from '@services/utils/dom'; import { CoreDomUtils } from '@services/utils/dom';
import { CoreCourse } from '@features/course/services/course'; import { CoreCourse } from '@features/course/services/course';
import { CoreSplitViewComponent } from '@components/split-view/split-view'; import { CoreSplitViewComponent } from '@components/split-view/split-view';
import { AddonModForumDiscussionOptionsMenuComponent } from '../discussion-options-menu/discussion-options-menu';
import { CoreScreen } from '@services/screen'; import { CoreScreen } from '@services/screen';
import { AddonModForumPrefetchHandler } from '../../services/handlers/prefetch'; import { AddonModForumPrefetchHandler } from '../../services/handlers/prefetch';
import { CoreRatingProvider } from '@features/rating/services/rating'; import { CoreRatingProvider } from '@features/rating/services/rating';
@ -636,6 +635,9 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
const { AddonModForumDiscussionOptionsMenuComponent } =
await import('../discussion-options-menu/discussion-options-menu');
const popoverData = await CorePopovers.open<{ action?: string; value: boolean }>({ const popoverData = await CorePopovers.open<{ action?: string; value: boolean }>({
component: AddonModForumDiscussionOptionsMenuComponent, component: AddonModForumDiscussionOptionsMenuComponent,
componentProps: { componentProps: {

View File

@ -19,6 +19,7 @@ import { AddonModForum, AddonModForumPost } from '@addons/mod/forum/services/for
import { PopoverController } from '@singletons'; import { PopoverController } from '@singletons';
import { CoreDomUtils } from '@services/utils/dom'; import { CoreDomUtils } from '@services/utils/dom';
import { CoreNetworkError } from '@classes/errors/network-error'; import { CoreNetworkError } from '@classes/errors/network-error';
import { CoreSharedModule } from '@/core/shared.module';
/** /**
* This component is meant to display a popover with the post options. * This component is meant to display a popover with the post options.
@ -26,7 +27,11 @@ import { CoreNetworkError } from '@classes/errors/network-error';
@Component({ @Component({
selector: 'addon-forum-post-options-menu', selector: 'addon-forum-post-options-menu',
templateUrl: 'post-options-menu.html', templateUrl: 'post-options-menu.html',
styleUrls: ['./post-options-menu.scss'], styleUrl: 'post-options-menu.scss',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class AddonModForumPostOptionsMenuComponent implements OnInit { export class AddonModForumPostOptionsMenuComponent implements OnInit {

View File

@ -45,7 +45,6 @@ import { CoreTextUtils } from '@services/utils/text';
import { AddonModForumHelper } from '../../services/forum-helper'; import { AddonModForumHelper } from '../../services/forum-helper';
import { AddonModForumOffline } from '../../services/forum-offline'; import { AddonModForumOffline } from '../../services/forum-offline';
import { CoreUtils } from '@services/utils/utils'; import { CoreUtils } from '@services/utils/utils';
import { AddonModForumPostOptionsMenuComponent } from '../post-options-menu/post-options-menu';
import { CoreRatingInfo } from '@features/rating/services/rating'; import { CoreRatingInfo } from '@features/rating/services/rating';
import { CoreForms } from '@singletons/form'; import { CoreForms } from '@singletons/form';
import { CoreFileEntry } from '@services/file-helper'; import { CoreFileEntry } from '@services/file-helper';
@ -234,6 +233,9 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges
* @param event Click Event. * @param event Click Event.
*/ */
async showOptionsMenu(event: Event): Promise<void> { async showOptionsMenu(event: Event): Promise<void> {
const { AddonModForumPostOptionsMenuComponent } =
await import('../post-options-menu/post-options-menu');
const popoverData = await CorePopovers.open<{ action?: string }>({ const popoverData = await CorePopovers.open<{ action?: string }>({
component: AddonModForumPostOptionsMenuComponent, component: AddonModForumPostOptionsMenuComponent,
componentProps: { componentProps: {

View File

@ -14,7 +14,6 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { AddonModGlossaryIndexComponent } from './index/index'; import { AddonModGlossaryIndexComponent } from './index/index';
import { AddonModGlossaryModePickerPopoverComponent } from './mode-picker/mode-picker';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { CoreCourseComponentsModule } from '@features/course/components/components.module'; import { CoreCourseComponentsModule } from '@features/course/components/components.module';
import { CoreSearchComponentsModule } from '@features/search/components/components.module'; import { CoreSearchComponentsModule } from '@features/search/components/components.module';
@ -22,7 +21,6 @@ import { CoreSearchComponentsModule } from '@features/search/components/componen
@NgModule({ @NgModule({
declarations: [ declarations: [
AddonModGlossaryIndexComponent, AddonModGlossaryIndexComponent,
AddonModGlossaryModePickerPopoverComponent,
], ],
imports: [ imports: [
CoreSharedModule, CoreSharedModule,
@ -31,7 +29,6 @@ import { CoreSearchComponentsModule } from '@features/search/components/componen
], ],
exports: [ exports: [
AddonModGlossaryIndexComponent, AddonModGlossaryIndexComponent,
AddonModGlossaryModePickerPopoverComponent,
], ],
}) })
export class AddonModGlossaryComponentsModule {} export class AddonModGlossaryComponentsModule {}

View File

@ -50,7 +50,6 @@ import {
GLOSSARY_AUTO_SYNCED, GLOSSARY_AUTO_SYNCED,
} from '../../services/glossary-sync'; } from '../../services/glossary-sync';
import { AddonModGlossaryPrefetchHandler } from '../../services/handlers/prefetch'; import { AddonModGlossaryPrefetchHandler } from '../../services/handlers/prefetch';
import { AddonModGlossaryModePickerPopoverComponent } from '../mode-picker/mode-picker';
import { CoreTime } from '@singletons/time'; import { CoreTime } from '@singletons/time';
import { import {
ADDON_MOD_GLOSSARY_COMPONENT, ADDON_MOD_GLOSSARY_COMPONENT,
@ -355,6 +354,7 @@ export class AddonModGlossaryIndexComponent extends CoreCourseModuleMainActivity
if (!this.glossary) { if (!this.glossary) {
return; return;
} }
const { AddonModGlossaryModePickerPopoverComponent } = await import('../mode-picker/mode-picker');
const entries = await this.promisedEntries; const entries = await this.promisedEntries;
const previousMode = entries.getSource().fetchMode; const previousMode = entries.getSource().fetchMode;

View File

@ -15,6 +15,7 @@
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { PopoverController } from '@singletons'; import { PopoverController } from '@singletons';
import { AddonModGlossaryFetchMode } from '../../classes/glossary-entries-source'; import { AddonModGlossaryFetchMode } from '../../classes/glossary-entries-source';
import { CoreSharedModule } from '@/core/shared.module';
/** /**
* Component to display the mode picker. * Component to display the mode picker.
@ -22,6 +23,10 @@ import { AddonModGlossaryFetchMode } from '../../classes/glossary-entries-source
@Component({ @Component({
selector: 'addon-mod-glossary-mode-picker-popover', selector: 'addon-mod-glossary-mode-picker-popover',
templateUrl: 'addon-mod-glossary-mode-picker.html', templateUrl: 'addon-mod-glossary-mode-picker.html',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class AddonModGlossaryModePickerPopoverComponent implements OnInit { export class AddonModGlossaryModePickerPopoverComponent implements OnInit {

View File

@ -17,7 +17,6 @@ import { BehaviorSubject } from 'rxjs';
import { CoreQuestionHelper } from '@features/question/services/question-helper'; import { CoreQuestionHelper } from '@features/question/services/question-helper';
import { CoreQuestionsAnswers } from '@features/question/services/question'; import { CoreQuestionsAnswers } from '@features/question/services/question';
import { CoreLogger } from '@singletons/logger'; import { CoreLogger } from '@singletons/logger';
import { AddonModQuizConnectionErrorComponent } from '../components/connection-error/connection-error';
import { AddonModQuiz, AddonModQuizAttemptWSData, AddonModQuizQuizWSData } from '../services/quiz'; import { AddonModQuiz, AddonModQuizAttemptWSData, AddonModQuizQuizWSData } from '../services/quiz';
import { CorePopovers } from '@services/popovers'; import { CorePopovers } from '@services/popovers';
@ -197,6 +196,8 @@ export class AddonModQuizAutoSave {
}; };
this.popoverShown = true; this.popoverShown = true;
const { AddonModQuizConnectionErrorComponent } = await import('../components/connection-error/connection-error');
this.popover = await CorePopovers.openWithoutResult({ this.popover = await CorePopovers.openWithoutResult({
component: AddonModQuizConnectionErrorComponent, component: AddonModQuizConnectionErrorComponent,
event: <Event> event, event: <Event> event,

View File

@ -16,7 +16,6 @@ import { NgModule } from '@angular/core';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { CoreCourseComponentsModule } from '@features/course/components/components.module'; import { CoreCourseComponentsModule } from '@features/course/components/components.module';
import { AddonModQuizConnectionErrorComponent } from './connection-error/connection-error';
import { AddonModQuizIndexComponent } from './index/index'; import { AddonModQuizIndexComponent } from './index/index';
import { AddonModQuizAttemptInfoComponent } from './attempt-info/attempt-info'; import { AddonModQuizAttemptInfoComponent } from './attempt-info/attempt-info';
import { AddonModQuizAttemptStateComponent } from './attempt-state/attempt-state'; import { AddonModQuizAttemptStateComponent } from './attempt-state/attempt-state';
@ -27,7 +26,6 @@ import { AddonModQuizQuestionCardComponent } from './question-card/question-card
AddonModQuizAttemptInfoComponent, AddonModQuizAttemptInfoComponent,
AddonModQuizAttemptStateComponent, AddonModQuizAttemptStateComponent,
AddonModQuizIndexComponent, AddonModQuizIndexComponent,
AddonModQuizConnectionErrorComponent,
AddonModQuizQuestionCardComponent, AddonModQuizQuestionCardComponent,
], ],
imports: [ imports: [
@ -38,7 +36,6 @@ import { AddonModQuizQuestionCardComponent } from './question-card/question-card
AddonModQuizAttemptInfoComponent, AddonModQuizAttemptInfoComponent,
AddonModQuizAttemptStateComponent, AddonModQuizAttemptStateComponent,
AddonModQuizIndexComponent, AddonModQuizIndexComponent,
AddonModQuizConnectionErrorComponent,
AddonModQuizQuestionCardComponent, AddonModQuizQuestionCardComponent,
], ],

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
/** /**
@ -20,7 +21,11 @@ import { Component } from '@angular/core';
@Component({ @Component({
selector: 'addon-mod-quiz-connection-error', selector: 'addon-mod-quiz-connection-error',
templateUrl: 'connection-error.html', templateUrl: 'connection-error.html',
styleUrls: ['connection-error.scss'], styleUrl: 'connection-error.scss',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class AddonModQuizConnectionErrorComponent { export class AddonModQuizConnectionErrorComponent {

View File

@ -27,7 +27,6 @@ import { CoreChartComponent } from './chart/chart';
import { CoreChronoComponent } from './chrono/chrono'; import { CoreChronoComponent } from './chrono/chrono';
import { CoreContextMenuComponent } from './context-menu/context-menu'; import { CoreContextMenuComponent } from './context-menu/context-menu';
import { CoreContextMenuItemComponent } from './context-menu/context-menu-item'; import { CoreContextMenuItemComponent } from './context-menu/context-menu-item';
import { CoreContextMenuPopoverComponent } from './context-menu/context-menu-popover';
import { CoreDownloadRefreshComponent } from './download-refresh/download-refresh'; import { CoreDownloadRefreshComponent } from './download-refresh/download-refresh';
import { CoreDynamicComponent } from './dynamic-component/dynamic-component'; import { CoreDynamicComponent } from './dynamic-component/dynamic-component';
import { CoreEmptyBoxComponent } from './empty-box/empty-box'; import { CoreEmptyBoxComponent } from './empty-box/empty-box';
@ -88,7 +87,6 @@ export async function getCoreStandaloneComponents(): Promise<Type<unknown>[]> {
CoreChronoComponent, CoreChronoComponent,
CoreContextMenuComponent, CoreContextMenuComponent,
CoreContextMenuItemComponent, CoreContextMenuItemComponent,
CoreContextMenuPopoverComponent,
CoreCourseImageComponent, CoreCourseImageComponent,
CoreDownloadRefreshComponent, CoreDownloadRefreshComponent,
CoreDynamicComponent, CoreDynamicComponent,
@ -141,7 +139,6 @@ export async function getCoreStandaloneComponents(): Promise<Type<unknown>[]> {
CoreChronoComponent, CoreChronoComponent,
CoreContextMenuComponent, CoreContextMenuComponent,
CoreContextMenuItemComponent, CoreContextMenuItemComponent,
CoreContextMenuPopoverComponent,
CoreCourseImageComponent, CoreCourseImageComponent,
CoreDownloadRefreshComponent, CoreDownloadRefreshComponent,
CoreDynamicComponent, CoreDynamicComponent,

View File

@ -17,6 +17,7 @@ import { Component } from '@angular/core';
import { NavParams } from '@ionic/angular'; import { NavParams } from '@ionic/angular';
import { PopoverController } from '@singletons'; import { PopoverController } from '@singletons';
import { CoreContextMenuItemComponent } from './context-menu-item'; import { CoreContextMenuItemComponent } from './context-menu-item';
import { CoreSharedModule } from '@/core/shared.module';
/** /**
* Component to display a list of items received by param in a popover. * Component to display a list of items received by param in a popover.
@ -24,7 +25,11 @@ import { CoreContextMenuItemComponent } from './context-menu-item';
@Component({ @Component({
selector: 'core-context-menu-popover', selector: 'core-context-menu-popover',
templateUrl: 'core-context-menu-popover.html', templateUrl: 'core-context-menu-popover.html',
styleUrls: ['context-menu-popover.scss'], styleUrl: 'context-menu-popover.scss',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class CoreContextMenuPopoverComponent { export class CoreContextMenuPopoverComponent {

View File

@ -19,7 +19,6 @@ import { CorePopovers } from '@services/popovers';
import { CoreUtils } from '@services/utils/utils'; import { CoreUtils } from '@services/utils/utils';
import { Translate } from '@singletons'; import { Translate } from '@singletons';
import { CoreContextMenuItemComponent } from './context-menu-item'; import { CoreContextMenuItemComponent } from './context-menu-item';
import { CoreContextMenuPopoverComponent } from './context-menu-popover';
import { CoreDirectivesRegistry } from '@singletons/directives-registry'; import { CoreDirectivesRegistry } from '@singletons/directives-registry';
/** /**
@ -183,6 +182,8 @@ export class CoreContextMenuComponent implements OnInit, OnDestroy {
if (!this.expanded) { if (!this.expanded) {
this.expanded = true; this.expanded = true;
const { CoreContextMenuPopoverComponent } = await import('./context-menu-popover');
const popoverData = await CorePopovers.open<CoreContextMenuItemComponent>({ const popoverData = await CorePopovers.open<CoreContextMenuItemComponent>({
event, event,
component: CoreContextMenuPopoverComponent, component: CoreContextMenuPopoverComponent,

View File

@ -25,7 +25,6 @@ import { CoreCourseModuleInfoComponent } from './module-info/module-info';
import { CoreCourseModuleNavigationComponent } from './module-navigation/module-navigation'; import { CoreCourseModuleNavigationComponent } from './module-navigation/module-navigation';
import { CoreCourseCourseIndexTourComponent } from './course-index-tour/course-index-tour'; import { CoreCourseCourseIndexTourComponent } from './course-index-tour/course-index-tour';
import { CoreRemindersComponentsModule } from '@features/reminders/components/components.module'; import { CoreRemindersComponentsModule } from '@features/reminders/components/components.module';
import { CoreCourseModuleCompletionDetailsComponent } from './module-completion-details/module-completion-details';
@NgModule({ @NgModule({
declarations: [ declarations: [
@ -37,7 +36,6 @@ import { CoreCourseModuleCompletionDetailsComponent } from './module-completion-
CoreCourseTagAreaComponent, CoreCourseTagAreaComponent,
CoreCourseUnsupportedModuleComponent, CoreCourseUnsupportedModuleComponent,
CoreCourseModuleNavigationComponent, CoreCourseModuleNavigationComponent,
CoreCourseModuleCompletionDetailsComponent,
], ],
imports: [ imports: [
CoreBlockComponentsModule, CoreBlockComponentsModule,
@ -53,7 +51,6 @@ import { CoreCourseModuleCompletionDetailsComponent } from './module-completion-
CoreCourseTagAreaComponent, CoreCourseTagAreaComponent,
CoreCourseUnsupportedModuleComponent, CoreCourseUnsupportedModuleComponent,
CoreCourseModuleNavigationComponent, CoreCourseModuleNavigationComponent,
CoreCourseModuleCompletionDetailsComponent,
], ],
}) })
export class CoreCourseComponentsModule {} export class CoreCourseComponentsModule {}

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { import {
@ -28,7 +29,11 @@ import { Translate } from '@singletons';
@Component({ @Component({
selector: 'core-course-module-completion-details', selector: 'core-course-module-completion-details',
templateUrl: 'module-completion-details.html', templateUrl: 'module-completion-details.html',
styleUrls: ['module-completion-details.scss'], styleUrl: 'module-completion-details.scss',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class CoreCourseModuleCompletionDetailsComponent implements OnInit { export class CoreCourseModuleCompletionDetailsComponent implements OnInit {

View File

@ -19,7 +19,6 @@ import {
CoreCourseModuleCompletionStatus, CoreCourseModuleCompletionStatus,
} from '@features/course/services/course'; } from '@features/course/services/course';
import { CorePopovers } from '@services/popovers'; import { CorePopovers } from '@services/popovers';
import { CoreCourseModuleCompletionDetailsComponent } from '../module-completion-details/module-completion-details';
import { CoreCourseHelper } from '@features/course/services/course-helper'; import { CoreCourseHelper } from '@features/course/services/course-helper';
import { CoreUser } from '@features/user/services/user'; import { CoreUser } from '@features/user/services/user';
import { Translate } from '@singletons'; import { Translate } from '@singletons';
@ -132,6 +131,9 @@ export class CoreCourseModuleCompletionComponent
target = target.parentElement; target = target.parentElement;
} }
const { CoreCourseModuleCompletionDetailsComponent } =
await import('../module-completion-details/module-completion-details');
CorePopovers.openWithoutResult({ CorePopovers.openWithoutResult({
component: CoreCourseModuleCompletionDetailsComponent, component: CoreCourseModuleCompletionDetailsComponent,
componentProps: { componentProps: {

View File

@ -16,19 +16,16 @@ import { NgModule } from '@angular/core';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { CoreCoursesCourseListItemComponent } from './course-list-item/course-list-item'; import { CoreCoursesCourseListItemComponent } from './course-list-item/course-list-item';
import { CoreCoursesCourseOptionsMenuComponent } from './course-options-menu/course-options-menu';
@NgModule({ @NgModule({
declarations: [ declarations: [
CoreCoursesCourseListItemComponent, CoreCoursesCourseListItemComponent,
CoreCoursesCourseOptionsMenuComponent,
], ],
imports: [ imports: [
CoreSharedModule, CoreSharedModule,
], ],
exports: [ exports: [
CoreCoursesCourseListItemComponent, CoreCoursesCourseListItemComponent,
CoreCoursesCourseOptionsMenuComponent,
], ],
}) })
export class CoreCoursesComponentsModule {} export class CoreCoursesComponentsModule {}

View File

@ -25,7 +25,6 @@ import { CoreColors } from '@singletons/colors';
import { CoreEventCourseStatusChanged, CoreEventObserver, CoreEvents } from '@singletons/events'; import { CoreEventCourseStatusChanged, CoreEventObserver, CoreEvents } from '@singletons/events';
import { CoreCourseListItem, CoreCourses, CoreCoursesProvider } from '../../services/courses'; import { CoreCourseListItem, CoreCourses, CoreCoursesProvider } from '../../services/courses';
import { CoreCoursesHelper, CoreEnrolledCourseDataWithExtraInfoAndOptions } from '../../services/courses-helper'; import { CoreCoursesHelper, CoreEnrolledCourseDataWithExtraInfoAndOptions } from '../../services/courses-helper';
import { CoreCoursesCourseOptionsMenuComponent } from '../course-options-menu/course-options-menu';
import { CoreEnrolHelper } from '@features/enrol/services/enrol-helper'; import { CoreEnrolHelper } from '@features/enrol/services/enrol-helper';
import { CoreDownloadStatusTranslatable } from '@components/download-refresh/download-refresh'; import { CoreDownloadStatusTranslatable } from '@components/download-refresh/download-refresh';
import { toBoolean } from '@/core/transforms/boolean'; import { toBoolean } from '@/core/transforms/boolean';
@ -298,6 +297,8 @@ export class CoreCoursesCourseListItemComponent implements OnInit, OnDestroy, On
this.initPrefetchCourse(true); this.initPrefetchCourse(true);
const { CoreCoursesCourseOptionsMenuComponent } = await import('../course-options-menu/course-options-menu');
const popoverData = await CorePopovers.open<string>({ const popoverData = await CorePopovers.open<string>({
component: CoreCoursesCourseOptionsMenuComponent, component: CoreCoursesCourseOptionsMenuComponent,
componentProps: { componentProps: {

View File

@ -17,6 +17,7 @@ import { CoreCourses } from '../../services/courses';
import { CoreEnrolledCourseDataWithExtraInfoAndOptions } from '../../services/courses-helper'; import { CoreEnrolledCourseDataWithExtraInfoAndOptions } from '../../services/courses-helper';
import { CorePrefetchStatusInfo } from '@features/course/services/course-helper'; import { CorePrefetchStatusInfo } from '@features/course/services/course-helper';
import { PopoverController } from '@singletons'; import { PopoverController } from '@singletons';
import { CoreSharedModule } from '@/core/shared.module';
/** /**
* This component is meant to display a popover with the course options. * This component is meant to display a popover with the course options.
@ -24,6 +25,11 @@ import { PopoverController } from '@singletons';
@Component({ @Component({
selector: 'core-courses-course-options-menu', selector: 'core-courses-course-options-menu',
templateUrl: 'core-courses-course-options-menu.html', templateUrl: 'core-courses-course-options-menu.html',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class CoreCoursesCourseOptionsMenuComponent implements OnInit { export class CoreCoursesCourseOptionsMenuComponent implements OnInit {

View File

@ -16,15 +16,11 @@ import { CoreSharedModule } from '@/core/shared.module';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CoreRemindersDateComponent } from './date/date'; import { CoreRemindersDateComponent } from './date/date';
import { CoreRemindersSetButtonComponent } from './set-button/set-button'; import { CoreRemindersSetButtonComponent } from './set-button/set-button';
import { CoreRemindersSetReminderCustomComponent } from './set-reminder-custom/set-reminder-custom';
import { CoreRemindersSetReminderMenuComponent } from './set-reminder-menu/set-reminder-menu';
@NgModule({ @NgModule({
declarations: [ declarations: [
CoreRemindersDateComponent, CoreRemindersDateComponent,
CoreRemindersSetButtonComponent, CoreRemindersSetButtonComponent,
CoreRemindersSetReminderCustomComponent,
CoreRemindersSetReminderMenuComponent,
], ],
imports: [ imports: [
CoreSharedModule, CoreSharedModule,
@ -32,8 +28,6 @@ import { CoreRemindersSetReminderMenuComponent } from './set-reminder-menu/set-r
exports: [ exports: [
CoreRemindersDateComponent, CoreRemindersDateComponent,
CoreRemindersSetButtonComponent, CoreRemindersSetButtonComponent,
CoreRemindersSetReminderCustomComponent,
CoreRemindersSetReminderMenuComponent,
], ],
}) })
export class CoreRemindersComponentsModule {} export class CoreRemindersComponentsModule {}

View File

@ -15,7 +15,6 @@
import { CoreReminderData, CoreReminders, CoreRemindersService } from '@features/reminders/services/reminders'; import { CoreReminderData, CoreReminders, CoreRemindersService } from '@features/reminders/services/reminders';
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { CorePopovers } from '@services/popovers'; import { CorePopovers } from '@services/popovers';
import { CoreRemindersSetReminderMenuComponent } from '../set-reminder-menu/set-reminder-menu';
import { Translate } from '@singletons'; import { Translate } from '@singletons';
import { CoreTimeUtils } from '@services/utils/time'; import { CoreTimeUtils } from '@services/utils/time';
import { CoreToasts } from '@services/toasts'; import { CoreToasts } from '@services/toasts';
@ -72,6 +71,9 @@ export class CoreRemindersSetButtonComponent implements OnInit {
} }
// Open popover. // Open popover.
const { CoreRemindersSetReminderMenuComponent }
= await import('../set-reminder-menu/set-reminder-menu');
const reminderTime = await CorePopovers.open<{timeBefore: number}>({ const reminderTime = await CorePopovers.open<{timeBefore: number}>({
component: CoreRemindersSetReminderMenuComponent, component: CoreRemindersSetReminderMenuComponent,
componentProps: { componentProps: {

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { CoreRemindersUnits } from '@features/reminders/services/reminders'; import { CoreRemindersUnits } from '@features/reminders/services/reminders';
import { PopoverController } from '@singletons'; import { PopoverController } from '@singletons';
@ -21,6 +22,10 @@ import { PopoverController } from '@singletons';
*/ */
@Component({ @Component({
templateUrl: 'set-reminder-custom.html', templateUrl: 'set-reminder-custom.html',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class CoreRemindersSetReminderCustomComponent { export class CoreRemindersSetReminderCustomComponent {

View File

@ -22,14 +22,18 @@ import {
import { CorePopovers } from '@services/popovers'; import { CorePopovers } from '@services/popovers';
import { CoreWait } from '@singletons/wait'; import { CoreWait } from '@singletons/wait';
import { PopoverController } from '@singletons'; import { PopoverController } from '@singletons';
import { CoreRemindersSetReminderCustomComponent } from '../set-reminder-custom/set-reminder-custom'; import { CoreSharedModule } from '@/core/shared.module';
/** /**
* This component is meant to display a popover with the reminder options. * This component is meant to display a popover with the reminder options.
*/ */
@Component({ @Component({
templateUrl: 'set-reminder-menu.html', templateUrl: 'set-reminder-menu.html',
styleUrls: ['set-reminder-menu.scss'], styleUrl: 'set-reminder-menu.scss',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class CoreRemindersSetReminderMenuComponent implements OnInit { export class CoreRemindersSetReminderMenuComponent implements OnInit {
@ -155,6 +159,9 @@ export class CoreRemindersSetReminderMenuComponent implements OnInit {
ev.stopPropagation(); ev.stopPropagation();
ev.preventDefault(); ev.preventDefault();
const { CoreRemindersSetReminderCustomComponent }
= await import('../set-reminder-custom/set-reminder-custom');
const reminderTime = await CorePopovers.open<CoreReminderValueAndUnit>({ const reminderTime = await CorePopovers.open<CoreReminderValueAndUnit>({
component: CoreRemindersSetReminderCustomComponent, component: CoreRemindersSetReminderCustomComponent,
componentProps: { componentProps: {

View File

@ -36,7 +36,6 @@ import {
import { CoreLogger } from '@singletons/logger'; import { CoreLogger } from '@singletons/logger';
import { CoreFileSizeSum } from '@services/plugin-file-delegate'; import { CoreFileSizeSum } from '@services/plugin-file-delegate';
import { CoreNetworkError } from '@classes/errors/network-error'; import { CoreNetworkError } from '@classes/errors/network-error';
import { CoreBSTooltipComponent } from '@components/bs-tooltip/bs-tooltip';
import { CoreSites } from '@services/sites'; import { CoreSites } from '@services/sites';
import { CoreNetwork } from '@services/network'; import { CoreNetwork } from '@services/network';
import { CoreSiteError } from '@classes/errors/siteerror'; import { CoreSiteError } from '@classes/errors/siteerror';
@ -540,6 +539,8 @@ export class CoreDomUtilsProvider {
el.addEventListener('click', async (ev: Event) => { el.addEventListener('click', async (ev: Event) => {
const html = el.getAttribute('data-html'); const html = el.getAttribute('data-html');
const { CoreBSTooltipComponent } = await import('@components/bs-tooltip/bs-tooltip');
await CorePopovers.openWithoutResult({ await CorePopovers.openWithoutResult({
component: CoreBSTooltipComponent, component: CoreBSTooltipComponent,
componentProps: { componentProps: {