Merge pull request #4134 from crazyserver/MOBILE-4616

Mobile 4616
main
Dani Palou 2024-08-14 08:40:18 +02:00 committed by GitHub
commit 81e90182d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
150 changed files with 979 additions and 532 deletions

View File

@ -69,7 +69,7 @@ jobs:
cat circular-dependencies
lines=$(cat circular-dependencies | wc -l)
echo "Total circular dependencies: $lines"
test $lines -eq 129
test $lines -eq 131
- name: JavaScript code compatibility
run: |
npx check-es-compat www/*.js --polyfills="\{Array,String,TypedArray\}.prototype.at,Object.hasOwn"

View File

@ -20,7 +20,7 @@ import {
AddonBlockRecentlyAccessedItemsItemCalculatedData,
} from '../../services/recentlyaccesseditems';
import { CoreTextUtils } from '@services/utils/text';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreLoadings } from '@services/loadings';
import { CoreUtils } from '@services/utils/utils';
import { CoreSharedModule } from '@/core/shared.module';
@ -93,7 +93,7 @@ export class AddonBlockRecentlyAccessedItemsComponent extends CoreBlockBaseCompo
e.stopPropagation();
const url = CoreTextUtils.decodeHTMLEntities(item.viewurl);
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
await CoreSites.visitLink(url);

View File

@ -14,7 +14,7 @@
import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
import { CoreSites } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreLoadings } from '@services/loadings';
import { CoreTextUtils } from '@services/utils/text';
import { CoreEnrolledCourseDataWithOptions } from '@features/courses/services/courses-helper';
import { AddonBlockTimelineDayEvents } from '@addons/block/timeline/classes/section';
@ -66,7 +66,7 @@ export class AddonBlockTimelineEventsComponent implements OnInit {
// Fix URL format.
url = CoreTextUtils.decodeHTMLEntities(url);
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
await CoreSites.visitLink(url);

View File

@ -21,7 +21,6 @@ import { CoreCommentsComponentsModule } from '@features/comments/components/comp
import { CoreTagComponentsModule } from '@features/tag/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 { ADDON_BLOG_MAINMENU_PAGE_NAME } from './constants';
import { canLeaveGuard } from '@guards/can-leave';
@ -62,7 +61,6 @@ import { canLeaveGuard } from '@guards/can-leave';
],
declarations: [
AddonBlogIndexPage,
AddonBlogEntryOptionsMenuComponent,
],
providers: [
{

View File

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

View File

@ -33,6 +33,7 @@ import { CoreEditorComponentsModule } from '@features/editor/components/componen
import { CoreFileUploader } from '@features/fileuploader/services/fileuploader';
import { CoreTagComponentsModule } from '@features/tag/components/components.module';
import { CanLeave } from '@guards/can-leave';
import { CoreLoadings } from '@services/loadings';
import { CoreNavigator } from '@services/navigator';
import { CoreSites, CoreSitesReadingStrategy } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
@ -267,7 +268,7 @@ export class AddonBlogEditEntryPage implements CanLeave, OnInit {
return;
}
const loading = await CoreDomUtils.showModalLoading('core.sending', true);
const loading = await CoreLoadings.show('core.sending', true);
if (this.entry) {
try {

View File

@ -13,7 +13,6 @@
// limitations under the License.
import { ContextLevel } from '@/core/constants';
import { AddonBlogEntryOptionsMenuComponent } from '@addons/blog/components/entry-options-menu';
import { ADDON_BLOG_ENTRY_UPDATED } from '@addons/blog/constants';
import { AddonBlog, AddonBlogFilter, AddonBlogPost, AddonBlogProvider } from '@addons/blog/services/blog';
import { Component, OnDestroy, OnInit } from '@angular/core';
@ -31,6 +30,8 @@ import { CoreUtils } from '@services/utils/utils';
import { CoreArray } from '@singletons/array';
import { CoreEventObserver, CoreEvents } from '@singletons/events';
import { CoreTime } from '@singletons/time';
import { CorePopovers } from '@services/popovers';
import { CoreLoadings } from '@services/loadings';
/**
* Page that displays the list of blog entries.
@ -242,7 +243,7 @@ export class AddonBlogIndexPage implements OnInit, OnDestroy {
* @param enabled If true, filter my entries. False otherwise.
*/
async onlyMyEntriesToggleChanged(enabled: boolean): Promise<void> {
const loading = await CoreDomUtils.showModalLoading();
const loading = await CoreLoadings.show();
try {
this.filter.userid = !enabled ? undefined : this.currentUserId;
@ -307,7 +308,7 @@ export class AddonBlogIndexPage implements OnInit, OnDestroy {
* @param id Entry id.
*/
async deleteEntry(id: number): Promise<void> {
const loading = await CoreDomUtils.showModalLoading();
const loading = await CoreLoadings.show();
try {
await AddonBlog.deleteEntry({ entryid: id });
await this.refresh();
@ -327,7 +328,10 @@ export class AddonBlogIndexPage implements OnInit, OnDestroy {
event.preventDefault();
event.stopPropagation();
const popoverData = await CoreDomUtils.openPopover<string>({
const { AddonBlogEntryOptionsMenuComponent } =
await import('@addons/blog/components/entry-options-menu/entry-options-menu');
const popoverData = await CorePopovers.open<string>({
component: AddonBlogEntryOptionsMenuComponent,
event,
});

View File

@ -43,10 +43,11 @@ import { CoreNavigator } from '@services/navigator';
import { CanLeave } from '@guards/can-leave';
import { CoreForms } from '@singletons/form';
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 { ADDON_CALENDAR_COMPONENT } from '@addons/calendar/constants';
import { ContextLevel } from '@/core/constants';
import { CorePopovers } from '@services/popovers';
import { CoreLoadings } from '@services/loadings';
/**
* Page that displays a form to create/edit an event.
@ -407,7 +408,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave {
return;
}
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
await this.loadGroups(courseId);
@ -513,7 +514,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave {
}
// Send the data.
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
let event: AddonCalendarEvent | AddonCalendarOfflineEventDBRecord;
try {
@ -637,7 +638,10 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave {
const formData = this.form.value;
const eventTime = moment(formData.timestart).unix();
const reminderTime = await CoreDomUtils.openPopover<{timeBefore: number}>({
const { CoreRemindersSetReminderMenuComponent } =
await import('@features/reminders/components/set-reminder-menu/set-reminder-menu');
const reminderTime = await CorePopovers.open<{timeBefore: number}>({
component: CoreRemindersSetReminderMenuComponent,
componentProps: {
eventTime,

View File

@ -39,11 +39,12 @@ import { CoreRoutedItemsManagerSourcesTracker } from '@classes/items-management/
import { AddonCalendarEventsSource } from '@addons/calendar/classes/events-source';
import { CoreSwipeNavigationItemsManager } from '@classes/items-management/swipe-navigation-items-manager';
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 { CorePlatform } from '@services/platform';
import { CoreConfig } from '@services/config';
import { CoreToasts, ToastDuration } from '@services/toasts';
import { CorePopovers } from '@services/popovers';
import { CoreLoadings } from '@services/loadings';
/**
* Page that displays a single calendar event.
@ -384,7 +385,10 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy {
return;
}
const reminderTime = await CoreDomUtils.openPopover<{timeBefore: number}>({
const { CoreRemindersSetReminderMenuComponent } =
await import('@features/reminders/components/set-reminder-menu/set-reminder-menu');
const reminderTime = await CorePopovers.open<{timeBefore: number}>({
component: CoreRemindersSetReminderMenuComponent,
componentProps: {
eventTime: this.event.timestart,
@ -415,7 +419,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy {
try {
await CoreDomUtils.showDeleteConfirm();
const modal = await CoreDomUtils.showModalLoading('core.deleting', true);
const modal = await CoreLoadings.show('core.deleting', true);
try {
await CoreReminders.removeReminder(id);
@ -522,12 +526,11 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy {
try {
deleteAll = await CoreDomUtils.showConfirm(message, title, undefined, undefined, options);
} catch {
// User canceled.
return;
}
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
try {
let onlineEventDeleted = false;
@ -584,7 +587,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy {
return;
}
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
try {

View File

@ -13,12 +13,11 @@
// limitations under the License.
import { Component, OnInit } from '@angular/core';
import { CoreDomUtils } from '@services/utils/dom';
import { CorePopovers } from '@services/popovers';
import {
CoreReminders,
CoreRemindersService,
} from '@features/reminders/services/reminders';
import { CoreRemindersSetReminderMenuComponent } from '@features/reminders/components/set-reminder-menu/set-reminder-menu';
/**
* Page that displays the calendar settings.
@ -51,7 +50,10 @@ export class AddonCalendarSettingsPage implements OnInit {
e.stopImmediatePropagation();
e.preventDefault();
const reminderTime = await CoreDomUtils.openPopover<{timeBefore: number}>({
const { CoreRemindersSetReminderMenuComponent } =
await import('@features/reminders/components/set-reminder-menu/set-reminder-menu');
const reminderTime = await CorePopovers.open<{timeBefore: number}>({
component: CoreRemindersSetReminderMenuComponent,
componentProps: {
initialValue: this.defaultTime,

View File

@ -19,6 +19,7 @@ import {
import { Component, OnInit } from '@angular/core';
import { CoreUser, CoreUserProfile } from '@features/user/services/user';
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
import { CoreLoadings } from '@services/loadings';
import { CoreNavigator } from '@services/navigator';
import { CoreSites } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
@ -123,7 +124,7 @@ export class AddonCourseCompletionReportPage implements OnInit {
* Mark course as completed.
*/
async completeCourse(): Promise<void> {
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
try {
await AddonCourseCompletion.markCourseAsSelfCompleted(this.courseId);

View File

@ -22,7 +22,7 @@ import {
import { makeSingleton } from '@singletons';
import { AddonEnrolGuest } from './guest';
import { CorePasswordModalResponse } from '@components/password-modal/password-modal';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreLoadings } from '@services/loadings';
import { CoreWSError } from '@classes/errors/wserror';
import { CoreEnrol, CoreEnrolEnrolmentMethod } from '@features/enrol/services/enrol';
import { CoreModals } from '@services/modals';
@ -100,7 +100,7 @@ export class AddonEnrolGuestHandlerService implements CoreEnrolGuestHandler {
}
const validatePassword = async (password = ''): Promise<CorePasswordModalResponse> => {
const modal = await CoreDomUtils.showModalLoading('core.loading', true);
const modal = await CoreLoadings.show('core.loading', true);
try {
const response = await AddonEnrolGuest.validateGuestAccessPassword(method.id, password);

View File

@ -21,6 +21,7 @@ import { CoreCoursesProvider } from '@features/courses/services/courses';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreEnrol, CoreEnrolEnrolmentMethod } from '@features/enrol/services/enrol';
import { CoreModals } from '@services/modals';
import { CoreLoadings } from '@services/loadings';
/**
* Enrol handler.
@ -112,7 +113,7 @@ export class AddonEnrolSelfHandlerService implements CoreEnrolSelfHandler {
*/
protected async performEnrol(method: CoreEnrolEnrolmentMethod): Promise<boolean> {
const validatePassword = async (password = ''): Promise<CorePasswordModalResponse> => {
const modal = await CoreDomUtils.showModalLoading('core.loading', true);
const modal = await CoreLoadings.show('core.loading', true);
const response: CorePasswordModalResponse = {
password,

View File

@ -48,6 +48,7 @@ import { CoreKeyboard } from '@singletons/keyboard';
import { CoreText } from '@singletons/text';
import { CoreWait } from '@singletons/wait';
import { CoreModals } from '@services/modals';
import { CoreLoadings } from '@services/loadings';
/**
* Page that displays a message discussion page.
@ -232,7 +233,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
protected async fetchData(): Promise<void> {
let loader: CoreIonLoadingElement | undefined;
if (this.showLoadingModal) {
loader = await CoreDomUtils.showModalLoading();
loader = await CoreLoadings.show();
}
if (!this.groupMessagingEnabled && this.userId) {
@ -965,7 +966,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
options,
);
const modal = await CoreDomUtils.showModalLoading('core.deleting', true);
const modal = await CoreLoadings.show('core.deleting', true);
try {
await AddonMessages.deleteMessage(message, data && data[0]);
@ -1406,7 +1407,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
await CoreDomUtils.showConfirm(template, undefined, okText);
this.blockIcon = CoreConstants.ICON_LOADING;
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
this.showLoadingModal = true;
try {
@ -1488,7 +1489,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
this.blockIcon = CoreConstants.ICON_LOADING;
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
this.showLoadingModal = true;
try {
@ -1527,7 +1528,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
this.addRemoveIcon = CoreConstants.ICON_LOADING;
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
this.showLoadingModal = true;
try {
@ -1558,7 +1559,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
throw new CoreError('No member selected to be confirmed.');
}
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
this.showLoadingModal = true;
try {
@ -1584,7 +1585,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
throw new CoreError('No member selected to be declined.');
}
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
this.showLoadingModal = true;
try {
@ -1618,7 +1619,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
this.addRemoveIcon = CoreConstants.ICON_LOADING;
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
this.showLoadingModal = true;
try {

View File

@ -28,6 +28,7 @@ import { CoreConstants } from '@/core/constants';
import { AddonNotificationsPreferencesNotificationProcessorState } from '@addons/notifications/services/notifications';
import { CorePlatform } from '@services/platform';
import { CoreTextUtils } from '@services/utils/text';
import { CoreLoadings } from '@services/loadings';
/**
* Page that displays the messages settings page.
@ -155,7 +156,7 @@ export class AddonMessagesSettingsPage implements OnInit, OnDestroy {
return;
}
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
if (!this.advancedContactable) {
// Convert from boolean to number.

View File

@ -67,6 +67,8 @@ import {
ADDON_MOD_ASSIGN_SUBMITTED_FOR_GRADING_EVENT,
ADDON_MOD_ASSIGN_UNLIMITED_ATTEMPTS,
} from '../../constants';
import { CoreViewer } from '@features/viewer/services/viewer';
import { CoreLoadings } from '@services/loadings';
/**
* Component that displays an assignment submission.
@ -320,7 +322,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can
}
const previousSubmission = this.previousAttempt.submission;
let modal = await CoreDomUtils.showModalLoading();
let modal = await CoreLoadings.show();
const size = await CoreUtils.ignoreErrors(
AddonModAssignHelper.getSubmissionSizeForCopy(this.assign, previousSubmission),
@ -338,7 +340,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can
}
// User confirmed, copy the attempt.
modal = await CoreDomUtils.showModalLoading('core.sending', true);
modal = await CoreLoadings.show('core.sending', true);
try {
await AddonModAssignHelper.copyPreviousAttempt(this.assign, previousSubmission);
@ -866,7 +868,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can
*/
showAdvancedGrade(): void {
if (this.feedback && this.feedback.advancedgrade) {
CoreTextUtils.viewText(
CoreViewer.viewText(
Translate.instant('core.grades.grade'),
this.feedback.gradefordisplay,
{
@ -897,7 +899,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can
// Ask for confirmation. @todo plugin precheck_submission
await CoreDomUtils.showConfirm(Translate.instant('addon.mod_assign.confirmsubmission'));
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
try {
await AddonModAssign.submitForGrading(
@ -948,7 +950,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can
throw new CoreError(Translate.instant('core.grades.badgrade'));
}
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
(this.gradeInfo?.outcomes || []).forEach((outcome) => {
if (outcome.itemNumber && outcome.selectedId) {

View File

@ -27,6 +27,8 @@ import { CoreUtils } from '@services/utils/utils';
import { AddonModAssignFeedbackPluginBaseComponent } from '@addons/mod/assign/classes/base-feedback-plugin-component';
import { ContextLevel } from '@/core/constants';
import { ADDON_MOD_ASSIGN_COMPONENT } from '@addons/mod/assign/constants';
import { CoreViewer } from '@features/viewer/services/viewer';
/**
* Component to render a comments feedback plugin.
*/
@ -67,7 +69,7 @@ export class AddonModAssignFeedbackCommentsComponent extends AddonModAssignFeedb
if (this.text) {
// Open a new state with the text.
CoreTextUtils.viewText(this.plugin.name, this.text, {
CoreViewer.viewText(this.plugin.name, this.text, {
component: this.component,
componentId: this.assign.cmid,
filter: true,

View File

@ -46,6 +46,7 @@ import {
ADDON_MOD_ASSIGN_SUBMITTED_FOR_GRADING_EVENT,
} from '../../constants';
import { CoreToasts, ToastDuration } from '@services/toasts';
import { CoreLoadings } from '@services/loadings';
/**
* Page that allows adding or editing an assigment submission.
@ -314,7 +315,7 @@ export class AddonModAssignEditPage implements OnInit, OnDestroy, CanLeave {
protected async hasDataChanged(): Promise<boolean> {
// Usually the hasSubmissionDataChanged call will be resolved inmediately, causing the modal to be shown just an instant.
// We'll wait a bit before showing it to prevent this "blink".
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
const data = this.getInputData();
@ -397,7 +398,7 @@ export class AddonModAssignEditPage implements OnInit, OnDestroy, CanLeave {
throw Translate.instant('addon.mod_assign.acceptsubmissionstatement');
}
let modal = await CoreDomUtils.showModalLoading();
let modal = await CoreLoadings.show();
let size = -1;
// Get size to ask for confirmation.
@ -414,7 +415,7 @@ export class AddonModAssignEditPage implements OnInit, OnDestroy, CanLeave {
// Confirm action.
await CoreFileUploaderHelper.confirmUploadFile(size, true, this.allowOffline);
modal = await CoreDomUtils.showModalLoading('core.sending', true);
modal = await CoreLoadings.show('core.sending', true);
const pluginData = await this.prepareSubmissionData(inputData);
if (!Object.keys(pluginData).length) {

View File

@ -23,6 +23,7 @@ import { CoreUtils } from '@services/utils/utils';
import { AddonModAssignSubmissionOnlineTextPluginData } from '../services/handler';
import { ContextLevel } from '@/core/constants';
import { ADDON_MOD_ASSIGN_COMPONENT } from '@addons/mod/assign/constants';
import { CoreViewer } from '@features/viewer/services/viewer';
/**
* Component to render an onlinetext submission plugin.
@ -84,7 +85,7 @@ export class AddonModAssignSubmissionOnlineTextComponent extends AddonModAssignS
if (this.text) {
// Open a new state with the interpolated contents.
CoreTextUtils.viewText(this.plugin.name, this.text, {
CoreViewer.viewText(this.plugin.name, this.text, {
component: this.component,
componentId: this.assign.cmid,
filter: true,

View File

@ -32,6 +32,7 @@ import {
AddonModBBBRecordingPlaybackTypes,
} from '../../services/bigbluebuttonbn';
import { ADDON_MOD_BBB_COMPONENT } from '../../constants';
import { CoreLoadings } from '@services/loadings';
/**
* Component that displays a Big Blue Button activity.
@ -295,7 +296,7 @@ export class AddonModBBBIndexComponent extends CoreCourseModuleMainActivityCompo
* @returns Promise resolved when done.
*/
async joinRoom(): Promise<void> {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
const joinUrl = await AddonModBBB.getJoinUrl(this.module.id, this.groupId);
@ -336,7 +337,7 @@ export class AddonModBBBIndexComponent extends CoreCourseModuleMainActivityCompo
return;
}
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
await AddonModBBB.endMeeting(this.bbb.id, this.groupId);

View File

@ -32,6 +32,7 @@ import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
import { CoreKeyboard } from '@singletons/keyboard';
import { CoreWait } from '@singletons/wait';
import { CoreModals } from '@services/modals';
import { CoreLoadings } from '@services/loadings';
/**
* Page that displays a chat session.
@ -342,7 +343,7 @@ export class AddonModChatChatPage implements OnInit, OnDestroy, CanLeave {
* @returns Promise resolved when done.
*/
async reconnect(): Promise<void> {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
// Call startPolling would take a while for the first execution, so we'll execute it manually to check if it works now.

View File

@ -25,6 +25,7 @@ import { CoreTime } from '@singletons/time';
import { Translate } from '@singletons';
import { AddonModChat } from '@addons/mod/chat/services/chat';
import { CoreUtils } from '@services/utils/utils';
import { CoreLoadings } from '@services/loadings';
/**
* Page that displays list of chat sessions.
@ -126,7 +127,7 @@ export class AddonModChatSessionsPage implements OnInit, AfterViewInit, OnDestro
* Reload chat sessions.
*/
async reloadSessions(): Promise<void> {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
await this.sessions.reload();

View File

@ -41,6 +41,7 @@ import {
ADDON_MOD_CHOICE_PUBLISH_ANONYMOUS,
AddonModChoiceShowResults,
} from '../../constants';
import { CoreLoadings } from '@services/loadings';
/**
* Component that displays a choice.
@ -383,7 +384,7 @@ export class AddonModChoiceIndexComponent extends CoreCourseModuleMainActivityCo
responses.push(this.selectedOption.id);
}
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
try {
const online = await AddonModChoice.submitResponse(this.choice.id, this.choice.name, this.courseId, responses);
@ -421,7 +422,7 @@ export class AddonModChoiceIndexComponent extends CoreCourseModuleMainActivityCo
return;
}
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
try {
await AddonModChoice.deleteResponses(this.choice.id, this.choice.name, this.courseId);

View File

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

View File

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

View File

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

View File

@ -19,6 +19,7 @@ import { FormBuilder } from '@angular/forms';
import { SafeUrl } from '@angular/platform-browser';
import { CoreAnyError } from '@classes/errors/error';
import { CoreGeolocation, CoreGeolocationError, CoreGeolocationErrorReason } from '@services/geolocation';
import { CoreLoadings } from '@services/loadings';
import { CorePlatform } from '@services/platform';
import { CoreDomUtils } from '@services/utils/dom';
import { DomSanitizer } from '@singletons';
@ -118,7 +119,7 @@ export class AddonModDataFieldLatlongComponent extends AddonModDataFieldPluginBa
async getLocation(event: Event): Promise<void> {
event.preventDefault();
const modal = await CoreDomUtils.showModalLoading('addon.mod_data.gettinglocation', true);
const modal = await CoreLoadings.show('addon.mod_data.gettinglocation', true);
try {
const coordinates = await CoreGeolocation.getCoordinates();

View File

@ -44,6 +44,7 @@ import { CoreTextUtils } from '@services/utils/text';
import { CoreTime } from '@singletons/time';
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
import { ADDON_MOD_DATA_COMPONENT, ADDON_MOD_DATA_ENTRY_CHANGED, AddonModDataTemplateType } from '../../constants';
import { CoreLoadings } from '@services/loadings';
/**
* Page that displays the view edit page.
@ -285,7 +286,7 @@ export class AddonModDataEditPage implements OnInit {
throw new CoreError(Translate.instant('addon.mod_data.emptyaddform'));
}
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
// Create an ID to assign files.
const entryTemp = this.entryId ? this.entryId : - (Date.now());

View File

@ -48,6 +48,7 @@ import {
AddonModDataTemplateMode,
} from '../constants';
import { CoreToasts, ToastDuration } from '@services/toasts';
import { CoreLoadings } from '@services/loadings';
/**
* Service that provides helper functions for datas.
@ -154,7 +155,7 @@ export class AddonModDataHelperProvider {
): Promise<void> {
siteId = siteId || CoreSites.getCurrentSiteId();
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
try {
courseId = await this.getActivityCourseIdIfNotSet(dataId, courseId, siteId);
@ -857,7 +858,7 @@ export class AddonModDataHelperProvider {
try {
await CoreDomUtils.showDeleteConfirm('addon.mod_data.confirmdeleterecord');
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
if (entryId > 0) {

View File

@ -17,7 +17,7 @@ import { Params } from '@angular/router';
import { CoreCourse } from '@features/course/services/course';
import { CoreNavigator } from '@services/navigator';
import { CoreSitesReadingStrategy } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreLoadings } from '@services/loadings';
import { makeSingleton } from '@singletons';
import { ADDON_MOD_DATA_FEATURE_NAME, ADDON_MOD_DATA_PAGE_NAME } from '../../constants';
import { AddonModDataEditLinkHandlerService } from '@addons/mod/data/services/handlers/edit-link';
@ -37,7 +37,7 @@ export class AddonModDataEditLinkHandlerLazyService extends AddonModDataEditLink
* @inheritdoc
*/
async handleAction(siteId: string, params: Record<string, string>): Promise<void> {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
const dataId = parseInt(params.d, 10);
const rId = params.rid || '';

View File

@ -17,7 +17,7 @@ import { Params } from '@angular/router';
import { CoreCourse } from '@features/course/services/course';
import { CoreNavigator } from '@services/navigator';
import { CoreSitesReadingStrategy } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreLoadings } from '@services/loadings';
import { makeSingleton } from '@singletons';
import { ADDON_MOD_DATA_PAGE_NAME } from '../../constants';
import { AddonModDataShowLinkHandlerService } from '@addons/mod/data/services/handlers/show-link';
@ -33,7 +33,7 @@ export class AddonModDataShowLinkHandlerLazyService extends AddonModDataShowLink
* @inheritdoc
*/
async handleAction(siteId: string, params: Record<string, string>): Promise<void> {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
const dataId = parseInt(params.d, 10);
const rId = params.rid || '';
const group = parseInt(params.group, 10) || false;

View File

@ -37,6 +37,7 @@ import { AddonModFeedbackFormItem, AddonModFeedbackHelper } from '../../services
import { AddonModFeedbackSync } from '../../services/feedback-sync';
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
import { ADDON_MOD_FEEDBACK_COMPONENT, ADDON_MOD_FEEDBACK_FORM_SUBMITTED, ADDON_MOD_FEEDBACK_PAGE_NAME } from '../../constants';
import { CoreLoadings } from '@services/loadings';
/**
* Page that displays feedback form.
@ -423,7 +424,7 @@ export class AddonModFeedbackFormPage implements OnInit, OnDestroy, CanLeave {
return CoreNavigator.back();
}
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
await CoreSites.visitLink(this.siteAfterSubmit, { siteId: this.currentSite.id });

View File

@ -40,6 +40,7 @@ import {
ADDON_MOD_FEEDBACK_MULTICHOICE_HIDENOSELECT,
ADDON_MOD_FEEDBACK_PAGE_NAME,
} from '../constants';
import { CoreLoadings } from '@services/loadings';
const MODE_RESPONSETIME = 1;
const MODE_COURSE = 2;
@ -179,7 +180,7 @@ export class AddonModFeedbackHelperProvider {
async handleShowEntriesLink(params: Record<string, string>, siteId?: string): Promise<void> {
siteId = siteId || CoreSites.getCurrentSiteId();
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
const module = await CoreCourse.getModuleBasicInfo(

View File

@ -20,6 +20,7 @@ import { CoreNavigator } from '@services/navigator';
import { CoreDomUtils } from '@services/utils/dom';
import { makeSingleton } from '@singletons';
import { ADDON_MOD_FEEDBACK_PAGE_NAME } from '../../constants';
import { CoreLoadings } from '@services/loadings';
/**
* Content links handler for a feedback analysis.
@ -38,7 +39,7 @@ export class AddonModFeedbackAnalysisLinkHandlerService extends CoreContentLinks
getActions(siteIds: string[], url: string, params: Record<string, string>): CoreContentLinksAction[] {
return [{
action: async (siteId: string) => {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
const moduleId = Number(params.id);

View File

@ -21,6 +21,7 @@ import { CoreSitesReadingStrategy } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
import { makeSingleton } from '@singletons';
import { ADDON_MOD_FEEDBACK_PAGE_NAME } from '../../constants';
import { CoreLoadings } from '@services/loadings';
/**
* Content links handler for feedback complete questions.
@ -39,7 +40,7 @@ export class AddonModFeedbackCompleteLinkHandlerService extends CoreContentLinks
getActions(siteIds: string[], url: string, params: Record<string, string>): CoreContentLinksAction[] {
return [{
action: async (siteId: string) => {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
const moduleId = Number(params.id);

View File

@ -21,6 +21,7 @@ import { CoreSitesReadingStrategy } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
import { makeSingleton } from '@singletons';
import { ADDON_MOD_FEEDBACK_PAGE_NAME } from '../../constants';
import { CoreLoadings } from '@services/loadings';
/**
* Content links handler for feedback print questions.
@ -39,7 +40,7 @@ export class AddonModFeedbackPrintLinkHandlerService extends CoreContentLinksHan
getActions(siteIds: string[], url: string, params: Record<string, string>): CoreContentLinksAction[] {
return [{
action: async (siteId: string) => {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
const moduleId = Number(params.id);

View File

@ -21,6 +21,7 @@ import { CoreSitesReadingStrategy } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
import { makeSingleton } from '@singletons';
import { ADDON_MOD_FEEDBACK_PAGE_NAME } from '../../constants';
import { CoreLoadings } from '@services/loadings';
/**
* Content links handler for feedback show non respondents.
* Match mod/feedback/show_nonrespondents.php with a valid feedback id.
@ -38,7 +39,7 @@ export class AddonModFeedbackShowNonRespondentsLinkHandlerService extends CoreCo
getActions(siteIds: string[], url: string, params: Record<string, string>): CoreContentLinksAction[] {
return [{
action: async (siteId: string) => {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
const moduleId = Number(params.id);

View File

@ -20,17 +20,13 @@ import { CoreSharedModule } from '@/core/shared.module';
import { CoreTagComponentsModule } from '@features/tag/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 { AddonModForumPostComponent } from './post/post';
import { AddonModForumPostOptionsMenuComponent } from './post-options-menu/post-options-menu';
@NgModule({
declarations: [
AddonModForumDiscussionOptionsMenuComponent,
AddonModForumIndexComponent,
AddonModForumPostComponent,
AddonModForumPostOptionsMenuComponent,
],
imports: [
CoreSharedModule,

View File

@ -20,6 +20,8 @@ import { CoreEvents } from '@singletons/events';
import { AddonModForum, AddonModForumDiscussion } from '../../services/forum';
import { ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT } from '../../constants';
import { CoreToasts } from '@services/toasts';
import { CoreSharedModule } from '@/core/shared.module';
import { CoreLoadings } from '@services/loadings';
/**
* This component is meant to display a popover with the discussion options.
@ -27,6 +29,10 @@ import { CoreToasts } from '@services/toasts';
@Component({
selector: 'addon-forum-discussion-options-menu',
templateUrl: 'discussion-options-menu.html',
standalone: true,
imports: [
CoreSharedModule,
],
})
export class AddonModForumDiscussionOptionsMenuComponent implements OnInit {
@ -62,7 +68,7 @@ export class AddonModForumDiscussionOptionsMenuComponent implements OnInit {
* @param locked True to lock the discussion, false to unlock.
*/
async setLockState(locked: boolean): Promise<void> {
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
try {
const response = await AddonModForum.setLockState(this.forumId, this.discussion.discussion, locked);
@ -93,7 +99,7 @@ export class AddonModForumDiscussionOptionsMenuComponent implements OnInit {
* @param pinned True to pin the discussion, false to unpin it.
*/
async setPinState(pinned: boolean): Promise<void> {
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
try {
await AddonModForum.setPinState(this.discussion.discussion, pinned);
@ -125,7 +131,7 @@ export class AddonModForumDiscussionOptionsMenuComponent implements OnInit {
* @param starred True to star the discussion, false to unstar it.
*/
async toggleFavouriteState(starred: boolean): Promise<void> {
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
try {
await AddonModForum.toggleFavouriteState(this.discussion.discussion, starred);

View File

@ -41,7 +41,6 @@ import { CoreUser } from '@features/user/services/user';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreCourse } from '@features/course/services/course';
import { CoreSplitViewComponent } from '@components/split-view/split-view';
import { AddonModForumDiscussionOptionsMenuComponent } from '../discussion-options-menu/discussion-options-menu';
import { CoreScreen } from '@services/screen';
import { AddonModForumPrefetchHandler } from '../../services/handlers/prefetch';
import { CoreRatingProvider } from '@features/rating/services/rating';
@ -66,6 +65,8 @@ import {
} from '@addons/mod/forum/constants';
import { CoreSearchGlobalSearch } from '@features/search/services/global-search';
import { CoreToasts } from '@services/toasts';
import { CorePopovers } from '@services/popovers';
import { CoreLoadings } from '@services/loadings';
/**
* Component that displays a forum entry page.
*/
@ -635,7 +636,10 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom
event.preventDefault();
event.stopPropagation();
const popoverData = await CoreDomUtils.openPopover<{ action?: string; value: boolean }>({
const { AddonModForumDiscussionOptionsMenuComponent } =
await import('../discussion-options-menu/discussion-options-menu');
const popoverData = await CorePopovers.open<{ action?: string; value: boolean }>({
component: AddonModForumDiscussionOptionsMenuComponent,
componentProps: {
discussion,
@ -666,7 +670,7 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom
* Group has changed.
*/
async groupChanged(): Promise<void> {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
await Promise.all([

View File

@ -19,6 +19,7 @@ import { AddonModForum, AddonModForumPost } from '@addons/mod/forum/services/for
import { PopoverController } from '@singletons';
import { CoreDomUtils } from '@services/utils/dom';
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.
@ -26,7 +27,11 @@ import { CoreNetworkError } from '@classes/errors/network-error';
@Component({
selector: 'addon-forum-post-options-menu',
templateUrl: 'post-options-menu.html',
styleUrls: ['./post-options-menu.scss'],
styleUrl: 'post-options-menu.scss',
standalone: true,
imports: [
CoreSharedModule,
],
})
export class AddonModForumPostOptionsMenuComponent implements OnInit {

View File

@ -45,7 +45,6 @@ import { CoreTextUtils } from '@services/utils/text';
import { AddonModForumHelper } from '../../services/forum-helper';
import { AddonModForumOffline } from '../../services/forum-offline';
import { CoreUtils } from '@services/utils/utils';
import { AddonModForumPostOptionsMenuComponent } from '../post-options-menu/post-options-menu';
import { CoreRatingInfo } from '@features/rating/services/rating';
import { CoreForms } from '@singletons/form';
import { CoreFileEntry } from '@services/file-helper';
@ -55,6 +54,8 @@ import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
import { ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT, ADDON_MOD_FORUM_COMPONENT } from '../../constants';
import { CoreToasts } from '@services/toasts';
import { toBoolean } from '@/core/transforms/boolean';
import { CorePopovers } from '@services/popovers';
import { CoreLoadings } from '@services/loadings';
/**
* Components that shows a discussion post, its attachments and the action buttons allowed (reply, etc.).
@ -150,7 +151,7 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges
try {
await CoreDomUtils.showDeleteConfirm('addon.mod_forum.deletesure');
const modal = await CoreDomUtils.showModalLoading('core.deleting', true);
const modal = await CoreLoadings.show('core.deleting', true);
try {
const response = await AddonModForum.deletePost(this.post.id);
@ -233,7 +234,10 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges
* @param event Click Event.
*/
async showOptionsMenu(event: Event): Promise<void> {
const popoverData = await CoreDomUtils.openPopover<{ action?: string }>({
const { AddonModForumPostOptionsMenuComponent } =
await import('../post-options-menu/post-options-menu');
const popoverData = await CorePopovers.open<{ action?: string }>({
component: AddonModForumPostOptionsMenuComponent,
componentProps: {
post: this.post,
@ -363,7 +367,7 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges
const replyingTo = this.formData.replyingTo!;
const files = this.formData.files || [];
const isEditOnline = this.formData.id && this.formData.id > 0;
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
// Add some HTML to the message if needed.
message = CoreTextUtils.formatHtmlLines(message);

View File

@ -60,6 +60,7 @@ import {
} from '../../constants';
import { CoreCourseContentsPage } from '@features/course/pages/contents/contents';
import { CoreToasts } from '@services/toasts';
import { CoreLoadings } from '@services/loadings';
type SortType = 'flat-newest' | 'flat-oldest' | 'nested';
@ -717,7 +718,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
return;
}
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
try {
const response = await AddonModForum.setLockState(this.forumId, this.discussionId, locked);
@ -752,7 +753,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
return;
}
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
try {
await AddonModForum.setPinState(this.discussionId, pinned);
@ -788,7 +789,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
return;
}
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
try {
await AddonModForum.toggleFavouriteState(this.discussionId, starred);

View File

@ -52,6 +52,7 @@ import {
ADDON_MOD_FORUM_NEW_DISCUSSION_EVENT,
} from '../../constants';
import { CoreCourseContentsPage } from '@features/course/pages/contents/contents';
import { CoreLoadings } from '@services/loadings';
type NewDiscussionData = {
subject: string;
@ -549,7 +550,7 @@ export class AddonModForumNewDiscussionPage implements OnInit, OnDestroy, CanLea
return;
}
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
// Add some HTML to the message if needed.
message = CoreTextUtils.formatHtmlLines(message);

View File

@ -18,7 +18,7 @@ import { CoreContentLinksAction } from '@features/contentlinks/services/contentl
import { CoreCourse } from '@features/course/services/course';
import { CoreNavigator } from '@services/navigator';
import { CoreSitesReadingStrategy } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreLoadings } from '@services/loadings';
import { makeSingleton } from '@singletons';
import { ADDON_MOD_FORUM_PAGE_NAME } from '../../constants';
@ -43,7 +43,7 @@ export class AddonModForumPostLinkHandlerService extends CoreContentLinksHandler
): CoreContentLinksAction[] | Promise<CoreContentLinksAction[]> {
return [{
action: async (siteId): Promise<void> => {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
const forumId = parseInt(params.forum, 10);
try {

View File

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

View File

@ -50,7 +50,6 @@ import {
GLOSSARY_AUTO_SYNCED,
} from '../../services/glossary-sync';
import { AddonModGlossaryPrefetchHandler } from '../../services/handlers/prefetch';
import { AddonModGlossaryModePickerPopoverComponent } from '../mode-picker/mode-picker';
import { CoreTime } from '@singletons/time';
import {
ADDON_MOD_GLOSSARY_COMPONENT,
@ -59,6 +58,7 @@ import {
ADDON_MOD_GLOSSARY_ENTRY_UPDATED,
ADDON_MOD_GLOSSARY_PAGE_NAME,
} from '../../constants';
import { CorePopovers } from '@services/popovers';
/**
* Component that displays a glossary entry page.
@ -354,10 +354,11 @@ export class AddonModGlossaryIndexComponent extends CoreCourseModuleMainActivity
if (!this.glossary) {
return;
}
const { AddonModGlossaryModePickerPopoverComponent } = await import('../mode-picker/mode-picker');
const entries = await this.promisedEntries;
const previousMode = entries.getSource().fetchMode;
const newMode = await CoreDomUtils.openPopover<AddonModGlossaryFetchMode>({
const newMode = await CorePopovers.open<AddonModGlossaryFetchMode>({
component: AddonModGlossaryModePickerPopoverComponent,
componentProps: {
browseModes: this.glossary.browsemodes,

View File

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

View File

@ -40,6 +40,7 @@ import { AddonModGlossaryHelper } from '../../services/glossary-helper';
import { AddonModGlossaryOffline } from '../../services/glossary-offline';
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
import { ADDON_MOD_GLOSSARY_COMPONENT } from '../../constants';
import { CoreLoadings } from '@services/loadings';
/**
* Page that displays the edit form.
@ -211,7 +212,7 @@ export class AddonModGlossaryEditPage implements OnInit, CanLeave {
return;
}
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
try {
const savedOnline = await this.handler.save(this.glossary);

View File

@ -41,6 +41,7 @@ import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
import { ADDON_MOD_GLOSSARY_COMPONENT, ADDON_MOD_GLOSSARY_ENTRY_UPDATED, ADDON_MOD_GLOSSARY_PAGE_NAME } from '../../constants';
import { CoreCourseContentsPage } from '@features/course/pages/contents/contents';
import { CoreToasts, ToastDuration } from '@services/toasts';
import { CoreLoadings } from '@services/loadings';
/**
* Page that displays a glossary entry.
@ -191,7 +192,7 @@ export class AddonModGlossaryEntryPage implements OnInit, OnDestroy {
return;
}
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
if (this.onlineEntry) {

View File

@ -21,6 +21,7 @@ import { CoreSitesReadingStrategy } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
import { makeSingleton } from '@singletons';
import { ADDON_MOD_GLOSSARY_PAGE_NAME } from '../../constants';
import { CoreLoadings } from '@services/loadings';
/**
* Content links handler for glossary new entry.
@ -40,7 +41,7 @@ export class AddonModGlossaryEditLinkHandlerService extends CoreContentLinksHand
getActions(siteIds: string[], url: string, params: Record<string, string>): CoreContentLinksAction[] {
return [{
action: async (siteId: string) => {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
const cmId = Number(params.cmid);

View File

@ -22,6 +22,7 @@ import { CoreDomUtils } from '@services/utils/dom';
import { makeSingleton } from '@singletons';
import { AddonModGlossary } from '../glossary';
import { ADDON_MOD_GLOSSARY_PAGE_NAME } from '../../constants';
import { CoreLoadings } from '@services/loadings';
/**
* Handler to treat links to glossary entries.
@ -39,7 +40,7 @@ export class AddonModGlossaryEntryLinkHandlerService extends CoreContentLinksHan
getActions(siteIds: string[], url: string, params: Record<string, string>): CoreContentLinksAction[] {
return [{
action: async (siteId: string) => {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
const entryId = params.mode == 'entry' ? Number(params.hook) : Number(params.eid);

View File

@ -24,6 +24,7 @@ import { CoreUtils } from '@services/utils/utils';
import { makeSingleton } from '@singletons';
import { AddonModH5PActivity } from '../h5pactivity';
import { ADDON_MOD_H5PACTIVITY_PAGE_NAME } from '../../constants';
import { CoreLoadings } from '@services/loadings';
/**
* Handler to treat links to H5P activity report.
@ -45,7 +46,7 @@ export class AddonModH5PActivityReportLinkHandlerService extends CoreContentLink
): CoreContentLinksAction[] | Promise<CoreContentLinksAction[]> {
return [{
action: async (siteId) => {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
const instanceId = Number(params.a);

View File

@ -23,6 +23,7 @@ import { CoreDomUtils } from '@services/utils/dom';
import { makeSingleton } from '@singletons';
import { AddonModLesson } from '../lesson';
import { ADDON_MOD_LESSON_PAGE_NAME } from '../../constants';
import { CoreLoadings } from '@services/loadings';
/**
* Handler to treat links to lesson grade.
@ -55,7 +56,7 @@ export class AddonModLessonGradeLinkHandlerService extends CoreContentLinksModul
const moduleId = Number(params.id);
const userId = Number(params.userid) || 0;
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
const module = await CoreCourse.getModuleBasicInfo(

View File

@ -19,7 +19,7 @@ import { CoreContentLinksAction } from '@features/contentlinks/services/contentl
import { CoreCourse } from '@features/course/services/course';
import { CoreCourseHelper } from '@features/course/services/course-helper';
import { CoreSitesReadingStrategy } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreLoadings } from '@services/loadings';
import { CoreUtils } from '@services/utils/utils';
import { makeSingleton } from '@singletons';
import { AddonModLesson } from '../lesson';
@ -85,7 +85,7 @@ export class AddonModLessonIndexLinkHandlerService extends CoreContentLinksModul
password: string,
siteId: string,
): Promise<void> {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
// Get the module.

View File

@ -22,6 +22,7 @@ import { CoreSitesReadingStrategy } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
import { makeSingleton } from '@singletons';
import { ADDON_MOD_LESSON_PAGE_NAME } from '../../constants';
import { CoreLoadings } from '@services/loadings';
/**
* Handler to treat links to lesson report.
@ -86,7 +87,7 @@ export class AddonModLessonReportLinkHandlerService extends CoreContentLinksHand
*/
protected async openReportOverview(moduleId: number, groupId?: number, siteId?: string): Promise<void> {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
// Get the module object.
@ -132,7 +133,7 @@ export class AddonModLessonReportLinkHandlerService extends CoreContentLinksHand
siteId: string,
): Promise<void> {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
// Get the module object.

View File

@ -23,6 +23,7 @@ import { makeSingleton } from '@singletons';
import { CoreEvents } from '@singletons/events';
import { AddonModLti, AddonModLtiLti } from './lti';
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
import { CoreLoadings } from '@services/loadings';
/**
* Service that provides some helper functions for LTI.
@ -62,7 +63,7 @@ export class AddonModLtiHelperProvider {
async getDataAndLaunch(courseId: number, module: CoreCourseModuleData, lti?: AddonModLtiLti, siteId?: string): Promise<void> {
siteId = siteId || CoreSites.getCurrentSiteId();
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
const openInBrowser = await AddonModLti.shouldLaunchInBrowser(siteId);

View File

@ -17,9 +17,8 @@ import { BehaviorSubject } from 'rxjs';
import { CoreQuestionHelper } from '@features/question/services/question-helper';
import { CoreQuestionsAnswers } from '@features/question/services/question';
import { CoreLogger } from '@singletons/logger';
import { AddonModQuizConnectionErrorComponent } from '../components/connection-error/connection-error';
import { AddonModQuiz, AddonModQuizAttemptWSData, AddonModQuizQuizWSData } from '../services/quiz';
import { CoreDomUtils } from '@services/utils/dom';
import { CorePopovers } from '@services/popovers';
/**
* Class to support auto-save in quiz. Every certain seconds, it will check if there are changes in the current page answers
@ -197,7 +196,9 @@ export class AddonModQuizAutoSave {
};
this.popoverShown = true;
this.popover = await CoreDomUtils.openPopoverWithoutResult({
const { AddonModQuizConnectionErrorComponent } = await import('../components/connection-error/connection-error');
this.popover = await CorePopovers.openWithoutResult({
component: AddonModQuizConnectionErrorComponent,
event: <Event> event,
});

View File

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

View File

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

View File

@ -55,6 +55,7 @@ import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
import { ADDON_MOD_QUIZ_ATTEMPT_FINISHED_EVENT, AddonModQuizAttemptStates, ADDON_MOD_QUIZ_COMPONENT } from '../../constants';
import { CoreWait } from '@singletons/wait';
import { CoreModals } from '@services/modals';
import { CoreLoadings } from '@services/loadings';
/**
* Page that allows attempting a quiz.
@ -166,7 +167,7 @@ export class AddonModQuizPlayerPage implements OnInit, OnDestroy, CanLeave {
}
// Save answers.
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
try {
await this.processAttempt(false, false);
@ -217,7 +218,7 @@ export class AddonModQuizPlayerPage implements OnInit, OnDestroy, CanLeave {
// Confirm that the user really wants to do it.
await CoreDomUtils.showConfirm(Translate.instant('core.areyousure'));
modal = await CoreDomUtils.showModalLoading('core.sending', true);
modal = await CoreLoadings.show('core.sending', true);
// Get the answers.
const answers = await this.prepareAnswers(this.quiz.coursemodule);
@ -292,7 +293,7 @@ export class AddonModQuizPlayerPage implements OnInit, OnDestroy, CanLeave {
// First try to save the attempt data. We only save it if we're not seeing the summary.
if (!this.showSummary) {
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
try {
await this.processAttempt(false, false);
@ -440,7 +441,7 @@ export class AddonModQuizPlayerPage implements OnInit, OnDestroy, CanLeave {
);
}
modal = await CoreDomUtils.showModalLoading('core.sending', true);
modal = await CoreLoadings.show('core.sending', true);
await this.processAttempt(userFinish, timeUp);
@ -719,7 +720,7 @@ export class AddonModQuizPlayerPage implements OnInit, OnDestroy, CanLeave {
if (this.reloadNavigation) {
// Some data has changed, reload the navigation.
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
await CoreUtils.ignoreErrors(this.loadNavigation());

View File

@ -41,6 +41,7 @@ import { QuestionDisplayOptionsMarks } from '@features/question/constants';
import { CoreGroups } from '@services/groups';
import { CoreTimeUtils } from '@services/utils/time';
import { CoreModals } from '@services/modals';
import { CoreLoadings } from '@services/loadings';
/**
* Helper service that provides some features for quiz.
@ -335,7 +336,7 @@ export class AddonModQuizHelperProvider {
async handleReviewLink(attemptId: number, page?: number, quizId?: number, siteId?: string): Promise<void> {
siteId = siteId || CoreSites.getCurrentSiteId();
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
if (!quizId) {

View File

@ -32,6 +32,7 @@ import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
import { CoreTextUtils } from '@services/utils/text';
import { CoreTimeUtils } from '@services/utils/time';
import { ADDON_MOD_RESOURCE_COMPONENT } from '../constants';
import { CoreLoadings } from '@services/loadings';
/**
* Service that provides helper functions for resources.
@ -190,7 +191,7 @@ export class AddonModResourceHelperProvider {
* @returns Resolved when done.
*/
async openModuleFile(module: CoreCourseModuleData, courseId: number, options: CoreUtilsOpenFileOptions = {}): Promise<void> {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
// Download and open the file from the resource contents.

View File

@ -38,6 +38,7 @@ import {
} from '../../services/survey-sync';
import { CoreUtils } from '@services/utils/utils';
import { ADDON_MOD_SURVEY_AUTO_SYNCED, ADDON_MOD_SURVEY_COMPONENT } from '../../constants';
import { CoreLoadings } from '@services/loadings';
/**
* Component that displays a survey.
@ -197,7 +198,7 @@ export class AddonModSurveyIndexComponent extends CoreCourseModuleMainActivityCo
await CoreDomUtils.showConfirm(Translate.instant('core.areyousure'));
const answers: AddonModSurveySubmitAnswerData[] = [];
modal = await CoreDomUtils.showModalLoading('core.sending', true);
modal = await CoreLoadings.show('core.sending', true);
for (const x in this.answers) {
answers.push({

View File

@ -20,7 +20,7 @@ import { CoreCourse, CoreCourseModuleContentFile } from '@features/course/servic
import { CoreCourseModuleData } from '@features/course/services/course-helper';
import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@features/course/services/module-delegate';
import { CoreNavigationOptions } from '@services/navigator';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreLoadings } from '@services/loadings';
import { CoreUtils } from '@services/utils/utils';
import { makeSingleton } from '@singletons';
import { AddonModUrl } from '../url';
@ -82,7 +82,7 @@ export class AddonModUrlModuleHandlerService extends CoreModuleHandlerBase imple
class: 'addon-mod_url-handler',
showDownloadButton: false,
action: async (event: Event, module: CoreCourseModuleData, courseId: number, options?: CoreNavigationOptions) => {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
const shouldOpen = await this.shouldOpenLink(module);

View File

@ -13,8 +13,8 @@
// limitations under the License.
import { Injectable } from '@angular/core';
import { CoreLoadings } from '@services/loadings';
import { CoreSites } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
import { makeSingleton } from '@singletons';
/**
@ -29,7 +29,7 @@ export class AddonModUrlHelperProvider {
* @param url The URL to go to.
*/
async open(url: string): Promise<void> {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
await CoreSites.visitLink(url, {

View File

@ -59,6 +59,7 @@ import {
ADDON_MOD_WIKI_PAGE_NAME,
} from '../../constants';
import { CoreModals } from '@services/modals';
import { CorePopovers } from '@services/popovers';
/**
* Component that displays a wiki entry page.
@ -887,7 +888,7 @@ export class AddonModWikiIndexComponent extends CoreCourseModuleMainActivityComp
async showSubwikiPicker(event: MouseEvent): Promise<void> {
const { AddonModWikiSubwikiPickerComponent } = await import('../subwiki-picker/subwiki-picker');
const subwiki = await CoreDomUtils.openPopover<AddonModWikiSubwiki>({
const subwiki = await CorePopovers.open<AddonModWikiSubwiki>({
component: AddonModWikiSubwikiPickerComponent,
componentProps: {
courseId: this.courseId,

View File

@ -32,6 +32,7 @@ import { AddonModWikiOffline } from '../../services/wiki-offline';
import { AddonModWikiSync } from '../../services/wiki-sync';
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
import { ADDON_MOD_WIKI_COMPONENT, ADDON_MOD_WIKI_PAGE_CREATED_EVENT, ADDON_MOD_WIKI_RENEW_LOCK_TIME } from '../../constants';
import { CoreLoadings } from '@services/loadings';
/**
* Page that allows adding or editing a wiki page.
@ -362,7 +363,7 @@ export class AddonModWikiEditPage implements OnInit, OnDestroy, CanLeave {
const title = values.title;
let text = values.text ?? '';
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
text = CoreTextUtils.restorePluginfileUrls(text, this.subwikiFiles);
text = CoreTextUtils.formatHtmlLines(text);

View File

@ -22,6 +22,7 @@ import { makeSingleton } from '@singletons';
import { AddonModWiki } from '../wiki';
import { ADDON_MOD_WIKI_PAGE_NAME } from '../../constants';
import { AddonModWikiCreateLinkHandlerService } from '@addons/mod/wiki/services/handlers/create-link';
import { CoreLoadings } from '@services/loadings';
/**
* Handler to treat links to create a wiki page.
@ -84,7 +85,7 @@ export class AddonModWikiCreateLinkHandlerLazyService extends AddonModWikiCreate
* @inheritdoc
*/
async handleAction(siteId: string, courseId: number, params: Record<string, string>): Promise<void> {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
const { AddonModWikiIndexPage } = await import('../../pages/index');
try {

View File

@ -21,6 +21,7 @@ import { makeSingleton } from '@singletons';
import { AddonModWiki } from '../wiki';
import { ADDON_MOD_WIKI_PAGE_NAME } from '../../constants';
import { AddonModWikiEditLinkHandlerService } from '@addons/mod/wiki/services/handlers/edit-link';
import { CoreLoadings } from '@services/loadings';
/**
* Handler to treat links to edit a wiki page.
@ -32,7 +33,7 @@ export class AddonModWikiEditLinkHandlerLazyService extends AddonModWikiEditLink
* @inheritdoc
*/
async handleAction(siteId: string, params: Record<string, string>): Promise<void> {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
const pageId = Number(params.pageid);

View File

@ -22,6 +22,7 @@ import { Md5 } from 'ts-md5';
import { AddonModWiki } from '../wiki';
import { ADDON_MOD_WIKI_PAGE_NAME } from '../../constants';
import { AddonModWikiPageOrMapLinkHandlerService } from '@addons/mod/wiki/services/handlers/page-or-map-link';
import { CoreLoadings } from '@services/loadings';
/**
* Handler to treat links to a wiki page or the wiki map.
@ -33,7 +34,7 @@ export class AddonModWikiPageOrMapLinkHandlerLazyService extends AddonModWikiPag
* @inheritdoc
*/
async handleAction(url: string, siteId: string, params: Record<string, string>): Promise<void> {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
const pageId = parseInt(params.pageid, 10);
const action = url.indexOf('mod/wiki/map.php') != -1 ? 'map' : 'page';

View File

@ -43,6 +43,7 @@ import {
AddonModWorkshopOverallFeedbackMode,
} from '@addons/mod/workshop/constants';
import { toBoolean } from '@/core/transforms/boolean';
import { CoreLoadings } from '@services/loadings';
/**
* Component that displays workshop assessment strategy form.
@ -302,7 +303,7 @@ export class AddonModWorkshopAssessmentStrategyComponent implements OnInit, OnDe
let saveOffline = false;
let allowOffline = !files.length;
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
this.data.fieldErrors = {};

View File

@ -26,6 +26,7 @@ import {
AddonModWorkshopSubmissionDataWithOfflineData,
} from '../../services/workshop-helper';
import { AddonModWorkshopOffline } from '../../services/workshop-offline';
import { CoreLoadings } from '@services/loadings';
/**
* Component that displays workshop assessment.
@ -123,7 +124,7 @@ export class AddonModWorkshopAssessmentComponent implements OnInit {
};
if (!this.submission) {
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
params.submission = await AddonModWorkshopHelper.getSubmissionById(

View File

@ -44,6 +44,7 @@ import {
ADDON_MOD_WORKSHOP_COMPONENT,
AddonModWorkshopPhase,
} from '@addons/mod/workshop/constants';
import { CoreLoadings } from '@services/loadings';
/**
* Page that displays a workshop assessment.
@ -372,7 +373,7 @@ export class AddonModWorkshopAssessmentPage implements OnInit, OnDestroy, CanLea
* @returns Resolved when done.
*/
protected async sendEvaluation(): Promise<void> {
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
const inputData: AddonModWorkshopAssessmentEvaluation = this.evaluateForm.value;
const grade = inputData.grade >= 0 ? String(inputData.grade) : '';

View File

@ -44,6 +44,7 @@ import {
AddonModWorkshopAction,
AddonModWorkshopSubmissionType,
} from '@addons/mod/workshop/constants';
import { CoreLoadings } from '@services/loadings';
/**
* Page that displays the workshop edit submission.
@ -353,7 +354,7 @@ export class AddonModWorkshopEditSubmissionPage implements OnInit, OnDestroy, Ca
let saveOffline = false;
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
const submissionId = this.submission?.id;
// Add some HTML to the message if needed.

View File

@ -55,6 +55,7 @@ import {
AddonModWorkshopAction,
AddonModWorkshopPhase,
} from '@addons/mod/workshop/constants';
import { CoreLoadings } from '@services/loadings';
/**
* Page that displays a workshop submission.
@ -510,7 +511,7 @@ export class AddonModWorkshopSubmissionPage implements OnInit, OnDestroy, CanLea
* @returns Resolved when done.
*/
protected async sendEvaluation(): Promise<void> {
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
const inputData: {
grade: number | string;
@ -559,7 +560,7 @@ export class AddonModWorkshopSubmissionPage implements OnInit, OnDestroy, CanLea
return;
}
const modal = await CoreDomUtils.showModalLoading('core.deleting', true);
const modal = await CoreLoadings.show('core.deleting', true);
let success = false;
try {

View File

@ -21,6 +21,7 @@ import { ModalController } from '@singletons';
import { CoreKeyboard } from '@singletons/keyboard';
import { CoreSharedModule } from '@/core/shared.module';
import { CoreToasts, ToastDuration } from '@services/toasts';
import { CoreLoadings } from '@services/loadings';
/**
* Component that displays a text area for composing a note.
@ -52,7 +53,7 @@ export class AddonNotesAddComponent {
e.stopPropagation();
CoreKeyboard.close();
const loadingModal = await CoreDomUtils.showModalLoading('core.sending', true);
const loadingModal = await CoreLoadings.show('core.sending', true);
// Freeze the add note button.
this.processing = true;

View File

@ -40,6 +40,7 @@ import { CoreTime } from '@singletons/time';
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
import { Translate } from '@singletons';
import { CoreTextUtils } from '@services/utils/text';
import { CoreLoadings } from '@services/loadings';
/**
* Page that displays notifications settings.
@ -311,7 +312,7 @@ export class AddonNotificationsSettingsPage implements OnInit, OnDestroy {
return;
}
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
try {
CoreUser.updateUserPreferences([], !enable);

View File

@ -15,7 +15,6 @@
import { Injectable } from '@angular/core';
import { CoreNavigator } from '@services/navigator';
import { CoreTextUtils } from '@services/utils/text';
import { CoreUtils } from '@services/utils/utils';
import { makeSingleton } from '@singletons';
import { CorePushNotificationsClickHandler } from '@features/pushnotifications/services/push-delegate';
@ -24,6 +23,7 @@ import { CoreContentLinksHelper } from '@features/contentlinks/services/contentl
import { AddonNotifications } from '../notifications';
import { AddonNotificationsMainMenuHandlerService } from './mainmenu';
import { AddonNotificationsHelper } from '../notifications-helper';
import { CoreViewer } from '@features/viewer/services/viewer';
/**
* Handler for non-messaging push notifications clicks.
@ -77,7 +77,7 @@ export class AddonNotificationsPushClickHandlerService implements CorePushNotifi
if (notification.customdata?.extendedtext) {
// Display the text in a modal.
return CoreTextUtils.viewText(notification.title || '', <string> notification.customdata.extendedtext, {
return CoreViewer.viewText(notification.title || '', <string> notification.customdata.extendedtext, {
displayCopyButton: true,
modalOptions: { cssClass: 'core-modal-fullscreen' },
});

View File

@ -15,7 +15,7 @@
import { Injectable } from '@angular/core';
import { CoreSites } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreLoadings } from '@services/loadings';
import { CoreFileUploaderHelper } from '@features/fileuploader/services/fileuploader-helper';
import { AddonPrivateFiles, AddonPrivateFilesGetUserInfoWSResult } from './privatefiles';
import { CoreError } from '@classes/errors/error';
@ -60,7 +60,7 @@ export class AddonPrivateFilesHelperProvider {
}
// File uploaded. Move it to private files.
const modal = await CoreDomUtils.showModalLoading('core.fileuploader.uploading', true);
const modal = await CoreLoadings.show('core.fileuploader.uploading', true);
try {
await AddonPrivateFiles.moveFromDraftToPrivate(result.itemid);

View File

@ -21,6 +21,7 @@ import { CoreDomUtils } from '@services/utils/dom';
import { makeSingleton, Translate } from '@singletons';
import { AddonReportInsights } from '../insights';
import { CoreToasts } from '@services/toasts';
import { CoreLoadings } from '@services/loadings';
// Bulk actions supported, along with the related lang string.
const BULK_ACTIONS = {
@ -51,7 +52,7 @@ export class AddonReportInsightsActionLinkHandlerService extends CoreContentLink
return [{
action: async (siteId?: string): Promise<void> => {
// Send the action.
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
const modal = await CoreLoadings.show('core.sending', true);
try {
await AddonReportInsights.sendActionExecuted(params.action, [Number(params.predictionid)], siteId);

View File

@ -26,6 +26,7 @@ import {
CoreCourseModulePrefetchHandler } from '@features/course/services/module-prefetch-delegate';
import { CoreCourseAnyCourseData, CoreCourses } from '@features/courses/services/courses';
import { AccordionGroupChangeEventDetail, IonAccordionGroup } from '@ionic/angular';
import { CoreLoadings } from '@services/loadings';
import { CoreNavigator } from '@services/navigator';
import { CoreSites } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
@ -469,7 +470,7 @@ export class AddonStorageManagerCourseStoragePage implements OnInit, OnDestroy {
* @returns Promise<void> Once deleting has finished
*/
protected async deleteModules(modules: AddonStorageManagerModule[], section?: AddonStorageManagerCourseSection): Promise<void> {
const modal = await CoreDomUtils.showModalLoading('core.deleting', true);
const modal = await CoreLoadings.show('core.deleting', true);
const promises: Promise<void>[] = [];
modules.forEach((module) => {

View File

@ -21,6 +21,7 @@ import { CoreCourseModulePrefetchDelegate } from '@features/course/services/modu
import { CoreCourses, CoreEnrolledCourseData } from '@features/courses/services/courses';
import { CoreSettingsHelper, CoreSiteSpaceUsage } from '@features/settings/services/settings-helper';
import { CoreSiteHome } from '@features/sitehome/services/sitehome';
import { CoreLoadings } from '@services/loadings';
import { CoreNavigator } from '@services/navigator';
import { CoreSites } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
@ -121,7 +122,7 @@ export class AddonStorageManagerCoursesStoragePage implements OnInit, OnDestroy
return;
}
const modal = await CoreDomUtils.showModalLoading('core.deleting', true);
const modal = await CoreLoadings.show('core.deleting', true);
const deletedCourseIds = this.completelyDownloadedCourses.map((course) => course.id);
try {
@ -160,7 +161,7 @@ export class AddonStorageManagerCoursesStoragePage implements OnInit, OnDestroy
return;
}
const modal = await CoreDomUtils.showModalLoading('core.deleting', true);
const modal = await CoreLoadings.show('core.deleting', true);
try {
await CoreCourseHelper.deleteCourseFiles(course.id);

View File

@ -55,6 +55,7 @@ import { CoreSiteInfo } from './unauthenticated-site';
import { CoreAuthenticatedSite, CoreAuthenticatedSiteOptionalData, CoreSiteWSPreSets, WSObservable } from './authenticated-site';
import { firstValueFrom } from 'rxjs';
import { CorePlatform } from '@services/platform';
import { CoreLoadings } from '@services/loadings';
/**
* Class that represents a site (combination of site + user).
@ -703,7 +704,7 @@ export class CoreSite extends CoreAuthenticatedSite {
let modal: CoreIonLoadingElement | undefined;
if (showModal) {
modal = await CoreDomUtils.showModalLoading();
modal = await CoreLoadings.show();
}
try {

View File

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

View File

@ -17,6 +17,7 @@ import { Component } from '@angular/core';
import { NavParams } from '@ionic/angular';
import { PopoverController } from '@singletons';
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.
@ -24,7 +25,11 @@ import { CoreContextMenuItemComponent } from './context-menu-item';
@Component({
selector: 'core-context-menu-popover',
templateUrl: 'core-context-menu-popover.html',
styleUrls: ['context-menu-popover.scss'],
styleUrl: 'context-menu-popover.scss',
standalone: true,
imports: [
CoreSharedModule,
],
})
export class CoreContextMenuPopoverComponent {

View File

@ -15,11 +15,10 @@
import { Component, Input, OnInit, OnDestroy, ElementRef, ChangeDetectorRef } from '@angular/core';
import { Subject, Subscription } from 'rxjs';
import { auditTime } from 'rxjs/operators';
import { CoreDomUtils } from '@services/utils/dom';
import { CorePopovers } from '@services/popovers';
import { CoreUtils } from '@services/utils/utils';
import { Translate } from '@singletons';
import { CoreContextMenuItemComponent } from './context-menu-item';
import { CoreContextMenuPopoverComponent } from './context-menu-popover';
import { CoreDirectivesRegistry } from '@singletons/directives-registry';
/**
@ -183,7 +182,9 @@ export class CoreContextMenuComponent implements OnInit, OnDestroy {
if (!this.expanded) {
this.expanded = true;
const popoverData = await CoreDomUtils.openPopover<CoreContextMenuItemComponent>({
const { CoreContextMenuPopoverComponent } = await import('./context-menu-popover');
const popoverData = await CorePopovers.open<CoreContextMenuItemComponent>({
event,
component: CoreContextMenuPopoverComponent,
componentProps: {

View File

@ -28,6 +28,7 @@ import { CoreForms } from '@singletons/form';
import { CorePath } from '@singletons/path';
import { CorePlatform } from '@services/platform';
import { toBoolean } from '@/core/transforms/boolean';
import { CoreLoadings } from '@services/loadings';
/**
* Component to handle a local file. Only files inside the app folder can be managed.
@ -180,7 +181,7 @@ export class CoreLocalFileComponent implements OnInit {
return;
}
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
const fileAndDir = CoreFile.getFileAndDirectoryFromPath(this.relativePath);
const newPath = CorePath.concatenatePaths(fileAndDir.directory, newName);
@ -224,7 +225,7 @@ export class CoreLocalFileComponent implements OnInit {
// Ask confirmation.
await CoreDomUtils.showDeleteConfirm('core.confirmdeletefile');
modal = await CoreDomUtils.showModalLoading('core.deleting', true);
modal = await CoreLoadings.show('core.deleting', true);
await CoreFile.removeFile(this.relativePath);

View File

@ -17,7 +17,7 @@ import { Component, ViewChild, ElementRef, Input } from '@angular/core';
import { CoreSites } from '@services/sites';
import { CoreForms } from '@singletons/form';
import { ModalController } from '@singletons';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreLoadings } from '@services/loadings';
/**
* Modal that asks the password.
@ -82,7 +82,7 @@ export class CorePasswordModalComponent {
return response;
}
const modal = await CoreDomUtils.showModalLoading('core.loading', true);
const modal = await CoreLoadings.show('core.loading', true);
try {
return await this.validator(password);
} catch (error) {

View File

@ -47,6 +47,7 @@ export async function getCoreServices(): Promise<Type<unknown>[]> {
const { CoreMimetypeUtilsProvider } = await import('@services/utils/mimetype');
const { CoreNavigatorService } = await import('@services/navigator');
const { CorePluginFileDelegateService } = await import('@services/plugin-file-delegate');
const { CorePopoversService } = await import('@services/popovers');
const { CoreScreenService } = await import('@services/screen');
const { CoreSitesProvider } = await import('@services/sites');
const { CoreSyncProvider } = await import('@services/sync');
@ -57,6 +58,8 @@ export async function getCoreServices(): Promise<Type<unknown>[]> {
const { CoreUtilsProvider } = await import('@services/utils/utils');
const { CoreWSProvider } = await import('@services/ws');
const { CorePlatformService } = await import('@services/platform');
const { CoreQRScanService } = await import('@services/qrscan');
const { CoreLoadingsService } = await import('@services/loadings');
return [
CoreAppProvider,
@ -73,11 +76,14 @@ export async function getCoreServices(): Promise<Type<unknown>[]> {
CoreGroupsProvider,
CoreIframeUtilsProvider,
CoreLangProvider,
CoreLoadingsService,
CoreLocalNotificationsProvider,
CoreMimetypeUtilsProvider,
CoreNavigatorService,
CorePluginFileDelegateService,
CorePopoversService,
CorePlatformService,
CoreQRScanService,
CoreScreenService,
CoreSitesProvider,
CoreSyncProvider,

View File

@ -14,6 +14,7 @@
import { Directive, Input, OnInit, ElementRef } from '@angular/core';
import { CoreFileHelper } from '@services/file-helper';
import { CoreLoadings } from '@services/loadings';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreWSFile } from '@services/ws';
@ -48,7 +49,7 @@ export class CoreDownloadFileDirective implements OnInit {
ev.preventDefault();
ev.stopPropagation();
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
await CoreFileHelper.downloadAndOpenFile(this.file, this.component, this.componentId);

View File

@ -57,6 +57,7 @@ import { CoreIcons } from '@singletons/icons';
import { ContextLevel } from '../constants';
import { CoreWait } from '@singletons/wait';
import { toBoolean } from '../transforms/boolean';
import { CoreViewer } from '@features/viewer/services/viewer';
/**
* Directive to format text rendered. It renders the HTML and treats all links and media, using CoreLinkDirective
@ -294,7 +295,7 @@ export class CoreFormatTextDirective implements OnChanges, OnDestroy, AsyncDirec
e.preventDefault();
e.stopPropagation();
CoreDomUtils.viewImage(imgSrc, img.getAttribute('alt'), this.component, this.componentId);
CoreViewer.viewImage(imgSrc, img.getAttribute('alt'), this.component, this.componentId);
});
img.parentNode?.appendChild(button);

View File

@ -28,6 +28,7 @@ import { DomSanitizer } from '@singletons';
import { CoreFilepool } from '@services/filepool';
import { CoreDom } from '@singletons/dom';
import { toBoolean } from '../transforms/boolean';
import { CoreLoadings } from '@services/loadings';
/**
* Directive to open a link in external browser or in the app.
@ -205,7 +206,7 @@ export class CoreLinkDirective implements OnInit {
if (isDownloading) {
// Wait for the download to finish before opening the file to prevent downloading it twice.
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
try {
const path = await CoreFilepool.downloadUrl(currentSite.getId(), href);

View File

@ -44,6 +44,7 @@ import { Subscription } from 'rxjs';
import { CoreAnimations } from '@components/animations';
import { CoreKeyboard } from '@singletons/keyboard';
import { CoreToasts, ToastDuration } from '@services/toasts';
import { CoreLoadings } from '@services/loadings';
/**
* Page that displays comments.
@ -311,7 +312,7 @@ export class CoreCommentsViewerPage implements OnInit, OnDestroy {
*/
async addComment(text: string): Promise<void> {
CoreKeyboard.close();
const loadingModal = await CoreDomUtils.showModalLoading('core.sending', true);
const loadingModal = await CoreLoadings.show('core.sending', true);
// Freeze the add comment button.
this.sending = true;
try {

View File

@ -15,7 +15,7 @@
import { CoreContentLinksAction } from '../services/contentlinks-delegate';
import { CoreContentLinksHandlerBase } from './base-handler';
import { CoreSites } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreLoadings } from '@services/loadings';
import { CoreCourseHelper } from '@features/course/services/course-helper';
/**
@ -72,7 +72,7 @@ export class CoreContentLinksModuleGradeHandler extends CoreContentLinksHandlerB
return [{
action: async (siteId): Promise<void> => {
// Check if userid is the site's current user.
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
const site = await CoreSites.getSite(siteId);
if (!params.userid || Number(params.userid) == site.getUserId()) {
// No user specified or current user. Navigate to module.

View File

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

View File

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

View File

@ -18,8 +18,7 @@ import { CoreCourseModuleCompletionBaseComponent } from '@features/course/classe
import {
CoreCourseModuleCompletionStatus,
} from '@features/course/services/course';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreCourseModuleCompletionDetailsComponent } from '../module-completion-details/module-completion-details';
import { CorePopovers } from '@services/popovers';
import { CoreCourseHelper } from '@features/course/services/course-helper';
import { CoreUser } from '@features/user/services/user';
import { Translate } from '@singletons';
@ -132,7 +131,10 @@ export class CoreCourseModuleCompletionComponent
target = target.parentElement;
}
CoreDomUtils.openPopoverWithoutResult({
const { CoreCourseModuleCompletionDetailsComponent } =
await import('../module-completion-details/module-completion-details');
CorePopovers.openWithoutResult({
component: CoreCourseModuleCompletionDetailsComponent,
componentProps: {
completion: this.completion,

View File

@ -17,6 +17,7 @@ import { CoreCourse, CoreCourseWSSection } from '@features/course/services/cours
import { CoreCourseHelper, CoreCourseModuleData } from '@features/course/services/course-helper';
import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate';
import { IonContent } from '@ionic/angular';
import { CoreLoadings } from '@services/loadings';
import { CoreNavigationOptions, CoreNavigator } from '@services/navigator';
import { CoreSites, CoreSitesReadingStrategy } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
@ -204,7 +205,7 @@ export class CoreCourseModuleNavigationComponent implements OnInit, OnDestroy {
return;
}
const modal = await CoreDomUtils.showModalLoading();
const modal = await CoreLoadings.show();
// Re-calculate module in case a new module was made visible.
await CoreUtils.ignoreErrors(this.setNextAndPreviousModules(CoreSitesReadingStrategy.PREFER_NETWORK, next, !next));

Some files were not shown because too many files have changed in this diff Show More