commit
81e90182d5
|
@ -69,7 +69,7 @@ jobs:
|
||||||
cat circular-dependencies
|
cat circular-dependencies
|
||||||
lines=$(cat circular-dependencies | wc -l)
|
lines=$(cat circular-dependencies | wc -l)
|
||||||
echo "Total circular dependencies: $lines"
|
echo "Total circular dependencies: $lines"
|
||||||
test $lines -eq 129
|
test $lines -eq 131
|
||||||
- name: JavaScript code compatibility
|
- name: JavaScript code compatibility
|
||||||
run: |
|
run: |
|
||||||
npx check-es-compat www/*.js --polyfills="\{Array,String,TypedArray\}.prototype.at,Object.hasOwn"
|
npx check-es-compat www/*.js --polyfills="\{Array,String,TypedArray\}.prototype.at,Object.hasOwn"
|
||||||
|
|
|
@ -20,7 +20,7 @@ import {
|
||||||
AddonBlockRecentlyAccessedItemsItemCalculatedData,
|
AddonBlockRecentlyAccessedItemsItemCalculatedData,
|
||||||
} from '../../services/recentlyaccesseditems';
|
} from '../../services/recentlyaccesseditems';
|
||||||
import { CoreTextUtils } from '@services/utils/text';
|
import { CoreTextUtils } from '@services/utils/text';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreLoadings } from '@services/loadings';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { CoreSharedModule } from '@/core/shared.module';
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ export class AddonBlockRecentlyAccessedItemsComponent extends CoreBlockBaseCompo
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
const url = CoreTextUtils.decodeHTMLEntities(item.viewurl);
|
const url = CoreTextUtils.decodeHTMLEntities(item.viewurl);
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await CoreSites.visitLink(url);
|
await CoreSites.visitLink(url);
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
|
import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreLoadings } from '@services/loadings';
|
||||||
import { CoreTextUtils } from '@services/utils/text';
|
import { CoreTextUtils } from '@services/utils/text';
|
||||||
import { CoreEnrolledCourseDataWithOptions } from '@features/courses/services/courses-helper';
|
import { CoreEnrolledCourseDataWithOptions } from '@features/courses/services/courses-helper';
|
||||||
import { AddonBlockTimelineDayEvents } from '@addons/block/timeline/classes/section';
|
import { AddonBlockTimelineDayEvents } from '@addons/block/timeline/classes/section';
|
||||||
|
@ -66,7 +66,7 @@ export class AddonBlockTimelineEventsComponent implements OnInit {
|
||||||
// Fix URL format.
|
// Fix URL format.
|
||||||
url = CoreTextUtils.decodeHTMLEntities(url);
|
url = CoreTextUtils.decodeHTMLEntities(url);
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await CoreSites.visitLink(url);
|
await CoreSites.visitLink(url);
|
||||||
|
|
|
@ -21,7 +21,6 @@ import { CoreCommentsComponentsModule } from '@features/comments/components/comp
|
||||||
|
|
||||||
import { CoreTagComponentsModule } from '@features/tag/components/components.module';
|
import { CoreTagComponentsModule } from '@features/tag/components/components.module';
|
||||||
import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/components.module';
|
import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/components.module';
|
||||||
import { AddonBlogEntryOptionsMenuComponent } from './components/entry-options-menu';
|
|
||||||
import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module';
|
import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module';
|
||||||
import { ADDON_BLOG_MAINMENU_PAGE_NAME } from './constants';
|
import { ADDON_BLOG_MAINMENU_PAGE_NAME } from './constants';
|
||||||
import { canLeaveGuard } from '@guards/can-leave';
|
import { canLeaveGuard } from '@guards/can-leave';
|
||||||
|
@ -62,7 +61,6 @@ import { canLeaveGuard } from '@guards/can-leave';
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
AddonBlogIndexPage,
|
AddonBlogIndexPage,
|
||||||
AddonBlogEntryOptionsMenuComponent,
|
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,12 +11,17 @@
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { PopoverController } from '@singletons';
|
import { PopoverController } from '@singletons';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'addon-blog-entry-options-menu',
|
selector: 'addon-blog-entry-options-menu',
|
||||||
templateUrl: './entry-options-menu.html',
|
templateUrl: 'entry-options-menu.html',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class AddonBlogEntryOptionsMenuComponent {
|
export class AddonBlogEntryOptionsMenuComponent {
|
||||||
|
|
|
@ -33,6 +33,7 @@ import { CoreEditorComponentsModule } from '@features/editor/components/componen
|
||||||
import { CoreFileUploader } from '@features/fileuploader/services/fileuploader';
|
import { CoreFileUploader } from '@features/fileuploader/services/fileuploader';
|
||||||
import { CoreTagComponentsModule } from '@features/tag/components/components.module';
|
import { CoreTagComponentsModule } from '@features/tag/components/components.module';
|
||||||
import { CanLeave } from '@guards/can-leave';
|
import { CanLeave } from '@guards/can-leave';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreSites, CoreSitesReadingStrategy } from '@services/sites';
|
import { CoreSites, CoreSitesReadingStrategy } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
|
@ -267,7 +268,7 @@ export class AddonBlogEditEntryPage implements CanLeave, OnInit {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const loading = await CoreDomUtils.showModalLoading('core.sending', true);
|
const loading = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
if (this.entry) {
|
if (this.entry) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { ContextLevel } from '@/core/constants';
|
import { ContextLevel } from '@/core/constants';
|
||||||
import { AddonBlogEntryOptionsMenuComponent } from '@addons/blog/components/entry-options-menu';
|
|
||||||
import { ADDON_BLOG_ENTRY_UPDATED } from '@addons/blog/constants';
|
import { ADDON_BLOG_ENTRY_UPDATED } from '@addons/blog/constants';
|
||||||
import { AddonBlog, AddonBlogFilter, AddonBlogPost, AddonBlogProvider } from '@addons/blog/services/blog';
|
import { AddonBlog, AddonBlogFilter, AddonBlogPost, AddonBlogProvider } from '@addons/blog/services/blog';
|
||||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||||
|
@ -31,6 +30,8 @@ import { CoreUtils } from '@services/utils/utils';
|
||||||
import { CoreArray } from '@singletons/array';
|
import { CoreArray } from '@singletons/array';
|
||||||
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
||||||
import { CoreTime } from '@singletons/time';
|
import { CoreTime } from '@singletons/time';
|
||||||
|
import { CorePopovers } from '@services/popovers';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays the list of blog entries.
|
* 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.
|
* @param enabled If true, filter my entries. False otherwise.
|
||||||
*/
|
*/
|
||||||
async onlyMyEntriesToggleChanged(enabled: boolean): Promise<void> {
|
async onlyMyEntriesToggleChanged(enabled: boolean): Promise<void> {
|
||||||
const loading = await CoreDomUtils.showModalLoading();
|
const loading = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.filter.userid = !enabled ? undefined : this.currentUserId;
|
this.filter.userid = !enabled ? undefined : this.currentUserId;
|
||||||
|
@ -307,7 +308,7 @@ export class AddonBlogIndexPage implements OnInit, OnDestroy {
|
||||||
* @param id Entry id.
|
* @param id Entry id.
|
||||||
*/
|
*/
|
||||||
async deleteEntry(id: number): Promise<void> {
|
async deleteEntry(id: number): Promise<void> {
|
||||||
const loading = await CoreDomUtils.showModalLoading();
|
const loading = await CoreLoadings.show();
|
||||||
try {
|
try {
|
||||||
await AddonBlog.deleteEntry({ entryid: id });
|
await AddonBlog.deleteEntry({ entryid: id });
|
||||||
await this.refresh();
|
await this.refresh();
|
||||||
|
@ -327,7 +328,10 @@ export class AddonBlogIndexPage implements OnInit, OnDestroy {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
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,
|
component: AddonBlogEntryOptionsMenuComponent,
|
||||||
event,
|
event,
|
||||||
});
|
});
|
||||||
|
|
|
@ -43,10 +43,11 @@ import { CoreNavigator } from '@services/navigator';
|
||||||
import { CanLeave } from '@guards/can-leave';
|
import { CanLeave } from '@guards/can-leave';
|
||||||
import { CoreForms } from '@singletons/form';
|
import { CoreForms } from '@singletons/form';
|
||||||
import { CoreReminders, CoreRemindersService, CoreRemindersUnits } from '@features/reminders/services/reminders';
|
import { CoreReminders, CoreRemindersService, CoreRemindersUnits } from '@features/reminders/services/reminders';
|
||||||
import { CoreRemindersSetReminderMenuComponent } from '@features/reminders/components/set-reminder-menu/set-reminder-menu';
|
|
||||||
import moment from 'moment-timezone';
|
import moment from 'moment-timezone';
|
||||||
import { ADDON_CALENDAR_COMPONENT } from '@addons/calendar/constants';
|
import { ADDON_CALENDAR_COMPONENT } from '@addons/calendar/constants';
|
||||||
import { ContextLevel } from '@/core/constants';
|
import { ContextLevel } from '@/core/constants';
|
||||||
|
import { CorePopovers } from '@services/popovers';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays a form to create/edit an event.
|
* Page that displays a form to create/edit an event.
|
||||||
|
@ -407,7 +408,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.loadGroups(courseId);
|
await this.loadGroups(courseId);
|
||||||
|
@ -513,7 +514,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send the data.
|
// Send the data.
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
let event: AddonCalendarEvent | AddonCalendarOfflineEventDBRecord;
|
let event: AddonCalendarEvent | AddonCalendarOfflineEventDBRecord;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -637,7 +638,10 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave {
|
||||||
const formData = this.form.value;
|
const formData = this.form.value;
|
||||||
const eventTime = moment(formData.timestart).unix();
|
const eventTime = moment(formData.timestart).unix();
|
||||||
|
|
||||||
const 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,
|
component: CoreRemindersSetReminderMenuComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
eventTime,
|
eventTime,
|
||||||
|
|
|
@ -39,11 +39,12 @@ import { CoreRoutedItemsManagerSourcesTracker } from '@classes/items-management/
|
||||||
import { AddonCalendarEventsSource } from '@addons/calendar/classes/events-source';
|
import { AddonCalendarEventsSource } from '@addons/calendar/classes/events-source';
|
||||||
import { CoreSwipeNavigationItemsManager } from '@classes/items-management/swipe-navigation-items-manager';
|
import { CoreSwipeNavigationItemsManager } from '@classes/items-management/swipe-navigation-items-manager';
|
||||||
import { CoreReminders, CoreRemindersService } from '@features/reminders/services/reminders';
|
import { CoreReminders, CoreRemindersService } from '@features/reminders/services/reminders';
|
||||||
import { CoreRemindersSetReminderMenuComponent } from '@features/reminders/components/set-reminder-menu/set-reminder-menu';
|
|
||||||
import { CoreLocalNotifications } from '@services/local-notifications';
|
import { CoreLocalNotifications } from '@services/local-notifications';
|
||||||
import { CorePlatform } from '@services/platform';
|
import { CorePlatform } from '@services/platform';
|
||||||
import { CoreConfig } from '@services/config';
|
import { CoreConfig } from '@services/config';
|
||||||
import { CoreToasts, ToastDuration } from '@services/toasts';
|
import { CoreToasts, ToastDuration } from '@services/toasts';
|
||||||
|
import { CorePopovers } from '@services/popovers';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays a single calendar event.
|
* Page that displays a single calendar event.
|
||||||
|
@ -384,7 +385,10 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy {
|
||||||
return;
|
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,
|
component: CoreRemindersSetReminderMenuComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
eventTime: this.event.timestart,
|
eventTime: this.event.timestart,
|
||||||
|
@ -415,7 +419,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy {
|
||||||
try {
|
try {
|
||||||
await CoreDomUtils.showDeleteConfirm();
|
await CoreDomUtils.showDeleteConfirm();
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.deleting', true);
|
const modal = await CoreLoadings.show('core.deleting', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await CoreReminders.removeReminder(id);
|
await CoreReminders.removeReminder(id);
|
||||||
|
@ -522,12 +526,11 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy {
|
||||||
try {
|
try {
|
||||||
deleteAll = await CoreDomUtils.showConfirm(message, title, undefined, undefined, options);
|
deleteAll = await CoreDomUtils.showConfirm(message, title, undefined, undefined, options);
|
||||||
} catch {
|
} catch {
|
||||||
|
|
||||||
// User canceled.
|
// User canceled.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let onlineEventDeleted = false;
|
let onlineEventDeleted = false;
|
||||||
|
@ -584,7 +587,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|
|
@ -13,12 +13,11 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CorePopovers } from '@services/popovers';
|
||||||
import {
|
import {
|
||||||
CoreReminders,
|
CoreReminders,
|
||||||
CoreRemindersService,
|
CoreRemindersService,
|
||||||
} from '@features/reminders/services/reminders';
|
} from '@features/reminders/services/reminders';
|
||||||
import { CoreRemindersSetReminderMenuComponent } from '@features/reminders/components/set-reminder-menu/set-reminder-menu';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays the calendar settings.
|
* Page that displays the calendar settings.
|
||||||
|
@ -51,7 +50,10 @@ export class AddonCalendarSettingsPage implements OnInit {
|
||||||
e.stopImmediatePropagation();
|
e.stopImmediatePropagation();
|
||||||
e.preventDefault();
|
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,
|
component: CoreRemindersSetReminderMenuComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
initialValue: this.defaultTime,
|
initialValue: this.defaultTime,
|
||||||
|
|
|
@ -19,6 +19,7 @@ import {
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { CoreUser, CoreUserProfile } from '@features/user/services/user';
|
import { CoreUser, CoreUserProfile } from '@features/user/services/user';
|
||||||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
|
@ -123,7 +124,7 @@ export class AddonCourseCompletionReportPage implements OnInit {
|
||||||
* Mark course as completed.
|
* Mark course as completed.
|
||||||
*/
|
*/
|
||||||
async completeCourse(): Promise<void> {
|
async completeCourse(): Promise<void> {
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await AddonCourseCompletion.markCourseAsSelfCompleted(this.courseId);
|
await AddonCourseCompletion.markCourseAsSelfCompleted(this.courseId);
|
||||||
|
|
|
@ -22,7 +22,7 @@ import {
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { AddonEnrolGuest } from './guest';
|
import { AddonEnrolGuest } from './guest';
|
||||||
import { CorePasswordModalResponse } from '@components/password-modal/password-modal';
|
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 { CoreWSError } from '@classes/errors/wserror';
|
||||||
import { CoreEnrol, CoreEnrolEnrolmentMethod } from '@features/enrol/services/enrol';
|
import { CoreEnrol, CoreEnrolEnrolmentMethod } from '@features/enrol/services/enrol';
|
||||||
import { CoreModals } from '@services/modals';
|
import { CoreModals } from '@services/modals';
|
||||||
|
@ -100,7 +100,7 @@ export class AddonEnrolGuestHandlerService implements CoreEnrolGuestHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
const validatePassword = async (password = ''): Promise<CorePasswordModalResponse> => {
|
const validatePassword = async (password = ''): Promise<CorePasswordModalResponse> => {
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.loading', true);
|
const modal = await CoreLoadings.show('core.loading', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await AddonEnrolGuest.validateGuestAccessPassword(method.id, password);
|
const response = await AddonEnrolGuest.validateGuestAccessPassword(method.id, password);
|
||||||
|
|
|
@ -21,6 +21,7 @@ import { CoreCoursesProvider } from '@features/courses/services/courses';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreEnrol, CoreEnrolEnrolmentMethod } from '@features/enrol/services/enrol';
|
import { CoreEnrol, CoreEnrolEnrolmentMethod } from '@features/enrol/services/enrol';
|
||||||
import { CoreModals } from '@services/modals';
|
import { CoreModals } from '@services/modals';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enrol handler.
|
* Enrol handler.
|
||||||
|
@ -112,7 +113,7 @@ export class AddonEnrolSelfHandlerService implements CoreEnrolSelfHandler {
|
||||||
*/
|
*/
|
||||||
protected async performEnrol(method: CoreEnrolEnrolmentMethod): Promise<boolean> {
|
protected async performEnrol(method: CoreEnrolEnrolmentMethod): Promise<boolean> {
|
||||||
const validatePassword = async (password = ''): Promise<CorePasswordModalResponse> => {
|
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 = {
|
const response: CorePasswordModalResponse = {
|
||||||
password,
|
password,
|
||||||
|
|
|
@ -48,6 +48,7 @@ import { CoreKeyboard } from '@singletons/keyboard';
|
||||||
import { CoreText } from '@singletons/text';
|
import { CoreText } from '@singletons/text';
|
||||||
import { CoreWait } from '@singletons/wait';
|
import { CoreWait } from '@singletons/wait';
|
||||||
import { CoreModals } from '@services/modals';
|
import { CoreModals } from '@services/modals';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays a message discussion page.
|
* Page that displays a message discussion page.
|
||||||
|
@ -232,7 +233,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
|
||||||
protected async fetchData(): Promise<void> {
|
protected async fetchData(): Promise<void> {
|
||||||
let loader: CoreIonLoadingElement | undefined;
|
let loader: CoreIonLoadingElement | undefined;
|
||||||
if (this.showLoadingModal) {
|
if (this.showLoadingModal) {
|
||||||
loader = await CoreDomUtils.showModalLoading();
|
loader = await CoreLoadings.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.groupMessagingEnabled && this.userId) {
|
if (!this.groupMessagingEnabled && this.userId) {
|
||||||
|
@ -965,7 +966,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
|
||||||
options,
|
options,
|
||||||
);
|
);
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.deleting', true);
|
const modal = await CoreLoadings.show('core.deleting', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await AddonMessages.deleteMessage(message, data && data[0]);
|
await AddonMessages.deleteMessage(message, data && data[0]);
|
||||||
|
@ -1406,7 +1407,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
|
||||||
await CoreDomUtils.showConfirm(template, undefined, okText);
|
await CoreDomUtils.showConfirm(template, undefined, okText);
|
||||||
this.blockIcon = CoreConstants.ICON_LOADING;
|
this.blockIcon = CoreConstants.ICON_LOADING;
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
this.showLoadingModal = true;
|
this.showLoadingModal = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -1488,7 +1489,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
|
||||||
|
|
||||||
this.blockIcon = CoreConstants.ICON_LOADING;
|
this.blockIcon = CoreConstants.ICON_LOADING;
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
this.showLoadingModal = true;
|
this.showLoadingModal = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -1527,7 +1528,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
|
||||||
|
|
||||||
this.addRemoveIcon = CoreConstants.ICON_LOADING;
|
this.addRemoveIcon = CoreConstants.ICON_LOADING;
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
this.showLoadingModal = true;
|
this.showLoadingModal = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -1558,7 +1559,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
|
||||||
throw new CoreError('No member selected to be confirmed.');
|
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;
|
this.showLoadingModal = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -1584,7 +1585,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
|
||||||
throw new CoreError('No member selected to be declined.');
|
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;
|
this.showLoadingModal = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -1618,7 +1619,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
|
||||||
|
|
||||||
this.addRemoveIcon = CoreConstants.ICON_LOADING;
|
this.addRemoveIcon = CoreConstants.ICON_LOADING;
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
this.showLoadingModal = true;
|
this.showLoadingModal = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -28,6 +28,7 @@ import { CoreConstants } from '@/core/constants';
|
||||||
import { AddonNotificationsPreferencesNotificationProcessorState } from '@addons/notifications/services/notifications';
|
import { AddonNotificationsPreferencesNotificationProcessorState } from '@addons/notifications/services/notifications';
|
||||||
import { CorePlatform } from '@services/platform';
|
import { CorePlatform } from '@services/platform';
|
||||||
import { CoreTextUtils } from '@services/utils/text';
|
import { CoreTextUtils } from '@services/utils/text';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays the messages settings page.
|
* Page that displays the messages settings page.
|
||||||
|
@ -155,7 +156,7 @@ export class AddonMessagesSettingsPage implements OnInit, OnDestroy {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
if (!this.advancedContactable) {
|
if (!this.advancedContactable) {
|
||||||
// Convert from boolean to number.
|
// Convert from boolean to number.
|
||||||
|
|
|
@ -67,6 +67,8 @@ import {
|
||||||
ADDON_MOD_ASSIGN_SUBMITTED_FOR_GRADING_EVENT,
|
ADDON_MOD_ASSIGN_SUBMITTED_FOR_GRADING_EVENT,
|
||||||
ADDON_MOD_ASSIGN_UNLIMITED_ATTEMPTS,
|
ADDON_MOD_ASSIGN_UNLIMITED_ATTEMPTS,
|
||||||
} from '../../constants';
|
} from '../../constants';
|
||||||
|
import { CoreViewer } from '@features/viewer/services/viewer';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component that displays an assignment submission.
|
* Component that displays an assignment submission.
|
||||||
|
@ -320,7 +322,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can
|
||||||
}
|
}
|
||||||
|
|
||||||
const previousSubmission = this.previousAttempt.submission;
|
const previousSubmission = this.previousAttempt.submission;
|
||||||
let modal = await CoreDomUtils.showModalLoading();
|
let modal = await CoreLoadings.show();
|
||||||
|
|
||||||
const size = await CoreUtils.ignoreErrors(
|
const size = await CoreUtils.ignoreErrors(
|
||||||
AddonModAssignHelper.getSubmissionSizeForCopy(this.assign, previousSubmission),
|
AddonModAssignHelper.getSubmissionSizeForCopy(this.assign, previousSubmission),
|
||||||
|
@ -338,7 +340,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can
|
||||||
}
|
}
|
||||||
|
|
||||||
// User confirmed, copy the attempt.
|
// User confirmed, copy the attempt.
|
||||||
modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await AddonModAssignHelper.copyPreviousAttempt(this.assign, previousSubmission);
|
await AddonModAssignHelper.copyPreviousAttempt(this.assign, previousSubmission);
|
||||||
|
@ -866,7 +868,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can
|
||||||
*/
|
*/
|
||||||
showAdvancedGrade(): void {
|
showAdvancedGrade(): void {
|
||||||
if (this.feedback && this.feedback.advancedgrade) {
|
if (this.feedback && this.feedback.advancedgrade) {
|
||||||
CoreTextUtils.viewText(
|
CoreViewer.viewText(
|
||||||
Translate.instant('core.grades.grade'),
|
Translate.instant('core.grades.grade'),
|
||||||
this.feedback.gradefordisplay,
|
this.feedback.gradefordisplay,
|
||||||
{
|
{
|
||||||
|
@ -897,7 +899,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can
|
||||||
// Ask for confirmation. @todo plugin precheck_submission
|
// Ask for confirmation. @todo plugin precheck_submission
|
||||||
await CoreDomUtils.showConfirm(Translate.instant('addon.mod_assign.confirmsubmission'));
|
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 {
|
try {
|
||||||
await AddonModAssign.submitForGrading(
|
await AddonModAssign.submitForGrading(
|
||||||
|
@ -948,7 +950,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can
|
||||||
throw new CoreError(Translate.instant('core.grades.badgrade'));
|
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) => {
|
(this.gradeInfo?.outcomes || []).forEach((outcome) => {
|
||||||
if (outcome.itemNumber && outcome.selectedId) {
|
if (outcome.itemNumber && outcome.selectedId) {
|
||||||
|
|
|
@ -27,6 +27,8 @@ import { CoreUtils } from '@services/utils/utils';
|
||||||
import { AddonModAssignFeedbackPluginBaseComponent } from '@addons/mod/assign/classes/base-feedback-plugin-component';
|
import { AddonModAssignFeedbackPluginBaseComponent } from '@addons/mod/assign/classes/base-feedback-plugin-component';
|
||||||
import { ContextLevel } from '@/core/constants';
|
import { ContextLevel } from '@/core/constants';
|
||||||
import { ADDON_MOD_ASSIGN_COMPONENT } from '@addons/mod/assign/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.
|
* Component to render a comments feedback plugin.
|
||||||
*/
|
*/
|
||||||
|
@ -67,7 +69,7 @@ export class AddonModAssignFeedbackCommentsComponent extends AddonModAssignFeedb
|
||||||
|
|
||||||
if (this.text) {
|
if (this.text) {
|
||||||
// Open a new state with the 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,
|
component: this.component,
|
||||||
componentId: this.assign.cmid,
|
componentId: this.assign.cmid,
|
||||||
filter: true,
|
filter: true,
|
||||||
|
|
|
@ -46,6 +46,7 @@ import {
|
||||||
ADDON_MOD_ASSIGN_SUBMITTED_FOR_GRADING_EVENT,
|
ADDON_MOD_ASSIGN_SUBMITTED_FOR_GRADING_EVENT,
|
||||||
} from '../../constants';
|
} from '../../constants';
|
||||||
import { CoreToasts, ToastDuration } from '@services/toasts';
|
import { CoreToasts, ToastDuration } from '@services/toasts';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that allows adding or editing an assigment submission.
|
* 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> {
|
protected async hasDataChanged(): Promise<boolean> {
|
||||||
// Usually the hasSubmissionDataChanged call will be resolved inmediately, causing the modal to be shown just an instant.
|
// 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".
|
// 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();
|
const data = this.getInputData();
|
||||||
|
|
||||||
|
@ -397,7 +398,7 @@ export class AddonModAssignEditPage implements OnInit, OnDestroy, CanLeave {
|
||||||
throw Translate.instant('addon.mod_assign.acceptsubmissionstatement');
|
throw Translate.instant('addon.mod_assign.acceptsubmissionstatement');
|
||||||
}
|
}
|
||||||
|
|
||||||
let modal = await CoreDomUtils.showModalLoading();
|
let modal = await CoreLoadings.show();
|
||||||
let size = -1;
|
let size = -1;
|
||||||
|
|
||||||
// Get size to ask for confirmation.
|
// Get size to ask for confirmation.
|
||||||
|
@ -414,7 +415,7 @@ export class AddonModAssignEditPage implements OnInit, OnDestroy, CanLeave {
|
||||||
// Confirm action.
|
// Confirm action.
|
||||||
await CoreFileUploaderHelper.confirmUploadFile(size, true, this.allowOffline);
|
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);
|
const pluginData = await this.prepareSubmissionData(inputData);
|
||||||
if (!Object.keys(pluginData).length) {
|
if (!Object.keys(pluginData).length) {
|
||||||
|
|
|
@ -23,6 +23,7 @@ import { CoreUtils } from '@services/utils/utils';
|
||||||
import { AddonModAssignSubmissionOnlineTextPluginData } from '../services/handler';
|
import { AddonModAssignSubmissionOnlineTextPluginData } from '../services/handler';
|
||||||
import { ContextLevel } from '@/core/constants';
|
import { ContextLevel } from '@/core/constants';
|
||||||
import { ADDON_MOD_ASSIGN_COMPONENT } from '@addons/mod/assign/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.
|
* Component to render an onlinetext submission plugin.
|
||||||
|
@ -84,7 +85,7 @@ export class AddonModAssignSubmissionOnlineTextComponent extends AddonModAssignS
|
||||||
|
|
||||||
if (this.text) {
|
if (this.text) {
|
||||||
// Open a new state with the interpolated contents.
|
// 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,
|
component: this.component,
|
||||||
componentId: this.assign.cmid,
|
componentId: this.assign.cmid,
|
||||||
filter: true,
|
filter: true,
|
||||||
|
|
|
@ -32,6 +32,7 @@ import {
|
||||||
AddonModBBBRecordingPlaybackTypes,
|
AddonModBBBRecordingPlaybackTypes,
|
||||||
} from '../../services/bigbluebuttonbn';
|
} from '../../services/bigbluebuttonbn';
|
||||||
import { ADDON_MOD_BBB_COMPONENT } from '../../constants';
|
import { ADDON_MOD_BBB_COMPONENT } from '../../constants';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component that displays a Big Blue Button activity.
|
* Component that displays a Big Blue Button activity.
|
||||||
|
@ -295,7 +296,7 @@ export class AddonModBBBIndexComponent extends CoreCourseModuleMainActivityCompo
|
||||||
* @returns Promise resolved when done.
|
* @returns Promise resolved when done.
|
||||||
*/
|
*/
|
||||||
async joinRoom(): Promise<void> {
|
async joinRoom(): Promise<void> {
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const joinUrl = await AddonModBBB.getJoinUrl(this.module.id, this.groupId);
|
const joinUrl = await AddonModBBB.getJoinUrl(this.module.id, this.groupId);
|
||||||
|
@ -336,7 +337,7 @@ export class AddonModBBBIndexComponent extends CoreCourseModuleMainActivityCompo
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await AddonModBBB.endMeeting(this.bbb.id, this.groupId);
|
await AddonModBBB.endMeeting(this.bbb.id, this.groupId);
|
||||||
|
|
|
@ -32,6 +32,7 @@ import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
||||||
import { CoreKeyboard } from '@singletons/keyboard';
|
import { CoreKeyboard } from '@singletons/keyboard';
|
||||||
import { CoreWait } from '@singletons/wait';
|
import { CoreWait } from '@singletons/wait';
|
||||||
import { CoreModals } from '@services/modals';
|
import { CoreModals } from '@services/modals';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays a chat session.
|
* Page that displays a chat session.
|
||||||
|
@ -342,7 +343,7 @@ export class AddonModChatChatPage implements OnInit, OnDestroy, CanLeave {
|
||||||
* @returns Promise resolved when done.
|
* @returns Promise resolved when done.
|
||||||
*/
|
*/
|
||||||
async reconnect(): Promise<void> {
|
async reconnect(): Promise<void> {
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Call startPolling would take a while for the first execution, so we'll execute it manually to check if it works now.
|
// Call startPolling would take a while for the first execution, so we'll execute it manually to check if it works now.
|
||||||
|
|
|
@ -25,6 +25,7 @@ import { CoreTime } from '@singletons/time';
|
||||||
import { Translate } from '@singletons';
|
import { Translate } from '@singletons';
|
||||||
import { AddonModChat } from '@addons/mod/chat/services/chat';
|
import { AddonModChat } from '@addons/mod/chat/services/chat';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays list of chat sessions.
|
* Page that displays list of chat sessions.
|
||||||
|
@ -126,7 +127,7 @@ export class AddonModChatSessionsPage implements OnInit, AfterViewInit, OnDestro
|
||||||
* Reload chat sessions.
|
* Reload chat sessions.
|
||||||
*/
|
*/
|
||||||
async reloadSessions(): Promise<void> {
|
async reloadSessions(): Promise<void> {
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.sessions.reload();
|
await this.sessions.reload();
|
||||||
|
|
|
@ -41,6 +41,7 @@ import {
|
||||||
ADDON_MOD_CHOICE_PUBLISH_ANONYMOUS,
|
ADDON_MOD_CHOICE_PUBLISH_ANONYMOUS,
|
||||||
AddonModChoiceShowResults,
|
AddonModChoiceShowResults,
|
||||||
} from '../../constants';
|
} from '../../constants';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component that displays a choice.
|
* Component that displays a choice.
|
||||||
|
@ -383,7 +384,7 @@ export class AddonModChoiceIndexComponent extends CoreCourseModuleMainActivityCo
|
||||||
responses.push(this.selectedOption.id);
|
responses.push(this.selectedOption.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const online = await AddonModChoice.submitResponse(this.choice.id, this.choice.name, this.courseId, responses);
|
const online = await AddonModChoice.submitResponse(this.choice.id, this.choice.name, this.courseId, responses);
|
||||||
|
@ -421,7 +422,7 @@ export class AddonModChoiceIndexComponent extends CoreCourseModuleMainActivityCo
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await AddonModChoice.deleteResponses(this.choice.id, this.choice.name, this.courseId);
|
await AddonModChoice.deleteResponses(this.choice.id, this.choice.name, this.courseId);
|
||||||
|
|
|
@ -26,8 +26,8 @@ import {
|
||||||
} from '../../services/data';
|
} from '../../services/data';
|
||||||
import { AddonModDataHelper } from '../../services/data-helper';
|
import { AddonModDataHelper } from '../../services/data-helper';
|
||||||
import { AddonModDataOffline } from '../../services/data-offline';
|
import { AddonModDataOffline } from '../../services/data-offline';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CorePopovers } from '@services/popovers';
|
||||||
import { AddonModDataActionsMenuComponent, AddonModDataActionsMenuItem } from '../actionsmenu/actionsmenu';
|
import { AddonModDataActionsMenuItem } from '../actionsmenu/actionsmenu';
|
||||||
import {
|
import {
|
||||||
ADDON_MOD_DATA_ENTRY_CHANGED,
|
ADDON_MOD_DATA_ENTRY_CHANGED,
|
||||||
ADDON_MOD_DATA_PAGE_NAME,
|
ADDON_MOD_DATA_PAGE_NAME,
|
||||||
|
@ -202,7 +202,9 @@ export class AddonModDataActionComponent implements OnInit {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
await CoreDomUtils.openPopoverWithoutResult({
|
const { AddonModDataActionsMenuComponent } = await import('../actionsmenu/actionsmenu');
|
||||||
|
|
||||||
|
await CorePopovers.openWithoutResult({
|
||||||
component: AddonModDataActionsMenuComponent,
|
component: AddonModDataActionsMenuComponent,
|
||||||
componentProps: { items },
|
componentProps: { items },
|
||||||
id: 'actionsmenu-popover',
|
id: 'actionsmenu-popover',
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
import { PopoverController } from '@singletons';
|
import { PopoverController } from '@singletons';
|
||||||
|
|
||||||
|
@ -21,6 +22,10 @@ import { PopoverController } from '@singletons';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'addon-mod-data-actionsmenu',
|
selector: 'addon-mod-data-actionsmenu',
|
||||||
templateUrl: 'actionsmenu.html',
|
templateUrl: 'actionsmenu.html',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class AddonModDataActionsMenuComponent {
|
export class AddonModDataActionsMenuComponent {
|
||||||
|
|
||||||
|
|
|
@ -17,12 +17,10 @@ import { CoreSharedModule } from '@/core/shared.module';
|
||||||
import { CoreCourseComponentsModule } from '@features/course/components/components.module';
|
import { CoreCourseComponentsModule } from '@features/course/components/components.module';
|
||||||
import { AddonModDataIndexComponent } from './index';
|
import { AddonModDataIndexComponent } from './index';
|
||||||
import { CoreCompileHtmlComponentModule } from '@features/compile/components/compile-html/compile-html.module';
|
import { CoreCompileHtmlComponentModule } from '@features/compile/components/compile-html/compile-html.module';
|
||||||
import { AddonModDataActionsMenuComponent } from './actionsmenu/actionsmenu';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AddonModDataIndexComponent,
|
AddonModDataIndexComponent,
|
||||||
AddonModDataActionsMenuComponent,
|
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
CoreSharedModule,
|
CoreSharedModule,
|
||||||
|
@ -31,7 +29,6 @@ import { AddonModDataActionsMenuComponent } from './actionsmenu/actionsmenu';
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
AddonModDataIndexComponent,
|
AddonModDataIndexComponent,
|
||||||
AddonModDataActionsMenuComponent,
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class AddonModDataComponentsModule {}
|
export class AddonModDataComponentsModule {}
|
||||||
|
|
|
@ -19,6 +19,7 @@ import { FormBuilder } from '@angular/forms';
|
||||||
import { SafeUrl } from '@angular/platform-browser';
|
import { SafeUrl } from '@angular/platform-browser';
|
||||||
import { CoreAnyError } from '@classes/errors/error';
|
import { CoreAnyError } from '@classes/errors/error';
|
||||||
import { CoreGeolocation, CoreGeolocationError, CoreGeolocationErrorReason } from '@services/geolocation';
|
import { CoreGeolocation, CoreGeolocationError, CoreGeolocationErrorReason } from '@services/geolocation';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
import { CorePlatform } from '@services/platform';
|
import { CorePlatform } from '@services/platform';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { DomSanitizer } from '@singletons';
|
import { DomSanitizer } from '@singletons';
|
||||||
|
@ -118,7 +119,7 @@ export class AddonModDataFieldLatlongComponent extends AddonModDataFieldPluginBa
|
||||||
async getLocation(event: Event): Promise<void> {
|
async getLocation(event: Event): Promise<void> {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('addon.mod_data.gettinglocation', true);
|
const modal = await CoreLoadings.show('addon.mod_data.gettinglocation', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const coordinates = await CoreGeolocation.getCoordinates();
|
const coordinates = await CoreGeolocation.getCoordinates();
|
||||||
|
|
|
@ -44,6 +44,7 @@ import { CoreTextUtils } from '@services/utils/text';
|
||||||
import { CoreTime } from '@singletons/time';
|
import { CoreTime } from '@singletons/time';
|
||||||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
||||||
import { ADDON_MOD_DATA_COMPONENT, ADDON_MOD_DATA_ENTRY_CHANGED, AddonModDataTemplateType } from '../../constants';
|
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.
|
* 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'));
|
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.
|
// Create an ID to assign files.
|
||||||
const entryTemp = this.entryId ? this.entryId : - (Date.now());
|
const entryTemp = this.entryId ? this.entryId : - (Date.now());
|
||||||
|
|
|
@ -48,6 +48,7 @@ import {
|
||||||
AddonModDataTemplateMode,
|
AddonModDataTemplateMode,
|
||||||
} from '../constants';
|
} from '../constants';
|
||||||
import { CoreToasts, ToastDuration } from '@services/toasts';
|
import { CoreToasts, ToastDuration } from '@services/toasts';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Service that provides helper functions for datas.
|
* Service that provides helper functions for datas.
|
||||||
|
@ -154,7 +155,7 @@ export class AddonModDataHelperProvider {
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
siteId = siteId || CoreSites.getCurrentSiteId();
|
siteId = siteId || CoreSites.getCurrentSiteId();
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
courseId = await this.getActivityCourseIdIfNotSet(dataId, courseId, siteId);
|
courseId = await this.getActivityCourseIdIfNotSet(dataId, courseId, siteId);
|
||||||
|
@ -857,7 +858,7 @@ export class AddonModDataHelperProvider {
|
||||||
try {
|
try {
|
||||||
await CoreDomUtils.showDeleteConfirm('addon.mod_data.confirmdeleterecord');
|
await CoreDomUtils.showDeleteConfirm('addon.mod_data.confirmdeleterecord');
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (entryId > 0) {
|
if (entryId > 0) {
|
||||||
|
|
|
@ -17,7 +17,7 @@ import { Params } from '@angular/router';
|
||||||
import { CoreCourse } from '@features/course/services/course';
|
import { CoreCourse } from '@features/course/services/course';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreSitesReadingStrategy } from '@services/sites';
|
import { CoreSitesReadingStrategy } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreLoadings } from '@services/loadings';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { ADDON_MOD_DATA_FEATURE_NAME, ADDON_MOD_DATA_PAGE_NAME } from '../../constants';
|
import { ADDON_MOD_DATA_FEATURE_NAME, ADDON_MOD_DATA_PAGE_NAME } from '../../constants';
|
||||||
import { AddonModDataEditLinkHandlerService } from '@addons/mod/data/services/handlers/edit-link';
|
import { AddonModDataEditLinkHandlerService } from '@addons/mod/data/services/handlers/edit-link';
|
||||||
|
@ -37,7 +37,7 @@ export class AddonModDataEditLinkHandlerLazyService extends AddonModDataEditLink
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
async handleAction(siteId: string, params: Record<string, string>): Promise<void> {
|
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 dataId = parseInt(params.d, 10);
|
||||||
const rId = params.rid || '';
|
const rId = params.rid || '';
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import { Params } from '@angular/router';
|
||||||
import { CoreCourse } from '@features/course/services/course';
|
import { CoreCourse } from '@features/course/services/course';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreSitesReadingStrategy } from '@services/sites';
|
import { CoreSitesReadingStrategy } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreLoadings } from '@services/loadings';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { ADDON_MOD_DATA_PAGE_NAME } from '../../constants';
|
import { ADDON_MOD_DATA_PAGE_NAME } from '../../constants';
|
||||||
import { AddonModDataShowLinkHandlerService } from '@addons/mod/data/services/handlers/show-link';
|
import { AddonModDataShowLinkHandlerService } from '@addons/mod/data/services/handlers/show-link';
|
||||||
|
@ -33,7 +33,7 @@ export class AddonModDataShowLinkHandlerLazyService extends AddonModDataShowLink
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
async handleAction(siteId: string, params: Record<string, string>): Promise<void> {
|
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 dataId = parseInt(params.d, 10);
|
||||||
const rId = params.rid || '';
|
const rId = params.rid || '';
|
||||||
const group = parseInt(params.group, 10) || false;
|
const group = parseInt(params.group, 10) || false;
|
||||||
|
|
|
@ -37,6 +37,7 @@ import { AddonModFeedbackFormItem, AddonModFeedbackHelper } from '../../services
|
||||||
import { AddonModFeedbackSync } from '../../services/feedback-sync';
|
import { AddonModFeedbackSync } from '../../services/feedback-sync';
|
||||||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
||||||
import { ADDON_MOD_FEEDBACK_COMPONENT, ADDON_MOD_FEEDBACK_FORM_SUBMITTED, ADDON_MOD_FEEDBACK_PAGE_NAME } from '../../constants';
|
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.
|
* Page that displays feedback form.
|
||||||
|
@ -423,7 +424,7 @@ export class AddonModFeedbackFormPage implements OnInit, OnDestroy, CanLeave {
|
||||||
return CoreNavigator.back();
|
return CoreNavigator.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await CoreSites.visitLink(this.siteAfterSubmit, { siteId: this.currentSite.id });
|
await CoreSites.visitLink(this.siteAfterSubmit, { siteId: this.currentSite.id });
|
||||||
|
|
|
@ -40,6 +40,7 @@ import {
|
||||||
ADDON_MOD_FEEDBACK_MULTICHOICE_HIDENOSELECT,
|
ADDON_MOD_FEEDBACK_MULTICHOICE_HIDENOSELECT,
|
||||||
ADDON_MOD_FEEDBACK_PAGE_NAME,
|
ADDON_MOD_FEEDBACK_PAGE_NAME,
|
||||||
} from '../constants';
|
} from '../constants';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
const MODE_RESPONSETIME = 1;
|
const MODE_RESPONSETIME = 1;
|
||||||
const MODE_COURSE = 2;
|
const MODE_COURSE = 2;
|
||||||
|
@ -179,7 +180,7 @@ export class AddonModFeedbackHelperProvider {
|
||||||
async handleShowEntriesLink(params: Record<string, string>, siteId?: string): Promise<void> {
|
async handleShowEntriesLink(params: Record<string, string>, siteId?: string): Promise<void> {
|
||||||
siteId = siteId || CoreSites.getCurrentSiteId();
|
siteId = siteId || CoreSites.getCurrentSiteId();
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const module = await CoreCourse.getModuleBasicInfo(
|
const module = await CoreCourse.getModuleBasicInfo(
|
||||||
|
|
|
@ -20,6 +20,7 @@ import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { ADDON_MOD_FEEDBACK_PAGE_NAME } from '../../constants';
|
import { ADDON_MOD_FEEDBACK_PAGE_NAME } from '../../constants';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Content links handler for a feedback analysis.
|
* 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[] {
|
getActions(siteIds: string[], url: string, params: Record<string, string>): CoreContentLinksAction[] {
|
||||||
return [{
|
return [{
|
||||||
action: async (siteId: string) => {
|
action: async (siteId: string) => {
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
const moduleId = Number(params.id);
|
const moduleId = Number(params.id);
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ import { CoreSitesReadingStrategy } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { ADDON_MOD_FEEDBACK_PAGE_NAME } from '../../constants';
|
import { ADDON_MOD_FEEDBACK_PAGE_NAME } from '../../constants';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Content links handler for feedback complete questions.
|
* 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[] {
|
getActions(siteIds: string[], url: string, params: Record<string, string>): CoreContentLinksAction[] {
|
||||||
return [{
|
return [{
|
||||||
action: async (siteId: string) => {
|
action: async (siteId: string) => {
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
const moduleId = Number(params.id);
|
const moduleId = Number(params.id);
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ import { CoreSitesReadingStrategy } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { ADDON_MOD_FEEDBACK_PAGE_NAME } from '../../constants';
|
import { ADDON_MOD_FEEDBACK_PAGE_NAME } from '../../constants';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Content links handler for feedback print questions.
|
* 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[] {
|
getActions(siteIds: string[], url: string, params: Record<string, string>): CoreContentLinksAction[] {
|
||||||
return [{
|
return [{
|
||||||
action: async (siteId: string) => {
|
action: async (siteId: string) => {
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
const moduleId = Number(params.id);
|
const moduleId = Number(params.id);
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ import { CoreSitesReadingStrategy } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { ADDON_MOD_FEEDBACK_PAGE_NAME } from '../../constants';
|
import { ADDON_MOD_FEEDBACK_PAGE_NAME } from '../../constants';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
/**
|
/**
|
||||||
* Content links handler for feedback show non respondents.
|
* Content links handler for feedback show non respondents.
|
||||||
* Match mod/feedback/show_nonrespondents.php with a valid feedback id.
|
* 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[] {
|
getActions(siteIds: string[], url: string, params: Record<string, string>): CoreContentLinksAction[] {
|
||||||
return [{
|
return [{
|
||||||
action: async (siteId: string) => {
|
action: async (siteId: string) => {
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
const moduleId = Number(params.id);
|
const moduleId = Number(params.id);
|
||||||
|
|
||||||
|
|
|
@ -20,17 +20,13 @@ import { CoreSharedModule } from '@/core/shared.module';
|
||||||
import { CoreTagComponentsModule } from '@features/tag/components/components.module';
|
import { CoreTagComponentsModule } from '@features/tag/components/components.module';
|
||||||
import { CoreRatingComponentsModule } from '@features/rating/components/components.module';
|
import { CoreRatingComponentsModule } from '@features/rating/components/components.module';
|
||||||
|
|
||||||
import { AddonModForumDiscussionOptionsMenuComponent } from './discussion-options-menu/discussion-options-menu';
|
|
||||||
import { AddonModForumIndexComponent } from './index/index';
|
import { AddonModForumIndexComponent } from './index/index';
|
||||||
import { AddonModForumPostComponent } from './post/post';
|
import { AddonModForumPostComponent } from './post/post';
|
||||||
import { AddonModForumPostOptionsMenuComponent } from './post-options-menu/post-options-menu';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AddonModForumDiscussionOptionsMenuComponent,
|
|
||||||
AddonModForumIndexComponent,
|
AddonModForumIndexComponent,
|
||||||
AddonModForumPostComponent,
|
AddonModForumPostComponent,
|
||||||
AddonModForumPostOptionsMenuComponent,
|
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
CoreSharedModule,
|
CoreSharedModule,
|
||||||
|
|
|
@ -20,6 +20,8 @@ import { CoreEvents } from '@singletons/events';
|
||||||
import { AddonModForum, AddonModForumDiscussion } from '../../services/forum';
|
import { AddonModForum, AddonModForumDiscussion } from '../../services/forum';
|
||||||
import { ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT } from '../../constants';
|
import { ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT } from '../../constants';
|
||||||
import { CoreToasts } from '@services/toasts';
|
import { CoreToasts } from '@services/toasts';
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component is meant to display a popover with the discussion options.
|
* This component is meant to display a popover with the discussion options.
|
||||||
|
@ -27,6 +29,10 @@ import { CoreToasts } from '@services/toasts';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'addon-forum-discussion-options-menu',
|
selector: 'addon-forum-discussion-options-menu',
|
||||||
templateUrl: 'discussion-options-menu.html',
|
templateUrl: 'discussion-options-menu.html',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class AddonModForumDiscussionOptionsMenuComponent implements OnInit {
|
export class AddonModForumDiscussionOptionsMenuComponent implements OnInit {
|
||||||
|
|
||||||
|
@ -62,7 +68,7 @@ export class AddonModForumDiscussionOptionsMenuComponent implements OnInit {
|
||||||
* @param locked True to lock the discussion, false to unlock.
|
* @param locked True to lock the discussion, false to unlock.
|
||||||
*/
|
*/
|
||||||
async setLockState(locked: boolean): Promise<void> {
|
async setLockState(locked: boolean): Promise<void> {
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await AddonModForum.setLockState(this.forumId, this.discussion.discussion, locked);
|
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.
|
* @param pinned True to pin the discussion, false to unpin it.
|
||||||
*/
|
*/
|
||||||
async setPinState(pinned: boolean): Promise<void> {
|
async setPinState(pinned: boolean): Promise<void> {
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await AddonModForum.setPinState(this.discussion.discussion, pinned);
|
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.
|
* @param starred True to star the discussion, false to unstar it.
|
||||||
*/
|
*/
|
||||||
async toggleFavouriteState(starred: boolean): Promise<void> {
|
async toggleFavouriteState(starred: boolean): Promise<void> {
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await AddonModForum.toggleFavouriteState(this.discussion.discussion, starred);
|
await AddonModForum.toggleFavouriteState(this.discussion.discussion, starred);
|
||||||
|
|
|
@ -41,7 +41,6 @@ import { CoreUser } from '@features/user/services/user';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreCourse } from '@features/course/services/course';
|
import { CoreCourse } from '@features/course/services/course';
|
||||||
import { CoreSplitViewComponent } from '@components/split-view/split-view';
|
import { CoreSplitViewComponent } from '@components/split-view/split-view';
|
||||||
import { AddonModForumDiscussionOptionsMenuComponent } from '../discussion-options-menu/discussion-options-menu';
|
|
||||||
import { CoreScreen } from '@services/screen';
|
import { CoreScreen } from '@services/screen';
|
||||||
import { AddonModForumPrefetchHandler } from '../../services/handlers/prefetch';
|
import { AddonModForumPrefetchHandler } from '../../services/handlers/prefetch';
|
||||||
import { CoreRatingProvider } from '@features/rating/services/rating';
|
import { CoreRatingProvider } from '@features/rating/services/rating';
|
||||||
|
@ -66,6 +65,8 @@ import {
|
||||||
} from '@addons/mod/forum/constants';
|
} from '@addons/mod/forum/constants';
|
||||||
import { CoreSearchGlobalSearch } from '@features/search/services/global-search';
|
import { CoreSearchGlobalSearch } from '@features/search/services/global-search';
|
||||||
import { CoreToasts } from '@services/toasts';
|
import { CoreToasts } from '@services/toasts';
|
||||||
|
import { CorePopovers } from '@services/popovers';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
/**
|
/**
|
||||||
* Component that displays a forum entry page.
|
* Component that displays a forum entry page.
|
||||||
*/
|
*/
|
||||||
|
@ -635,7 +636,10 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
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,
|
component: AddonModForumDiscussionOptionsMenuComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
discussion,
|
discussion,
|
||||||
|
@ -666,7 +670,7 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom
|
||||||
* Group has changed.
|
* Group has changed.
|
||||||
*/
|
*/
|
||||||
async groupChanged(): Promise<void> {
|
async groupChanged(): Promise<void> {
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
|
|
|
@ -19,6 +19,7 @@ import { AddonModForum, AddonModForumPost } from '@addons/mod/forum/services/for
|
||||||
import { PopoverController } from '@singletons';
|
import { PopoverController } from '@singletons';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreNetworkError } from '@classes/errors/network-error';
|
import { CoreNetworkError } from '@classes/errors/network-error';
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component is meant to display a popover with the post options.
|
* This component is meant to display a popover with the post options.
|
||||||
|
@ -26,7 +27,11 @@ import { CoreNetworkError } from '@classes/errors/network-error';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'addon-forum-post-options-menu',
|
selector: 'addon-forum-post-options-menu',
|
||||||
templateUrl: 'post-options-menu.html',
|
templateUrl: 'post-options-menu.html',
|
||||||
styleUrls: ['./post-options-menu.scss'],
|
styleUrl: 'post-options-menu.scss',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class AddonModForumPostOptionsMenuComponent implements OnInit {
|
export class AddonModForumPostOptionsMenuComponent implements OnInit {
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,6 @@ import { CoreTextUtils } from '@services/utils/text';
|
||||||
import { AddonModForumHelper } from '../../services/forum-helper';
|
import { AddonModForumHelper } from '../../services/forum-helper';
|
||||||
import { AddonModForumOffline } from '../../services/forum-offline';
|
import { AddonModForumOffline } from '../../services/forum-offline';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { AddonModForumPostOptionsMenuComponent } from '../post-options-menu/post-options-menu';
|
|
||||||
import { CoreRatingInfo } from '@features/rating/services/rating';
|
import { CoreRatingInfo } from '@features/rating/services/rating';
|
||||||
import { CoreForms } from '@singletons/form';
|
import { CoreForms } from '@singletons/form';
|
||||||
import { CoreFileEntry } from '@services/file-helper';
|
import { CoreFileEntry } from '@services/file-helper';
|
||||||
|
@ -55,6 +54,8 @@ import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
||||||
import { ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT, ADDON_MOD_FORUM_COMPONENT } from '../../constants';
|
import { ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT, ADDON_MOD_FORUM_COMPONENT } from '../../constants';
|
||||||
import { CoreToasts } from '@services/toasts';
|
import { CoreToasts } from '@services/toasts';
|
||||||
import { toBoolean } from '@/core/transforms/boolean';
|
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.).
|
* 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 {
|
try {
|
||||||
await CoreDomUtils.showDeleteConfirm('addon.mod_forum.deletesure');
|
await CoreDomUtils.showDeleteConfirm('addon.mod_forum.deletesure');
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.deleting', true);
|
const modal = await CoreLoadings.show('core.deleting', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await AddonModForum.deletePost(this.post.id);
|
const response = await AddonModForum.deletePost(this.post.id);
|
||||||
|
@ -233,7 +234,10 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges
|
||||||
* @param event Click Event.
|
* @param event Click Event.
|
||||||
*/
|
*/
|
||||||
async showOptionsMenu(event: Event): Promise<void> {
|
async showOptionsMenu(event: Event): Promise<void> {
|
||||||
const 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,
|
component: AddonModForumPostOptionsMenuComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
post: this.post,
|
post: this.post,
|
||||||
|
@ -363,7 +367,7 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges
|
||||||
const replyingTo = this.formData.replyingTo!;
|
const replyingTo = this.formData.replyingTo!;
|
||||||
const files = this.formData.files || [];
|
const files = this.formData.files || [];
|
||||||
const isEditOnline = this.formData.id && this.formData.id > 0;
|
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.
|
// Add some HTML to the message if needed.
|
||||||
message = CoreTextUtils.formatHtmlLines(message);
|
message = CoreTextUtils.formatHtmlLines(message);
|
||||||
|
|
|
@ -60,6 +60,7 @@ import {
|
||||||
} from '../../constants';
|
} from '../../constants';
|
||||||
import { CoreCourseContentsPage } from '@features/course/pages/contents/contents';
|
import { CoreCourseContentsPage } from '@features/course/pages/contents/contents';
|
||||||
import { CoreToasts } from '@services/toasts';
|
import { CoreToasts } from '@services/toasts';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
type SortType = 'flat-newest' | 'flat-oldest' | 'nested';
|
type SortType = 'flat-newest' | 'flat-oldest' | 'nested';
|
||||||
|
|
||||||
|
@ -717,7 +718,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await AddonModForum.setLockState(this.forumId, this.discussionId, locked);
|
const response = await AddonModForum.setLockState(this.forumId, this.discussionId, locked);
|
||||||
|
@ -752,7 +753,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await AddonModForum.setPinState(this.discussionId, pinned);
|
await AddonModForum.setPinState(this.discussionId, pinned);
|
||||||
|
@ -788,7 +789,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await AddonModForum.toggleFavouriteState(this.discussionId, starred);
|
await AddonModForum.toggleFavouriteState(this.discussionId, starred);
|
||||||
|
|
|
@ -52,6 +52,7 @@ import {
|
||||||
ADDON_MOD_FORUM_NEW_DISCUSSION_EVENT,
|
ADDON_MOD_FORUM_NEW_DISCUSSION_EVENT,
|
||||||
} from '../../constants';
|
} from '../../constants';
|
||||||
import { CoreCourseContentsPage } from '@features/course/pages/contents/contents';
|
import { CoreCourseContentsPage } from '@features/course/pages/contents/contents';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
type NewDiscussionData = {
|
type NewDiscussionData = {
|
||||||
subject: string;
|
subject: string;
|
||||||
|
@ -549,7 +550,7 @@ export class AddonModForumNewDiscussionPage implements OnInit, OnDestroy, CanLea
|
||||||
return;
|
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.
|
// Add some HTML to the message if needed.
|
||||||
message = CoreTextUtils.formatHtmlLines(message);
|
message = CoreTextUtils.formatHtmlLines(message);
|
||||||
|
|
|
@ -18,7 +18,7 @@ import { CoreContentLinksAction } from '@features/contentlinks/services/contentl
|
||||||
import { CoreCourse } from '@features/course/services/course';
|
import { CoreCourse } from '@features/course/services/course';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreSitesReadingStrategy } from '@services/sites';
|
import { CoreSitesReadingStrategy } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreLoadings } from '@services/loadings';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { ADDON_MOD_FORUM_PAGE_NAME } from '../../constants';
|
import { ADDON_MOD_FORUM_PAGE_NAME } from '../../constants';
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ export class AddonModForumPostLinkHandlerService extends CoreContentLinksHandler
|
||||||
): CoreContentLinksAction[] | Promise<CoreContentLinksAction[]> {
|
): CoreContentLinksAction[] | Promise<CoreContentLinksAction[]> {
|
||||||
return [{
|
return [{
|
||||||
action: async (siteId): Promise<void> => {
|
action: async (siteId): Promise<void> => {
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
const forumId = parseInt(params.forum, 10);
|
const forumId = parseInt(params.forum, 10);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
|
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { AddonModGlossaryIndexComponent } from './index/index';
|
import { AddonModGlossaryIndexComponent } from './index/index';
|
||||||
import { AddonModGlossaryModePickerPopoverComponent } from './mode-picker/mode-picker';
|
|
||||||
import { CoreSharedModule } from '@/core/shared.module';
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
import { CoreCourseComponentsModule } from '@features/course/components/components.module';
|
import { CoreCourseComponentsModule } from '@features/course/components/components.module';
|
||||||
import { CoreSearchComponentsModule } from '@features/search/components/components.module';
|
import { CoreSearchComponentsModule } from '@features/search/components/components.module';
|
||||||
|
@ -22,7 +21,6 @@ import { CoreSearchComponentsModule } from '@features/search/components/componen
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AddonModGlossaryIndexComponent,
|
AddonModGlossaryIndexComponent,
|
||||||
AddonModGlossaryModePickerPopoverComponent,
|
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
CoreSharedModule,
|
CoreSharedModule,
|
||||||
|
@ -31,7 +29,6 @@ import { CoreSearchComponentsModule } from '@features/search/components/componen
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
AddonModGlossaryIndexComponent,
|
AddonModGlossaryIndexComponent,
|
||||||
AddonModGlossaryModePickerPopoverComponent,
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class AddonModGlossaryComponentsModule {}
|
export class AddonModGlossaryComponentsModule {}
|
||||||
|
|
|
@ -50,7 +50,6 @@ import {
|
||||||
GLOSSARY_AUTO_SYNCED,
|
GLOSSARY_AUTO_SYNCED,
|
||||||
} from '../../services/glossary-sync';
|
} from '../../services/glossary-sync';
|
||||||
import { AddonModGlossaryPrefetchHandler } from '../../services/handlers/prefetch';
|
import { AddonModGlossaryPrefetchHandler } from '../../services/handlers/prefetch';
|
||||||
import { AddonModGlossaryModePickerPopoverComponent } from '../mode-picker/mode-picker';
|
|
||||||
import { CoreTime } from '@singletons/time';
|
import { CoreTime } from '@singletons/time';
|
||||||
import {
|
import {
|
||||||
ADDON_MOD_GLOSSARY_COMPONENT,
|
ADDON_MOD_GLOSSARY_COMPONENT,
|
||||||
|
@ -59,6 +58,7 @@ import {
|
||||||
ADDON_MOD_GLOSSARY_ENTRY_UPDATED,
|
ADDON_MOD_GLOSSARY_ENTRY_UPDATED,
|
||||||
ADDON_MOD_GLOSSARY_PAGE_NAME,
|
ADDON_MOD_GLOSSARY_PAGE_NAME,
|
||||||
} from '../../constants';
|
} from '../../constants';
|
||||||
|
import { CorePopovers } from '@services/popovers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component that displays a glossary entry page.
|
* Component that displays a glossary entry page.
|
||||||
|
@ -354,10 +354,11 @@ export class AddonModGlossaryIndexComponent extends CoreCourseModuleMainActivity
|
||||||
if (!this.glossary) {
|
if (!this.glossary) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const { AddonModGlossaryModePickerPopoverComponent } = await import('../mode-picker/mode-picker');
|
||||||
|
|
||||||
const entries = await this.promisedEntries;
|
const entries = await this.promisedEntries;
|
||||||
const previousMode = entries.getSource().fetchMode;
|
const previousMode = entries.getSource().fetchMode;
|
||||||
const newMode = await CoreDomUtils.openPopover<AddonModGlossaryFetchMode>({
|
const newMode = await CorePopovers.open<AddonModGlossaryFetchMode>({
|
||||||
component: AddonModGlossaryModePickerPopoverComponent,
|
component: AddonModGlossaryModePickerPopoverComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
browseModes: this.glossary.browsemodes,
|
browseModes: this.glossary.browsemodes,
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { PopoverController } from '@singletons';
|
import { PopoverController } from '@singletons';
|
||||||
import { AddonModGlossaryFetchMode } from '../../classes/glossary-entries-source';
|
import { AddonModGlossaryFetchMode } from '../../classes/glossary-entries-source';
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component to display the mode picker.
|
* Component to display the mode picker.
|
||||||
|
@ -22,6 +23,10 @@ import { AddonModGlossaryFetchMode } from '../../classes/glossary-entries-source
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'addon-mod-glossary-mode-picker-popover',
|
selector: 'addon-mod-glossary-mode-picker-popover',
|
||||||
templateUrl: 'addon-mod-glossary-mode-picker.html',
|
templateUrl: 'addon-mod-glossary-mode-picker.html',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class AddonModGlossaryModePickerPopoverComponent implements OnInit {
|
export class AddonModGlossaryModePickerPopoverComponent implements OnInit {
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ import { AddonModGlossaryHelper } from '../../services/glossary-helper';
|
||||||
import { AddonModGlossaryOffline } from '../../services/glossary-offline';
|
import { AddonModGlossaryOffline } from '../../services/glossary-offline';
|
||||||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
||||||
import { ADDON_MOD_GLOSSARY_COMPONENT } from '../../constants';
|
import { ADDON_MOD_GLOSSARY_COMPONENT } from '../../constants';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays the edit form.
|
* Page that displays the edit form.
|
||||||
|
@ -211,7 +212,7 @@ export class AddonModGlossaryEditPage implements OnInit, CanLeave {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const savedOnline = await this.handler.save(this.glossary);
|
const savedOnline = await this.handler.save(this.glossary);
|
||||||
|
|
|
@ -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 { 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 { CoreCourseContentsPage } from '@features/course/pages/contents/contents';
|
||||||
import { CoreToasts, ToastDuration } from '@services/toasts';
|
import { CoreToasts, ToastDuration } from '@services/toasts';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays a glossary entry.
|
* Page that displays a glossary entry.
|
||||||
|
@ -191,7 +192,7 @@ export class AddonModGlossaryEntryPage implements OnInit, OnDestroy {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (this.onlineEntry) {
|
if (this.onlineEntry) {
|
||||||
|
|
|
@ -21,6 +21,7 @@ import { CoreSitesReadingStrategy } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { ADDON_MOD_GLOSSARY_PAGE_NAME } from '../../constants';
|
import { ADDON_MOD_GLOSSARY_PAGE_NAME } from '../../constants';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Content links handler for glossary new entry.
|
* 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[] {
|
getActions(siteIds: string[], url: string, params: Record<string, string>): CoreContentLinksAction[] {
|
||||||
return [{
|
return [{
|
||||||
action: async (siteId: string) => {
|
action: async (siteId: string) => {
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
const cmId = Number(params.cmid);
|
const cmId = Number(params.cmid);
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { AddonModGlossary } from '../glossary';
|
import { AddonModGlossary } from '../glossary';
|
||||||
import { ADDON_MOD_GLOSSARY_PAGE_NAME } from '../../constants';
|
import { ADDON_MOD_GLOSSARY_PAGE_NAME } from '../../constants';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler to treat links to glossary entries.
|
* 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[] {
|
getActions(siteIds: string[], url: string, params: Record<string, string>): CoreContentLinksAction[] {
|
||||||
return [{
|
return [{
|
||||||
action: async (siteId: string) => {
|
action: async (siteId: string) => {
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const entryId = params.mode == 'entry' ? Number(params.hook) : Number(params.eid);
|
const entryId = params.mode == 'entry' ? Number(params.hook) : Number(params.eid);
|
||||||
|
|
|
@ -24,6 +24,7 @@ import { CoreUtils } from '@services/utils/utils';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { AddonModH5PActivity } from '../h5pactivity';
|
import { AddonModH5PActivity } from '../h5pactivity';
|
||||||
import { ADDON_MOD_H5PACTIVITY_PAGE_NAME } from '../../constants';
|
import { ADDON_MOD_H5PACTIVITY_PAGE_NAME } from '../../constants';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler to treat links to H5P activity report.
|
* Handler to treat links to H5P activity report.
|
||||||
|
@ -45,7 +46,7 @@ export class AddonModH5PActivityReportLinkHandlerService extends CoreContentLink
|
||||||
): CoreContentLinksAction[] | Promise<CoreContentLinksAction[]> {
|
): CoreContentLinksAction[] | Promise<CoreContentLinksAction[]> {
|
||||||
return [{
|
return [{
|
||||||
action: async (siteId) => {
|
action: async (siteId) => {
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const instanceId = Number(params.a);
|
const instanceId = Number(params.a);
|
||||||
|
|
|
@ -23,6 +23,7 @@ import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { AddonModLesson } from '../lesson';
|
import { AddonModLesson } from '../lesson';
|
||||||
import { ADDON_MOD_LESSON_PAGE_NAME } from '../../constants';
|
import { ADDON_MOD_LESSON_PAGE_NAME } from '../../constants';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler to treat links to lesson grade.
|
* Handler to treat links to lesson grade.
|
||||||
|
@ -55,7 +56,7 @@ export class AddonModLessonGradeLinkHandlerService extends CoreContentLinksModul
|
||||||
const moduleId = Number(params.id);
|
const moduleId = Number(params.id);
|
||||||
const userId = Number(params.userid) || 0;
|
const userId = Number(params.userid) || 0;
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const module = await CoreCourse.getModuleBasicInfo(
|
const module = await CoreCourse.getModuleBasicInfo(
|
||||||
|
|
|
@ -19,7 +19,7 @@ import { CoreContentLinksAction } from '@features/contentlinks/services/contentl
|
||||||
import { CoreCourse } from '@features/course/services/course';
|
import { CoreCourse } from '@features/course/services/course';
|
||||||
import { CoreCourseHelper } from '@features/course/services/course-helper';
|
import { CoreCourseHelper } from '@features/course/services/course-helper';
|
||||||
import { CoreSitesReadingStrategy } from '@services/sites';
|
import { CoreSitesReadingStrategy } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreLoadings } from '@services/loadings';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { AddonModLesson } from '../lesson';
|
import { AddonModLesson } from '../lesson';
|
||||||
|
@ -85,7 +85,7 @@ export class AddonModLessonIndexLinkHandlerService extends CoreContentLinksModul
|
||||||
password: string,
|
password: string,
|
||||||
siteId: string,
|
siteId: string,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Get the module.
|
// Get the module.
|
||||||
|
|
|
@ -22,6 +22,7 @@ import { CoreSitesReadingStrategy } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { ADDON_MOD_LESSON_PAGE_NAME } from '../../constants';
|
import { ADDON_MOD_LESSON_PAGE_NAME } from '../../constants';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler to treat links to lesson report.
|
* 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> {
|
protected async openReportOverview(moduleId: number, groupId?: number, siteId?: string): Promise<void> {
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Get the module object.
|
// Get the module object.
|
||||||
|
@ -132,7 +133,7 @@ export class AddonModLessonReportLinkHandlerService extends CoreContentLinksHand
|
||||||
siteId: string,
|
siteId: string,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Get the module object.
|
// Get the module object.
|
||||||
|
|
|
@ -23,6 +23,7 @@ import { makeSingleton } from '@singletons';
|
||||||
import { CoreEvents } from '@singletons/events';
|
import { CoreEvents } from '@singletons/events';
|
||||||
import { AddonModLti, AddonModLtiLti } from './lti';
|
import { AddonModLti, AddonModLtiLti } from './lti';
|
||||||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Service that provides some helper functions for LTI.
|
* 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> {
|
async getDataAndLaunch(courseId: number, module: CoreCourseModuleData, lti?: AddonModLtiLti, siteId?: string): Promise<void> {
|
||||||
siteId = siteId || CoreSites.getCurrentSiteId();
|
siteId = siteId || CoreSites.getCurrentSiteId();
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const openInBrowser = await AddonModLti.shouldLaunchInBrowser(siteId);
|
const openInBrowser = await AddonModLti.shouldLaunchInBrowser(siteId);
|
||||||
|
|
|
@ -17,9 +17,8 @@ import { BehaviorSubject } from 'rxjs';
|
||||||
import { CoreQuestionHelper } from '@features/question/services/question-helper';
|
import { CoreQuestionHelper } from '@features/question/services/question-helper';
|
||||||
import { CoreQuestionsAnswers } from '@features/question/services/question';
|
import { CoreQuestionsAnswers } from '@features/question/services/question';
|
||||||
import { CoreLogger } from '@singletons/logger';
|
import { CoreLogger } from '@singletons/logger';
|
||||||
import { AddonModQuizConnectionErrorComponent } from '../components/connection-error/connection-error';
|
|
||||||
import { AddonModQuiz, AddonModQuizAttemptWSData, AddonModQuizQuizWSData } from '../services/quiz';
|
import { AddonModQuiz, AddonModQuizAttemptWSData, AddonModQuizQuizWSData } from '../services/quiz';
|
||||||
import { 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
|
* 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.popoverShown = true;
|
||||||
|
|
||||||
this.popover = await CoreDomUtils.openPopoverWithoutResult({
|
const { AddonModQuizConnectionErrorComponent } = await import('../components/connection-error/connection-error');
|
||||||
|
|
||||||
|
this.popover = await CorePopovers.openWithoutResult({
|
||||||
component: AddonModQuizConnectionErrorComponent,
|
component: AddonModQuizConnectionErrorComponent,
|
||||||
event: <Event> event,
|
event: <Event> event,
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,7 +16,6 @@ import { NgModule } from '@angular/core';
|
||||||
|
|
||||||
import { CoreSharedModule } from '@/core/shared.module';
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
import { CoreCourseComponentsModule } from '@features/course/components/components.module';
|
import { CoreCourseComponentsModule } from '@features/course/components/components.module';
|
||||||
import { AddonModQuizConnectionErrorComponent } from './connection-error/connection-error';
|
|
||||||
import { AddonModQuizIndexComponent } from './index/index';
|
import { AddonModQuizIndexComponent } from './index/index';
|
||||||
import { AddonModQuizAttemptInfoComponent } from './attempt-info/attempt-info';
|
import { AddonModQuizAttemptInfoComponent } from './attempt-info/attempt-info';
|
||||||
import { AddonModQuizAttemptStateComponent } from './attempt-state/attempt-state';
|
import { AddonModQuizAttemptStateComponent } from './attempt-state/attempt-state';
|
||||||
|
@ -27,7 +26,6 @@ import { AddonModQuizQuestionCardComponent } from './question-card/question-card
|
||||||
AddonModQuizAttemptInfoComponent,
|
AddonModQuizAttemptInfoComponent,
|
||||||
AddonModQuizAttemptStateComponent,
|
AddonModQuizAttemptStateComponent,
|
||||||
AddonModQuizIndexComponent,
|
AddonModQuizIndexComponent,
|
||||||
AddonModQuizConnectionErrorComponent,
|
|
||||||
AddonModQuizQuestionCardComponent,
|
AddonModQuizQuestionCardComponent,
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -38,7 +36,6 @@ import { AddonModQuizQuestionCardComponent } from './question-card/question-card
|
||||||
AddonModQuizAttemptInfoComponent,
|
AddonModQuizAttemptInfoComponent,
|
||||||
AddonModQuizAttemptStateComponent,
|
AddonModQuizAttemptStateComponent,
|
||||||
AddonModQuizIndexComponent,
|
AddonModQuizIndexComponent,
|
||||||
AddonModQuizConnectionErrorComponent,
|
|
||||||
AddonModQuizQuestionCardComponent,
|
AddonModQuizQuestionCardComponent,
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,7 +21,11 @@ import { Component } from '@angular/core';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'addon-mod-quiz-connection-error',
|
selector: 'addon-mod-quiz-connection-error',
|
||||||
templateUrl: 'connection-error.html',
|
templateUrl: 'connection-error.html',
|
||||||
styleUrls: ['connection-error.scss'],
|
styleUrl: 'connection-error.scss',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class AddonModQuizConnectionErrorComponent {
|
export class AddonModQuizConnectionErrorComponent {
|
||||||
|
|
||||||
|
|
|
@ -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 { ADDON_MOD_QUIZ_ATTEMPT_FINISHED_EVENT, AddonModQuizAttemptStates, ADDON_MOD_QUIZ_COMPONENT } from '../../constants';
|
||||||
import { CoreWait } from '@singletons/wait';
|
import { CoreWait } from '@singletons/wait';
|
||||||
import { CoreModals } from '@services/modals';
|
import { CoreModals } from '@services/modals';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that allows attempting a quiz.
|
* Page that allows attempting a quiz.
|
||||||
|
@ -166,7 +167,7 @@ export class AddonModQuizPlayerPage implements OnInit, OnDestroy, CanLeave {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save answers.
|
// Save answers.
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.processAttempt(false, false);
|
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.
|
// Confirm that the user really wants to do it.
|
||||||
await CoreDomUtils.showConfirm(Translate.instant('core.areyousure'));
|
await CoreDomUtils.showConfirm(Translate.instant('core.areyousure'));
|
||||||
|
|
||||||
modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
// Get the answers.
|
// Get the answers.
|
||||||
const answers = await this.prepareAnswers(this.quiz.coursemodule);
|
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.
|
// First try to save the attempt data. We only save it if we're not seeing the summary.
|
||||||
if (!this.showSummary) {
|
if (!this.showSummary) {
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.processAttempt(false, false);
|
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);
|
await this.processAttempt(userFinish, timeUp);
|
||||||
|
|
||||||
|
@ -719,7 +720,7 @@ export class AddonModQuizPlayerPage implements OnInit, OnDestroy, CanLeave {
|
||||||
|
|
||||||
if (this.reloadNavigation) {
|
if (this.reloadNavigation) {
|
||||||
// Some data has changed, reload the navigation.
|
// Some data has changed, reload the navigation.
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
await CoreUtils.ignoreErrors(this.loadNavigation());
|
await CoreUtils.ignoreErrors(this.loadNavigation());
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ import { QuestionDisplayOptionsMarks } from '@features/question/constants';
|
||||||
import { CoreGroups } from '@services/groups';
|
import { CoreGroups } from '@services/groups';
|
||||||
import { CoreTimeUtils } from '@services/utils/time';
|
import { CoreTimeUtils } from '@services/utils/time';
|
||||||
import { CoreModals } from '@services/modals';
|
import { CoreModals } from '@services/modals';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper service that provides some features for quiz.
|
* 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> {
|
async handleReviewLink(attemptId: number, page?: number, quizId?: number, siteId?: string): Promise<void> {
|
||||||
siteId = siteId || CoreSites.getCurrentSiteId();
|
siteId = siteId || CoreSites.getCurrentSiteId();
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!quizId) {
|
if (!quizId) {
|
||||||
|
|
|
@ -32,6 +32,7 @@ import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
||||||
import { CoreTextUtils } from '@services/utils/text';
|
import { CoreTextUtils } from '@services/utils/text';
|
||||||
import { CoreTimeUtils } from '@services/utils/time';
|
import { CoreTimeUtils } from '@services/utils/time';
|
||||||
import { ADDON_MOD_RESOURCE_COMPONENT } from '../constants';
|
import { ADDON_MOD_RESOURCE_COMPONENT } from '../constants';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Service that provides helper functions for resources.
|
* Service that provides helper functions for resources.
|
||||||
|
@ -190,7 +191,7 @@ export class AddonModResourceHelperProvider {
|
||||||
* @returns Resolved when done.
|
* @returns Resolved when done.
|
||||||
*/
|
*/
|
||||||
async openModuleFile(module: CoreCourseModuleData, courseId: number, options: CoreUtilsOpenFileOptions = {}): Promise<void> {
|
async openModuleFile(module: CoreCourseModuleData, courseId: number, options: CoreUtilsOpenFileOptions = {}): Promise<void> {
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Download and open the file from the resource contents.
|
// Download and open the file from the resource contents.
|
||||||
|
|
|
@ -38,6 +38,7 @@ import {
|
||||||
} from '../../services/survey-sync';
|
} from '../../services/survey-sync';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { ADDON_MOD_SURVEY_AUTO_SYNCED, ADDON_MOD_SURVEY_COMPONENT } from '../../constants';
|
import { ADDON_MOD_SURVEY_AUTO_SYNCED, ADDON_MOD_SURVEY_COMPONENT } from '../../constants';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component that displays a survey.
|
* Component that displays a survey.
|
||||||
|
@ -197,7 +198,7 @@ export class AddonModSurveyIndexComponent extends CoreCourseModuleMainActivityCo
|
||||||
await CoreDomUtils.showConfirm(Translate.instant('core.areyousure'));
|
await CoreDomUtils.showConfirm(Translate.instant('core.areyousure'));
|
||||||
|
|
||||||
const answers: AddonModSurveySubmitAnswerData[] = [];
|
const answers: AddonModSurveySubmitAnswerData[] = [];
|
||||||
modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
for (const x in this.answers) {
|
for (const x in this.answers) {
|
||||||
answers.push({
|
answers.push({
|
||||||
|
|
|
@ -20,7 +20,7 @@ import { CoreCourse, CoreCourseModuleContentFile } from '@features/course/servic
|
||||||
import { CoreCourseModuleData } from '@features/course/services/course-helper';
|
import { CoreCourseModuleData } from '@features/course/services/course-helper';
|
||||||
import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@features/course/services/module-delegate';
|
import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@features/course/services/module-delegate';
|
||||||
import { CoreNavigationOptions } from '@services/navigator';
|
import { CoreNavigationOptions } from '@services/navigator';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreLoadings } from '@services/loadings';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { AddonModUrl } from '../url';
|
import { AddonModUrl } from '../url';
|
||||||
|
@ -82,7 +82,7 @@ export class AddonModUrlModuleHandlerService extends CoreModuleHandlerBase imple
|
||||||
class: 'addon-mod_url-handler',
|
class: 'addon-mod_url-handler',
|
||||||
showDownloadButton: false,
|
showDownloadButton: false,
|
||||||
action: async (event: Event, module: CoreCourseModuleData, courseId: number, options?: CoreNavigationOptions) => {
|
action: async (event: Event, module: CoreCourseModuleData, courseId: number, options?: CoreNavigationOptions) => {
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const shouldOpen = await this.shouldOpenLink(module);
|
const shouldOpen = await this.shouldOpenLink(module);
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,7 +29,7 @@ export class AddonModUrlHelperProvider {
|
||||||
* @param url The URL to go to.
|
* @param url The URL to go to.
|
||||||
*/
|
*/
|
||||||
async open(url: string): Promise<void> {
|
async open(url: string): Promise<void> {
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await CoreSites.visitLink(url, {
|
await CoreSites.visitLink(url, {
|
||||||
|
|
|
@ -59,6 +59,7 @@ import {
|
||||||
ADDON_MOD_WIKI_PAGE_NAME,
|
ADDON_MOD_WIKI_PAGE_NAME,
|
||||||
} from '../../constants';
|
} from '../../constants';
|
||||||
import { CoreModals } from '@services/modals';
|
import { CoreModals } from '@services/modals';
|
||||||
|
import { CorePopovers } from '@services/popovers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component that displays a wiki entry page.
|
* Component that displays a wiki entry page.
|
||||||
|
@ -887,7 +888,7 @@ export class AddonModWikiIndexComponent extends CoreCourseModuleMainActivityComp
|
||||||
async showSubwikiPicker(event: MouseEvent): Promise<void> {
|
async showSubwikiPicker(event: MouseEvent): Promise<void> {
|
||||||
const { AddonModWikiSubwikiPickerComponent } = await import('../subwiki-picker/subwiki-picker');
|
const { AddonModWikiSubwikiPickerComponent } = await import('../subwiki-picker/subwiki-picker');
|
||||||
|
|
||||||
const subwiki = await CoreDomUtils.openPopover<AddonModWikiSubwiki>({
|
const subwiki = await CorePopovers.open<AddonModWikiSubwiki>({
|
||||||
component: AddonModWikiSubwikiPickerComponent,
|
component: AddonModWikiSubwikiPickerComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
courseId: this.courseId,
|
courseId: this.courseId,
|
||||||
|
|
|
@ -32,6 +32,7 @@ import { AddonModWikiOffline } from '../../services/wiki-offline';
|
||||||
import { AddonModWikiSync } from '../../services/wiki-sync';
|
import { AddonModWikiSync } from '../../services/wiki-sync';
|
||||||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
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 { 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.
|
* Page that allows adding or editing a wiki page.
|
||||||
|
@ -362,7 +363,7 @@ export class AddonModWikiEditPage implements OnInit, OnDestroy, CanLeave {
|
||||||
const title = values.title;
|
const title = values.title;
|
||||||
let text = values.text ?? '';
|
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.restorePluginfileUrls(text, this.subwikiFiles);
|
||||||
text = CoreTextUtils.formatHtmlLines(text);
|
text = CoreTextUtils.formatHtmlLines(text);
|
||||||
|
|
|
@ -22,6 +22,7 @@ import { makeSingleton } from '@singletons';
|
||||||
import { AddonModWiki } from '../wiki';
|
import { AddonModWiki } from '../wiki';
|
||||||
import { ADDON_MOD_WIKI_PAGE_NAME } from '../../constants';
|
import { ADDON_MOD_WIKI_PAGE_NAME } from '../../constants';
|
||||||
import { AddonModWikiCreateLinkHandlerService } from '@addons/mod/wiki/services/handlers/create-link';
|
import { AddonModWikiCreateLinkHandlerService } from '@addons/mod/wiki/services/handlers/create-link';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler to treat links to create a wiki page.
|
* Handler to treat links to create a wiki page.
|
||||||
|
@ -84,7 +85,7 @@ export class AddonModWikiCreateLinkHandlerLazyService extends AddonModWikiCreate
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
async handleAction(siteId: string, courseId: number, params: Record<string, string>): Promise<void> {
|
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');
|
const { AddonModWikiIndexPage } = await import('../../pages/index');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -21,6 +21,7 @@ import { makeSingleton } from '@singletons';
|
||||||
import { AddonModWiki } from '../wiki';
|
import { AddonModWiki } from '../wiki';
|
||||||
import { ADDON_MOD_WIKI_PAGE_NAME } from '../../constants';
|
import { ADDON_MOD_WIKI_PAGE_NAME } from '../../constants';
|
||||||
import { AddonModWikiEditLinkHandlerService } from '@addons/mod/wiki/services/handlers/edit-link';
|
import { AddonModWikiEditLinkHandlerService } from '@addons/mod/wiki/services/handlers/edit-link';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler to treat links to edit a wiki page.
|
* Handler to treat links to edit a wiki page.
|
||||||
|
@ -32,7 +33,7 @@ export class AddonModWikiEditLinkHandlerLazyService extends AddonModWikiEditLink
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
async handleAction(siteId: string, params: Record<string, string>): Promise<void> {
|
async handleAction(siteId: string, params: Record<string, string>): Promise<void> {
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const pageId = Number(params.pageid);
|
const pageId = Number(params.pageid);
|
||||||
|
|
|
@ -22,6 +22,7 @@ import { Md5 } from 'ts-md5';
|
||||||
import { AddonModWiki } from '../wiki';
|
import { AddonModWiki } from '../wiki';
|
||||||
import { ADDON_MOD_WIKI_PAGE_NAME } from '../../constants';
|
import { ADDON_MOD_WIKI_PAGE_NAME } from '../../constants';
|
||||||
import { AddonModWikiPageOrMapLinkHandlerService } from '@addons/mod/wiki/services/handlers/page-or-map-link';
|
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.
|
* Handler to treat links to a wiki page or the wiki map.
|
||||||
|
@ -33,7 +34,7 @@ export class AddonModWikiPageOrMapLinkHandlerLazyService extends AddonModWikiPag
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
async handleAction(url: string, siteId: string, params: Record<string, string>): Promise<void> {
|
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 pageId = parseInt(params.pageid, 10);
|
||||||
const action = url.indexOf('mod/wiki/map.php') != -1 ? 'map' : 'page';
|
const action = url.indexOf('mod/wiki/map.php') != -1 ? 'map' : 'page';
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ import {
|
||||||
AddonModWorkshopOverallFeedbackMode,
|
AddonModWorkshopOverallFeedbackMode,
|
||||||
} from '@addons/mod/workshop/constants';
|
} from '@addons/mod/workshop/constants';
|
||||||
import { toBoolean } from '@/core/transforms/boolean';
|
import { toBoolean } from '@/core/transforms/boolean';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component that displays workshop assessment strategy form.
|
* Component that displays workshop assessment strategy form.
|
||||||
|
@ -302,7 +303,7 @@ export class AddonModWorkshopAssessmentStrategyComponent implements OnInit, OnDe
|
||||||
let saveOffline = false;
|
let saveOffline = false;
|
||||||
let allowOffline = !files.length;
|
let allowOffline = !files.length;
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
this.data.fieldErrors = {};
|
this.data.fieldErrors = {};
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ import {
|
||||||
AddonModWorkshopSubmissionDataWithOfflineData,
|
AddonModWorkshopSubmissionDataWithOfflineData,
|
||||||
} from '../../services/workshop-helper';
|
} from '../../services/workshop-helper';
|
||||||
import { AddonModWorkshopOffline } from '../../services/workshop-offline';
|
import { AddonModWorkshopOffline } from '../../services/workshop-offline';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component that displays workshop assessment.
|
* Component that displays workshop assessment.
|
||||||
|
@ -123,7 +124,7 @@ export class AddonModWorkshopAssessmentComponent implements OnInit {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!this.submission) {
|
if (!this.submission) {
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
params.submission = await AddonModWorkshopHelper.getSubmissionById(
|
params.submission = await AddonModWorkshopHelper.getSubmissionById(
|
||||||
|
|
|
@ -44,6 +44,7 @@ import {
|
||||||
ADDON_MOD_WORKSHOP_COMPONENT,
|
ADDON_MOD_WORKSHOP_COMPONENT,
|
||||||
AddonModWorkshopPhase,
|
AddonModWorkshopPhase,
|
||||||
} from '@addons/mod/workshop/constants';
|
} from '@addons/mod/workshop/constants';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays a workshop assessment.
|
* Page that displays a workshop assessment.
|
||||||
|
@ -372,7 +373,7 @@ export class AddonModWorkshopAssessmentPage implements OnInit, OnDestroy, CanLea
|
||||||
* @returns Resolved when done.
|
* @returns Resolved when done.
|
||||||
*/
|
*/
|
||||||
protected async sendEvaluation(): Promise<void> {
|
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 inputData: AddonModWorkshopAssessmentEvaluation = this.evaluateForm.value;
|
||||||
|
|
||||||
const grade = inputData.grade >= 0 ? String(inputData.grade) : '';
|
const grade = inputData.grade >= 0 ? String(inputData.grade) : '';
|
||||||
|
|
|
@ -44,6 +44,7 @@ import {
|
||||||
AddonModWorkshopAction,
|
AddonModWorkshopAction,
|
||||||
AddonModWorkshopSubmissionType,
|
AddonModWorkshopSubmissionType,
|
||||||
} from '@addons/mod/workshop/constants';
|
} from '@addons/mod/workshop/constants';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays the workshop edit submission.
|
* Page that displays the workshop edit submission.
|
||||||
|
@ -353,7 +354,7 @@ export class AddonModWorkshopEditSubmissionPage implements OnInit, OnDestroy, Ca
|
||||||
|
|
||||||
let saveOffline = false;
|
let saveOffline = false;
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
const submissionId = this.submission?.id;
|
const submissionId = this.submission?.id;
|
||||||
|
|
||||||
// Add some HTML to the message if needed.
|
// Add some HTML to the message if needed.
|
||||||
|
|
|
@ -55,6 +55,7 @@ import {
|
||||||
AddonModWorkshopAction,
|
AddonModWorkshopAction,
|
||||||
AddonModWorkshopPhase,
|
AddonModWorkshopPhase,
|
||||||
} from '@addons/mod/workshop/constants';
|
} from '@addons/mod/workshop/constants';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays a workshop submission.
|
* Page that displays a workshop submission.
|
||||||
|
@ -510,7 +511,7 @@ export class AddonModWorkshopSubmissionPage implements OnInit, OnDestroy, CanLea
|
||||||
* @returns Resolved when done.
|
* @returns Resolved when done.
|
||||||
*/
|
*/
|
||||||
protected async sendEvaluation(): Promise<void> {
|
protected async sendEvaluation(): Promise<void> {
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
const inputData: {
|
const inputData: {
|
||||||
grade: number | string;
|
grade: number | string;
|
||||||
|
@ -559,7 +560,7 @@ export class AddonModWorkshopSubmissionPage implements OnInit, OnDestroy, CanLea
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.deleting', true);
|
const modal = await CoreLoadings.show('core.deleting', true);
|
||||||
|
|
||||||
let success = false;
|
let success = false;
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -21,6 +21,7 @@ import { ModalController } from '@singletons';
|
||||||
import { CoreKeyboard } from '@singletons/keyboard';
|
import { CoreKeyboard } from '@singletons/keyboard';
|
||||||
import { CoreSharedModule } from '@/core/shared.module';
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
import { CoreToasts, ToastDuration } from '@services/toasts';
|
import { CoreToasts, ToastDuration } from '@services/toasts';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component that displays a text area for composing a note.
|
* Component that displays a text area for composing a note.
|
||||||
|
@ -52,7 +53,7 @@ export class AddonNotesAddComponent {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
CoreKeyboard.close();
|
CoreKeyboard.close();
|
||||||
const loadingModal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const loadingModal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
// Freeze the add note button.
|
// Freeze the add note button.
|
||||||
this.processing = true;
|
this.processing = true;
|
||||||
|
|
|
@ -40,6 +40,7 @@ import { CoreTime } from '@singletons/time';
|
||||||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
||||||
import { Translate } from '@singletons';
|
import { Translate } from '@singletons';
|
||||||
import { CoreTextUtils } from '@services/utils/text';
|
import { CoreTextUtils } from '@services/utils/text';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays notifications settings.
|
* Page that displays notifications settings.
|
||||||
|
@ -311,7 +312,7 @@ export class AddonNotificationsSettingsPage implements OnInit, OnDestroy {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
CoreUser.updateUserPreferences([], !enable);
|
CoreUser.updateUserPreferences([], !enable);
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreTextUtils } from '@services/utils/text';
|
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { makeSingleton } from '@singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { CorePushNotificationsClickHandler } from '@features/pushnotifications/services/push-delegate';
|
import { CorePushNotificationsClickHandler } from '@features/pushnotifications/services/push-delegate';
|
||||||
|
@ -24,6 +23,7 @@ import { CoreContentLinksHelper } from '@features/contentlinks/services/contentl
|
||||||
import { AddonNotifications } from '../notifications';
|
import { AddonNotifications } from '../notifications';
|
||||||
import { AddonNotificationsMainMenuHandlerService } from './mainmenu';
|
import { AddonNotificationsMainMenuHandlerService } from './mainmenu';
|
||||||
import { AddonNotificationsHelper } from '../notifications-helper';
|
import { AddonNotificationsHelper } from '../notifications-helper';
|
||||||
|
import { CoreViewer } from '@features/viewer/services/viewer';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler for non-messaging push notifications clicks.
|
* Handler for non-messaging push notifications clicks.
|
||||||
|
@ -77,7 +77,7 @@ export class AddonNotificationsPushClickHandlerService implements CorePushNotifi
|
||||||
|
|
||||||
if (notification.customdata?.extendedtext) {
|
if (notification.customdata?.extendedtext) {
|
||||||
// Display the text in a modal.
|
// 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,
|
displayCopyButton: true,
|
||||||
modalOptions: { cssClass: 'core-modal-fullscreen' },
|
modalOptions: { cssClass: 'core-modal-fullscreen' },
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
import { CoreSites } from '@services/sites';
|
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 { CoreFileUploaderHelper } from '@features/fileuploader/services/fileuploader-helper';
|
||||||
import { AddonPrivateFiles, AddonPrivateFilesGetUserInfoWSResult } from './privatefiles';
|
import { AddonPrivateFiles, AddonPrivateFilesGetUserInfoWSResult } from './privatefiles';
|
||||||
import { CoreError } from '@classes/errors/error';
|
import { CoreError } from '@classes/errors/error';
|
||||||
|
@ -60,7 +60,7 @@ export class AddonPrivateFilesHelperProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
// File uploaded. Move it to private files.
|
// 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 {
|
try {
|
||||||
await AddonPrivateFiles.moveFromDraftToPrivate(result.itemid);
|
await AddonPrivateFiles.moveFromDraftToPrivate(result.itemid);
|
||||||
|
|
|
@ -21,6 +21,7 @@ import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { makeSingleton, Translate } from '@singletons';
|
import { makeSingleton, Translate } from '@singletons';
|
||||||
import { AddonReportInsights } from '../insights';
|
import { AddonReportInsights } from '../insights';
|
||||||
import { CoreToasts } from '@services/toasts';
|
import { CoreToasts } from '@services/toasts';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
// Bulk actions supported, along with the related lang string.
|
// Bulk actions supported, along with the related lang string.
|
||||||
const BULK_ACTIONS = {
|
const BULK_ACTIONS = {
|
||||||
|
@ -51,7 +52,7 @@ export class AddonReportInsightsActionLinkHandlerService extends CoreContentLink
|
||||||
return [{
|
return [{
|
||||||
action: async (siteId?: string): Promise<void> => {
|
action: async (siteId?: string): Promise<void> => {
|
||||||
// Send the action.
|
// Send the action.
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const modal = await CoreLoadings.show('core.sending', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await AddonReportInsights.sendActionExecuted(params.action, [Number(params.predictionid)], siteId);
|
await AddonReportInsights.sendActionExecuted(params.action, [Number(params.predictionid)], siteId);
|
||||||
|
|
|
@ -26,6 +26,7 @@ import {
|
||||||
CoreCourseModulePrefetchHandler } from '@features/course/services/module-prefetch-delegate';
|
CoreCourseModulePrefetchHandler } from '@features/course/services/module-prefetch-delegate';
|
||||||
import { CoreCourseAnyCourseData, CoreCourses } from '@features/courses/services/courses';
|
import { CoreCourseAnyCourseData, CoreCourses } from '@features/courses/services/courses';
|
||||||
import { AccordionGroupChangeEventDetail, IonAccordionGroup } from '@ionic/angular';
|
import { AccordionGroupChangeEventDetail, IonAccordionGroup } from '@ionic/angular';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
|
@ -469,7 +470,7 @@ export class AddonStorageManagerCourseStoragePage implements OnInit, OnDestroy {
|
||||||
* @returns Promise<void> Once deleting has finished
|
* @returns Promise<void> Once deleting has finished
|
||||||
*/
|
*/
|
||||||
protected async deleteModules(modules: AddonStorageManagerModule[], section?: AddonStorageManagerCourseSection): Promise<void> {
|
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>[] = [];
|
const promises: Promise<void>[] = [];
|
||||||
modules.forEach((module) => {
|
modules.forEach((module) => {
|
||||||
|
|
|
@ -21,6 +21,7 @@ import { CoreCourseModulePrefetchDelegate } from '@features/course/services/modu
|
||||||
import { CoreCourses, CoreEnrolledCourseData } from '@features/courses/services/courses';
|
import { CoreCourses, CoreEnrolledCourseData } from '@features/courses/services/courses';
|
||||||
import { CoreSettingsHelper, CoreSiteSpaceUsage } from '@features/settings/services/settings-helper';
|
import { CoreSettingsHelper, CoreSiteSpaceUsage } from '@features/settings/services/settings-helper';
|
||||||
import { CoreSiteHome } from '@features/sitehome/services/sitehome';
|
import { CoreSiteHome } from '@features/sitehome/services/sitehome';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
|
@ -121,7 +122,7 @@ export class AddonStorageManagerCoursesStoragePage implements OnInit, OnDestroy
|
||||||
return;
|
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);
|
const deletedCourseIds = this.completelyDownloadedCourses.map((course) => course.id);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -160,7 +161,7 @@ export class AddonStorageManagerCoursesStoragePage implements OnInit, OnDestroy
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.deleting', true);
|
const modal = await CoreLoadings.show('core.deleting', true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await CoreCourseHelper.deleteCourseFiles(course.id);
|
await CoreCourseHelper.deleteCourseFiles(course.id);
|
||||||
|
|
|
@ -55,6 +55,7 @@ import { CoreSiteInfo } from './unauthenticated-site';
|
||||||
import { CoreAuthenticatedSite, CoreAuthenticatedSiteOptionalData, CoreSiteWSPreSets, WSObservable } from './authenticated-site';
|
import { CoreAuthenticatedSite, CoreAuthenticatedSiteOptionalData, CoreSiteWSPreSets, WSObservable } from './authenticated-site';
|
||||||
import { firstValueFrom } from 'rxjs';
|
import { firstValueFrom } from 'rxjs';
|
||||||
import { CorePlatform } from '@services/platform';
|
import { CorePlatform } from '@services/platform';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class that represents a site (combination of site + user).
|
* Class that represents a site (combination of site + user).
|
||||||
|
@ -703,7 +704,7 @@ export class CoreSite extends CoreAuthenticatedSite {
|
||||||
let modal: CoreIonLoadingElement | undefined;
|
let modal: CoreIonLoadingElement | undefined;
|
||||||
|
|
||||||
if (showModal) {
|
if (showModal) {
|
||||||
modal = await CoreDomUtils.showModalLoading();
|
modal = await CoreLoadings.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -27,7 +27,6 @@ import { CoreChartComponent } from './chart/chart';
|
||||||
import { CoreChronoComponent } from './chrono/chrono';
|
import { CoreChronoComponent } from './chrono/chrono';
|
||||||
import { CoreContextMenuComponent } from './context-menu/context-menu';
|
import { CoreContextMenuComponent } from './context-menu/context-menu';
|
||||||
import { CoreContextMenuItemComponent } from './context-menu/context-menu-item';
|
import { CoreContextMenuItemComponent } from './context-menu/context-menu-item';
|
||||||
import { CoreContextMenuPopoverComponent } from './context-menu/context-menu-popover';
|
|
||||||
import { CoreDownloadRefreshComponent } from './download-refresh/download-refresh';
|
import { CoreDownloadRefreshComponent } from './download-refresh/download-refresh';
|
||||||
import { CoreDynamicComponent } from './dynamic-component/dynamic-component';
|
import { CoreDynamicComponent } from './dynamic-component/dynamic-component';
|
||||||
import { CoreEmptyBoxComponent } from './empty-box/empty-box';
|
import { CoreEmptyBoxComponent } from './empty-box/empty-box';
|
||||||
|
@ -88,7 +87,6 @@ export async function getCoreStandaloneComponents(): Promise<Type<unknown>[]> {
|
||||||
CoreChronoComponent,
|
CoreChronoComponent,
|
||||||
CoreContextMenuComponent,
|
CoreContextMenuComponent,
|
||||||
CoreContextMenuItemComponent,
|
CoreContextMenuItemComponent,
|
||||||
CoreContextMenuPopoverComponent,
|
|
||||||
CoreCourseImageComponent,
|
CoreCourseImageComponent,
|
||||||
CoreDownloadRefreshComponent,
|
CoreDownloadRefreshComponent,
|
||||||
CoreDynamicComponent,
|
CoreDynamicComponent,
|
||||||
|
@ -141,7 +139,6 @@ export async function getCoreStandaloneComponents(): Promise<Type<unknown>[]> {
|
||||||
CoreChronoComponent,
|
CoreChronoComponent,
|
||||||
CoreContextMenuComponent,
|
CoreContextMenuComponent,
|
||||||
CoreContextMenuItemComponent,
|
CoreContextMenuItemComponent,
|
||||||
CoreContextMenuPopoverComponent,
|
|
||||||
CoreCourseImageComponent,
|
CoreCourseImageComponent,
|
||||||
CoreDownloadRefreshComponent,
|
CoreDownloadRefreshComponent,
|
||||||
CoreDynamicComponent,
|
CoreDynamicComponent,
|
||||||
|
|
|
@ -17,6 +17,7 @@ import { Component } from '@angular/core';
|
||||||
import { NavParams } from '@ionic/angular';
|
import { NavParams } from '@ionic/angular';
|
||||||
import { PopoverController } from '@singletons';
|
import { PopoverController } from '@singletons';
|
||||||
import { CoreContextMenuItemComponent } from './context-menu-item';
|
import { CoreContextMenuItemComponent } from './context-menu-item';
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component to display a list of items received by param in a popover.
|
* Component to display a list of items received by param in a popover.
|
||||||
|
@ -24,7 +25,11 @@ import { CoreContextMenuItemComponent } from './context-menu-item';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'core-context-menu-popover',
|
selector: 'core-context-menu-popover',
|
||||||
templateUrl: 'core-context-menu-popover.html',
|
templateUrl: 'core-context-menu-popover.html',
|
||||||
styleUrls: ['context-menu-popover.scss'],
|
styleUrl: 'context-menu-popover.scss',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class CoreContextMenuPopoverComponent {
|
export class CoreContextMenuPopoverComponent {
|
||||||
|
|
||||||
|
|
|
@ -15,11 +15,10 @@
|
||||||
import { Component, Input, OnInit, OnDestroy, ElementRef, ChangeDetectorRef } from '@angular/core';
|
import { Component, Input, OnInit, OnDestroy, ElementRef, ChangeDetectorRef } from '@angular/core';
|
||||||
import { Subject, Subscription } from 'rxjs';
|
import { Subject, Subscription } from 'rxjs';
|
||||||
import { auditTime } from 'rxjs/operators';
|
import { auditTime } from 'rxjs/operators';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CorePopovers } from '@services/popovers';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { Translate } from '@singletons';
|
import { Translate } from '@singletons';
|
||||||
import { CoreContextMenuItemComponent } from './context-menu-item';
|
import { CoreContextMenuItemComponent } from './context-menu-item';
|
||||||
import { CoreContextMenuPopoverComponent } from './context-menu-popover';
|
|
||||||
import { CoreDirectivesRegistry } from '@singletons/directives-registry';
|
import { CoreDirectivesRegistry } from '@singletons/directives-registry';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -183,7 +182,9 @@ export class CoreContextMenuComponent implements OnInit, OnDestroy {
|
||||||
if (!this.expanded) {
|
if (!this.expanded) {
|
||||||
this.expanded = true;
|
this.expanded = true;
|
||||||
|
|
||||||
const popoverData = await CoreDomUtils.openPopover<CoreContextMenuItemComponent>({
|
const { CoreContextMenuPopoverComponent } = await import('./context-menu-popover');
|
||||||
|
|
||||||
|
const popoverData = await CorePopovers.open<CoreContextMenuItemComponent>({
|
||||||
event,
|
event,
|
||||||
component: CoreContextMenuPopoverComponent,
|
component: CoreContextMenuPopoverComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
|
|
|
@ -28,6 +28,7 @@ import { CoreForms } from '@singletons/form';
|
||||||
import { CorePath } from '@singletons/path';
|
import { CorePath } from '@singletons/path';
|
||||||
import { CorePlatform } from '@services/platform';
|
import { CorePlatform } from '@services/platform';
|
||||||
import { toBoolean } from '@/core/transforms/boolean';
|
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.
|
* 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
const fileAndDir = CoreFile.getFileAndDirectoryFromPath(this.relativePath);
|
const fileAndDir = CoreFile.getFileAndDirectoryFromPath(this.relativePath);
|
||||||
const newPath = CorePath.concatenatePaths(fileAndDir.directory, newName);
|
const newPath = CorePath.concatenatePaths(fileAndDir.directory, newName);
|
||||||
|
|
||||||
|
@ -224,7 +225,7 @@ export class CoreLocalFileComponent implements OnInit {
|
||||||
// Ask confirmation.
|
// Ask confirmation.
|
||||||
await CoreDomUtils.showDeleteConfirm('core.confirmdeletefile');
|
await CoreDomUtils.showDeleteConfirm('core.confirmdeletefile');
|
||||||
|
|
||||||
modal = await CoreDomUtils.showModalLoading('core.deleting', true);
|
modal = await CoreLoadings.show('core.deleting', true);
|
||||||
|
|
||||||
await CoreFile.removeFile(this.relativePath);
|
await CoreFile.removeFile(this.relativePath);
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import { Component, ViewChild, ElementRef, Input } from '@angular/core';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreForms } from '@singletons/form';
|
import { CoreForms } from '@singletons/form';
|
||||||
import { ModalController } from '@singletons';
|
import { ModalController } from '@singletons';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modal that asks the password.
|
* Modal that asks the password.
|
||||||
|
@ -82,7 +82,7 @@ export class CorePasswordModalComponent {
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading('core.loading', true);
|
const modal = await CoreLoadings.show('core.loading', true);
|
||||||
try {
|
try {
|
||||||
return await this.validator(password);
|
return await this.validator(password);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
@ -47,6 +47,7 @@ export async function getCoreServices(): Promise<Type<unknown>[]> {
|
||||||
const { CoreMimetypeUtilsProvider } = await import('@services/utils/mimetype');
|
const { CoreMimetypeUtilsProvider } = await import('@services/utils/mimetype');
|
||||||
const { CoreNavigatorService } = await import('@services/navigator');
|
const { CoreNavigatorService } = await import('@services/navigator');
|
||||||
const { CorePluginFileDelegateService } = await import('@services/plugin-file-delegate');
|
const { CorePluginFileDelegateService } = await import('@services/plugin-file-delegate');
|
||||||
|
const { CorePopoversService } = await import('@services/popovers');
|
||||||
const { CoreScreenService } = await import('@services/screen');
|
const { CoreScreenService } = await import('@services/screen');
|
||||||
const { CoreSitesProvider } = await import('@services/sites');
|
const { CoreSitesProvider } = await import('@services/sites');
|
||||||
const { CoreSyncProvider } = await import('@services/sync');
|
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 { CoreUtilsProvider } = await import('@services/utils/utils');
|
||||||
const { CoreWSProvider } = await import('@services/ws');
|
const { CoreWSProvider } = await import('@services/ws');
|
||||||
const { CorePlatformService } = await import('@services/platform');
|
const { CorePlatformService } = await import('@services/platform');
|
||||||
|
const { CoreQRScanService } = await import('@services/qrscan');
|
||||||
|
const { CoreLoadingsService } = await import('@services/loadings');
|
||||||
|
|
||||||
return [
|
return [
|
||||||
CoreAppProvider,
|
CoreAppProvider,
|
||||||
|
@ -73,11 +76,14 @@ export async function getCoreServices(): Promise<Type<unknown>[]> {
|
||||||
CoreGroupsProvider,
|
CoreGroupsProvider,
|
||||||
CoreIframeUtilsProvider,
|
CoreIframeUtilsProvider,
|
||||||
CoreLangProvider,
|
CoreLangProvider,
|
||||||
|
CoreLoadingsService,
|
||||||
CoreLocalNotificationsProvider,
|
CoreLocalNotificationsProvider,
|
||||||
CoreMimetypeUtilsProvider,
|
CoreMimetypeUtilsProvider,
|
||||||
CoreNavigatorService,
|
CoreNavigatorService,
|
||||||
CorePluginFileDelegateService,
|
CorePluginFileDelegateService,
|
||||||
|
CorePopoversService,
|
||||||
CorePlatformService,
|
CorePlatformService,
|
||||||
|
CoreQRScanService,
|
||||||
CoreScreenService,
|
CoreScreenService,
|
||||||
CoreSitesProvider,
|
CoreSitesProvider,
|
||||||
CoreSyncProvider,
|
CoreSyncProvider,
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
import { Directive, Input, OnInit, ElementRef } from '@angular/core';
|
import { Directive, Input, OnInit, ElementRef } from '@angular/core';
|
||||||
import { CoreFileHelper } from '@services/file-helper';
|
import { CoreFileHelper } from '@services/file-helper';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreWSFile } from '@services/ws';
|
import { CoreWSFile } from '@services/ws';
|
||||||
|
|
||||||
|
@ -48,7 +49,7 @@ export class CoreDownloadFileDirective implements OnInit {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await CoreFileHelper.downloadAndOpenFile(this.file, this.component, this.componentId);
|
await CoreFileHelper.downloadAndOpenFile(this.file, this.component, this.componentId);
|
||||||
|
|
|
@ -57,6 +57,7 @@ import { CoreIcons } from '@singletons/icons';
|
||||||
import { ContextLevel } from '../constants';
|
import { ContextLevel } from '../constants';
|
||||||
import { CoreWait } from '@singletons/wait';
|
import { CoreWait } from '@singletons/wait';
|
||||||
import { toBoolean } from '../transforms/boolean';
|
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
|
* 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.preventDefault();
|
||||||
e.stopPropagation();
|
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);
|
img.parentNode?.appendChild(button);
|
||||||
|
|
|
@ -28,6 +28,7 @@ import { DomSanitizer } from '@singletons';
|
||||||
import { CoreFilepool } from '@services/filepool';
|
import { CoreFilepool } from '@services/filepool';
|
||||||
import { CoreDom } from '@singletons/dom';
|
import { CoreDom } from '@singletons/dom';
|
||||||
import { toBoolean } from '../transforms/boolean';
|
import { toBoolean } from '../transforms/boolean';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Directive to open a link in external browser or in the app.
|
* Directive to open a link in external browser or in the app.
|
||||||
|
@ -205,7 +206,7 @@ export class CoreLinkDirective implements OnInit {
|
||||||
|
|
||||||
if (isDownloading) {
|
if (isDownloading) {
|
||||||
// Wait for the download to finish before opening the file to prevent downloading it twice.
|
// 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 {
|
try {
|
||||||
const path = await CoreFilepool.downloadUrl(currentSite.getId(), href);
|
const path = await CoreFilepool.downloadUrl(currentSite.getId(), href);
|
||||||
|
|
|
@ -44,6 +44,7 @@ import { Subscription } from 'rxjs';
|
||||||
import { CoreAnimations } from '@components/animations';
|
import { CoreAnimations } from '@components/animations';
|
||||||
import { CoreKeyboard } from '@singletons/keyboard';
|
import { CoreKeyboard } from '@singletons/keyboard';
|
||||||
import { CoreToasts, ToastDuration } from '@services/toasts';
|
import { CoreToasts, ToastDuration } from '@services/toasts';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays comments.
|
* Page that displays comments.
|
||||||
|
@ -311,7 +312,7 @@ export class CoreCommentsViewerPage implements OnInit, OnDestroy {
|
||||||
*/
|
*/
|
||||||
async addComment(text: string): Promise<void> {
|
async addComment(text: string): Promise<void> {
|
||||||
CoreKeyboard.close();
|
CoreKeyboard.close();
|
||||||
const loadingModal = await CoreDomUtils.showModalLoading('core.sending', true);
|
const loadingModal = await CoreLoadings.show('core.sending', true);
|
||||||
// Freeze the add comment button.
|
// Freeze the add comment button.
|
||||||
this.sending = true;
|
this.sending = true;
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
import { CoreContentLinksAction } from '../services/contentlinks-delegate';
|
import { CoreContentLinksAction } from '../services/contentlinks-delegate';
|
||||||
import { CoreContentLinksHandlerBase } from './base-handler';
|
import { CoreContentLinksHandlerBase } from './base-handler';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreLoadings } from '@services/loadings';
|
||||||
import { CoreCourseHelper } from '@features/course/services/course-helper';
|
import { CoreCourseHelper } from '@features/course/services/course-helper';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -72,7 +72,7 @@ export class CoreContentLinksModuleGradeHandler extends CoreContentLinksHandlerB
|
||||||
return [{
|
return [{
|
||||||
action: async (siteId): Promise<void> => {
|
action: async (siteId): Promise<void> => {
|
||||||
// Check if userid is the site's current user.
|
// 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);
|
const site = await CoreSites.getSite(siteId);
|
||||||
if (!params.userid || Number(params.userid) == site.getUserId()) {
|
if (!params.userid || Number(params.userid) == site.getUserId()) {
|
||||||
// No user specified or current user. Navigate to module.
|
// No user specified or current user. Navigate to module.
|
||||||
|
|
|
@ -25,7 +25,6 @@ import { CoreCourseModuleInfoComponent } from './module-info/module-info';
|
||||||
import { CoreCourseModuleNavigationComponent } from './module-navigation/module-navigation';
|
import { CoreCourseModuleNavigationComponent } from './module-navigation/module-navigation';
|
||||||
import { CoreCourseCourseIndexTourComponent } from './course-index-tour/course-index-tour';
|
import { CoreCourseCourseIndexTourComponent } from './course-index-tour/course-index-tour';
|
||||||
import { CoreRemindersComponentsModule } from '@features/reminders/components/components.module';
|
import { CoreRemindersComponentsModule } from '@features/reminders/components/components.module';
|
||||||
import { CoreCourseModuleCompletionDetailsComponent } from './module-completion-details/module-completion-details';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
|
@ -37,7 +36,6 @@ import { CoreCourseModuleCompletionDetailsComponent } from './module-completion-
|
||||||
CoreCourseTagAreaComponent,
|
CoreCourseTagAreaComponent,
|
||||||
CoreCourseUnsupportedModuleComponent,
|
CoreCourseUnsupportedModuleComponent,
|
||||||
CoreCourseModuleNavigationComponent,
|
CoreCourseModuleNavigationComponent,
|
||||||
CoreCourseModuleCompletionDetailsComponent,
|
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
CoreBlockComponentsModule,
|
CoreBlockComponentsModule,
|
||||||
|
@ -53,7 +51,6 @@ import { CoreCourseModuleCompletionDetailsComponent } from './module-completion-
|
||||||
CoreCourseTagAreaComponent,
|
CoreCourseTagAreaComponent,
|
||||||
CoreCourseUnsupportedModuleComponent,
|
CoreCourseUnsupportedModuleComponent,
|
||||||
CoreCourseModuleNavigationComponent,
|
CoreCourseModuleNavigationComponent,
|
||||||
CoreCourseModuleCompletionDetailsComponent,
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class CoreCourseComponentsModule {}
|
export class CoreCourseComponentsModule {}
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -28,7 +29,11 @@ import { Translate } from '@singletons';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'core-course-module-completion-details',
|
selector: 'core-course-module-completion-details',
|
||||||
templateUrl: 'module-completion-details.html',
|
templateUrl: 'module-completion-details.html',
|
||||||
styleUrls: ['module-completion-details.scss'],
|
styleUrl: 'module-completion-details.scss',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class CoreCourseModuleCompletionDetailsComponent implements OnInit {
|
export class CoreCourseModuleCompletionDetailsComponent implements OnInit {
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,7 @@ import { CoreCourseModuleCompletionBaseComponent } from '@features/course/classe
|
||||||
import {
|
import {
|
||||||
CoreCourseModuleCompletionStatus,
|
CoreCourseModuleCompletionStatus,
|
||||||
} from '@features/course/services/course';
|
} from '@features/course/services/course';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CorePopovers } from '@services/popovers';
|
||||||
import { CoreCourseModuleCompletionDetailsComponent } from '../module-completion-details/module-completion-details';
|
|
||||||
import { CoreCourseHelper } from '@features/course/services/course-helper';
|
import { CoreCourseHelper } from '@features/course/services/course-helper';
|
||||||
import { CoreUser } from '@features/user/services/user';
|
import { CoreUser } from '@features/user/services/user';
|
||||||
import { Translate } from '@singletons';
|
import { Translate } from '@singletons';
|
||||||
|
@ -132,7 +131,10 @@ export class CoreCourseModuleCompletionComponent
|
||||||
target = target.parentElement;
|
target = target.parentElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
CoreDomUtils.openPopoverWithoutResult({
|
const { CoreCourseModuleCompletionDetailsComponent } =
|
||||||
|
await import('../module-completion-details/module-completion-details');
|
||||||
|
|
||||||
|
CorePopovers.openWithoutResult({
|
||||||
component: CoreCourseModuleCompletionDetailsComponent,
|
component: CoreCourseModuleCompletionDetailsComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
completion: this.completion,
|
completion: this.completion,
|
||||||
|
|
|
@ -17,6 +17,7 @@ import { CoreCourse, CoreCourseWSSection } from '@features/course/services/cours
|
||||||
import { CoreCourseHelper, CoreCourseModuleData } from '@features/course/services/course-helper';
|
import { CoreCourseHelper, CoreCourseModuleData } from '@features/course/services/course-helper';
|
||||||
import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate';
|
import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate';
|
||||||
import { IonContent } from '@ionic/angular';
|
import { IonContent } from '@ionic/angular';
|
||||||
|
import { CoreLoadings } from '@services/loadings';
|
||||||
import { CoreNavigationOptions, CoreNavigator } from '@services/navigator';
|
import { CoreNavigationOptions, CoreNavigator } from '@services/navigator';
|
||||||
import { CoreSites, CoreSitesReadingStrategy } from '@services/sites';
|
import { CoreSites, CoreSitesReadingStrategy } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
|
@ -204,7 +205,7 @@ export class CoreCourseModuleNavigationComponent implements OnInit, OnDestroy {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const modal = await CoreDomUtils.showModalLoading();
|
const modal = await CoreLoadings.show();
|
||||||
|
|
||||||
// Re-calculate module in case a new module was made visible.
|
// Re-calculate module in case a new module was made visible.
|
||||||
await CoreUtils.ignoreErrors(this.setNextAndPreviousModules(CoreSitesReadingStrategy.PREFER_NETWORK, next, !next));
|
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
Loading…
Reference in New Issue