commit
ee4527b72c
|
@ -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 135
|
test $lines -eq 129
|
||||||
- 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"
|
||||||
|
|
|
@ -18,13 +18,11 @@ import { CoreSharedModule } from '@/core/shared.module';
|
||||||
|
|
||||||
import { AddonCalendarCalendarComponent } from './calendar/calendar';
|
import { AddonCalendarCalendarComponent } from './calendar/calendar';
|
||||||
import { AddonCalendarUpcomingEventsComponent } from './upcoming-events/upcoming-events';
|
import { AddonCalendarUpcomingEventsComponent } from './upcoming-events/upcoming-events';
|
||||||
import { AddonCalendarFilterComponent } from './filter/filter';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AddonCalendarCalendarComponent,
|
AddonCalendarCalendarComponent,
|
||||||
AddonCalendarUpcomingEventsComponent,
|
AddonCalendarUpcomingEventsComponent,
|
||||||
AddonCalendarFilterComponent,
|
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
CoreSharedModule,
|
CoreSharedModule,
|
||||||
|
@ -32,7 +30,6 @@ import { AddonCalendarFilterComponent } from './filter/filter';
|
||||||
exports: [
|
exports: [
|
||||||
AddonCalendarCalendarComponent,
|
AddonCalendarCalendarComponent,
|
||||||
AddonCalendarUpcomingEventsComponent,
|
AddonCalendarUpcomingEventsComponent,
|
||||||
AddonCalendarFilterComponent,
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class AddonCalendarComponentsModule {}
|
export class AddonCalendarComponentsModule {}
|
||||||
|
|
|
@ -20,6 +20,7 @@ import { CoreEvents } from '@singletons/events';
|
||||||
import { AddonCalendarEventType, AddonCalendarProvider } from '../../services/calendar';
|
import { AddonCalendarEventType, AddonCalendarProvider } from '../../services/calendar';
|
||||||
import { AddonCalendarFilter, AddonCalendarEventIcons } from '../../services/calendar-helper';
|
import { AddonCalendarFilter, AddonCalendarEventIcons } from '../../services/calendar-helper';
|
||||||
import { ALL_COURSES_ID } from '@features/courses/services/courses-helper';
|
import { ALL_COURSES_ID } from '@features/courses/services/courses-helper';
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component to display the events filter that includes events types and a list of courses.
|
* Component to display the events filter that includes events types and a list of courses.
|
||||||
|
@ -28,6 +29,10 @@ import { ALL_COURSES_ID } from '@features/courses/services/courses-helper';
|
||||||
selector: 'addon-calendar-filter',
|
selector: 'addon-calendar-filter',
|
||||||
templateUrl: 'filter.html',
|
templateUrl: 'filter.html',
|
||||||
styleUrls: ['../../calendar-common.scss', 'filter.scss'],
|
styleUrls: ['../../calendar-common.scss', 'filter.scss'],
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class AddonCalendarFilterComponent implements OnInit {
|
export class AddonCalendarFilterComponent implements OnInit {
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ import { AddonCalendarFilter, AddonCalendarHelper } from '../../services/calenda
|
||||||
import { AddonCalendarSync, AddonCalendarSyncProvider } from '../../services/calendar-sync';
|
import { AddonCalendarSync, AddonCalendarSyncProvider } from '../../services/calendar-sync';
|
||||||
import { CoreCategoryData, CoreCourses, CoreEnrolledCourseData } from '@features/courses/services/courses';
|
import { CoreCategoryData, CoreCourses, CoreEnrolledCourseData } from '@features/courses/services/courses';
|
||||||
import { CoreCoursesHelper } from '@features/courses/services/courses-helper';
|
import { CoreCoursesHelper } from '@features/courses/services/courses-helper';
|
||||||
import { AddonCalendarFilterComponent } from '../../components/filter/filter';
|
|
||||||
import moment from 'moment-timezone';
|
import moment from 'moment-timezone';
|
||||||
import { NgZone, Translate } from '@singletons';
|
import { NgZone, Translate } from '@singletons';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
|
@ -49,6 +48,7 @@ import { AddonCalendarEventsSource } from '@addons/calendar/classes/events-sourc
|
||||||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
||||||
import { CoreUrl } from '@singletons/url';
|
import { CoreUrl } from '@singletons/url';
|
||||||
import { CoreTime } from '@singletons/time';
|
import { CoreTime } from '@singletons/time';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays the calendar events for a certain day.
|
* Page that displays the calendar events for a certain day.
|
||||||
|
@ -375,7 +375,9 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy {
|
||||||
* Show the filter menu.
|
* Show the filter menu.
|
||||||
*/
|
*/
|
||||||
async openFilter(): Promise<void> {
|
async openFilter(): Promise<void> {
|
||||||
await CoreDomUtils.openSideModal({
|
const { AddonCalendarFilterComponent } = await import('../../components/filter/filter');
|
||||||
|
|
||||||
|
await CoreModals.openSideModal({
|
||||||
component: AddonCalendarFilterComponent,
|
component: AddonCalendarFilterComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
courses: this.manager?.getSource().courses,
|
courses: this.manager?.getSource().courses,
|
||||||
|
|
|
@ -24,7 +24,7 @@ import { AddonCalendarOffline } from '../../services/calendar-offline';
|
||||||
import { AddonCalendarSync, AddonCalendarSyncEvents, AddonCalendarSyncProvider } from '../../services/calendar-sync';
|
import { AddonCalendarSync, AddonCalendarSyncEvents, AddonCalendarSyncProvider } from '../../services/calendar-sync';
|
||||||
import { CoreNetwork } from '@services/network';
|
import { CoreNetwork } from '@services/network';
|
||||||
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
||||||
import { CoreDomUtils, ToastDuration } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreTextUtils } from '@services/utils/text';
|
import { CoreTextUtils } from '@services/utils/text';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreCourse } from '@features/course/services/course';
|
import { CoreCourse } from '@features/course/services/course';
|
||||||
|
@ -43,6 +43,7 @@ import { CoreRemindersSetReminderMenuComponent } from '@features/reminders/compo
|
||||||
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';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays a single calendar event.
|
* Page that displays a single calendar event.
|
||||||
|
@ -556,7 +557,11 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (onlineEventDeleted || this.event.id < 0) {
|
if (onlineEventDeleted || this.event.id < 0) {
|
||||||
CoreDomUtils.showToast('addon.calendar.eventcalendareventdeleted', true, ToastDuration.LONG);
|
CoreToasts.show({
|
||||||
|
message: 'addon.calendar.eventcalendareventdeleted',
|
||||||
|
translateMessage: true,
|
||||||
|
duration: ToastDuration.LONG,
|
||||||
|
});
|
||||||
|
|
||||||
// Event deleted, close the view.
|
// Event deleted, close the view.
|
||||||
CoreNavigator.back();
|
CoreNavigator.back();
|
||||||
|
@ -611,7 +616,11 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.deleted && data.deleted.indexOf(this.eventId) != -1) {
|
if (data.deleted && data.deleted.indexOf(this.eventId) != -1) {
|
||||||
CoreDomUtils.showToast('addon.calendar.eventcalendareventdeleted', true, ToastDuration.LONG);
|
CoreToasts.show({
|
||||||
|
message: 'addon.calendar.eventcalendareventdeleted',
|
||||||
|
translateMessage: true,
|
||||||
|
duration: ToastDuration.LONG,
|
||||||
|
});
|
||||||
|
|
||||||
// Event was deleted, close the view.
|
// Event was deleted, close the view.
|
||||||
CoreNavigator.back();
|
CoreNavigator.back();
|
||||||
|
|
|
@ -28,10 +28,10 @@ import { CoreEnrolledCourseData } from '@features/courses/services/courses';
|
||||||
import { ActivatedRoute, Params } from '@angular/router';
|
import { ActivatedRoute, Params } from '@angular/router';
|
||||||
import { AddonCalendarCalendarComponent } from '../../components/calendar/calendar';
|
import { AddonCalendarCalendarComponent } from '../../components/calendar/calendar';
|
||||||
import { AddonCalendarUpcomingEventsComponent } from '../../components/upcoming-events/upcoming-events';
|
import { AddonCalendarUpcomingEventsComponent } from '../../components/upcoming-events/upcoming-events';
|
||||||
import { AddonCalendarFilterComponent } from '../../components/filter/filter';
|
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreConstants } from '@/core/constants';
|
import { CoreConstants } from '@/core/constants';
|
||||||
import { CoreMainMenuDeepLinkManager } from '@features/mainmenu/classes/deep-link-manager';
|
import { CoreMainMenuDeepLinkManager } from '@features/mainmenu/classes/deep-link-manager';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays the calendar events.
|
* Page that displays the calendar events.
|
||||||
|
@ -330,7 +330,9 @@ export class AddonCalendarIndexPage implements OnInit, OnDestroy {
|
||||||
* Show the filter menu.
|
* Show the filter menu.
|
||||||
*/
|
*/
|
||||||
async openFilter(): Promise<void> {
|
async openFilter(): Promise<void> {
|
||||||
await CoreDomUtils.openSideModal({
|
const { AddonCalendarFilterComponent } = await import('../../components/filter/filter');
|
||||||
|
|
||||||
|
await CoreModals.openSideModal({
|
||||||
component: AddonCalendarFilterComponent,
|
component: AddonCalendarFilterComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
courses: this.courses,
|
courses: this.courses,
|
||||||
|
|
|
@ -25,6 +25,7 @@ import { CorePasswordModalResponse } from '@components/password-modal/password-m
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
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';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enrol handler.
|
* Enrol handler.
|
||||||
|
@ -118,7 +119,7 @@ export class AddonEnrolGuestHandlerService implements CoreEnrolGuestHandler {
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await CoreDomUtils.promptPassword<CorePasswordModalResponse>({
|
const response = await CoreModals.promptPassword<CorePasswordModalResponse>({
|
||||||
title: method.name,
|
title: method.name,
|
||||||
validator: validatePassword,
|
validator: validatePassword,
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,6 +20,7 @@ import { CorePasswordModalResponse } from '@components/password-modal/password-m
|
||||||
import { CoreCoursesProvider } from '@features/courses/services/courses';
|
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';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enrol handler.
|
* Enrol handler.
|
||||||
|
@ -145,7 +146,7 @@ export class AddonEnrolSelfHandlerService implements CoreEnrolSelfHandler {
|
||||||
|
|
||||||
if (!response.validated) {
|
if (!response.validated) {
|
||||||
try {
|
try {
|
||||||
const response = await CoreDomUtils.promptPassword({
|
const response = await CoreModals.promptPassword({
|
||||||
validator: validatePassword,
|
validator: validatePassword,
|
||||||
title: method.name,
|
title: method.name,
|
||||||
placeholder: 'addon.enrol_self.password',
|
placeholder: 'addon.enrol_self.password',
|
||||||
|
|
|
@ -47,6 +47,7 @@ import { CoreDom } from '@singletons/dom';
|
||||||
import { CoreKeyboard } from '@singletons/keyboard';
|
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';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays a message discussion page.
|
* Page that displays a message discussion page.
|
||||||
|
@ -1250,7 +1251,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
|
||||||
await import('@addons/messages/components/conversation-info/conversation-info.module');
|
await import('@addons/messages/components/conversation-info/conversation-info.module');
|
||||||
|
|
||||||
// Display the group information.
|
// Display the group information.
|
||||||
const userId = await CoreDomUtils.openSideModal<number>({
|
const userId = await CoreModals.openSideModal<number>({
|
||||||
component: AddonMessagesConversationInfoComponent,
|
component: AddonMessagesConversationInfoComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
conversationId: this.conversationId,
|
conversationId: this.conversationId,
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
import { CoreCanceledError } from '@classes/errors/cancelederror';
|
import { CoreCanceledError } from '@classes/errors/cancelederror';
|
||||||
import { CoreError } from '@classes/errors/error';
|
import { CoreError } from '@classes/errors/error';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreModals } from '@services/modals';
|
||||||
import { AddonModAssignFeedbackCommentsTextData } from '../feedback/comments/services/handler';
|
import { AddonModAssignFeedbackCommentsTextData } from '../feedback/comments/services/handler';
|
||||||
import { AddonModAssignAssign, AddonModAssignPlugin, AddonModAssignSubmission } from '../services/assign';
|
import { AddonModAssignAssign, AddonModAssignPlugin, AddonModAssignSubmission } from '../services/assign';
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ export class AddonModAssignFeedbackPluginBaseComponent implements IAddonModAssig
|
||||||
await import('@addons/mod/assign/components/edit-feedback-modal/edit-feedback-modal');
|
await import('@addons/mod/assign/components/edit-feedback-modal/edit-feedback-modal');
|
||||||
|
|
||||||
// Create the navigation modal.
|
// Create the navigation modal.
|
||||||
const modalData = await CoreDomUtils.openModal<AddonModAssignFeedbackCommentsTextData>({
|
const modalData = await CoreModals.openModal<AddonModAssignFeedbackCommentsTextData>({
|
||||||
component: AddonModAssignEditFeedbackModalComponent,
|
component: AddonModAssignEditFeedbackModalComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
assign: this.assign,
|
assign: this.assign,
|
||||||
|
|
|
@ -20,7 +20,7 @@ import { CanLeave } from '@guards/can-leave';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreSites, CoreSitesReadingStrategy } from '@services/sites';
|
import { CoreSites, CoreSitesReadingStrategy } from '@services/sites';
|
||||||
import { CoreSync } from '@services/sync';
|
import { CoreSync } from '@services/sync';
|
||||||
import { CoreDomUtils, ToastDuration } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreFormFields, CoreForms } from '@singletons/form';
|
import { CoreFormFields, CoreForms } from '@singletons/form';
|
||||||
import { Translate } from '@singletons';
|
import { Translate } from '@singletons';
|
||||||
import { CoreEvents } from '@singletons/events';
|
import { CoreEvents } from '@singletons/events';
|
||||||
|
@ -45,6 +45,7 @@ import {
|
||||||
ADDON_MOD_ASSIGN_SUBMISSION_SAVED_EVENT,
|
ADDON_MOD_ASSIGN_SUBMISSION_SAVED_EVENT,
|
||||||
ADDON_MOD_ASSIGN_SUBMITTED_FOR_GRADING_EVENT,
|
ADDON_MOD_ASSIGN_SUBMITTED_FOR_GRADING_EVENT,
|
||||||
} from '../../constants';
|
} from '../../constants';
|
||||||
|
import { CoreToasts, ToastDuration } from '@services/toasts';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that allows adding or editing an assigment submission.
|
* Page that allows adding or editing an assigment submission.
|
||||||
|
@ -488,7 +489,7 @@ export class AddonModAssignEditPage implements OnInit, OnDestroy, CanLeave {
|
||||||
* Function called when the time is up.
|
* Function called when the time is up.
|
||||||
*/
|
*/
|
||||||
async timeUp(): Promise<void> {
|
async timeUp(): Promise<void> {
|
||||||
this.timeUpToast = await CoreDomUtils.showToastWithOptions({
|
this.timeUpToast = await CoreToasts.show({
|
||||||
message: Translate.instant('addon.mod_assign.caneditsubmission'),
|
message: Translate.instant('addon.mod_assign.caneditsubmission'),
|
||||||
duration: ToastDuration.STICKY,
|
duration: ToastDuration.STICKY,
|
||||||
buttons: [Translate.instant('core.dismiss')],
|
buttons: [Translate.instant('core.dismiss')],
|
||||||
|
|
|
@ -25,8 +25,6 @@ import { CoreCourseComponentsModule } from '@features/course/components/componen
|
||||||
CoreSharedModule,
|
CoreSharedModule,
|
||||||
CoreCourseComponentsModule,
|
CoreCourseComponentsModule,
|
||||||
],
|
],
|
||||||
providers: [
|
|
||||||
],
|
|
||||||
exports: [
|
exports: [
|
||||||
AddonModBBBIndexComponent,
|
AddonModBBBIndexComponent,
|
||||||
],
|
],
|
||||||
|
|
|
@ -18,12 +18,10 @@ import { CoreSharedModule } from '@/core/shared.module';
|
||||||
import { CoreCourseComponentsModule } from '@features/course/components/components.module';
|
import { CoreCourseComponentsModule } from '@features/course/components/components.module';
|
||||||
|
|
||||||
import { AddonModBookIndexComponent } from './index/index';
|
import { AddonModBookIndexComponent } from './index/index';
|
||||||
import { AddonModBookTocComponent } from './toc/toc';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AddonModBookIndexComponent,
|
AddonModBookIndexComponent,
|
||||||
AddonModBookTocComponent,
|
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
CoreSharedModule,
|
CoreSharedModule,
|
||||||
|
@ -31,7 +29,6 @@ import { AddonModBookTocComponent } from './toc/toc';
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
AddonModBookIndexComponent,
|
AddonModBookIndexComponent,
|
||||||
AddonModBookTocComponent,
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class AddonModBookComponentsModule {}
|
export class AddonModBookComponentsModule {}
|
||||||
|
|
|
@ -16,6 +16,7 @@ import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { ModalController } from '@singletons';
|
import { ModalController } from '@singletons';
|
||||||
import { AddonModBookTocChapter, AddonModBookBookWSData } from '../../services/book';
|
import { AddonModBookTocChapter, AddonModBookBookWSData } from '../../services/book';
|
||||||
import { AddonModBookNumbering } from '../../constants';
|
import { AddonModBookNumbering } from '../../constants';
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modal to display the TOC of a book.
|
* Modal to display the TOC of a book.
|
||||||
|
@ -23,7 +24,11 @@ import { AddonModBookNumbering } from '../../constants';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'addon-mod-book-toc',
|
selector: 'addon-mod-book-toc',
|
||||||
templateUrl: 'toc.html',
|
templateUrl: 'toc.html',
|
||||||
styleUrls: ['toc.scss'],
|
styleUrl: 'toc.scss',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class AddonModBookTocComponent implements OnInit {
|
export class AddonModBookTocComponent implements OnInit {
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreTextUtils } from '@services/utils/text';
|
import { CoreTextUtils } from '@services/utils/text';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { Translate } from '@singletons';
|
import { Translate } from '@singletons';
|
||||||
import { AddonModBookTocComponent } from '../../components/toc/toc';
|
|
||||||
import {
|
import {
|
||||||
AddonModBook,
|
AddonModBook,
|
||||||
AddonModBookBookWSData,
|
AddonModBookBookWSData,
|
||||||
|
@ -40,6 +39,7 @@ import {
|
||||||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
||||||
import { CoreUrl } from '@singletons/url';
|
import { CoreUrl } from '@singletons/url';
|
||||||
import { ADDON_MOD_BOOK_COMPONENT, AddonModBookNavStyle } from '../../constants';
|
import { ADDON_MOD_BOOK_COMPONENT, AddonModBookNavStyle } from '../../constants';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays a book contents.
|
* Page that displays a book contents.
|
||||||
|
@ -250,7 +250,9 @@ export class AddonModBookContentsPage implements OnInit, OnDestroy {
|
||||||
// Create the toc modal.
|
// Create the toc modal.
|
||||||
const visibleChapter = this.manager?.getSelectedItem();
|
const visibleChapter = this.manager?.getSelectedItem();
|
||||||
|
|
||||||
const modalData = await CoreDomUtils.openSideModal<number>({
|
const { AddonModBookTocComponent } = await import('../../components/toc/toc');
|
||||||
|
|
||||||
|
const modalData = await CoreModals.openSideModal<number>({
|
||||||
component: AddonModBookTocComponent,
|
component: AddonModBookTocComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
moduleId: this.cmId,
|
moduleId: this.cmId,
|
||||||
|
|
|
@ -16,12 +16,10 @@ import { NgModule } from '@angular/core';
|
||||||
import { AddonModChatIndexComponent } from './index/index';
|
import { AddonModChatIndexComponent } from './index/index';
|
||||||
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 { AddonModChatUsersModalComponent } from './users-modal/users-modal';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AddonModChatIndexComponent,
|
AddonModChatIndexComponent,
|
||||||
AddonModChatUsersModalComponent,
|
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
CoreSharedModule,
|
CoreSharedModule,
|
||||||
|
@ -29,7 +27,6 @@ import { AddonModChatUsersModalComponent } from './users-modal/users-modal';
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
AddonModChatIndexComponent,
|
AddonModChatIndexComponent,
|
||||||
AddonModChatUsersModalComponent,
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class AddonModChatComponentsModule {}
|
export class AddonModChatComponentsModule {}
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
// 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 { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { CoreNetwork } from '@services/network';
|
import { CoreNetwork } from '@services/network';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
|
@ -19,6 +18,7 @@ import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { ModalController, NgZone } from '@singletons';
|
import { ModalController, NgZone } from '@singletons';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { AddonModChat, AddonModChatUser } from '../../services/chat';
|
import { AddonModChat, AddonModChatUser } from '../../services/chat';
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MMdal that displays the chat session users.
|
* MMdal that displays the chat session users.
|
||||||
|
@ -26,6 +26,10 @@ import { AddonModChat, AddonModChatUser } from '../../services/chat';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'addon-mod-chat-users-modal',
|
selector: 'addon-mod-chat-users-modal',
|
||||||
templateUrl: 'users-modal.html',
|
templateUrl: 'users-modal.html',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class AddonModChatUsersModalComponent implements OnInit, OnDestroy {
|
export class AddonModChatUsersModalComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
|
|
|
@ -24,13 +24,14 @@ import { CoreUtils } from '@services/utils/utils';
|
||||||
import { NgZone, Translate } from '@singletons';
|
import { NgZone, Translate } from '@singletons';
|
||||||
import { CoreEvents } from '@singletons/events';
|
import { CoreEvents } from '@singletons/events';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { AddonModChatUsersModalComponent, AddonModChatUsersModalResult } from '../../components/users-modal/users-modal';
|
import { AddonModChatUsersModalResult } from '../../components/users-modal/users-modal';
|
||||||
import { AddonModChat, AddonModChatUser } from '../../services/chat';
|
import { AddonModChat, AddonModChatUser } from '../../services/chat';
|
||||||
import { AddonModChatFormattedMessage, AddonModChatHelper } from '../../services/chat-helper';
|
import { AddonModChatFormattedMessage, AddonModChatHelper } from '../../services/chat-helper';
|
||||||
import { CoreTime } from '@singletons/time';
|
import { CoreTime } from '@singletons/time';
|
||||||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
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';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays a chat session.
|
* Page that displays a chat session.
|
||||||
|
@ -186,8 +187,10 @@ export class AddonModChatChatPage implements OnInit, OnDestroy, CanLeave {
|
||||||
* Display the chat users modal.
|
* Display the chat users modal.
|
||||||
*/
|
*/
|
||||||
async showChatUsers(): Promise<void> {
|
async showChatUsers(): Promise<void> {
|
||||||
|
const { AddonModChatUsersModalComponent } = await import('../../components/users-modal/users-modal');
|
||||||
|
|
||||||
// Create the toc modal.
|
// Create the toc modal.
|
||||||
const modalData = await CoreDomUtils.openSideModal<AddonModChatUsersModalResult>({
|
const modalData = await CoreModals.openSideModal<AddonModChatUsersModalResult>({
|
||||||
component: AddonModChatUsersModalComponent,
|
component: AddonModChatUsersModalComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
sessionId: this.sessionId,
|
sessionId: this.sessionId,
|
||||||
|
|
|
@ -25,8 +25,6 @@ import { AddonModChoiceIndexComponent } from './index/index';
|
||||||
CoreSharedModule,
|
CoreSharedModule,
|
||||||
CoreCourseComponentsModule,
|
CoreCourseComponentsModule,
|
||||||
],
|
],
|
||||||
providers: [
|
|
||||||
],
|
|
||||||
exports: [
|
exports: [
|
||||||
AddonModChoiceIndexComponent,
|
AddonModChoiceIndexComponent,
|
||||||
],
|
],
|
||||||
|
|
|
@ -51,6 +51,7 @@ import {
|
||||||
AddonModDataTemplateType,
|
AddonModDataTemplateType,
|
||||||
AddonModDataTemplateMode,
|
AddonModDataTemplateMode,
|
||||||
} from '../../constants';
|
} from '../../constants';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
|
|
||||||
const contentToken = '<!-- CORE-DATABASE-CONTENT-GOES-HERE -->';
|
const contentToken = '<!-- CORE-DATABASE-CONTENT-GOES-HERE -->';
|
||||||
|
|
||||||
|
@ -401,7 +402,7 @@ export class AddonModDataIndexComponent extends CoreCourseModuleMainActivityComp
|
||||||
async showSearch(): Promise<void> {
|
async showSearch(): Promise<void> {
|
||||||
const { AddonModDataSearchModalComponent } = await import('@addons/mod/data/components/search-modal/search-modal');
|
const { AddonModDataSearchModalComponent } = await import('@addons/mod/data/components/search-modal/search-modal');
|
||||||
|
|
||||||
const modalData = await CoreDomUtils.openModal<AddonModDataSearchDataParams>({
|
const modalData = await CoreModals.openModal<AddonModDataSearchDataParams>({
|
||||||
component: AddonModDataSearchModalComponent,
|
component: AddonModDataSearchModalComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
search: this.search,
|
search: this.search,
|
||||||
|
|
|
@ -19,7 +19,7 @@ import { CoreFileUploader, CoreFileUploaderStoreFilesResult } from '@features/fi
|
||||||
import { CoreRatingOffline } from '@features/rating/services/rating-offline';
|
import { CoreRatingOffline } from '@features/rating/services/rating-offline';
|
||||||
import { FileEntry } from '@awesome-cordova-plugins/file/ngx';
|
import { FileEntry } from '@awesome-cordova-plugins/file/ngx';
|
||||||
import { CoreSites, CoreSitesReadingStrategy } from '@services/sites';
|
import { CoreSites, CoreSitesReadingStrategy } from '@services/sites';
|
||||||
import { CoreDomUtils, ToastDuration } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreFormFields } from '@singletons/form';
|
import { CoreFormFields } from '@singletons/form';
|
||||||
import { CoreTextUtils } from '@services/utils/text';
|
import { CoreTextUtils } from '@services/utils/text';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
|
@ -47,6 +47,7 @@ import {
|
||||||
AddonModDataTemplateType,
|
AddonModDataTemplateType,
|
||||||
AddonModDataTemplateMode,
|
AddonModDataTemplateMode,
|
||||||
} from '../constants';
|
} from '../constants';
|
||||||
|
import { CoreToasts, ToastDuration } from '@services/toasts';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Service that provides helper functions for datas.
|
* Service that provides helper functions for datas.
|
||||||
|
@ -176,11 +177,11 @@ export class AddonModDataHelperProvider {
|
||||||
|
|
||||||
CoreEvents.trigger(ADDON_MOD_DATA_ENTRY_CHANGED, { dataId: dataId, entryId: entryId }, siteId);
|
CoreEvents.trigger(ADDON_MOD_DATA_ENTRY_CHANGED, { dataId: dataId, entryId: entryId }, siteId);
|
||||||
|
|
||||||
CoreDomUtils.showToast(
|
CoreToasts.show({
|
||||||
approve ? 'addon.mod_data.recordapproved' : 'addon.mod_data.recorddisapproved',
|
message: approve ? 'addon.mod_data.recordapproved' : 'addon.mod_data.recorddisapproved',
|
||||||
true,
|
translateMessage: true,
|
||||||
ToastDuration.LONG,
|
duration: ToastDuration.LONG,
|
||||||
);
|
});
|
||||||
} catch {
|
} catch {
|
||||||
// Ignore error, it was already displayed.
|
// Ignore error, it was already displayed.
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -883,7 +884,11 @@ export class AddonModDataHelperProvider {
|
||||||
|
|
||||||
CoreEvents.trigger(ADDON_MOD_DATA_ENTRY_CHANGED, { dataId, entryId, deleted: true }, siteId);
|
CoreEvents.trigger(ADDON_MOD_DATA_ENTRY_CHANGED, { dataId, entryId, deleted: true }, siteId);
|
||||||
|
|
||||||
CoreDomUtils.showToast('addon.mod_data.recorddeleted', true, ToastDuration.LONG);
|
CoreToasts.show({
|
||||||
|
message: 'addon.mod_data.recorddeleted',
|
||||||
|
translateMessage: true,
|
||||||
|
duration: ToastDuration.LONG,
|
||||||
|
});
|
||||||
|
|
||||||
modal.dismiss();
|
modal.dismiss();
|
||||||
} catch {
|
} catch {
|
||||||
|
|
|
@ -25,8 +25,6 @@ import { AddonModFeedbackIndexComponent } from './index/index';
|
||||||
CoreSharedModule,
|
CoreSharedModule,
|
||||||
CoreCourseComponentsModule,
|
CoreCourseComponentsModule,
|
||||||
],
|
],
|
||||||
providers: [
|
|
||||||
],
|
|
||||||
exports: [
|
exports: [
|
||||||
AddonModFeedbackIndexComponent,
|
AddonModFeedbackIndexComponent,
|
||||||
],
|
],
|
||||||
|
|
|
@ -19,6 +19,7 @@ import { PopoverController } from '@singletons';
|
||||||
import { CoreEvents } from '@singletons/events';
|
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';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component is meant to display a popover with the discussion options.
|
* This component is meant to display a popover with the discussion options.
|
||||||
|
@ -74,7 +75,10 @@ export class AddonModForumDiscussionOptionsMenuComponent implements OnInit {
|
||||||
|
|
||||||
CoreEvents.trigger(ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT, data, CoreSites.getCurrentSiteId());
|
CoreEvents.trigger(ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT, data, CoreSites.getCurrentSiteId());
|
||||||
PopoverController.dismiss({ action: 'lock', value: locked });
|
PopoverController.dismiss({ action: 'lock', value: locked });
|
||||||
CoreDomUtils.showToast('addon.mod_forum.lockupdated', true);
|
CoreToasts.show({
|
||||||
|
message: 'addon.mod_forum.lockupdated',
|
||||||
|
translateMessage: true,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CoreDomUtils.showErrorModal(error);
|
CoreDomUtils.showErrorModal(error);
|
||||||
PopoverController.dismiss();
|
PopoverController.dismiss();
|
||||||
|
@ -103,7 +107,10 @@ export class AddonModForumDiscussionOptionsMenuComponent implements OnInit {
|
||||||
|
|
||||||
CoreEvents.trigger(ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT, data, CoreSites.getCurrentSiteId());
|
CoreEvents.trigger(ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT, data, CoreSites.getCurrentSiteId());
|
||||||
PopoverController.dismiss({ action: 'pin', value: pinned });
|
PopoverController.dismiss({ action: 'pin', value: pinned });
|
||||||
CoreDomUtils.showToast('addon.mod_forum.pinupdated', true);
|
CoreToasts.show({
|
||||||
|
message: 'addon.mod_forum.pinupdated',
|
||||||
|
translateMessage: true,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CoreDomUtils.showErrorModal(error);
|
CoreDomUtils.showErrorModal(error);
|
||||||
PopoverController.dismiss();
|
PopoverController.dismiss();
|
||||||
|
@ -132,7 +139,10 @@ export class AddonModForumDiscussionOptionsMenuComponent implements OnInit {
|
||||||
|
|
||||||
CoreEvents.trigger(ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT, data, CoreSites.getCurrentSiteId());
|
CoreEvents.trigger(ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT, data, CoreSites.getCurrentSiteId());
|
||||||
PopoverController.dismiss({ action: 'star', value: starred });
|
PopoverController.dismiss({ action: 'star', value: starred });
|
||||||
CoreDomUtils.showToast('addon.mod_forum.favouriteupdated', true);
|
CoreToasts.show({
|
||||||
|
message: 'addon.mod_forum.favouriteupdated',
|
||||||
|
translateMessage: true,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CoreDomUtils.showErrorModal(error);
|
CoreDomUtils.showErrorModal(error);
|
||||||
PopoverController.dismiss();
|
PopoverController.dismiss();
|
||||||
|
|
|
@ -65,6 +65,7 @@ import {
|
||||||
ADDON_MOD_FORUM_SEARCH_PAGE_NAME,
|
ADDON_MOD_FORUM_SEARCH_PAGE_NAME,
|
||||||
} 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';
|
||||||
/**
|
/**
|
||||||
* Component that displays a forum entry page.
|
* Component that displays a forum entry page.
|
||||||
*/
|
*/
|
||||||
|
@ -554,7 +555,10 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (isNewDiscussion) {
|
if (isNewDiscussion) {
|
||||||
CoreDomUtils.showToast('addon.mod_forum.postaddedsuccess', true);
|
CoreToasts.show({
|
||||||
|
message: 'addon.mod_forum.postaddedsuccess',
|
||||||
|
translateMessage: true,
|
||||||
|
});
|
||||||
|
|
||||||
const newDiscGroupId = (data as AddonModForumNewDiscussionData).groupId;
|
const newDiscGroupId = (data as AddonModForumNewDiscussionData).groupId;
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,7 @@ import { AddonModForumSharedPostFormData } from '../../pages/discussion/discussi
|
||||||
import { CoreDom } from '@singletons/dom';
|
import { CoreDom } from '@singletons/dom';
|
||||||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
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';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.).
|
||||||
|
@ -167,7 +168,10 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges
|
||||||
CoreSites.getCurrentSiteId(),
|
CoreSites.getCurrentSiteId(),
|
||||||
);
|
);
|
||||||
|
|
||||||
CoreDomUtils.showToast('addon.mod_forum.deletedpost', true);
|
CoreToasts.show({
|
||||||
|
message: 'addon.mod_forum.deletedpost',
|
||||||
|
translateMessage: true,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CoreDomUtils.showErrorModal(error);
|
CoreDomUtils.showErrorModal(error);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -59,6 +59,7 @@ import {
|
||||||
ADDON_MOD_FORUM_REPLY_DISCUSSION_EVENT,
|
ADDON_MOD_FORUM_REPLY_DISCUSSION_EVENT,
|
||||||
} 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';
|
||||||
|
|
||||||
type SortType = 'flat-newest' | 'flat-oldest' | 'nested';
|
type SortType = 'flat-newest' | 'flat-oldest' | 'nested';
|
||||||
|
|
||||||
|
@ -730,7 +731,10 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
|
||||||
};
|
};
|
||||||
CoreEvents.trigger(ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT, data, CoreSites.getCurrentSiteId());
|
CoreEvents.trigger(ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT, data, CoreSites.getCurrentSiteId());
|
||||||
|
|
||||||
CoreDomUtils.showToast('addon.mod_forum.lockupdated', true);
|
CoreToasts.show({
|
||||||
|
message: 'addon.mod_forum.lockupdated',
|
||||||
|
translateMessage: true,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CoreDomUtils.showErrorModal(error);
|
CoreDomUtils.showErrorModal(error);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -763,7 +767,10 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
|
||||||
};
|
};
|
||||||
CoreEvents.trigger(ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT, data, CoreSites.getCurrentSiteId());
|
CoreEvents.trigger(ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT, data, CoreSites.getCurrentSiteId());
|
||||||
|
|
||||||
CoreDomUtils.showToast('addon.mod_forum.pinupdated', true);
|
CoreToasts.show({
|
||||||
|
message: 'addon.mod_forum.pinupdated',
|
||||||
|
translateMessage: true,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CoreDomUtils.showErrorModal(error);
|
CoreDomUtils.showErrorModal(error);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -796,7 +803,10 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
|
||||||
};
|
};
|
||||||
CoreEvents.trigger(ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT, data, CoreSites.getCurrentSiteId());
|
CoreEvents.trigger(ADDON_MOD_FORUM_CHANGE_DISCUSSION_EVENT, data, CoreSites.getCurrentSiteId());
|
||||||
|
|
||||||
CoreDomUtils.showToast('addon.mod_forum.favouriteupdated', true);
|
CoreToasts.show({
|
||||||
|
message: 'addon.mod_forum.favouriteupdated',
|
||||||
|
translateMessage: true,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CoreDomUtils.showErrorModal(error);
|
CoreDomUtils.showErrorModal(error);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -29,8 +29,6 @@ import { CoreSearchComponentsModule } from '@features/search/components/componen
|
||||||
CoreCourseComponentsModule,
|
CoreCourseComponentsModule,
|
||||||
CoreSearchComponentsModule,
|
CoreSearchComponentsModule,
|
||||||
],
|
],
|
||||||
providers: [
|
|
||||||
],
|
|
||||||
exports: [
|
exports: [
|
||||||
AddonModGlossaryIndexComponent,
|
AddonModGlossaryIndexComponent,
|
||||||
AddonModGlossaryModePickerPopoverComponent,
|
AddonModGlossaryModePickerPopoverComponent,
|
||||||
|
|
|
@ -26,7 +26,7 @@ import { CoreTag } from '@features/tag/services/tag';
|
||||||
import { FileEntry } from '@awesome-cordova-plugins/file/ngx';
|
import { FileEntry } from '@awesome-cordova-plugins/file/ngx';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreNetwork } from '@services/network';
|
import { CoreNetwork } from '@services/network';
|
||||||
import { CoreDomUtils, ToastDuration } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { Translate } from '@singletons';
|
import { Translate } from '@singletons';
|
||||||
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
||||||
|
@ -40,6 +40,7 @@ import { CoreTime } from '@singletons/time';
|
||||||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
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';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays a glossary entry.
|
* Page that displays a glossary entry.
|
||||||
|
@ -214,7 +215,11 @@ export class AddonModGlossaryEntryPage implements OnInit, OnDestroy {
|
||||||
await AddonModGlossaryHelper.deleteStoredFiles(glossaryId, concept, timecreated);
|
await AddonModGlossaryHelper.deleteStoredFiles(glossaryId, concept, timecreated);
|
||||||
}
|
}
|
||||||
|
|
||||||
CoreDomUtils.showToast('addon.mod_glossary.entrydeleted', true, ToastDuration.LONG);
|
CoreToasts.show({
|
||||||
|
message: 'addon.mod_glossary.entrydeleted',
|
||||||
|
translateMessage: true,
|
||||||
|
duration: ToastDuration.LONG,
|
||||||
|
});
|
||||||
|
|
||||||
await this.goBack();
|
await this.goBack();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
@ -28,8 +28,6 @@ import { CoreH5PComponentsModule } from '@features/h5p/components/components.mod
|
||||||
CoreCourseComponentsModule,
|
CoreCourseComponentsModule,
|
||||||
CoreH5PComponentsModule,
|
CoreH5PComponentsModule,
|
||||||
],
|
],
|
||||||
providers: [
|
|
||||||
],
|
|
||||||
exports: [
|
exports: [
|
||||||
AddonModH5PActivityIndexComponent,
|
AddonModH5PActivityIndexComponent,
|
||||||
],
|
],
|
||||||
|
|
|
@ -18,12 +18,10 @@ import { CoreSharedModule } from '@/core/shared.module';
|
||||||
import { CoreCourseComponentsModule } from '@features/course/components/components.module';
|
import { CoreCourseComponentsModule } from '@features/course/components/components.module';
|
||||||
|
|
||||||
import { AddonModImscpIndexComponent } from './index';
|
import { AddonModImscpIndexComponent } from './index';
|
||||||
import { AddonModImscpTocComponent } from './toc/toc';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AddonModImscpIndexComponent,
|
AddonModImscpIndexComponent,
|
||||||
AddonModImscpTocComponent,
|
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
CoreSharedModule,
|
CoreSharedModule,
|
||||||
|
@ -31,7 +29,6 @@ import { AddonModImscpTocComponent } from './toc/toc';
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
AddonModImscpIndexComponent,
|
AddonModImscpIndexComponent,
|
||||||
AddonModImscpTocComponent,
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class AddonModImscpComponentsModule {}
|
export class AddonModImscpComponentsModule {}
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
import { ModalController } from '@singletons';
|
import { ModalController } from '@singletons';
|
||||||
import { AddonModImscpTocItem } from '../../services/imscp';
|
import { AddonModImscpTocItem } from '../../services/imscp';
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modal to display the TOC of a imscp.
|
* Modal to display the TOC of a imscp.
|
||||||
|
@ -22,6 +23,10 @@ import { AddonModImscpTocItem } from '../../services/imscp';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'addon-mod-imscp-toc',
|
selector: 'addon-mod-imscp-toc',
|
||||||
templateUrl: 'toc.html',
|
templateUrl: 'toc.html',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class AddonModImscpTocComponent {
|
export class AddonModImscpTocComponent {
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,8 @@ import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreTextUtils } from '@services/utils/text';
|
import { CoreTextUtils } from '@services/utils/text';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { Translate } from '@singletons';
|
import { Translate } from '@singletons';
|
||||||
import { AddonModImscpTocComponent } from '../../components/toc/toc';
|
|
||||||
import { AddonModImscp, AddonModImscpImscp, AddonModImscpTocItem } from '../../services/imscp';
|
import { AddonModImscp, AddonModImscpImscp, AddonModImscpTocItem } from '../../services/imscp';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays a IMSCP content.
|
* Page that displays a IMSCP content.
|
||||||
|
@ -272,8 +272,10 @@ export class AddonModImscpViewPage implements OnInit {
|
||||||
* Show the TOC.
|
* Show the TOC.
|
||||||
*/
|
*/
|
||||||
async showToc(): Promise<void> {
|
async showToc(): Promise<void> {
|
||||||
|
const { AddonModImscpTocComponent } = await import('../../components/toc/toc');
|
||||||
|
|
||||||
// Create the toc modal.
|
// Create the toc modal.
|
||||||
const itemHref = await CoreDomUtils.openSideModal<string>({
|
const itemHref = await CoreModals.openSideModal<string>({
|
||||||
component: AddonModImscpTocComponent,
|
component: AddonModImscpTocComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
items: this.items,
|
items: this.items,
|
||||||
|
|
|
@ -17,22 +17,17 @@ 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 { AddonModLessonIndexComponent } from './index/index';
|
import { AddonModLessonIndexComponent } from './index/index';
|
||||||
import { AddonModLessonMenuModalPage } from './menu-modal/menu-modal';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AddonModLessonIndexComponent,
|
AddonModLessonIndexComponent,
|
||||||
AddonModLessonMenuModalPage,
|
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
CoreSharedModule,
|
CoreSharedModule,
|
||||||
CoreCourseComponentsModule,
|
CoreCourseComponentsModule,
|
||||||
],
|
],
|
||||||
providers: [
|
|
||||||
],
|
|
||||||
exports: [
|
exports: [
|
||||||
AddonModLessonIndexComponent,
|
AddonModLessonIndexComponent,
|
||||||
AddonModLessonMenuModalPage,
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class AddonModLessonComponentsModule {}
|
export class AddonModLessonComponentsModule {}
|
||||||
|
|
|
@ -16,6 +16,7 @@ import { Component, Input } from '@angular/core';
|
||||||
|
|
||||||
import { ModalController } from '@singletons';
|
import { ModalController } from '@singletons';
|
||||||
import { AddonModLessonPlayerPage } from '../../pages/player/player';
|
import { AddonModLessonPlayerPage } from '../../pages/player/player';
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modal that renders the lesson menu and media file.
|
* Modal that renders the lesson menu and media file.
|
||||||
|
@ -23,6 +24,10 @@ import { AddonModLessonPlayerPage } from '../../pages/player/player';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'page-addon-mod-lesson-menu-modal',
|
selector: 'page-addon-mod-lesson-menu-modal',
|
||||||
templateUrl: 'menu-modal.html',
|
templateUrl: 'menu-modal.html',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class AddonModLessonMenuModalPage {
|
export class AddonModLessonMenuModalPage {
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,6 @@ import { CoreUtils } from '@services/utils/utils';
|
||||||
import { CoreWSExternalFile } from '@services/ws';
|
import { CoreWSExternalFile } from '@services/ws';
|
||||||
import { ModalController, Translate } from '@singletons';
|
import { ModalController, Translate } from '@singletons';
|
||||||
import { CoreEvents } from '@singletons/events';
|
import { CoreEvents } from '@singletons/events';
|
||||||
import { AddonModLessonMenuModalPage } from '../../components/menu-modal/menu-modal';
|
|
||||||
import {
|
import {
|
||||||
AddonModLesson,
|
AddonModLesson,
|
||||||
AddonModLessonEOLPageDataEntry,
|
AddonModLessonEOLPageDataEntry,
|
||||||
|
@ -55,6 +54,7 @@ import { AddonModLessonSync } from '../../services/lesson-sync';
|
||||||
import { CoreFormFields, CoreForms } from '@singletons/form';
|
import { CoreFormFields, CoreForms } from '@singletons/form';
|
||||||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
||||||
import { ADDON_MOD_LESSON_COMPONENT, AddonModLessonJumpTo } from '../../constants';
|
import { ADDON_MOD_LESSON_COMPONENT, AddonModLessonJumpTo } from '../../constants';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that allows attempting and reviewing a lesson.
|
* Page that allows attempting and reviewing a lesson.
|
||||||
|
@ -829,7 +829,9 @@ export class AddonModLessonPlayerPage implements OnInit, OnDestroy, CanLeave {
|
||||||
async showMenu(): Promise<void> {
|
async showMenu(): Promise<void> {
|
||||||
this.menuShown = true;
|
this.menuShown = true;
|
||||||
|
|
||||||
await CoreDomUtils.openSideModal({
|
const { AddonModLessonMenuModalPage } = await import('../../components/menu-modal/menu-modal');
|
||||||
|
|
||||||
|
await CoreModals.openSideModal({
|
||||||
component: AddonModLessonMenuModalPage,
|
component: AddonModLessonMenuModalPage,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
pageInstance: this,
|
pageInstance: this,
|
||||||
|
|
|
@ -21,7 +21,7 @@ import { CoreFilepool } from '@services/filepool';
|
||||||
import { CoreGroups } from '@services/groups';
|
import { CoreGroups } from '@services/groups';
|
||||||
import { CoreFileSizeSum, CorePluginFileDelegate } from '@services/plugin-file-delegate';
|
import { CoreFileSizeSum, CorePluginFileDelegate } from '@services/plugin-file-delegate';
|
||||||
import { CoreSites, CoreSitesReadingStrategy } from '@services/sites';
|
import { CoreSites, CoreSitesReadingStrategy } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreModals } from '@services/modals';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { CoreWSFile } from '@services/ws';
|
import { CoreWSFile } from '@services/ws';
|
||||||
import { makeSingleton, Translate } from '@singletons';
|
import { makeSingleton, Translate } from '@singletons';
|
||||||
|
@ -136,7 +136,7 @@ export class AddonModLessonPrefetchHandlerService extends CoreCourseActivityPref
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create and show the modal.
|
// Create and show the modal.
|
||||||
const response = await CoreDomUtils.promptPassword({
|
const response = await CoreModals.promptPassword({
|
||||||
title: 'addon.mod_lesson.enterpassword',
|
title: 'addon.mod_lesson.enterpassword',
|
||||||
placeholder: 'core.login.password',
|
placeholder: 'core.login.password',
|
||||||
submit: 'addon.mod_lesson.continue',
|
submit: 'addon.mod_lesson.continue',
|
||||||
|
|
|
@ -18,7 +18,6 @@ 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 { AddonModQuizConnectionErrorComponent } from './connection-error/connection-error';
|
||||||
import { AddonModQuizIndexComponent } from './index/index';
|
import { AddonModQuizIndexComponent } from './index/index';
|
||||||
import { AddonModQuizNavigationModalComponent } from './navigation-modal/navigation-modal';
|
|
||||||
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';
|
||||||
import { AddonModQuizQuestionCardComponent } from './question-card/question-card';
|
import { AddonModQuizQuestionCardComponent } from './question-card/question-card';
|
||||||
|
@ -29,7 +28,6 @@ import { AddonModQuizQuestionCardComponent } from './question-card/question-card
|
||||||
AddonModQuizAttemptStateComponent,
|
AddonModQuizAttemptStateComponent,
|
||||||
AddonModQuizIndexComponent,
|
AddonModQuizIndexComponent,
|
||||||
AddonModQuizConnectionErrorComponent,
|
AddonModQuizConnectionErrorComponent,
|
||||||
AddonModQuizNavigationModalComponent,
|
|
||||||
AddonModQuizQuestionCardComponent,
|
AddonModQuizQuestionCardComponent,
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -41,7 +39,6 @@ import { AddonModQuizQuestionCardComponent } from './question-card/question-card
|
||||||
AddonModQuizAttemptStateComponent,
|
AddonModQuizAttemptStateComponent,
|
||||||
AddonModQuizIndexComponent,
|
AddonModQuizIndexComponent,
|
||||||
AddonModQuizConnectionErrorComponent,
|
AddonModQuizConnectionErrorComponent,
|
||||||
AddonModQuizNavigationModalComponent,
|
|
||||||
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, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
|
|
||||||
import { CoreQuestionQuestionParsed } from '@features/question/services/question';
|
import { CoreQuestionQuestionParsed } from '@features/question/services/question';
|
||||||
|
@ -23,6 +24,10 @@ import { ModalController } from '@singletons';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'addon-mod-quiz-navigation-modal',
|
selector: 'addon-mod-quiz-navigation-modal',
|
||||||
templateUrl: 'navigation-modal.html',
|
templateUrl: 'navigation-modal.html',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class AddonModQuizNavigationModalComponent {
|
export class AddonModQuizNavigationModalComponent {
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,6 @@ import { ModalController, Translate } from '@singletons';
|
||||||
import { CoreEvents } from '@singletons/events';
|
import { CoreEvents } from '@singletons/events';
|
||||||
import { AddonModQuizAutoSave } from '../../classes/auto-save';
|
import { AddonModQuizAutoSave } from '../../classes/auto-save';
|
||||||
import {
|
import {
|
||||||
AddonModQuizNavigationModalComponent,
|
|
||||||
AddonModQuizNavigationModalReturn,
|
AddonModQuizNavigationModalReturn,
|
||||||
AddonModQuizNavigationQuestion,
|
AddonModQuizNavigationQuestion,
|
||||||
} from '../../components/navigation-modal/navigation-modal';
|
} from '../../components/navigation-modal/navigation-modal';
|
||||||
|
@ -55,6 +54,7 @@ import { CoreWSError } from '@classes/errors/wserror';
|
||||||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
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';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that allows attempting a quiz.
|
* Page that allows attempting a quiz.
|
||||||
|
@ -727,8 +727,10 @@ export class AddonModQuizPlayerPage implements OnInit, OnDestroy, CanLeave {
|
||||||
this.reloadNavigation = false;
|
this.reloadNavigation = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { AddonModQuizNavigationModalComponent } = await import('../../components/navigation-modal/navigation-modal');
|
||||||
|
|
||||||
// Create the navigation modal.
|
// Create the navigation modal.
|
||||||
const modalData = await CoreDomUtils.openSideModal<AddonModQuizNavigationModalReturn>({
|
const modalData = await CoreModals.openSideModal<AddonModQuizNavigationModalReturn>({
|
||||||
component: AddonModQuizNavigationModalComponent,
|
component: AddonModQuizNavigationModalComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
navigation: this.navigation,
|
navigation: this.navigation,
|
||||||
|
|
|
@ -22,7 +22,6 @@ import { CoreUtils } from '@services/utils/utils';
|
||||||
import { CoreDom } from '@singletons/dom';
|
import { CoreDom } from '@singletons/dom';
|
||||||
import { CoreTime } from '@singletons/time';
|
import { CoreTime } from '@singletons/time';
|
||||||
import {
|
import {
|
||||||
AddonModQuizNavigationModalComponent,
|
|
||||||
AddonModQuizNavigationModalReturn,
|
AddonModQuizNavigationModalReturn,
|
||||||
AddonModQuizNavigationQuestion,
|
AddonModQuizNavigationQuestion,
|
||||||
} from '../../components/navigation-modal/navigation-modal';
|
} from '../../components/navigation-modal/navigation-modal';
|
||||||
|
@ -36,6 +35,7 @@ import {
|
||||||
import { AddonModQuizHelper } from '../../services/quiz-helper';
|
import { AddonModQuizHelper } from '../../services/quiz-helper';
|
||||||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
||||||
import { ADDON_MOD_QUIZ_COMPONENT } from '../../constants';
|
import { ADDON_MOD_QUIZ_COMPONENT } from '../../constants';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that allows reviewing a quiz attempt.
|
* Page that allows reviewing a quiz attempt.
|
||||||
|
@ -265,8 +265,10 @@ export class AddonModQuizReviewPage implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
async openNavigation(): Promise<void> {
|
async openNavigation(): Promise<void> {
|
||||||
|
const { AddonModQuizNavigationModalComponent } = await import('../../components/navigation-modal/navigation-modal');
|
||||||
|
|
||||||
// Create the navigation modal.
|
// Create the navigation modal.
|
||||||
const modalData = await CoreDomUtils.openSideModal<AddonModQuizNavigationModalReturn>({
|
const modalData = await CoreModals.openSideModal<AddonModQuizNavigationModalReturn>({
|
||||||
component: AddonModQuizNavigationModalComponent,
|
component: AddonModQuizNavigationModalComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
navigation: this.navigation,
|
navigation: this.navigation,
|
||||||
|
|
|
@ -474,7 +474,6 @@ export class AddonModQuizPrefetchHandlerService extends CoreCourseActivityPrefet
|
||||||
* @param accessInfo Quiz access info.
|
* @param accessInfo Quiz access info.
|
||||||
* @param attempt Attempt.
|
* @param attempt Attempt.
|
||||||
* @param modOptions Other options.
|
* @param modOptions Other options.
|
||||||
* @param siteId Site ID.
|
|
||||||
* @returns Promise resolved when done.
|
* @returns Promise resolved when done.
|
||||||
*/
|
*/
|
||||||
protected async prefetchAttemptReview(
|
protected async prefetchAttemptReview(
|
||||||
|
|
|
@ -40,6 +40,7 @@ import {
|
||||||
import { QuestionDisplayOptionsMarks } from '@features/question/constants';
|
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';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper service that provides some features for quiz.
|
* Helper service that provides some features for quiz.
|
||||||
|
@ -272,7 +273,7 @@ export class AddonModQuizHelperProvider {
|
||||||
await import('@addons/mod/quiz/components/preflight-modal/preflight-modal');
|
await import('@addons/mod/quiz/components/preflight-modal/preflight-modal');
|
||||||
|
|
||||||
// Create and show the modal.
|
// Create and show the modal.
|
||||||
const modalData = await CoreDomUtils.openModal<Record<string, string>>({
|
const modalData = await CoreModals.openModal<Record<string, string>>({
|
||||||
component: AddonModQuizPreflightModalComponent,
|
component: AddonModQuizPreflightModalComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
title: options.title,
|
title: options.title,
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Binary file not shown.
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
@ -27,8 +27,6 @@ import { AddonModResourceIndexComponent } from './index/index';
|
||||||
CoreSharedModule,
|
CoreSharedModule,
|
||||||
CoreCourseComponentsModule,
|
CoreCourseComponentsModule,
|
||||||
],
|
],
|
||||||
providers: [
|
|
||||||
],
|
|
||||||
exports: [
|
exports: [
|
||||||
AddonModResourceIndexComponent,
|
AddonModResourceIndexComponent,
|
||||||
],
|
],
|
||||||
|
|
|
@ -16,22 +16,17 @@ import { NgModule } from '@angular/core';
|
||||||
import { AddonModScormIndexComponent } from './index/index';
|
import { AddonModScormIndexComponent } from './index/index';
|
||||||
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 { AddonModScormTocComponent } from './toc/toc';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AddonModScormIndexComponent,
|
AddonModScormIndexComponent,
|
||||||
AddonModScormTocComponent,
|
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
CoreSharedModule,
|
CoreSharedModule,
|
||||||
CoreCourseComponentsModule,
|
CoreCourseComponentsModule,
|
||||||
],
|
],
|
||||||
providers: [
|
|
||||||
],
|
|
||||||
exports: [
|
exports: [
|
||||||
AddonModScormIndexComponent,
|
AddonModScormIndexComponent,
|
||||||
AddonModScormTocComponent,
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class AddonModScormComponentsModule {}
|
export class AddonModScormComponentsModule {}
|
||||||
|
|
|
@ -17,6 +17,7 @@ import { ModalController } from '@singletons';
|
||||||
import { AddonModScormGetScormAccessInformationWSResponse } from '../../services/scorm';
|
import { AddonModScormGetScormAccessInformationWSResponse } from '../../services/scorm';
|
||||||
import { AddonModScormTOCScoWithIcon } from '../../services/scorm-helper';
|
import { AddonModScormTOCScoWithIcon } from '../../services/scorm-helper';
|
||||||
import { AddonModScormMode } from '../../constants';
|
import { AddonModScormMode } from '../../constants';
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modal to display the TOC of a SCORM.
|
* Modal to display the TOC of a SCORM.
|
||||||
|
@ -24,6 +25,10 @@ import { AddonModScormMode } from '../../constants';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'addon-mod-scorm-toc',
|
selector: 'addon-mod-scorm-toc',
|
||||||
templateUrl: 'toc.html',
|
templateUrl: 'toc.html',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class AddonModScormTocComponent implements OnInit {
|
export class AddonModScormTocComponent implements OnInit {
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@ import { CoreTimeUtils } from '@services/utils/time';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
||||||
import { AddonModScormDataModel12 } from '../../classes/data-model-12';
|
import { AddonModScormDataModel12 } from '../../classes/data-model-12';
|
||||||
import { AddonModScormTocComponent } from '../../components/toc/toc';
|
|
||||||
import {
|
import {
|
||||||
AddonModScorm,
|
AddonModScorm,
|
||||||
AddonModScormAttemptCountResult,
|
AddonModScormAttemptCountResult,
|
||||||
|
@ -44,6 +43,7 @@ import {
|
||||||
ADDON_MOD_SCORM_UPDATE_TOC_EVENT,
|
ADDON_MOD_SCORM_UPDATE_TOC_EVENT,
|
||||||
} from '../../constants';
|
} from '../../constants';
|
||||||
import { CoreWait } from '@singletons/wait';
|
import { CoreWait } from '@singletons/wait';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that allows playing a SCORM.
|
* Page that allows playing a SCORM.
|
||||||
|
@ -513,7 +513,9 @@ export class AddonModScormPlayerPage implements OnInit, OnDestroy {
|
||||||
* Show the TOC.
|
* Show the TOC.
|
||||||
*/
|
*/
|
||||||
async openToc(): Promise<void> {
|
async openToc(): Promise<void> {
|
||||||
const modalData = await CoreDomUtils.openSideModal<AddonModScormScoWithData>({
|
const { AddonModScormTocComponent } = await import('../../components/toc/toc');
|
||||||
|
|
||||||
|
const modalData = await CoreModals.openSideModal<AddonModScormScoWithData>({
|
||||||
component: AddonModScormTocComponent,
|
component: AddonModScormTocComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
toc: this.toc,
|
toc: this.toc,
|
||||||
|
|
|
@ -17,14 +17,10 @@ import { NgModule } from '@angular/core';
|
||||||
import { CoreCourseComponentsModule } from '@features/course/components/components.module';
|
import { CoreCourseComponentsModule } from '@features/course/components/components.module';
|
||||||
import { CoreTagComponentsModule } from '@features/tag/components/components.module';
|
import { CoreTagComponentsModule } from '@features/tag/components/components.module';
|
||||||
import { AddonModWikiIndexComponent } from './index/index';
|
import { AddonModWikiIndexComponent } from './index/index';
|
||||||
import { AddonModWikiMapModalComponent } from './map/map';
|
|
||||||
import { AddonModWikiSubwikiPickerComponent } from './subwiki-picker/subwiki-picker';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AddonModWikiIndexComponent,
|
AddonModWikiIndexComponent,
|
||||||
AddonModWikiSubwikiPickerComponent,
|
|
||||||
AddonModWikiMapModalComponent,
|
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
CoreSharedModule,
|
CoreSharedModule,
|
||||||
|
@ -33,8 +29,6 @@ import { AddonModWikiSubwikiPickerComponent } from './subwiki-picker/subwiki-pic
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
AddonModWikiIndexComponent,
|
AddonModWikiIndexComponent,
|
||||||
AddonModWikiSubwikiPickerComponent,
|
|
||||||
AddonModWikiMapModalComponent,
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class AddonModWikiComponentsModule {}
|
export class AddonModWikiComponentsModule {}
|
||||||
|
|
|
@ -58,6 +58,7 @@ import {
|
||||||
ADDON_MOD_WIKI_PAGE_CREATED_EVENT,
|
ADDON_MOD_WIKI_PAGE_CREATED_EVENT,
|
||||||
ADDON_MOD_WIKI_PAGE_NAME,
|
ADDON_MOD_WIKI_PAGE_NAME,
|
||||||
} from '../../constants';
|
} from '../../constants';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component that displays a wiki entry page.
|
* Component that displays a wiki entry page.
|
||||||
|
@ -663,9 +664,10 @@ export class AddonModWikiIndexComponent extends CoreCourseModuleMainActivityComp
|
||||||
* Show the map.
|
* Show the map.
|
||||||
*/
|
*/
|
||||||
async openMap(): Promise<void> {
|
async openMap(): Promise<void> {
|
||||||
// Create the toc modal.
|
|
||||||
const { AddonModWikiMapModalComponent } = await import('../map/map');
|
const { AddonModWikiMapModalComponent } = await import('../map/map');
|
||||||
const modalData = await CoreDomUtils.openSideModal<AddonModWikiMapModalReturn>({
|
|
||||||
|
// Create the map modal.
|
||||||
|
const modalData = await CoreModals.openSideModal<AddonModWikiMapModalReturn>({
|
||||||
component: AddonModWikiMapModalComponent,
|
component: AddonModWikiMapModalComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
pages: this.subwikiPages,
|
pages: this.subwikiPages,
|
||||||
|
@ -884,6 +886,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 CoreDomUtils.openPopover<AddonModWikiSubwiki>({
|
||||||
component: AddonModWikiSubwikiPickerComponent,
|
component: AddonModWikiSubwikiPickerComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
|
|
|
@ -17,6 +17,7 @@ import { ModalController } from '@singletons';
|
||||||
import { AddonModWikiPageDBRecord } from '../../services/database/wiki';
|
import { AddonModWikiPageDBRecord } from '../../services/database/wiki';
|
||||||
import { AddonModWikiSubwikiPage, AddonModWikiWiki } from '../../services/wiki';
|
import { AddonModWikiSubwikiPage, AddonModWikiWiki } from '../../services/wiki';
|
||||||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modal to display the map of a Wiki.
|
* Modal to display the map of a Wiki.
|
||||||
|
@ -24,6 +25,10 @@ import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'page-addon-mod-wiki-map',
|
selector: 'page-addon-mod-wiki-map',
|
||||||
templateUrl: 'map.html',
|
templateUrl: 'map.html',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class AddonModWikiMapModalComponent implements OnInit {
|
export class AddonModWikiMapModalComponent implements OnInit {
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
import { PopoverController } from '@singletons';
|
import { PopoverController } from '@singletons';
|
||||||
import { AddonModWikiSubwiki, AddonModWikiSubwikiListGrouping } from '../../services/wiki';
|
import { AddonModWikiSubwiki, AddonModWikiSubwikiListGrouping } from '../../services/wiki';
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component to display the a list of subwikis in a wiki.
|
* Component to display the a list of subwikis in a wiki.
|
||||||
|
@ -22,6 +23,10 @@ import { AddonModWikiSubwiki, AddonModWikiSubwikiListGrouping } from '../../serv
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'addon-mod-wiki-subwiki-picker',
|
selector: 'addon-mod-wiki-subwiki-picker',
|
||||||
templateUrl: 'addon-mod-wiki-subwiki-picker.html',
|
templateUrl: 'addon-mod-wiki-subwiki-picker.html',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class AddonModWikiSubwikiPickerComponent {
|
export class AddonModWikiSubwikiPickerComponent {
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ import { IonContent } from '@ionic/angular';
|
||||||
import { CoreGroupInfo, CoreGroups } from '@services/groups';
|
import { CoreGroupInfo, CoreGroups } from '@services/groups';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CorePlatform } from '@services/platform';
|
import { CorePlatform } from '@services/platform';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreModals } from '@services/modals';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
|
@ -400,7 +400,7 @@ export class AddonModWorkshopIndexComponent extends CoreCourseModuleMainActivity
|
||||||
const { AddonModWorkshopPhaseInfoModalComponent } =
|
const { AddonModWorkshopPhaseInfoModalComponent } =
|
||||||
await import('@addons/mod/workshop/components/phase-modal/phase-modal');
|
await import('@addons/mod/workshop/components/phase-modal/phase-modal');
|
||||||
|
|
||||||
const modalData = await CoreDomUtils.openModal<boolean>({
|
const modalData = await CoreModals.openModal<boolean>({
|
||||||
component: AddonModWorkshopPhaseInfoModalComponent,
|
component: AddonModWorkshopPhaseInfoModalComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
phases: CoreUtils.objectToArray(this.phases),
|
phases: CoreUtils.objectToArray(this.phases),
|
||||||
|
|
|
@ -15,11 +15,12 @@
|
||||||
import { AddonNotes, AddonNotesPublishState } from '@addons/notes/services/notes';
|
import { AddonNotes, AddonNotesPublishState } from '@addons/notes/services/notes';
|
||||||
import { Component, ViewChild, ElementRef, Input } from '@angular/core';
|
import { Component, ViewChild, ElementRef, Input } from '@angular/core';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreDomUtils, ToastDuration } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreForms } from '@singletons/form';
|
import { CoreForms } from '@singletons/form';
|
||||||
import { ModalController } from '@singletons';
|
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';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component that displays a text area for composing a note.
|
* Component that displays a text area for composing a note.
|
||||||
|
@ -62,7 +63,11 @@ export class AddonNotesAddComponent {
|
||||||
CoreForms.triggerFormSubmittedEvent(this.formElement, sent, CoreSites.getCurrentSiteId());
|
CoreForms.triggerFormSubmittedEvent(this.formElement, sent, CoreSites.getCurrentSiteId());
|
||||||
|
|
||||||
ModalController.dismiss(<AddonNotesAddModalReturn>{ type: this.type, sent: true }).finally(() => {
|
ModalController.dismiss(<AddonNotesAddModalReturn>{ type: this.type, sent: true }).finally(() => {
|
||||||
CoreDomUtils.showToast(sent ? 'addon.notes.eventnotecreated' : 'core.datastoredoffline', true, ToastDuration.LONG);
|
CoreToasts.show({
|
||||||
|
message: sent ? 'addon.notes.eventnotecreated' : 'core.datastoredoffline',
|
||||||
|
translateMessage: true,
|
||||||
|
duration: ToastDuration.LONG,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} catch (error){
|
} catch (error){
|
||||||
CoreDomUtils.showErrorModal(error);
|
CoreDomUtils.showErrorModal(error);
|
||||||
|
|
|
@ -24,13 +24,15 @@ import { IonContent } from '@ionic/angular';
|
||||||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreDomUtils, ToastDuration } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreTextUtils } from '@services/utils/text';
|
import { CoreTextUtils } from '@services/utils/text';
|
||||||
import { CoreUrl } from '@singletons/url';
|
import { CoreUrl } from '@singletons/url';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { Translate } from '@singletons';
|
import { Translate } from '@singletons';
|
||||||
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
||||||
import { CoreTime } from '@singletons/time';
|
import { CoreTime } from '@singletons/time';
|
||||||
|
import { CoreToasts, ToastDuration } from '@services/toasts';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays a list of notes.
|
* Page that displays a list of notes.
|
||||||
|
@ -196,7 +198,7 @@ export class AddonNotesListPage implements OnInit, OnDestroy {
|
||||||
|
|
||||||
const { AddonNotesAddComponent } = await import('@addons/notes/components/add/add-modal');
|
const { AddonNotesAddComponent } = await import('@addons/notes/components/add/add-modal');
|
||||||
|
|
||||||
const modalData = await CoreDomUtils.openModal<AddonNotesAddModalReturn>({
|
const modalData = await CoreModals.openModal<AddonNotesAddModalReturn>({
|
||||||
component: AddonNotesAddComponent,
|
component: AddonNotesAddComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
userId: this.userId,
|
userId: this.userId,
|
||||||
|
@ -240,7 +242,11 @@ export class AddonNotesListPage implements OnInit, OnDestroy {
|
||||||
|
|
||||||
this.refreshNotes(false);
|
this.refreshNotes(false);
|
||||||
|
|
||||||
CoreDomUtils.showToast('addon.notes.eventnotedeleted', true, ToastDuration.LONG);
|
CoreToasts.show({
|
||||||
|
message: 'addon.notes.eventnotedeleted',
|
||||||
|
translateMessage: true,
|
||||||
|
duration: ToastDuration.LONG,
|
||||||
|
});
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CoreDomUtils.showErrorModalDefault(error, 'Delete note failed.');
|
CoreDomUtils.showErrorModalDefault(error, 'Delete note failed.');
|
||||||
|
|
|
@ -20,6 +20,7 @@ import { CoreFileUploaderHelper } from '@features/fileuploader/services/fileuplo
|
||||||
import { AddonPrivateFiles, AddonPrivateFilesGetUserInfoWSResult } from './privatefiles';
|
import { AddonPrivateFiles, AddonPrivateFilesGetUserInfoWSResult } from './privatefiles';
|
||||||
import { CoreError } from '@classes/errors/error';
|
import { CoreError } from '@classes/errors/error';
|
||||||
import { makeSingleton, Translate } from '@singletons';
|
import { makeSingleton, Translate } from '@singletons';
|
||||||
|
import { CoreToasts } from '@services/toasts';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Service that provides some helper functions regarding private and site files.
|
* Service that provides some helper functions regarding private and site files.
|
||||||
|
@ -64,7 +65,11 @@ export class AddonPrivateFilesHelperProvider {
|
||||||
try {
|
try {
|
||||||
await AddonPrivateFiles.moveFromDraftToPrivate(result.itemid);
|
await AddonPrivateFiles.moveFromDraftToPrivate(result.itemid);
|
||||||
|
|
||||||
CoreDomUtils.showToast('core.fileuploader.fileuploaded', true, undefined, 'core-toast-success');
|
CoreToasts.show({
|
||||||
|
message: 'core.fileuploader.fileuploaded',
|
||||||
|
translateMessage: true,
|
||||||
|
cssClass: 'core-toast-success',
|
||||||
|
});
|
||||||
} finally {
|
} finally {
|
||||||
modal.dismiss();
|
modal.dismiss();
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreTextUtils } from '@services/utils/text';
|
import { CoreText } from '@singletons/text';
|
||||||
import { CoreCoordinates, CoreDom } from '@singletons/dom';
|
import { CoreCoordinates, CoreDom } from '@singletons/dom';
|
||||||
import { CoreEventObserver } from '@singletons/events';
|
import { CoreEventObserver } from '@singletons/events';
|
||||||
import { CoreLogger } from '@singletons/logger';
|
import { CoreLogger } from '@singletons/logger';
|
||||||
|
@ -267,7 +267,7 @@ export class AddonQtypeDdMarkerQuestion {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that a function to draw this shape exists.
|
// Check that a function to draw this shape exists.
|
||||||
const drawFunc = 'drawShape' + CoreTextUtils.ucFirst(shape);
|
const drawFunc = 'drawShape' + CoreText.capitalize(shape);
|
||||||
if (!(this[drawFunc] instanceof Function)) {
|
if (!(this[drawFunc] instanceof Function)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ import { CoreSites } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
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';
|
||||||
|
|
||||||
// Bulk actions supported, along with the related lang string.
|
// Bulk actions supported, along with the related lang string.
|
||||||
const BULK_ACTIONS = {
|
const BULK_ACTIONS = {
|
||||||
|
@ -64,12 +65,17 @@ export class AddonReportInsightsActionLinkHandlerService extends CoreContentLink
|
||||||
|
|
||||||
if (BULK_ACTIONS[params.action]) {
|
if (BULK_ACTIONS[params.action]) {
|
||||||
// Done, display a toast.
|
// Done, display a toast.
|
||||||
CoreDomUtils.showToast(Translate.instant('addon.report_insights.actionsaved', {
|
CoreToasts.show({
|
||||||
|
message: Translate.instant('addon.report_insights.actionsaved', {
|
||||||
$a: Translate.instant(BULK_ACTIONS[params.action]),
|
$a: Translate.instant(BULK_ACTIONS[params.action]),
|
||||||
}));
|
}),
|
||||||
|
});
|
||||||
} else if (!params.forwardurl) {
|
} else if (!params.forwardurl) {
|
||||||
// Forward URL not defined, display a toast.
|
// Forward URL not defined, display a toast.
|
||||||
CoreDomUtils.showToast('core.success', true);
|
CoreToasts.show({
|
||||||
|
message: 'core.success',
|
||||||
|
translateMessage: true,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
// Try to open the link in the app.
|
// Try to open the link in the app.
|
||||||
const forwardUrl = decodeURIComponent(params.forwardurl);
|
const forwardUrl = decodeURIComponent(params.forwardurl);
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreModals } from '@services/modals';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { AsyncDirective } from './async-directive';
|
import { AsyncDirective } from './async-directive';
|
||||||
import { PageLoadWatcher } from './page-load-watcher';
|
import { PageLoadWatcher } from './page-load-watcher';
|
||||||
|
@ -131,7 +131,7 @@ export class PageLoadsManager {
|
||||||
const { CoreRefreshButtonModalComponent }
|
const { CoreRefreshButtonModalComponent }
|
||||||
= await import('@components/refresh-button-modal/refresh-button-modal');
|
= await import('@components/refresh-button-modal/refresh-button-modal');
|
||||||
|
|
||||||
await CoreDomUtils.openModal<boolean>({
|
await CoreModals.openModal<boolean>({
|
||||||
component: CoreRefreshButtonModalComponent,
|
component: CoreRefreshButtonModalComponent,
|
||||||
cssClass: 'core-modal-no-background core-modal-fullscreen',
|
cssClass: 'core-modal-no-background core-modal-fullscreen',
|
||||||
closeOnNavigate: true,
|
closeOnNavigate: true,
|
||||||
|
|
|
@ -21,7 +21,7 @@ import {
|
||||||
CoreWSPreSetsSplitRequest,
|
CoreWSPreSetsSplitRequest,
|
||||||
CoreWSTypeExpected,
|
CoreWSTypeExpected,
|
||||||
} from '@services/ws';
|
} from '@services/ws';
|
||||||
import { CoreDomUtils, ToastDuration } from '@services/utils/dom';
|
import { CoreToasts, ToastDuration } from '@services/toasts';
|
||||||
import { CoreTextUtils } from '@services/utils/text';
|
import { CoreTextUtils } from '@services/utils/text';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { CoreConstants } from '@/core/constants';
|
import { CoreConstants } from '@/core/constants';
|
||||||
|
@ -420,7 +420,11 @@ export class CoreAuthenticatedSite extends CoreUnauthenticatedSite {
|
||||||
|
|
||||||
if (wsPreSets.cleanUnicode && CoreTextUtils.hasUnicodeData(data)) {
|
if (wsPreSets.cleanUnicode && CoreTextUtils.hasUnicodeData(data)) {
|
||||||
// Data will be cleaned, notify the user.
|
// Data will be cleaned, notify the user.
|
||||||
CoreDomUtils.showToast('core.unicodenotsupported', true, ToastDuration.LONG);
|
CoreToasts.show({
|
||||||
|
message: 'core.unicodenotsupported',
|
||||||
|
translateMessage: true,
|
||||||
|
duration: ToastDuration.LONG,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
// No need to clean data in this call.
|
// No need to clean data in this call.
|
||||||
wsPreSets.cleanUnicode = false;
|
wsPreSets.cleanUnicode = false;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||||
import { Translate } from '@singletons';
|
import { Translate } from '@singletons';
|
||||||
import { ModalOptions } from '@ionic/core';
|
import { ModalOptions } from '@ionic/core';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreModals } from '@services/modals';
|
||||||
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -123,7 +123,7 @@ export class CoreComboboxComponent implements ControlValueAccessor {
|
||||||
this.modalOptions.id = this.listboxId;
|
this.modalOptions.id = this.listboxId;
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = await CoreDomUtils.openModal(this.modalOptions);
|
const data = await CoreModals.openModal(this.modalOptions);
|
||||||
this.expanded = false;
|
this.expanded = false;
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
|
|
|
@ -34,6 +34,7 @@ export async function getCoreServices(): Promise<Type<unknown>[]> {
|
||||||
const { CoreCustomURLSchemesProvider } = await import('@services/urlschemes');
|
const { CoreCustomURLSchemesProvider } = await import('@services/urlschemes');
|
||||||
const { CoreDbProvider } = await import('@services/db');
|
const { CoreDbProvider } = await import('@services/db');
|
||||||
const { CoreDomUtilsProvider } = await import('@services/utils/dom');
|
const { CoreDomUtilsProvider } = await import('@services/utils/dom');
|
||||||
|
const { CoreToastsService } = await import('@services/toasts');
|
||||||
const { CoreFileHelperProvider } = await import('@services/file-helper');
|
const { CoreFileHelperProvider } = await import('@services/file-helper');
|
||||||
const { CoreFilepoolProvider } = await import('@services/filepool');
|
const { CoreFilepoolProvider } = await import('@services/filepool');
|
||||||
const { CoreFileProvider } = await import('@services/file');
|
const { CoreFileProvider } = await import('@services/file');
|
||||||
|
@ -82,6 +83,7 @@ export async function getCoreServices(): Promise<Type<unknown>[]> {
|
||||||
CoreSyncProvider,
|
CoreSyncProvider,
|
||||||
CoreTextUtilsProvider,
|
CoreTextUtilsProvider,
|
||||||
CoreTimeUtilsProvider,
|
CoreTimeUtilsProvider,
|
||||||
|
CoreToastsService,
|
||||||
CoreUpdateManagerProvider,
|
CoreUpdateManagerProvider,
|
||||||
CoreUrlUtilsProvider,
|
CoreUrlUtilsProvider,
|
||||||
CoreUtilsProvider,
|
CoreUtilsProvider,
|
||||||
|
|
|
@ -17,7 +17,6 @@ import { CoreBlockComponent } from './block/block';
|
||||||
import { CoreBlockOnlyTitleComponent } from './only-title-block/only-title-block';
|
import { CoreBlockOnlyTitleComponent } from './only-title-block/only-title-block';
|
||||||
import { CoreBlockPreRenderedComponent } from './pre-rendered-block/pre-rendered-block';
|
import { CoreBlockPreRenderedComponent } from './pre-rendered-block/pre-rendered-block';
|
||||||
import { CoreSharedModule } from '@/core/shared.module';
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
import { CoreBlockSideBlocksComponent } from './side-blocks/side-blocks';
|
|
||||||
import { CoreBlockSideBlocksButtonComponent } from './side-blocks-button/side-blocks-button';
|
import { CoreBlockSideBlocksButtonComponent } from './side-blocks-button/side-blocks-button';
|
||||||
import { CoreBlockSideBlocksTourComponent } from './side-blocks-tour/side-blocks-tour';
|
import { CoreBlockSideBlocksTourComponent } from './side-blocks-tour/side-blocks-tour';
|
||||||
|
|
||||||
|
@ -26,7 +25,6 @@ import { CoreBlockSideBlocksTourComponent } from './side-blocks-tour/side-blocks
|
||||||
CoreBlockComponent,
|
CoreBlockComponent,
|
||||||
CoreBlockOnlyTitleComponent,
|
CoreBlockOnlyTitleComponent,
|
||||||
CoreBlockPreRenderedComponent,
|
CoreBlockPreRenderedComponent,
|
||||||
CoreBlockSideBlocksComponent,
|
|
||||||
CoreBlockSideBlocksButtonComponent,
|
CoreBlockSideBlocksButtonComponent,
|
||||||
CoreBlockSideBlocksTourComponent,
|
CoreBlockSideBlocksTourComponent,
|
||||||
],
|
],
|
||||||
|
@ -37,7 +35,6 @@ import { CoreBlockSideBlocksTourComponent } from './side-blocks-tour/side-blocks
|
||||||
CoreBlockComponent,
|
CoreBlockComponent,
|
||||||
CoreBlockOnlyTitleComponent,
|
CoreBlockOnlyTitleComponent,
|
||||||
CoreBlockPreRenderedComponent,
|
CoreBlockPreRenderedComponent,
|
||||||
CoreBlockSideBlocksComponent,
|
|
||||||
CoreBlockSideBlocksButtonComponent,
|
CoreBlockSideBlocksButtonComponent,
|
||||||
CoreBlockSideBlocksTourComponent,
|
CoreBlockSideBlocksTourComponent,
|
||||||
],
|
],
|
||||||
|
|
|
@ -16,10 +16,9 @@ import { Component, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { CoreCancellablePromise } from '@classes/cancellable-promise';
|
import { CoreCancellablePromise } from '@classes/cancellable-promise';
|
||||||
import { CoreUserTourDirectiveOptions } from '@directives/user-tour';
|
import { CoreUserTourDirectiveOptions } from '@directives/user-tour';
|
||||||
import { CoreUserToursAlignment, CoreUserToursSide } from '@features/usertours/services/user-tours';
|
import { CoreUserToursAlignment, CoreUserToursSide } from '@features/usertours/services/user-tours';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreModals } from '@services/modals';
|
||||||
import { CoreDom } from '@singletons/dom';
|
import { CoreDom } from '@singletons/dom';
|
||||||
import { CoreBlockSideBlocksTourComponent } from '../side-blocks-tour/side-blocks-tour';
|
import { CoreBlockSideBlocksTourComponent } from '../side-blocks-tour/side-blocks-tour';
|
||||||
import { CoreBlockSideBlocksComponent } from '../side-blocks/side-blocks';
|
|
||||||
import { ContextLevel } from '@/core/constants';
|
import { ContextLevel } from '@/core/constants';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -67,8 +66,10 @@ export class CoreBlockSideBlocksButtonComponent implements OnInit, OnDestroy {
|
||||||
/**
|
/**
|
||||||
* Open side blocks.
|
* Open side blocks.
|
||||||
*/
|
*/
|
||||||
openBlocks(): void {
|
async openBlocks(): Promise<void> {
|
||||||
CoreDomUtils.openSideModal({
|
const { CoreBlockSideBlocksComponent } = await import('@features/block/components/side-blocks/side-blocks');
|
||||||
|
|
||||||
|
CoreModals.openSideModal({
|
||||||
component: CoreBlockSideBlocksComponent,
|
component: CoreBlockSideBlocksComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
contextLevel: this.contextLevel,
|
contextLevel: this.contextLevel,
|
||||||
|
|
|
@ -24,6 +24,8 @@ import { CoreTextUtils } from '@services/utils/text';
|
||||||
import { CoreDom } from '@singletons/dom';
|
import { CoreDom } from '@singletons/dom';
|
||||||
import { ContextLevel } from '@/core/constants';
|
import { ContextLevel } from '@/core/constants';
|
||||||
import { CoreWait } from '@singletons/wait';
|
import { CoreWait } from '@singletons/wait';
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
|
import { CoreBlockComponentsModule } from '../components.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component that displays the list of side blocks.
|
* Component that displays the list of side blocks.
|
||||||
|
@ -31,7 +33,12 @@ import { CoreWait } from '@singletons/wait';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'core-block-side-blocks',
|
selector: 'core-block-side-blocks',
|
||||||
templateUrl: 'side-blocks.html',
|
templateUrl: 'side-blocks.html',
|
||||||
styleUrls: ['side-blocks.scss'],
|
styleUrl: 'side-blocks.scss',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
CoreBlockComponentsModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class CoreBlockSideBlocksComponent implements OnInit {
|
export class CoreBlockSideBlocksComponent implements OnInit {
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ import { ContextLevel, CoreConstants } from '@/core/constants';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { NgZone, Translate } from '@singletons';
|
import { NgZone, Translate } from '@singletons';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { CoreDomUtils, ToastDuration } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreUser } from '@features/user/services/user';
|
import { CoreUser } from '@features/user/services/user';
|
||||||
import { CoreTextUtils } from '@services/utils/text';
|
import { CoreTextUtils } from '@services/utils/text';
|
||||||
import { CoreError } from '@classes/errors/error';
|
import { CoreError } from '@classes/errors/error';
|
||||||
|
@ -43,6 +43,7 @@ import moment from 'moment-timezone';
|
||||||
import { Subscription } from 'rxjs';
|
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';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays comments.
|
* Page that displays comments.
|
||||||
|
@ -323,11 +324,11 @@ export class CoreCommentsViewerPage implements OnInit, OnDestroy {
|
||||||
this.area,
|
this.area,
|
||||||
);
|
);
|
||||||
|
|
||||||
CoreDomUtils.showToast(
|
CoreToasts.show({
|
||||||
commentsResponse ? 'core.comments.eventcommentcreated' : 'core.datastoredoffline',
|
message: commentsResponse ? 'core.comments.eventcommentcreated' : 'core.datastoredoffline',
|
||||||
true,
|
translateMessage: true,
|
||||||
ToastDuration.LONG,
|
duration: ToastDuration.LONG,
|
||||||
);
|
});
|
||||||
|
|
||||||
if (commentsResponse) {
|
if (commentsResponse) {
|
||||||
this.invalidateComments();
|
this.invalidateComments();
|
||||||
|
@ -426,7 +427,11 @@ export class CoreCommentsViewerPage implements OnInit, OnDestroy {
|
||||||
|
|
||||||
this.invalidateComments();
|
this.invalidateComments();
|
||||||
|
|
||||||
CoreDomUtils.showToast('core.comments.eventcommentdeleted', true, ToastDuration.LONG);
|
CoreToasts.show({
|
||||||
|
message: 'core.comments.eventcommentdeleted',
|
||||||
|
translateMessage: true,
|
||||||
|
duration: ToastDuration.LONG,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CoreDomUtils.showErrorModalDefault(error, 'Delete comment failed.');
|
CoreDomUtils.showErrorModalDefault(error, 'Delete comment failed.');
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ import { CoreSite } from '@classes/sites/site';
|
||||||
import { makeSingleton, Translate } from '@singletons';
|
import { makeSingleton, Translate } from '@singletons';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreCustomURLSchemes } from '@services/urlschemes';
|
import { CoreCustomURLSchemes } from '@services/urlschemes';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Service that provides some features regarding content links.
|
* Service that provides some features regarding content links.
|
||||||
|
@ -98,7 +99,7 @@ export class CoreContentLinksHelperProvider {
|
||||||
const { CoreContentLinksChooseSiteModalComponent }
|
const { CoreContentLinksChooseSiteModalComponent }
|
||||||
= await import('@features/contentlinks/components/choose-site-modal/choose-site-modal');
|
= await import('@features/contentlinks/components/choose-site-modal/choose-site-modal');
|
||||||
|
|
||||||
await CoreDomUtils.openModal({
|
await CoreModals.openModal({
|
||||||
component: CoreContentLinksChooseSiteModalComponent,
|
component: CoreContentLinksChooseSiteModalComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
url: url,
|
url: url,
|
||||||
|
|
|
@ -24,7 +24,7 @@ import { CoreUtils } from '@services/utils/utils';
|
||||||
import { Translate } from '@singletons';
|
import { Translate } from '@singletons';
|
||||||
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
||||||
import { CoreLogger } from '@singletons/logger';
|
import { CoreLogger } from '@singletons/logger';
|
||||||
import { CoreCourseModuleSummaryComponent, CoreCourseModuleSummaryResult } from '../components/module-summary/module-summary';
|
import { CoreCourseModuleSummaryResult } from '../components/module-summary/module-summary';
|
||||||
import { CoreCourseContentsPage } from '../pages/contents/contents';
|
import { CoreCourseContentsPage } from '../pages/contents/contents';
|
||||||
import { CoreCourse } from '../services/course';
|
import { CoreCourse } from '../services/course';
|
||||||
import { CoreCourseHelper, CoreCourseModuleData } from '../services/course-helper';
|
import { CoreCourseHelper, CoreCourseModuleData } from '../services/course-helper';
|
||||||
|
@ -33,6 +33,8 @@ import { CoreCourseModulePrefetchDelegate } from '../services/module-prefetch-de
|
||||||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
||||||
import { CoreUrl } from '@singletons/url';
|
import { CoreUrl } from '@singletons/url';
|
||||||
import { CoreTime } from '@singletons/time';
|
import { CoreTime } from '@singletons/time';
|
||||||
|
import { CoreText } from '@singletons/text';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Result of a resource download.
|
* Result of a resource download.
|
||||||
|
@ -232,7 +234,7 @@ export class CoreCourseModuleMainResourceComponent implements OnInit, OnDestroy,
|
||||||
const lastDownloaded =
|
const lastDownloaded =
|
||||||
await CoreCourseHelper.getModulePackageLastDownloaded(this.module, this.component);
|
await CoreCourseHelper.getModulePackageLastDownloaded(this.module, this.component);
|
||||||
|
|
||||||
this.downloadTimeReadable = CoreTextUtils.ucFirst(lastDownloaded.downloadTimeReadable);
|
this.downloadTimeReadable = CoreText.capitalize(lastDownloaded.downloadTimeReadable);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -423,7 +425,9 @@ export class CoreCourseModuleMainResourceComponent implements OnInit, OnDestroy,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = await CoreDomUtils.openSideModal<CoreCourseModuleSummaryResult>({
|
const { CoreCourseModuleSummaryComponent } = await import('@features/course/components/module-summary/module-summary');
|
||||||
|
|
||||||
|
const data = await CoreModals.openSideModal<CoreCourseModuleSummaryResult>({
|
||||||
component: CoreCourseModuleSummaryComponent,
|
component: CoreCourseModuleSummaryComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
moduleId: this.module.id,
|
moduleId: this.module.id,
|
||||||
|
|
|
@ -24,7 +24,6 @@ import { CoreCourseUnsupportedModuleComponent } from './unsupported-module/unsup
|
||||||
import { CoreCourseModuleCompletionLegacyComponent } from './module-completion-legacy/module-completion-legacy';
|
import { CoreCourseModuleCompletionLegacyComponent } from './module-completion-legacy/module-completion-legacy';
|
||||||
import { CoreCourseModuleInfoComponent } from './module-info/module-info';
|
import { CoreCourseModuleInfoComponent } from './module-info/module-info';
|
||||||
import { CoreCourseModuleNavigationComponent } from './module-navigation/module-navigation';
|
import { CoreCourseModuleNavigationComponent } from './module-navigation/module-navigation';
|
||||||
import { CoreCourseModuleSummaryComponent } from './module-summary/module-summary';
|
|
||||||
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';
|
import { CoreCourseModuleCompletionDetailsComponent } from './module-completion-details/module-completion-details';
|
||||||
|
@ -40,7 +39,6 @@ import { CoreCourseModuleCompletionDetailsComponent } from './module-completion-
|
||||||
CoreCourseTagAreaComponent,
|
CoreCourseTagAreaComponent,
|
||||||
CoreCourseUnsupportedModuleComponent,
|
CoreCourseUnsupportedModuleComponent,
|
||||||
CoreCourseModuleNavigationComponent,
|
CoreCourseModuleNavigationComponent,
|
||||||
CoreCourseModuleSummaryComponent,
|
|
||||||
CoreCourseModuleCompletionDetailsComponent,
|
CoreCourseModuleCompletionDetailsComponent,
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -58,7 +56,6 @@ import { CoreCourseModuleCompletionDetailsComponent } from './module-completion-
|
||||||
CoreCourseTagAreaComponent,
|
CoreCourseTagAreaComponent,
|
||||||
CoreCourseUnsupportedModuleComponent,
|
CoreCourseUnsupportedModuleComponent,
|
||||||
CoreCourseModuleNavigationComponent,
|
CoreCourseModuleNavigationComponent,
|
||||||
CoreCourseModuleSummaryComponent,
|
|
||||||
CoreCourseModuleCompletionDetailsComponent,
|
CoreCourseModuleCompletionDetailsComponent,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
|
@ -51,8 +51,8 @@ import { CoreCourseCourseIndexTourComponent } from '../course-index-tour/course-
|
||||||
import { CoreDom } from '@singletons/dom';
|
import { CoreDom } from '@singletons/dom';
|
||||||
import { CoreUserTourDirectiveOptions } from '@directives/user-tour';
|
import { CoreUserTourDirectiveOptions } from '@directives/user-tour';
|
||||||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
||||||
import { CoreBlockSideBlocksComponent } from '@features/block/components/side-blocks/side-blocks';
|
|
||||||
import { ContextLevel } from '@/core/constants';
|
import { ContextLevel } from '@/core/constants';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component to display course contents using a certain format. If the format isn't found, use default one.
|
* Component to display course contents using a certain format. If the format isn't found, use default one.
|
||||||
|
@ -316,7 +316,9 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy {
|
||||||
this.sectionChanged(section);
|
this.sectionChanged(section);
|
||||||
}
|
}
|
||||||
} else if (this.initialBlockInstanceId && this.displayBlocks && this.hasBlocks) {
|
} else if (this.initialBlockInstanceId && this.displayBlocks && this.hasBlocks) {
|
||||||
CoreDomUtils.openSideModal({
|
const { CoreBlockSideBlocksComponent } = await import('@features/block/components/side-blocks/side-blocks');
|
||||||
|
|
||||||
|
CoreModals.openSideModal({
|
||||||
component: CoreBlockSideBlocksComponent,
|
component: CoreBlockSideBlocksComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
contextLevel: ContextLevel.COURSE,
|
contextLevel: ContextLevel.COURSE,
|
||||||
|
@ -431,7 +433,7 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy {
|
||||||
|
|
||||||
const { CoreCourseCourseIndexComponent } = await import('@features/course/components/course-index/course-index');
|
const { CoreCourseCourseIndexComponent } = await import('@features/course/components/course-index/course-index');
|
||||||
|
|
||||||
const data = await CoreDomUtils.openModal<CoreCourseIndexSectionWithModule>({
|
const data = await CoreModals.openModal<CoreCourseIndexSectionWithModule>({
|
||||||
component: CoreCourseCourseIndexComponent,
|
component: CoreCourseCourseIndexComponent,
|
||||||
initialBreakpoint: 1,
|
initialBreakpoint: 1,
|
||||||
breakpoints: [0, 1],
|
breakpoints: [0, 1],
|
||||||
|
|
|
@ -28,11 +28,12 @@ import { CoreFilepool } from '@services/filepool';
|
||||||
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';
|
||||||
import { CoreTextUtils } from '@services/utils/text';
|
import { CoreText } from '@singletons/text';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { ModalController, NgZone } from '@singletons';
|
import { ModalController, NgZone } from '@singletons';
|
||||||
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component to display a module summary modal.
|
* Component to display a module summary modal.
|
||||||
|
@ -40,7 +41,11 @@ import { Subscription } from 'rxjs';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'core-course-module-summary',
|
selector: 'core-course-module-summary',
|
||||||
templateUrl: 'module-summary.html',
|
templateUrl: 'module-summary.html',
|
||||||
styleUrls: ['module-summary.scss'],
|
styleUrl: 'module-summary.scss',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class CoreCourseModuleSummaryComponent implements OnInit, OnDestroy {
|
export class CoreCourseModuleSummaryComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
|
@ -222,7 +227,7 @@ export class CoreCourseModuleSummaryComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
if (this.canPrefetch) {
|
if (this.canPrefetch) {
|
||||||
if (moduleInfo.downloadTime && moduleInfo.downloadTime > 0) {
|
if (moduleInfo.downloadTime && moduleInfo.downloadTime > 0) {
|
||||||
this.downloadTimeReadable = CoreTextUtils.ucFirst(moduleInfo.downloadTimeReadable);
|
this.downloadTimeReadable = CoreText.capitalize(moduleInfo.downloadTimeReadable);
|
||||||
}
|
}
|
||||||
this.prefetchLoading = moduleInfo.status === DownloadStatus.DOWNLOADING;
|
this.prefetchLoading = moduleInfo.status === DownloadStatus.DOWNLOADING;
|
||||||
this.prefetchDisabled = moduleInfo.status === DownloadStatus.DOWNLOADED;
|
this.prefetchDisabled = moduleInfo.status === DownloadStatus.DOWNLOADED;
|
||||||
|
|
|
@ -13,13 +13,11 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import {
|
import { CoreCourseModuleSummaryResult } from '@features/course/components/module-summary/module-summary';
|
||||||
CoreCourseModuleSummaryResult,
|
|
||||||
CoreCourseModuleSummaryComponent,
|
|
||||||
} from '@features/course/components/module-summary/module-summary';
|
|
||||||
import { CoreCourse } from '@features/course/services/course';
|
import { CoreCourse } from '@features/course/services/course';
|
||||||
import { CoreCourseHelper, CoreCourseModuleData, CoreCourseSection } from '@features/course/services/course-helper';
|
import { CoreCourseHelper, CoreCourseModuleData, CoreCourseSection } from '@features/course/services/course-helper';
|
||||||
import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate';
|
import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
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';
|
||||||
|
@ -106,7 +104,9 @@ export class CoreCourseModulePreviewPage implements OnInit {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = await CoreDomUtils.openSideModal<CoreCourseModuleSummaryResult>({
|
const { CoreCourseModuleSummaryComponent } = await import('@features/course/components/module-summary/module-summary');
|
||||||
|
|
||||||
|
const data = await CoreModals.openSideModal<CoreCourseModuleSummaryResult>({
|
||||||
component: CoreCourseModuleSummaryComponent,
|
component: CoreCourseModuleSummaryComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
moduleId: this.module.id,
|
moduleId: this.module.id,
|
||||||
|
|
|
@ -69,12 +69,12 @@ import { CoreNavigationOptions, CoreNavigator } from '@services/navigator';
|
||||||
import { CoreSiteHomeHomeHandlerService } from '@features/sitehome/services/handlers/sitehome-home';
|
import { CoreSiteHomeHomeHandlerService } from '@features/sitehome/services/handlers/sitehome-home';
|
||||||
import { CoreStatusWithWarningsWSResponse } from '@services/ws';
|
import { CoreStatusWithWarningsWSResponse } from '@services/ws';
|
||||||
import { CoreCourseWithImageAndColor } from '@features/courses/services/courses-helper';
|
import { CoreCourseWithImageAndColor } from '@features/courses/services/courses-helper';
|
||||||
import { CoreCourseSummaryPage } from '../pages/course-summary/course-summary.page';
|
|
||||||
import { CoreRemindersPushNotificationData } from '@features/reminders/services/reminders';
|
import { CoreRemindersPushNotificationData } from '@features/reminders/services/reminders';
|
||||||
import { CoreLocalNotifications } from '@services/local-notifications';
|
import { CoreLocalNotifications } from '@services/local-notifications';
|
||||||
import { CoreEnrol } from '@features/enrol/services/enrol';
|
import { CoreEnrol } from '@features/enrol/services/enrol';
|
||||||
import { CoreEnrolAction, CoreEnrolDelegate } from '@features/enrol/services/enrol-delegate';
|
import { CoreEnrolAction, CoreEnrolDelegate } from '@features/enrol/services/enrol-delegate';
|
||||||
import { LazyRoutesModule } from '@/app/app-routing.module';
|
import { LazyRoutesModule } from '@/app/app-routing.module';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prefetch info of a module.
|
* Prefetch info of a module.
|
||||||
|
@ -645,9 +645,8 @@ export class CoreCourseHelperProvider {
|
||||||
|
|
||||||
// Now determine the status of the whole list.
|
// Now determine the status of the whole list.
|
||||||
let status = statuses[0];
|
let status = statuses[0];
|
||||||
const filepool = CoreFilepool.instance;
|
|
||||||
for (let i = 1; i < statuses.length; i++) {
|
for (let i = 1; i < statuses.length; i++) {
|
||||||
status = filepool.determinePackagesStatus(status, statuses[i]);
|
status = CoreFilepool.determinePackagesStatus(status, statuses[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
@ -1996,6 +1995,7 @@ export class CoreCourseHelperProvider {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves course summary page module.
|
* Retrieves course summary page module.
|
||||||
|
* This is meant to be here so it can be overriden.
|
||||||
*
|
*
|
||||||
* @returns Course summary page module.
|
* @returns Course summary page module.
|
||||||
*/
|
*/
|
||||||
|
@ -2008,8 +2008,10 @@ export class CoreCourseHelperProvider {
|
||||||
*
|
*
|
||||||
* @param course Course selected
|
* @param course Course selected
|
||||||
*/
|
*/
|
||||||
openCourseSummary(course: CoreCourseWithImageAndColor & CoreCourseAnyCourseData): void {
|
async openCourseSummary(course: CoreCourseWithImageAndColor & CoreCourseAnyCourseData): Promise<void> {
|
||||||
CoreDomUtils.openSideModal<void>({
|
const { CoreCourseSummaryPage } = await import('../pages/course-summary/course-summary.page');
|
||||||
|
|
||||||
|
CoreModals.openSideModal<void>({
|
||||||
component: CoreCourseSummaryPage,
|
component: CoreCourseSummaryPage,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
courseId: course.id,
|
courseId: course.id,
|
||||||
|
|
|
@ -18,7 +18,8 @@ import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||||
import { CoreDataPrivacy } from '@features/dataprivacy/services/dataprivacy';
|
import { CoreDataPrivacy } from '@features/dataprivacy/services/dataprivacy';
|
||||||
import { CoreUser } from '@features/user/services/user';
|
import { CoreUser } from '@features/user/services/user';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreDomUtils, ToastDuration } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
|
import { CoreToasts, ToastDuration } from '@services/toasts';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
|
|
||||||
import { ModalController } from '@singletons';
|
import { ModalController } from '@singletons';
|
||||||
|
@ -80,7 +81,11 @@ export class CoreDataPrivacyContactDPOComponent implements OnInit {
|
||||||
// Send the message.
|
// Send the message.
|
||||||
const succeed = await CoreDataPrivacy.contactDPO(this.message);
|
const succeed = await CoreDataPrivacy.contactDPO(this.message);
|
||||||
if (succeed) {
|
if (succeed) {
|
||||||
CoreDomUtils.showToast('core.dataprivacy.requestsubmitted', true, ToastDuration.LONG);
|
CoreToasts.show({
|
||||||
|
message: 'core.dataprivacy.requestsubmitted',
|
||||||
|
translateMessage: true,
|
||||||
|
duration: ToastDuration.LONG,
|
||||||
|
});
|
||||||
ModalController.dismiss(true);
|
ModalController.dismiss(true);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
@ -20,7 +20,8 @@ import {
|
||||||
CoreDataPrivacyDataRequestType,
|
CoreDataPrivacyDataRequestType,
|
||||||
CoreDataPrivacyGetAccessInformationWSResponse,
|
CoreDataPrivacyGetAccessInformationWSResponse,
|
||||||
} from '@features/dataprivacy/services/dataprivacy';
|
} from '@features/dataprivacy/services/dataprivacy';
|
||||||
import { CoreDomUtils, ToastDuration } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
|
import { CoreToasts, ToastDuration } from '@services/toasts';
|
||||||
|
|
||||||
import { ModalController } from '@singletons';
|
import { ModalController } from '@singletons';
|
||||||
|
|
||||||
|
@ -105,7 +106,11 @@ export class CoreDataPrivacyNewRequestComponent implements OnInit {
|
||||||
// Send the message.
|
// Send the message.
|
||||||
const requestId = await CoreDataPrivacy.createDataRequest(this.typeControl.value, this.message);
|
const requestId = await CoreDataPrivacy.createDataRequest(this.typeControl.value, this.message);
|
||||||
if (requestId) {
|
if (requestId) {
|
||||||
CoreDomUtils.showToast('core.dataprivacy.requestsubmitted', true, ToastDuration.LONG);
|
CoreToasts.show({
|
||||||
|
message: 'core.dataprivacy.requestsubmitted',
|
||||||
|
translateMessage: true,
|
||||||
|
duration: ToastDuration.LONG,
|
||||||
|
});
|
||||||
ModalController.dismiss(true);
|
ModalController.dismiss(true);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
@ -19,6 +19,7 @@ import {
|
||||||
CoreDataPrivacyGetAccessInformationWSResponse,
|
CoreDataPrivacyGetAccessInformationWSResponse,
|
||||||
CoreDataPrivacyRequest,
|
CoreDataPrivacyRequest,
|
||||||
} from '@features/dataprivacy/services/dataprivacy';
|
} from '@features/dataprivacy/services/dataprivacy';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreScreen } from '@services/screen';
|
import { CoreScreen } from '@services/screen';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
|
@ -117,7 +118,7 @@ export class CoreDataPrivacyMainPage implements OnInit {
|
||||||
await import('@features/dataprivacy/components/contactdpo/contactdpo');
|
await import('@features/dataprivacy/components/contactdpo/contactdpo');
|
||||||
|
|
||||||
// Create and show the modal.
|
// Create and show the modal.
|
||||||
const succeed = await CoreDomUtils.openModal<boolean>({
|
const succeed = await CoreModals.openModal<boolean>({
|
||||||
component: CoreDataPrivacyContactDPOComponent,
|
component: CoreDataPrivacyContactDPOComponent,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -139,7 +140,7 @@ export class CoreDataPrivacyMainPage implements OnInit {
|
||||||
await import('@features/dataprivacy/components/newrequest/newrequest');
|
await import('@features/dataprivacy/components/newrequest/newrequest');
|
||||||
|
|
||||||
// Create and show the modal.
|
// Create and show the modal.
|
||||||
const succeed = await CoreDomUtils.openModal<boolean>({
|
const succeed = await CoreModals.openModal<boolean>({
|
||||||
component: CoreDataPrivacyNewRequestComponent,
|
component: CoreDataPrivacyNewRequestComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
accessInfo: this.accessInfo,
|
accessInfo: this.accessInfo,
|
||||||
|
|
|
@ -24,8 +24,6 @@ import { CoreSharedModule } from '@/core/shared.module';
|
||||||
imports: [
|
imports: [
|
||||||
CoreSharedModule,
|
CoreSharedModule,
|
||||||
],
|
],
|
||||||
providers: [
|
|
||||||
],
|
|
||||||
exports: [
|
exports: [
|
||||||
CoreEditorRichTextEditorComponent,
|
CoreEditorRichTextEditorComponent,
|
||||||
],
|
],
|
||||||
|
|
|
@ -1045,7 +1045,7 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterViewInit,
|
||||||
* Window resized.
|
* Window resized.
|
||||||
*/
|
*/
|
||||||
protected async windowResized(): Promise<void> {
|
protected async windowResized(): Promise<void> {
|
||||||
await CoreDomUtils.waitForResizeDone();
|
await CoreWait.waitForResizeDone();
|
||||||
this.isPhone = CoreScreen.isMobile;
|
this.isPhone = CoreScreen.isMobile;
|
||||||
|
|
||||||
this.maximizeEditorSize();
|
this.maximizeEditorSize();
|
||||||
|
|
|
@ -44,6 +44,7 @@ import { CorePath } from '@singletons/path';
|
||||||
import { CorePromisedValue } from '@classes/promised-value';
|
import { CorePromisedValue } from '@classes/promised-value';
|
||||||
import { CorePlatform } from '@services/platform';
|
import { CorePlatform } from '@services/platform';
|
||||||
import { Chooser } from '@features/native/plugins';
|
import { Chooser } from '@features/native/plugins';
|
||||||
|
import { CoreToasts } from '@services/toasts';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper service to upload files.
|
* Helper service to upload files.
|
||||||
|
@ -457,7 +458,11 @@ export class CoreFileUploaderHelperProvider {
|
||||||
|
|
||||||
await this.uploadGenericFile(CoreFile.getFileEntryURL(fileEntry), file.name, file.type, deleteAfterUpload, siteId);
|
await this.uploadGenericFile(CoreFile.getFileEntryURL(fileEntry), file.name, file.type, deleteAfterUpload, siteId);
|
||||||
|
|
||||||
CoreDomUtils.showToast('core.fileuploader.fileuploaded', true, undefined, 'core-toast-success');
|
CoreToasts.show({
|
||||||
|
message: 'core.fileuploader.fileuploaded',
|
||||||
|
translateMessage: true,
|
||||||
|
cssClass: 'core-toast-success',
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CoreDomUtils.showErrorModalDefault(error, 'core.fileuploader.errorreadingfile', true);
|
CoreDomUtils.showErrorModalDefault(error, 'core.fileuploader.errorreadingfile', true);
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,6 @@ import { CoreH5PIframeComponent } from './h5p-iframe/h5p-iframe';
|
||||||
imports: [
|
imports: [
|
||||||
CoreSharedModule,
|
CoreSharedModule,
|
||||||
],
|
],
|
||||||
providers: [
|
|
||||||
],
|
|
||||||
exports: [
|
exports: [
|
||||||
CoreH5PPlayerComponent,
|
CoreH5PPlayerComponent,
|
||||||
CoreH5PIframeComponent,
|
CoreH5PIframeComponent,
|
||||||
|
|
|
@ -14,14 +14,12 @@
|
||||||
|
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CoreSharedModule } from '@/core/shared.module';
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
import { CoreLoginSitesModalComponent } from './sites-modal/sites-modal';
|
|
||||||
import { CoreLoginMethodsComponent } from './login-methods/login-methods';
|
import { CoreLoginMethodsComponent } from './login-methods/login-methods';
|
||||||
import { CoreLoginExceededAttemptsComponent } from '@features/login/components/exceeded-attempts/exceeded-attempts';
|
import { CoreLoginExceededAttemptsComponent } from '@features/login/components/exceeded-attempts/exceeded-attempts';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
CoreLoginExceededAttemptsComponent,
|
CoreLoginExceededAttemptsComponent,
|
||||||
CoreLoginSitesModalComponent,
|
|
||||||
CoreLoginMethodsComponent,
|
CoreLoginMethodsComponent,
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -29,7 +27,6 @@ import { CoreLoginExceededAttemptsComponent } from '@features/login/components/e
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
CoreLoginExceededAttemptsComponent,
|
CoreLoginExceededAttemptsComponent,
|
||||||
CoreLoginSitesModalComponent,
|
|
||||||
CoreLoginMethodsComponent,
|
CoreLoginMethodsComponent,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
|
@ -21,6 +21,7 @@ import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreFilter } from '@features/filter/services/filter';
|
import { CoreFilter } from '@features/filter/services/filter';
|
||||||
import { CoreAnimations } from '@components/animations';
|
import { CoreAnimations } from '@components/animations';
|
||||||
import { ModalController } from '@singletons';
|
import { ModalController } from '@singletons';
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modal that displays a list of sites to be able to enter or delete a site.
|
* Modal that displays a list of sites to be able to enter or delete a site.
|
||||||
|
@ -29,6 +30,10 @@ import { ModalController } from '@singletons';
|
||||||
selector: 'core-login-sites-modal',
|
selector: 'core-login-sites-modal',
|
||||||
templateUrl: 'sites-modal.html',
|
templateUrl: 'sites-modal.html',
|
||||||
animations: [CoreAnimations.SLIDE_IN_OUT, CoreAnimations.SHOW_HIDE],
|
animations: [CoreAnimations.SLIDE_IN_OUT, CoreAnimations.SHOW_HIDE],
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class CoreLoginSitesModalComponent implements OnInit {
|
export class CoreLoginSitesModalComponent implements OnInit {
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@ import { CoreSitesFactory } from '@services/sites-factory';
|
||||||
import { ONBOARDING_DONE } from '@features/login/constants';
|
import { ONBOARDING_DONE } from '@features/login/constants';
|
||||||
import { CoreUnauthenticatedSite } from '@classes/sites/unauthenticated-site';
|
import { CoreUnauthenticatedSite } from '@classes/sites/unauthenticated-site';
|
||||||
import { CoreKeyboard } from '@singletons/keyboard';
|
import { CoreKeyboard } from '@singletons/keyboard';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Site (url) chooser when adding a new site.
|
* Site (url) chooser when adding a new site.
|
||||||
|
@ -260,7 +261,7 @@ export class CoreLoginSitePage implements OnInit {
|
||||||
const { CoreLoginSiteHelpComponent } =
|
const { CoreLoginSiteHelpComponent } =
|
||||||
await import('@features/login/components/site-help/site-help');
|
await import('@features/login/components/site-help/site-help');
|
||||||
|
|
||||||
await CoreDomUtils.openModal({
|
await CoreModals.openModal({
|
||||||
component: CoreLoginSiteHelpComponent,
|
component: CoreLoginSiteHelpComponent,
|
||||||
cssClass: 'core-modal-fullscreen',
|
cssClass: 'core-modal-fullscreen',
|
||||||
});
|
});
|
||||||
|
@ -273,7 +274,7 @@ export class CoreLoginSitePage implements OnInit {
|
||||||
const { CoreLoginSiteOnboardingComponent } =
|
const { CoreLoginSiteOnboardingComponent } =
|
||||||
await import('@features/login/components/site-onboarding/site-onboarding');
|
await import('@features/login/components/site-onboarding/site-onboarding');
|
||||||
|
|
||||||
await CoreDomUtils.openModal({
|
await CoreModals.openModal({
|
||||||
component: CoreLoginSiteOnboardingComponent,
|
component: CoreLoginSiteOnboardingComponent,
|
||||||
cssClass: 'core-modal-fullscreen',
|
cssClass: 'core-modal-fullscreen',
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,14 +15,12 @@
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CoreSharedModule } from '@/core/shared.module';
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
import { CoreMainMenuUserButtonComponent } from './user-menu-button/user-menu-button';
|
import { CoreMainMenuUserButtonComponent } from './user-menu-button/user-menu-button';
|
||||||
import { CoreMainMenuUserMenuComponent } from './user-menu/user-menu';
|
|
||||||
import { CoreLoginComponentsModule } from '@features/login/components/components.module';
|
import { CoreLoginComponentsModule } from '@features/login/components/components.module';
|
||||||
import { CoreMainMenuUserMenuTourComponent } from './user-menu-tour/user-menu-tour';
|
import { CoreMainMenuUserMenuTourComponent } from './user-menu-tour/user-menu-tour';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
CoreMainMenuUserButtonComponent,
|
CoreMainMenuUserButtonComponent,
|
||||||
CoreMainMenuUserMenuComponent,
|
|
||||||
CoreMainMenuUserMenuTourComponent,
|
CoreMainMenuUserMenuTourComponent,
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -31,7 +29,6 @@ import { CoreMainMenuUserMenuTourComponent } from './user-menu-tour/user-menu-to
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
CoreMainMenuUserButtonComponent,
|
CoreMainMenuUserButtonComponent,
|
||||||
CoreMainMenuUserMenuComponent,
|
|
||||||
CoreMainMenuUserMenuTourComponent,
|
CoreMainMenuUserMenuTourComponent,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
|
@ -19,9 +19,8 @@ import { CoreUserToursAlignment, CoreUserToursSide } from '@features/usertours/s
|
||||||
import { IonRouterOutlet } from '@ionic/angular';
|
import { IonRouterOutlet } from '@ionic/angular';
|
||||||
import { CoreScreen } from '@services/screen';
|
import { CoreScreen } from '@services/screen';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreModals } from '@services/modals';
|
||||||
import { CoreMainMenuUserMenuTourComponent } from '../user-menu-tour/user-menu-tour';
|
import { CoreMainMenuUserMenuTourComponent } from '../user-menu-tour/user-menu-tour';
|
||||||
import { CoreMainMenuUserMenuComponent } from '../user-menu/user-menu';
|
|
||||||
import { CoreMainMenuPage } from '@features/mainmenu/pages/menu/menu';
|
import { CoreMainMenuPage } from '@features/mainmenu/pages/menu/menu';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -62,11 +61,13 @@ export class CoreMainMenuUserButtonComponent implements OnInit {
|
||||||
*
|
*
|
||||||
* @param event Click event.
|
* @param event Click event.
|
||||||
*/
|
*/
|
||||||
openUserMenu(event: Event): void {
|
async openUserMenu(event: Event): Promise<void> {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
CoreDomUtils.openSideModal<void>({
|
const { CoreMainMenuUserMenuComponent } = await import('../user-menu/user-menu');
|
||||||
|
|
||||||
|
CoreModals.openSideModal<void>({
|
||||||
component: CoreMainMenuUserMenuComponent,
|
component: CoreMainMenuUserMenuComponent,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,11 +13,11 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { CoreConstants } from '@/core/constants';
|
import { CoreConstants } from '@/core/constants';
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { CoreSite } from '@classes/sites/site';
|
import { CoreSite } from '@classes/sites/site';
|
||||||
import { CoreSiteInfo } from '@classes/sites/unauthenticated-site';
|
import { CoreSiteInfo } from '@classes/sites/unauthenticated-site';
|
||||||
import { CoreFilter } from '@features/filter/services/filter';
|
import { CoreFilter } from '@features/filter/services/filter';
|
||||||
import { CoreLoginSitesModalComponent } from '@features/login/components/sites-modal/sites-modal';
|
|
||||||
import { CoreLoginHelper } from '@features/login/services/login-helper';
|
import { CoreLoginHelper } from '@features/login/services/login-helper';
|
||||||
import { CoreUserAuthenticatedSupportConfig } from '@features/user/classes/support/authenticated-support-config';
|
import { CoreUserAuthenticatedSupportConfig } from '@features/user/classes/support/authenticated-support-config';
|
||||||
import { CoreUserSupport } from '@features/user/services/support';
|
import { CoreUserSupport } from '@features/user/services/support';
|
||||||
|
@ -28,6 +28,7 @@ import {
|
||||||
CoreUserProfileHandlerType,
|
CoreUserProfileHandlerType,
|
||||||
CoreUserDelegateContext,
|
CoreUserDelegateContext,
|
||||||
} from '@features/user/services/user-delegate';
|
} from '@features/user/services/user-delegate';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
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';
|
||||||
|
@ -41,7 +42,11 @@ import { Subscription } from 'rxjs';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'core-main-menu-user-menu',
|
selector: 'core-main-menu-user-menu',
|
||||||
templateUrl: 'user-menu.html',
|
templateUrl: 'user-menu.html',
|
||||||
styleUrls: ['user-menu.scss'],
|
styleUrl: 'user-menu.scss',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class CoreMainMenuUserMenuComponent implements OnInit, OnDestroy {
|
export class CoreMainMenuUserMenuComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
|
@ -248,7 +253,9 @@ export class CoreMainMenuUserMenuComponent implements OnInit, OnDestroy {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
const closeAll = await CoreDomUtils.openSideModal<boolean>({
|
const { CoreLoginSitesModalComponent } = await import('@features/login/components/sites-modal/sites-modal');
|
||||||
|
|
||||||
|
const closeAll = await CoreModals.openSideModal<boolean>({
|
||||||
component: CoreLoginSitesModalComponent,
|
component: CoreLoginSitesModalComponent,
|
||||||
cssClass: 'core-modal-lateral core-modal-lateral-sm',
|
cssClass: 'core-modal-lateral core-modal-lateral-sm',
|
||||||
});
|
});
|
||||||
|
|
|
@ -26,6 +26,7 @@ import { Subscription } from 'rxjs';
|
||||||
import { CORE_DATAPRIVACY_FEATURE_NAME, CORE_DATAPRIVACY_PAGE_NAME } from '@features/dataprivacy/constants';
|
import { CORE_DATAPRIVACY_FEATURE_NAME, CORE_DATAPRIVACY_PAGE_NAME } from '@features/dataprivacy/constants';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreDataPrivacy } from '@features/dataprivacy/services/dataprivacy';
|
import { CoreDataPrivacy } from '@features/dataprivacy/services/dataprivacy';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page to view user acceptances.
|
* Page to view user acceptances.
|
||||||
|
@ -194,7 +195,7 @@ export class CorePolicyAcceptancesPage implements OnInit, OnDestroy {
|
||||||
const { CorePolicyViewPolicyModalComponent } =
|
const { CorePolicyViewPolicyModalComponent } =
|
||||||
await import('@features/policy/components/policy-modal/policy-modal');
|
await import('@features/policy/components/policy-modal/policy-modal');
|
||||||
|
|
||||||
CoreDomUtils.openModal({
|
CoreModals.openModal({
|
||||||
component: CorePolicyViewPolicyModalComponent,
|
component: CorePolicyViewPolicyModalComponent,
|
||||||
componentProps: { policy },
|
componentProps: { policy },
|
||||||
});
|
});
|
||||||
|
|
|
@ -31,6 +31,7 @@ import { CoreScreen } from '@services/screen';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { CoreDom } from '@singletons/dom';
|
import { CoreDom } from '@singletons/dom';
|
||||||
import { CoreWait } from '@singletons/wait';
|
import { CoreWait } from '@singletons/wait';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page to accept a site policy.
|
* Page to accept a site policy.
|
||||||
|
@ -468,7 +469,7 @@ export class CorePolicySitePolicyPage implements OnInit, OnDestroy {
|
||||||
const { CorePolicyViewPolicyModalComponent } =
|
const { CorePolicyViewPolicyModalComponent } =
|
||||||
await import('@features/policy/components/policy-modal/policy-modal');
|
await import('@features/policy/components/policy-modal/policy-modal');
|
||||||
|
|
||||||
CoreDomUtils.openModal({
|
CoreModals.openModal({
|
||||||
component: CorePolicyViewPolicyModalComponent,
|
component: CorePolicyViewPolicyModalComponent,
|
||||||
componentProps: { policy },
|
componentProps: { policy },
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,8 +20,8 @@ import {
|
||||||
CoreRatingInfoItem,
|
CoreRatingInfoItem,
|
||||||
CoreRatingProvider,
|
CoreRatingProvider,
|
||||||
} from '@features/rating/services/rating';
|
} from '@features/rating/services/rating';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
|
||||||
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -120,7 +120,7 @@ export class CoreRatingAggregateComponent implements OnChanges, OnDestroy {
|
||||||
const { CoreRatingRatingsComponent } =
|
const { CoreRatingRatingsComponent } =
|
||||||
await import('@features/rating/components/ratings/ratings');
|
await import('@features/rating/components/ratings/ratings');
|
||||||
|
|
||||||
await CoreDomUtils.openModal({
|
await CoreModals.openModal({
|
||||||
component: CoreRatingRatingsComponent,
|
component: CoreRatingRatingsComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
contextLevel: this.contextLevel,
|
contextLevel: this.contextLevel,
|
||||||
|
|
|
@ -23,7 +23,8 @@ import {
|
||||||
} from '@features/rating/services/rating';
|
} from '@features/rating/services/rating';
|
||||||
import { CoreRatingOffline } from '@features/rating/services/rating-offline';
|
import { CoreRatingOffline } from '@features/rating/services/rating-offline';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreDomUtils, ToastDuration } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
|
import { CoreToasts, ToastDuration } from '@services/toasts';
|
||||||
import { Translate } from '@singletons';
|
import { Translate } from '@singletons';
|
||||||
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
||||||
|
|
||||||
|
@ -147,7 +148,11 @@ export class CoreRatingRateComponent implements OnChanges, OnDestroy {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response === undefined) {
|
if (response === undefined) {
|
||||||
CoreDomUtils.showToast('core.datastoredoffline', true, ToastDuration.LONG);
|
CoreToasts.show({
|
||||||
|
message: 'core.datastoredoffline',
|
||||||
|
translateMessage: true,
|
||||||
|
duration: ToastDuration.LONG,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this.onUpdate.emit();
|
this.onUpdate.emit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreRemindersSetReminderMenuComponent } from '../set-reminder-menu/set-reminder-menu';
|
import { CoreRemindersSetReminderMenuComponent } from '../set-reminder-menu/set-reminder-menu';
|
||||||
import { Translate } from '@singletons';
|
import { Translate } from '@singletons';
|
||||||
import { CoreTimeUtils } from '@services/utils/time';
|
import { CoreTimeUtils } from '@services/utils/time';
|
||||||
|
import { CoreToasts } from '@services/toasts';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component that displays a button to set a reminder.
|
* Component that displays a button to set a reminder.
|
||||||
|
@ -127,7 +128,10 @@ export class CoreRemindersSetButtonComponent implements OnInit {
|
||||||
|
|
||||||
if (timebefore === undefined || timebefore === CoreRemindersService.DISABLED) {
|
if (timebefore === undefined || timebefore === CoreRemindersService.DISABLED) {
|
||||||
this.setTimebefore(undefined);
|
this.setTimebefore(undefined);
|
||||||
CoreDomUtils.showToast('core.reminders.reminderunset', true);
|
CoreToasts.show({
|
||||||
|
message: 'core.reminders.reminderunset',
|
||||||
|
translateMessage: true,
|
||||||
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -148,8 +152,8 @@ export class CoreRemindersSetButtonComponent implements OnInit {
|
||||||
await CoreReminders.addReminder(reminder);
|
await CoreReminders.addReminder(reminder);
|
||||||
|
|
||||||
const time = this.time - timebefore;
|
const time = this.time - timebefore;
|
||||||
const text = Translate.instant('core.reminders.reminderset', { $a: CoreTimeUtils.userDate(time * 1000) });
|
const message = Translate.instant('core.reminders.reminderset', { $a: CoreTimeUtils.userDate(time * 1000) });
|
||||||
CoreDomUtils.showToast(text);
|
CoreToasts.show({ message });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,6 @@ import { NgModule } from '@angular/core';
|
||||||
import { CoreSharedModule } from '@/core/shared.module';
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
import { CoreReportBuilderReportColumnComponent } from './report-column/report-column';
|
import { CoreReportBuilderReportColumnComponent } from './report-column/report-column';
|
||||||
import { CoreReportBuilderReportDetailComponent } from './report-detail/report-detail';
|
import { CoreReportBuilderReportDetailComponent } from './report-detail/report-detail';
|
||||||
import { CoreReportBuilderReportSummaryComponent } from './report-summary/report-summary';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -25,12 +24,10 @@ import { CoreReportBuilderReportSummaryComponent } from './report-summary/report
|
||||||
declarations: [
|
declarations: [
|
||||||
CoreReportBuilderReportDetailComponent,
|
CoreReportBuilderReportDetailComponent,
|
||||||
CoreReportBuilderReportColumnComponent,
|
CoreReportBuilderReportColumnComponent,
|
||||||
CoreReportBuilderReportSummaryComponent,
|
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
CoreReportBuilderReportDetailComponent,
|
CoreReportBuilderReportDetailComponent,
|
||||||
CoreReportBuilderReportColumnComponent,
|
CoreReportBuilderReportColumnComponent,
|
||||||
CoreReportBuilderReportSummaryComponent,
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class CoreReportBuilderComponentsModule {}
|
export class CoreReportBuilderComponentsModule {}
|
||||||
|
|
|
@ -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 { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
|
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
|
||||||
import { CoreReportBuilderReportDetail } from '@features/reportbuilder/services/reportbuilder';
|
import { CoreReportBuilderReportDetail } from '@features/reportbuilder/services/reportbuilder';
|
||||||
import { CoreFormatDatePipe } from '@pipes/format-date';
|
import { CoreFormatDatePipe } from '@pipes/format-date';
|
||||||
|
@ -21,8 +22,12 @@ import { ModalController } from '@singletons';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'core-report-builder-report-summary',
|
selector: 'core-report-builder-report-summary',
|
||||||
templateUrl: './report-summary.html',
|
templateUrl: './report-summary.html',
|
||||||
styleUrls: ['./report-summary.scss'],
|
styleUrl: './report-summary.scss',
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class CoreReportBuilderReportSummaryComponent implements OnInit {
|
export class CoreReportBuilderReportSummaryComponent implements OnInit {
|
||||||
|
|
||||||
|
@ -30,6 +35,9 @@ export class CoreReportBuilderReportSummaryComponent implements OnInit {
|
||||||
reportUrl!: string;
|
reportUrl!: string;
|
||||||
reportDetailToDisplay!: { title: string; text: string }[];
|
reportDetailToDisplay!: { title: string; text: string }[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritdoc
|
||||||
|
*/
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
const formatDate = new CoreFormatDatePipe();
|
const formatDate = new CoreFormatDatePipe();
|
||||||
const site = CoreSites.getRequiredCurrentSite();
|
const site = CoreSites.getRequiredCurrentSite();
|
||||||
|
@ -54,6 +62,9 @@ export class CoreReportBuilderReportSummaryComponent implements OnInit {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close the modal.
|
||||||
|
*/
|
||||||
closeModal(): void {
|
closeModal(): void {
|
||||||
ModalController.dismiss();
|
ModalController.dismiss();
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,10 +13,9 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { CoreReportBuilderReportSummaryComponent } from '@features/reportbuilder/components/report-summary/report-summary';
|
|
||||||
import { CoreReportBuilderReportDetail } from '@features/reportbuilder/services/reportbuilder';
|
import { CoreReportBuilderReportDetail } from '@features/reportbuilder/services/reportbuilder';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'core-report-builder-report',
|
selector: 'core-report-builder-report',
|
||||||
|
@ -26,6 +25,7 @@ export class CoreReportBuilderReportPage implements OnInit {
|
||||||
|
|
||||||
reportId!: string;
|
reportId!: string;
|
||||||
reportDetail?: CoreReportBuilderReportDetail;
|
reportDetail?: CoreReportBuilderReportDetail;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
|
@ -42,8 +42,14 @@ export class CoreReportBuilderReportPage implements OnInit {
|
||||||
this.reportDetail = reportDetail;
|
this.reportDetail = reportDetail;
|
||||||
}
|
}
|
||||||
|
|
||||||
openInfo(): void {
|
/**
|
||||||
CoreDomUtils.openSideModal<void>({
|
* Open the report info modal.
|
||||||
|
*/
|
||||||
|
async openInfo(): Promise<void> {
|
||||||
|
const { CoreReportBuilderReportSummaryComponent } =
|
||||||
|
await import('@features/reportbuilder/components/report-summary/report-summary');
|
||||||
|
|
||||||
|
CoreModals.openSideModal<void>({
|
||||||
component: CoreReportBuilderReportSummaryComponent,
|
component: CoreReportBuilderReportSummaryComponent,
|
||||||
componentProps: { reportDetail: this.reportDetail },
|
componentProps: { reportDetail: this.reportDetail },
|
||||||
});
|
});
|
||||||
|
|
|
@ -23,6 +23,7 @@ import {
|
||||||
import { CoreEvents } from '@singletons/events';
|
import { CoreEvents } from '@singletons/events';
|
||||||
import { ModalController } from '@singletons';
|
import { ModalController } from '@singletons';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
|
import { CoreSharedModule } from '@/core/shared.module';
|
||||||
|
|
||||||
type Filter<T=unknown> = T & { checked: boolean };
|
type Filter<T=unknown> = T & { checked: boolean };
|
||||||
|
|
||||||
|
@ -30,6 +31,10 @@ type Filter<T=unknown> = T & { checked: boolean };
|
||||||
selector: 'core-search-global-search-filters',
|
selector: 'core-search-global-search-filters',
|
||||||
templateUrl: 'global-search-filters.html',
|
templateUrl: 'global-search-filters.html',
|
||||||
styleUrls: ['./global-search-filters.scss'],
|
styleUrls: ['./global-search-filters.scss'],
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CoreSharedModule,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class CoreSearchGlobalSearchFiltersComponent implements OnInit {
|
export class CoreSearchGlobalSearchFiltersComponent implements OnInit {
|
||||||
|
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
// (C) Copyright 2015 Moodle Pty Ltd.
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
import { CoreSharedModule } from '@/core/shared.module';
|
|
||||||
import { NgModule } from '@angular/core';
|
|
||||||
|
|
||||||
import { CoreSearchGlobalSearchFiltersComponent } from './global-search-filters.component';
|
|
||||||
|
|
||||||
export { CoreSearchGlobalSearchFiltersComponent };
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [
|
|
||||||
CoreSharedModule,
|
|
||||||
],
|
|
||||||
declarations: [
|
|
||||||
CoreSearchGlobalSearchFiltersComponent,
|
|
||||||
],
|
|
||||||
})
|
|
||||||
export class CoreSearchGlobalSearchFiltersComponentModule {}
|
|
|
@ -29,6 +29,7 @@ import {
|
||||||
} from '@features/search/services/global-search';
|
} from '@features/search/services/global-search';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreSearchBoxComponent } from '@features/search/components/search-box/search-box';
|
import { CoreSearchBoxComponent } from '@features/search/components/search-box/search-box';
|
||||||
|
import { CoreModals } from '@services/modals';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'page-core-search-global-search',
|
selector: 'page-core-search-global-search',
|
||||||
|
@ -137,9 +138,9 @@ export class CoreSearchGlobalSearchPage implements OnInit, OnDestroy, AfterViewI
|
||||||
*/
|
*/
|
||||||
async openFilters(): Promise<void> {
|
async openFilters(): Promise<void> {
|
||||||
const { CoreSearchGlobalSearchFiltersComponent } =
|
const { CoreSearchGlobalSearchFiltersComponent } =
|
||||||
await import('@features/search/components/global-search-filters/global-search-filters.module');
|
await import('@features/search/components/global-search-filters/global-search-filters.component');
|
||||||
|
|
||||||
await CoreDomUtils.openSideModal<CoreSearchGlobalSearchFilters>({
|
await CoreModals.openSideModal<CoreSearchGlobalSearchFilters>({
|
||||||
component: CoreSearchGlobalSearchFiltersComponent,
|
component: CoreSearchGlobalSearchFiltersComponent,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
hideCourses: !!this.courseId,
|
hideCourses: !!this.courseId,
|
||||||
|
|
|
@ -24,7 +24,8 @@ import { CoreFile } from '@services/file';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CorePlatform } from '@services/platform';
|
import { CorePlatform } from '@services/platform';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreDomUtils, ToastDuration } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
|
import { CoreToasts, ToastDuration } from '@services/toasts';
|
||||||
import { CoreText } from '@singletons/text';
|
import { CoreText } from '@singletons/text';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -177,7 +178,7 @@ export class CoreSettingsDevPage implements OnInit {
|
||||||
await CoreConfig.delete(ONBOARDING_DONE);
|
await CoreConfig.delete(ONBOARDING_DONE);
|
||||||
await CoreConfig.delete(FAQ_QRCODE_INFO_DONE);
|
await CoreConfig.delete(FAQ_QRCODE_INFO_DONE);
|
||||||
|
|
||||||
CoreDomUtils.showToast('User tours have been reseted');
|
CoreToasts.show({ message: 'User tours have been reseted' });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -194,7 +195,10 @@ export class CoreSettingsDevPage implements OnInit {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await CoreDomUtils.showToast('Caches invalidated', true, ToastDuration.LONG);
|
await CoreToasts.show({
|
||||||
|
message: 'Caches invalidated',
|
||||||
|
duration: ToastDuration.LONG,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -205,7 +209,7 @@ export class CoreSettingsDevPage implements OnInit {
|
||||||
await CoreFile.clearDeletedSitesFolder(sites);
|
await CoreFile.clearDeletedSitesFolder(sites);
|
||||||
await CoreFile.clearTmpFolder();
|
await CoreFile.clearTmpFolder();
|
||||||
|
|
||||||
CoreDomUtils.showToast('File storage cleared');
|
CoreToasts.show({ message: 'File storage cleared' });
|
||||||
}
|
}
|
||||||
|
|
||||||
async setEnabledStagingSites(enabled: boolean): Promise<void> {
|
async setEnabledStagingSites(enabled: boolean): Promise<void> {
|
||||||
|
|
|
@ -23,7 +23,7 @@ import { CoreUtils } from '@services/utils/utils';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { CorePushNotifications } from '@features/pushnotifications/services/pushnotifications';
|
import { CorePushNotifications } from '@features/pushnotifications/services/pushnotifications';
|
||||||
import { CoreConfig } from '@services/config';
|
import { CoreConfig } from '@services/config';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreToasts } from '@services/toasts';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CorePlatform } from '@services/platform';
|
import { CorePlatform } from '@services/platform';
|
||||||
import { CoreNetwork } from '@services/network';
|
import { CoreNetwork } from '@services/network';
|
||||||
|
@ -86,9 +86,6 @@ export class CoreSettingsDeviceInfoPage implements OnDestroy {
|
||||||
protected onlineObserver?: Subscription;
|
protected onlineObserver?: Subscription;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
const sitesProvider = CoreSites.instance;
|
|
||||||
const device = Device.instance;
|
|
||||||
const translate = Translate.instance;
|
|
||||||
const navigator = window.navigator;
|
const navigator = window.navigator;
|
||||||
|
|
||||||
this.deviceInfo = {
|
this.deviceInfo = {
|
||||||
|
@ -128,7 +125,7 @@ export class CoreSettingsDeviceInfoPage implements OnDestroy {
|
||||||
this.deviceOsTranslated = matches[1];
|
this.deviceOsTranslated = matches[1];
|
||||||
} else {
|
} else {
|
||||||
this.deviceInfo.deviceOs = 'unknown';
|
this.deviceInfo.deviceOs = 'unknown';
|
||||||
this.deviceOsTranslated = translate.instant('core.unknown');
|
this.deviceOsTranslated = Translate.instant('core.unknown');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -139,11 +136,10 @@ export class CoreSettingsDeviceInfoPage implements OnDestroy {
|
||||||
this.deviceOsTranslated = matches[1];
|
this.deviceOsTranslated = matches[1];
|
||||||
} else {
|
} else {
|
||||||
this.deviceInfo.deviceOs = 'unknown';
|
this.deviceInfo.deviceOs = 'unknown';
|
||||||
this.deviceOsTranslated = translate.instant('core.unknown');
|
this.deviceOsTranslated = Translate.instant('core.unknown');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (navigator) {
|
|
||||||
if (navigator.userAgent) {
|
if (navigator.userAgent) {
|
||||||
this.deviceInfo.userAgent = navigator.userAgent;
|
this.deviceInfo.userAgent = navigator.userAgent;
|
||||||
}
|
}
|
||||||
|
@ -151,27 +147,24 @@ export class CoreSettingsDeviceInfoPage implements OnDestroy {
|
||||||
if (navigator.language) {
|
if (navigator.language) {
|
||||||
this.deviceInfo.browserLanguage = navigator.language;
|
this.deviceInfo.browserLanguage = navigator.language;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Device.cordova) {
|
||||||
|
this.deviceInfo.cordovaVersion = Device.cordova;
|
||||||
|
}
|
||||||
|
if (Device.platform) {
|
||||||
|
this.deviceInfo.platform = Device.platform;
|
||||||
|
}
|
||||||
|
if (Device.version) {
|
||||||
|
this.deviceInfo.osVersion = Device.version;
|
||||||
|
}
|
||||||
|
if (Device.model) {
|
||||||
|
this.deviceInfo.model = Device.model;
|
||||||
|
}
|
||||||
|
if (Device.uuid) {
|
||||||
|
this.deviceInfo.uuid = Device.uuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device) {
|
const currentSite = CoreSites.getCurrentSite();
|
||||||
if (device.cordova) {
|
|
||||||
this.deviceInfo.cordovaVersion = device.cordova;
|
|
||||||
}
|
|
||||||
if (device.platform) {
|
|
||||||
this.deviceInfo.platform = device.platform;
|
|
||||||
}
|
|
||||||
if (device.version) {
|
|
||||||
this.deviceInfo.osVersion = device.version;
|
|
||||||
}
|
|
||||||
if (device.model) {
|
|
||||||
this.deviceInfo.model = device.model;
|
|
||||||
}
|
|
||||||
if (device.uuid) {
|
|
||||||
this.deviceInfo.uuid = device.uuid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const currentSite = sitesProvider.getCurrentSite();
|
|
||||||
this.deviceInfo.siteId = currentSite?.getId();
|
this.deviceInfo.siteId = currentSite?.getId();
|
||||||
this.deviceInfo.siteVersion = currentSite?.getInfo()?.release;
|
this.deviceInfo.siteVersion = currentSite?.getInfo()?.release;
|
||||||
|
|
||||||
|
@ -190,14 +183,11 @@ export class CoreSettingsDeviceInfoPage implements OnDestroy {
|
||||||
* Async part of the constructor.
|
* Async part of the constructor.
|
||||||
*/
|
*/
|
||||||
protected async asyncInit(): Promise<void> {
|
protected async asyncInit(): Promise<void> {
|
||||||
const sitesProvider = CoreSites.instance;
|
|
||||||
const fileProvider = CoreFile.instance;
|
|
||||||
|
|
||||||
const lang = await CoreLang.getCurrentLanguage();
|
const lang = await CoreLang.getCurrentLanguage();
|
||||||
this.deviceInfo.currentLanguage = lang;
|
this.deviceInfo.currentLanguage = lang;
|
||||||
this.currentLangName = CoreConstants.CONFIG.languages[lang];
|
this.currentLangName = CoreConstants.CONFIG.languages[lang];
|
||||||
|
|
||||||
const currentSite = sitesProvider.getCurrentSite();
|
const currentSite = CoreSites.getCurrentSite();
|
||||||
const isSingleFixedSite = await CoreLoginHelper.isSingleFixedSite();
|
const isSingleFixedSite = await CoreLoginHelper.isSingleFixedSite();
|
||||||
const sites = await CoreLoginHelper.getAvailableSites();
|
const sites = await CoreLoginHelper.getAvailableSites();
|
||||||
const firstUrl = isSingleFixedSite && sites[0].url;
|
const firstUrl = isSingleFixedSite && sites[0].url;
|
||||||
|
@ -207,10 +197,10 @@ export class CoreSettingsDeviceInfoPage implements OnDestroy {
|
||||||
this.displaySiteUrl = !!this.deviceInfo.siteUrl &&
|
this.displaySiteUrl = !!this.deviceInfo.siteUrl &&
|
||||||
(currentSite ?? CoreSitesFactory.makeUnauthenticatedSite(this.deviceInfo.siteUrl)).shouldDisplayInformativeLinks();
|
(currentSite ?? CoreSitesFactory.makeUnauthenticatedSite(this.deviceInfo.siteUrl)).shouldDisplayInformativeLinks();
|
||||||
|
|
||||||
if (fileProvider.isAvailable()) {
|
if (CoreFile.isAvailable()) {
|
||||||
const basepath = await fileProvider.getBasePath();
|
const basepath = await CoreFile.getBasePath();
|
||||||
this.deviceInfo.fileSystemRoot = basepath;
|
this.deviceInfo.fileSystemRoot = basepath;
|
||||||
this.fsClickable = fileProvider.usesHTMLAPI();
|
this.fsClickable = CoreFile.usesHTMLAPI();
|
||||||
}
|
}
|
||||||
|
|
||||||
const showDevOptionsOnConfig = await CoreConfig.get('showDevOptions', 0);
|
const showDevOptionsOnConfig = await CoreConfig.get('showDevOptions', 0);
|
||||||
|
@ -265,7 +255,10 @@ export class CoreSettingsDeviceInfoPage implements OnDestroy {
|
||||||
this.showDevOptions = true;
|
this.showDevOptions = true;
|
||||||
await CoreConfig.set('showDevOptions', 1);
|
await CoreConfig.set('showDevOptions', 1);
|
||||||
|
|
||||||
CoreDomUtils.showToast('core.settings.youradev', true);
|
CoreToasts.show({
|
||||||
|
message: 'core.settings.youradev',
|
||||||
|
translateMessage: true,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this.showDevOptions = false;
|
this.showDevOptions = false;
|
||||||
await CoreConfig.delete('showDevOptions');
|
await CoreConfig.delete('showDevOptions');
|
||||||
|
|
|
@ -29,6 +29,7 @@ import { NgZone } from '@singletons';
|
||||||
import { CoreConstants } from '@/core/constants';
|
import { CoreConstants } from '@/core/constants';
|
||||||
import { CoreConfig } from '@services/config';
|
import { CoreConfig } from '@services/config';
|
||||||
import { CoreSettingsHandlersSource } from '@features/settings/classes/settings-handlers-source';
|
import { CoreSettingsHandlersSource } from '@features/settings/classes/settings-handlers-source';
|
||||||
|
import { CoreToasts } from '@services/toasts';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays the list of site settings pages.
|
* Page that displays the list of site settings pages.
|
||||||
|
@ -117,7 +118,10 @@ export class CoreSitePreferencesPage implements AfterViewInit, OnDestroy {
|
||||||
// Using syncOnlyOnWifi false to force manual sync.
|
// Using syncOnlyOnWifi false to force manual sync.
|
||||||
await CoreSettingsHelper.synchronizeSite(false, this.siteId);
|
await CoreSettingsHelper.synchronizeSite(false, this.siteId);
|
||||||
|
|
||||||
CoreDomUtils.showToast('core.settings.sitesynccompleted', true);
|
CoreToasts.show({
|
||||||
|
message: 'core.settings.sitesynccompleted',
|
||||||
|
translateMessage: true,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (this.isDestroyed) {
|
if (this.isDestroyed) {
|
||||||
return;
|
return;
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue