diff --git a/src/addons/mod/assign/classes/base-feedback-plugin-component.ts b/src/addons/mod/assign/classes/base-feedback-plugin-component.ts index 31713b758..f2211a3bc 100644 --- a/src/addons/mod/assign/classes/base-feedback-plugin-component.ts +++ b/src/addons/mod/assign/classes/base-feedback-plugin-component.ts @@ -27,10 +27,10 @@ import { AddonModAssignAssign, AddonModAssignPlugin, AddonModAssignSubmission } }) export class AddonModAssignFeedbackPluginBaseComponent implements IAddonModAssignFeedbackPluginComponent { - @Input() assign!: AddonModAssignAssign; // The assignment. - @Input() submission!: AddonModAssignSubmission; // The submission. - @Input() plugin!: AddonModAssignPlugin; // The plugin object. - @Input() userId!: number; // The user ID of the submission. + @Input({ required: true }) assign!: AddonModAssignAssign; // The assignment. + @Input({ required: true }) submission!: AddonModAssignSubmission; // The submission. + @Input({ required: true }) plugin!: AddonModAssignPlugin; // The plugin object. + @Input({ required: true }) userId!: number; // The user ID of the submission. @Input() configs?: Record; // The configs for the plugin. @Input() canEdit = false; // Whether the user can edit. @Input() edit = false; // Whether the user is editing. diff --git a/src/addons/mod/assign/classes/base-submission-plugin-component.ts b/src/addons/mod/assign/classes/base-submission-plugin-component.ts index 56f938d0b..b2251af07 100644 --- a/src/addons/mod/assign/classes/base-submission-plugin-component.ts +++ b/src/addons/mod/assign/classes/base-submission-plugin-component.ts @@ -23,9 +23,9 @@ import { AddonModAssignAssign, AddonModAssignPlugin, AddonModAssignSubmission } }) export class AddonModAssignSubmissionPluginBaseComponent { - @Input() assign!: AddonModAssignAssign; // The assignment. - @Input() submission!: AddonModAssignSubmission; // The submission. - @Input() plugin!: AddonModAssignPlugin; // The plugin object. + @Input({ required: true }) assign!: AddonModAssignAssign; // The assignment. + @Input({ required: true }) submission!: AddonModAssignSubmission; // The submission. + @Input({ required: true }) plugin!: AddonModAssignPlugin; // The plugin object. @Input() configs?: Record; // The configs for the plugin. @Input() edit = false; // Whether the user is editing. @Input() allowOffline = false; // Whether to allow offline. diff --git a/src/addons/mod/assign/components/edit-feedback-modal/edit-feedback-modal.ts b/src/addons/mod/assign/components/edit-feedback-modal/edit-feedback-modal.ts index 35682d76f..aafd35365 100644 --- a/src/addons/mod/assign/components/edit-feedback-modal/edit-feedback-modal.ts +++ b/src/addons/mod/assign/components/edit-feedback-modal/edit-feedback-modal.ts @@ -37,10 +37,10 @@ import { AddonModAssignComponentsModule } from '../components.module'; }) export class AddonModAssignEditFeedbackModalComponent { - @Input() assign!: AddonModAssignAssign; // The assignment. - @Input() submission!: AddonModAssignSubmission; // The submission. - @Input() plugin!: AddonModAssignPlugin; // The plugin object. - @Input() userId!: number; // The user ID of the submission. + @Input({ required: true }) assign!: AddonModAssignAssign; // The assignment. + @Input({ required: true }) submission!: AddonModAssignSubmission; // The submission. + @Input({ required: true }) plugin!: AddonModAssignPlugin; // The plugin object. + @Input({ required: true }) userId!: number; // The user ID of the submission. @ViewChild('editFeedbackForm') formElement?: ElementRef; diff --git a/src/addons/mod/assign/components/feedback-plugin/feedback-plugin.ts b/src/addons/mod/assign/components/feedback-plugin/feedback-plugin.ts index 136e991b5..dbec8e19d 100644 --- a/src/addons/mod/assign/components/feedback-plugin/feedback-plugin.ts +++ b/src/addons/mod/assign/components/feedback-plugin/feedback-plugin.ts @@ -37,10 +37,10 @@ export class AddonModAssignFeedbackPluginComponent implements OnInit { @ViewChild(CoreDynamicComponent) dynamicComponent!: CoreDynamicComponent; - @Input() assign!: AddonModAssignAssign; // The assignment. - @Input() submission!: AddonModAssignSubmission; // The submission. - @Input() plugin!: AddonModAssignPlugin; // The plugin object. - @Input() userId!: number; // The user ID of the submission. + @Input({ required: true }) assign!: AddonModAssignAssign; // The assignment. + @Input({ required: true }) submission!: AddonModAssignSubmission; // The submission. + @Input({ required: true }) plugin!: AddonModAssignPlugin; // The plugin object. + @Input({ required: true }) userId!: number; // The user ID of the submission. @Input() canEdit = false; // Whether the user can edit. @Input() edit = false; // Whether the user is editing. diff --git a/src/addons/mod/assign/components/submission-plugin/submission-plugin.ts b/src/addons/mod/assign/components/submission-plugin/submission-plugin.ts index 93210b120..929bf34a4 100644 --- a/src/addons/mod/assign/components/submission-plugin/submission-plugin.ts +++ b/src/addons/mod/assign/components/submission-plugin/submission-plugin.ts @@ -37,9 +37,9 @@ export class AddonModAssignSubmissionPluginComponent implements OnInit { @ViewChild(CoreDynamicComponent) dynamicComponent!: CoreDynamicComponent; - @Input() assign!: AddonModAssignAssign; // The assignment. - @Input() submission!: AddonModAssignSubmission; // The submission. - @Input() plugin!: AddonModAssignPlugin; // The plugin object. + @Input({ required: true }) assign!: AddonModAssignAssign; // The assignment. + @Input({ required: true }) submission!: AddonModAssignSubmission; // The submission. + @Input({ required: true }) plugin!: AddonModAssignPlugin; // The plugin object. @Input() edit = false; // Whether the user is editing. @Input() allowOffline = false; // Whether to allow offline. diff --git a/src/addons/mod/assign/components/submission/submission.ts b/src/addons/mod/assign/components/submission/submission.ts index 420b69701..5d4148030 100644 --- a/src/addons/mod/assign/components/submission/submission.ts +++ b/src/addons/mod/assign/components/submission/submission.ts @@ -82,9 +82,9 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can @ViewChildren(AddonModAssignSubmissionPluginComponent) submissionComponents!: QueryList; - @Input() courseId!: number; // Course ID the submission belongs to. - @Input() moduleId!: number; // Module ID the submission belongs to. - @Input() submitId!: number; // User that did the submission. + @Input({ required: true }) courseId!: number; // Course ID the submission belongs to. + @Input({ required: true }) moduleId!: number; // Module ID the submission belongs to. + @Input() submitId!: number; // User that did the submission. Defaults to current user @Input() blindId?: number; // Blinded user ID (if it's blinded). loaded = false; // Whether data has been loaded. diff --git a/src/addons/mod/chat/components/users-modal/users-modal.ts b/src/addons/mod/chat/components/users-modal/users-modal.ts index 1ebd510e7..6f40a45fd 100644 --- a/src/addons/mod/chat/components/users-modal/users-modal.ts +++ b/src/addons/mod/chat/components/users-modal/users-modal.ts @@ -33,8 +33,8 @@ import { CoreSharedModule } from '@/core/shared.module'; }) export class AddonModChatUsersModalComponent implements OnInit, OnDestroy { - @Input() sessionId!: string; - @Input() cmId!: number; + @Input({ required: true }) sessionId!: string; + @Input({ required: true }) cmId!: number; users: AddonModChatUser[] = []; usersLoaded = false; diff --git a/src/addons/mod/data/classes/base-field-plugin-component.ts b/src/addons/mod/data/classes/base-field-plugin-component.ts index 93483a028..72a64b03c 100644 --- a/src/addons/mod/data/classes/base-field-plugin-component.ts +++ b/src/addons/mod/data/classes/base-field-plugin-component.ts @@ -26,8 +26,8 @@ import { AddonModDataTemplateMode } from '../constants'; }) export abstract class AddonModDataFieldPluginBaseComponent implements OnInit, OnChanges { - @Input() mode!: AddonModDataTemplateMode; // The render mode. - @Input() field!: AddonModDataField; // The field to render. + @Input({ required: true }) mode!: AddonModDataTemplateMode; // The render mode. + @Input({ required: true }) field!: AddonModDataField; // The field to render. @Input() value?: Partial; // The value of the field. @Input() database?: AddonModDataData; // Database object. @Input() error?: string; // Error when editing. diff --git a/src/addons/mod/data/components/action/action.ts b/src/addons/mod/data/components/action/action.ts index 10022f9f8..57a9da66d 100644 --- a/src/addons/mod/data/components/action/action.ts +++ b/src/addons/mod/data/components/action/action.ts @@ -45,10 +45,10 @@ import { export class AddonModDataActionComponent implements OnInit { @Input() access?: AddonModDataGetDataAccessInformationWSResponse; // Access info. - @Input() mode!: AddonModDataTemplateMode; // The render mode. - @Input() action!: AddonModDataAction; // The field to render. - @Input() entry!: AddonModDataEntry; // The value of the field. - @Input() database!: AddonModDataData; // Database object. + @Input({ required: true }) mode!: AddonModDataTemplateMode; // The render mode. + @Input({ required: true }) action!: AddonModDataAction; // The field to render. + @Input({ required: true }) entry!: AddonModDataEntry; // The value of the field. + @Input({ required: true }) database!: AddonModDataData; // Database object. @Input() title = ''; // Name of the module. @Input() group = 0; // Module group. @Input() offset?: number; // Offset of the entry. diff --git a/src/addons/mod/data/components/field-plugin/field-plugin.ts b/src/addons/mod/data/components/field-plugin/field-plugin.ts index 3527ccee3..f364c1a67 100644 --- a/src/addons/mod/data/components/field-plugin/field-plugin.ts +++ b/src/addons/mod/data/components/field-plugin/field-plugin.ts @@ -32,8 +32,8 @@ export class AddonModDataFieldPluginComponent implements OnInit, OnChanges { @ViewChild(CoreDynamicComponent) dynamicComponent?: CoreDynamicComponent; - @Input() mode!: AddonModDataTemplateMode; // The render mode. - @Input() field!: AddonModDataField; // The field to render. + @Input({ required: true }) mode!: AddonModDataTemplateMode; // The render mode. + @Input({ required: true }) field!: AddonModDataField; // The field to render. @Input() value?: unknown; // The value of the field. @Input() database?: AddonModDataData; // Database object. @Input() error?: string; // Error when editing. diff --git a/src/addons/mod/data/components/search-modal/search-modal.ts b/src/addons/mod/data/components/search-modal/search-modal.ts index 2867c9fea..9f7cf1086 100644 --- a/src/addons/mod/data/components/search-modal/search-modal.ts +++ b/src/addons/mod/data/components/search-modal/search-modal.ts @@ -50,9 +50,9 @@ export class AddonModDataSearchModalComponent implements OnInit { @ViewChild('searchFormEl') formElement!: ElementRef; - @Input() search!: AddonModDataSearchDataParams; - @Input() fields!: Record; - @Input() database!: AddonModDataData; + @Input({ required: true }) search!: AddonModDataSearchDataParams; + @Input({ required: true }) fields!: Record; + @Input({ required: true }) database!: AddonModDataData; advancedSearch = ''; advancedIndexed: CoreFormFields = {}; diff --git a/src/addons/mod/forum/components/discussion-options-menu/discussion-options-menu.ts b/src/addons/mod/forum/components/discussion-options-menu/discussion-options-menu.ts index 0eb646d2d..91e3041fa 100644 --- a/src/addons/mod/forum/components/discussion-options-menu/discussion-options-menu.ts +++ b/src/addons/mod/forum/components/discussion-options-menu/discussion-options-menu.ts @@ -30,9 +30,9 @@ import { CoreToasts } from '@services/toasts'; }) export class AddonModForumDiscussionOptionsMenuComponent implements OnInit { - @Input() discussion!: AddonModForumDiscussion; // The discussion. - @Input() forumId!: number; // The forum Id. - @Input() cmId!: number; // The component module Id. + @Input({ required: true }) discussion!: AddonModForumDiscussion; // The discussion. + @Input({ required: true }) forumId!: number; // The forum Id. + @Input({ required: true }) cmId!: number; // The component module Id. canPin = false; diff --git a/src/addons/mod/forum/components/post-options-menu/post-options-menu.ts b/src/addons/mod/forum/components/post-options-menu/post-options-menu.ts index 8dccdcb02..e7f44e28b 100644 --- a/src/addons/mod/forum/components/post-options-menu/post-options-menu.ts +++ b/src/addons/mod/forum/components/post-options-menu/post-options-menu.ts @@ -30,9 +30,9 @@ import { CoreNetworkError } from '@classes/errors/network-error'; }) export class AddonModForumPostOptionsMenuComponent implements OnInit { - @Input() post!: AddonModForumPost; // The post. - @Input() cmId!: number; - @Input() forumId!: number; // The forum Id. + @Input({ required: true }) post!: AddonModForumPost; // The post. + @Input({ required: true }) cmId!: number; + @Input({ required: true }) forumId!: number; // The forum Id. canEdit = false; canDelete = false; diff --git a/src/addons/mod/forum/components/post/post.ts b/src/addons/mod/forum/components/post/post.ts index 759782675..496b313b8 100644 --- a/src/addons/mod/forum/components/post/post.ts +++ b/src/addons/mod/forum/components/post/post.ts @@ -65,17 +65,17 @@ import { CoreToasts } from '@services/toasts'; }) export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges { - @Input() post!: AddonModForumPost; // Post. - @Input() courseId!: number; // Post's course ID. - @Input() discussionId!: number; // Post's' discussion ID. + @Input({ required: true }) post!: AddonModForumPost; // Post. + @Input({ required: true }) courseId!: number; // Post's course ID. + @Input({ required: true }) discussionId!: number; // Post's' discussion ID. @Input() discussion?: AddonModForumDiscussion; // Post's' discussion, only for starting posts. - @Input() component!: string; // Component this post belong to. - @Input() componentId!: number; // Component ID. - @Input() formData!: AddonModForumSharedPostFormData; // Object with the new post data. Usually shared between posts. - @Input() originalData!: Omit; // Original post data. Usually shared between posts. - @Input() trackPosts!: boolean; // True if post is being tracked. - @Input() forum!: AddonModForumData; // The forum the post belongs to. Required for attachments and offline posts. - @Input() accessInfo!: AddonModForumAccessInformation; // Forum access information. + @Input({ required: true }) component!: string; // Component this post belong to. + @Input({ required: true }) componentId!: number; // Component ID. + @Input({ required: true }) formData!: AddonModForumSharedPostFormData; // New post data. Usually shared between posts. + @Input({ required: true }) originalData!: Omit; // Original data. Usually shared between posts. + @Input({ required: true }) trackPosts!: boolean; // True if post is being tracked. + @Input({ required: true }) forum!: AddonModForumData; // The forum the post belongs to. + @Input({ required: true }) accessInfo!: AddonModForumAccessInformation; // Forum access information. @Input() parentSubject?: string; // Subject of parent post. @Input() ratingInfo?: CoreRatingInfo; // Rating info item. @Input() leavingPage?: boolean; // Whether the page that contains this post is being left and will be destroyed. diff --git a/src/addons/mod/quiz/components/attempt-info/attempt-info.ts b/src/addons/mod/quiz/components/attempt-info/attempt-info.ts index 25c0498ac..4e6ef30c6 100644 --- a/src/addons/mod/quiz/components/attempt-info/attempt-info.ts +++ b/src/addons/mod/quiz/components/attempt-info/attempt-info.ts @@ -30,8 +30,8 @@ import { isSafeNumber } from '@/core/utils/types'; }) export class AddonModQuizAttemptInfoComponent implements OnChanges { - @Input() quiz!: AddonModQuizQuizData; - @Input() attempt!: AddonModQuizAttempt; + @Input({ required: true }) quiz!: AddonModQuizQuizData; + @Input({ required: true }) attempt!: AddonModQuizAttempt; @Input() additionalData?: AddonModQuizWSAdditionalData[]; // Additional data to display for the attempt. isFinished = false; diff --git a/src/addons/mod/quiz/components/preflight-modal/preflight-modal.ts b/src/addons/mod/quiz/components/preflight-modal/preflight-modal.ts index 4ec740b22..59d06ca32 100644 --- a/src/addons/mod/quiz/components/preflight-modal/preflight-modal.ts +++ b/src/addons/mod/quiz/components/preflight-modal/preflight-modal.ts @@ -39,12 +39,12 @@ export class AddonModQuizPreflightModalComponent implements OnInit { @ViewChild('preflightFormEl') formElement?: ElementRef; - @Input() title!: string; + @Input({ required: true }) title!: string; @Input() quiz?: AddonModQuizQuizWSData; @Input() attempt?: AddonModQuizAttemptWSData; @Input() prefetch?: boolean; - @Input() siteId!: string; - @Input() rules!: string[]; + @Input({ required: true }) siteId!: string; + @Input({ required: true }) rules!: string[]; preflightForm: FormGroup; accessRulesData: { component: Type; data: Record}[] = []; // Component and data for each access rule. diff --git a/src/addons/mod/quiz/components/question-card/question-card.ts b/src/addons/mod/quiz/components/question-card/question-card.ts index 0f6c4c87a..b89c912cb 100644 --- a/src/addons/mod/quiz/components/question-card/question-card.ts +++ b/src/addons/mod/quiz/components/question-card/question-card.ts @@ -25,6 +25,6 @@ import { CoreQuestionQuestionForView } from '@features/question/services/questio }) export class AddonModQuizQuestionCardComponent { - @Input() question!: CoreQuestionQuestionForView; + @Input({ required: true }) question!: CoreQuestionQuestionForView; } diff --git a/src/addons/mod/scorm/components/toc/toc.ts b/src/addons/mod/scorm/components/toc/toc.ts index 42199ba11..f91d0bbcf 100644 --- a/src/addons/mod/scorm/components/toc/toc.ts +++ b/src/addons/mod/scorm/components/toc/toc.ts @@ -35,9 +35,9 @@ export class AddonModScormTocComponent implements OnInit { @Input() toc: AddonModScormTOCScoWithIcon[] = []; @Input() attemptToContinue?: number; @Input() selected?: number; - @Input() moduleId!: number; - @Input() courseId!: number; - @Input() accessInfo!: AddonModScormGetScormAccessInformationWSResponse; + @Input({ required: true }) moduleId!: number; + @Input({ required: true }) courseId!: number; + @Input({ required: true }) accessInfo!: AddonModScormGetScormAccessInformationWSResponse; @Input() mode = ''; isBrowse = false; diff --git a/src/addons/mod/wiki/components/subwiki-picker/subwiki-picker.ts b/src/addons/mod/wiki/components/subwiki-picker/subwiki-picker.ts index 878d918d3..adfb4821a 100644 --- a/src/addons/mod/wiki/components/subwiki-picker/subwiki-picker.ts +++ b/src/addons/mod/wiki/components/subwiki-picker/subwiki-picker.ts @@ -32,7 +32,7 @@ export class AddonModWikiSubwikiPickerComponent { @Input() courseId?: number; @Input() subwikis: AddonModWikiSubwikiListGrouping[] = []; - @Input() currentSubwiki!: AddonModWikiSubwiki; + @Input({ required: true }) currentSubwiki!: AddonModWikiSubwiki; /** * Checks if the given subwiki is the one currently selected. diff --git a/src/addons/mod/workshop/classes/assessment-strategy-component.ts b/src/addons/mod/workshop/classes/assessment-strategy-component.ts index 1e9c85548..6d0f5780b 100644 --- a/src/addons/mod/workshop/classes/assessment-strategy-component.ts +++ b/src/addons/mod/workshop/classes/assessment-strategy-component.ts @@ -24,13 +24,13 @@ import { AddonModWorkshopSubmissionAssessmentWithFormData } from '../services/wo }) export class AddonModWorkshopAssessmentStrategyBaseComponent { - @Input() workshopId!: number; - @Input() assessment!: AddonModWorkshopSubmissionAssessmentWithFormData; - @Input() edit!: boolean; - @Input() selectedValues!: AddonModWorkshopGetAssessmentFormFieldsParsedData[]; - @Input() fieldErrors!: Record; - @Input() strategy!: string; - @Input() moduleId!: number; + @Input({ required: true }) workshopId!: number; + @Input({ required: true }) assessment!: AddonModWorkshopSubmissionAssessmentWithFormData; + @Input({ required: true }) edit!: boolean; + @Input({ required: true }) selectedValues!: AddonModWorkshopGetAssessmentFormFieldsParsedData[]; + @Input({ required: true }) fieldErrors!: Record; + @Input({ required: true }) strategy!: string; + @Input({ required: true }) moduleId!: number; @Input() courseId?: number; } diff --git a/src/addons/mod/workshop/components/assessment-strategy/assessment-strategy.ts b/src/addons/mod/workshop/components/assessment-strategy/assessment-strategy.ts index 503174cf5..1e6709cfa 100644 --- a/src/addons/mod/workshop/components/assessment-strategy/assessment-strategy.ts +++ b/src/addons/mod/workshop/components/assessment-strategy/assessment-strategy.ts @@ -52,11 +52,11 @@ import { }) export class AddonModWorkshopAssessmentStrategyComponent implements OnInit, OnDestroy { - @Input() workshop!: AddonModWorkshopData; - @Input() access!: AddonModWorkshopGetWorkshopAccessInformationWSResponse; - @Input() assessmentId!: number; - @Input() userId!: number; - @Input() strategy!: string; + @Input({ required: true }) workshop!: AddonModWorkshopData; + @Input({ required: true }) access!: AddonModWorkshopGetWorkshopAccessInformationWSResponse; + @Input({ required: true }) assessmentId!: number; + @Input({ required: true }) userId!: number; + @Input({ required: true }) strategy!: string; @Input() edit = false; @ViewChild('assessmentForm') formElement!: ElementRef; diff --git a/src/addons/mod/workshop/components/assessment/assessment.ts b/src/addons/mod/workshop/components/assessment/assessment.ts index 1e6464bc0..6fac33bd2 100644 --- a/src/addons/mod/workshop/components/assessment/assessment.ts +++ b/src/addons/mod/workshop/components/assessment/assessment.ts @@ -36,12 +36,12 @@ import { AddonModWorkshopOffline } from '../../services/workshop-offline'; }) export class AddonModWorkshopAssessmentComponent implements OnInit { - @Input() assessment!: AddonModWorkshopSubmissionAssessmentWithFormData; - @Input() courseId!: number; - @Input() workshop!: AddonModWorkshopData; - @Input() access!: AddonModWorkshopGetWorkshopAccessInformationWSResponse; - @Input() submission!: AddonModWorkshopSubmissionDataWithOfflineData; - @Input() module!: CoreCourseModuleData; + @Input({ required: true }) assessment!: AddonModWorkshopSubmissionAssessmentWithFormData; + @Input({ required: true }) courseId!: number; + @Input({ required: true }) workshop!: AddonModWorkshopData; + @Input({ required: true }) access!: AddonModWorkshopGetWorkshopAccessInformationWSResponse; + @Input({ required: true }) submission!: AddonModWorkshopSubmissionDataWithOfflineData; + @Input({ required: true }) module!: CoreCourseModuleData; canViewAssessment = false; canSelfAssess = false; diff --git a/src/addons/mod/workshop/components/phase-modal/phase-modal.ts b/src/addons/mod/workshop/components/phase-modal/phase-modal.ts index 95bc52faa..c437404ec 100644 --- a/src/addons/mod/workshop/components/phase-modal/phase-modal.ts +++ b/src/addons/mod/workshop/components/phase-modal/phase-modal.ts @@ -31,10 +31,10 @@ import { CoreSharedModule } from '@/core/shared.module'; }) export class AddonModWorkshopPhaseInfoModalComponent implements OnInit { - @Input() phases!: AddonModWorkshopPhaseDataWithSwitch[]; - @Input() workshopPhase!: AddonModWorkshopPhase; + @Input({ required: true }) phases!: AddonModWorkshopPhaseDataWithSwitch[]; + @Input({ required: true }) workshopPhase!: AddonModWorkshopPhase; @Input() showSubmit = false; - @Input() externalUrl!: string; + @Input({ required: true }) externalUrl!: string; ngOnInit(): void { diff --git a/src/addons/mod/workshop/components/submission/submission.ts b/src/addons/mod/workshop/components/submission/submission.ts index 53ae4a891..6dfbe5226 100644 --- a/src/addons/mod/workshop/components/submission/submission.ts +++ b/src/addons/mod/workshop/components/submission/submission.ts @@ -41,11 +41,11 @@ import { ADDON_MOD_WORKSHOP_COMPONENT, ADDON_MOD_WORKSHOP_PAGE_NAME, AddonModWor }) export class AddonModWorkshopSubmissionComponent implements OnInit { - @Input() submission!: AddonModWorkshopSubmissionDataWithOfflineData; - @Input() module!: CoreCourseModuleData; - @Input() workshop!: AddonModWorkshopData; - @Input() access!: AddonModWorkshopGetWorkshopAccessInformationWSResponse; - @Input() courseId!: number; + @Input({ required: true }) submission!: AddonModWorkshopSubmissionDataWithOfflineData; + @Input({ required: true }) module!: CoreCourseModuleData; + @Input({ required: true }) workshop!: AddonModWorkshopData; + @Input({ required: true }) access!: AddonModWorkshopGetWorkshopAccessInformationWSResponse; + @Input({ required: true }) courseId!: number; @Input() assessment?: AddonModWorkshopSubmissionAssessmentWithFormData; @Input() summary = false; diff --git a/src/addons/mod/workshop/pages/submission/submission.html b/src/addons/mod/workshop/pages/submission/submission.html index dde29a697..0a4ed5029 100644 --- a/src/addons/mod/workshop/pages/submission/submission.html +++ b/src/addons/mod/workshop/pages/submission/submission.html @@ -88,8 +88,8 @@

{{ 'addon.mod_workshop.givengrades' | translate }}

- +
diff --git a/src/addons/notes/components/add/add-modal.ts b/src/addons/notes/components/add/add-modal.ts index 337b97dc6..c4c12b786 100644 --- a/src/addons/notes/components/add/add-modal.ts +++ b/src/addons/notes/components/add/add-modal.ts @@ -36,7 +36,7 @@ export class AddonNotesAddComponent { @ViewChild('itemEdit') formElement?: ElementRef; - @Input() courseId!: number; + @Input({ required: true }) courseId!: number; @Input() userId?: number; @Input() type: AddonNotesPublishState = 'personal'; text = ''; diff --git a/src/core/components/course-image/course-image.ts b/src/core/components/course-image/course-image.ts index dc440b81a..16be9d569 100644 --- a/src/core/components/course-image/course-image.ts +++ b/src/core/components/course-image/course-image.ts @@ -24,7 +24,7 @@ import { CoreColors } from '@singletons/colors'; }) export class CoreCourseImageComponent implements OnInit, OnChanges { - @Input() course!: CoreCourseListItem; + @Input({ required: true }) course!: CoreCourseListItem; @Input() fill = false; protected element: HTMLElement; diff --git a/src/core/components/group-selector/group-selector.ts b/src/core/components/group-selector/group-selector.ts index 41dbcfe29..df9139a34 100644 --- a/src/core/components/group-selector/group-selector.ts +++ b/src/core/components/group-selector/group-selector.ts @@ -34,7 +34,7 @@ export class CoreGroupSelectorComponent { @Input() groupInfo?: CoreGroupInfo; @Input() multipleGroupsMessage?: string; - @Input() selected!: number; + @Input({ required: true }) selected!: number; @Input() courseId?: number; @Output() selectedChange = new EventEmitter(); diff --git a/src/core/components/infinite-loading/infinite-loading.ts b/src/core/components/infinite-loading/infinite-loading.ts index 49103a3df..8999b0093 100644 --- a/src/core/components/infinite-loading/infinite-loading.ts +++ b/src/core/components/infinite-loading/infinite-loading.ts @@ -30,7 +30,7 @@ const THRESHOLD = .15; // % of the scroll element height that must be close to t }) export class CoreInfiniteLoadingComponent implements OnChanges { - @Input() enabled!: boolean; + @Input({ required: true }) enabled!: boolean; @Input() error = false; @Input() position: 'top' | 'bottom' = 'bottom'; @Output() action: EventEmitter<() => void>; // Will emit an event when triggered. diff --git a/src/core/components/progress-bar/progress-bar.ts b/src/core/components/progress-bar/progress-bar.ts index 932e63ddc..1d30c770c 100644 --- a/src/core/components/progress-bar/progress-bar.ts +++ b/src/core/components/progress-bar/progress-bar.ts @@ -30,7 +30,7 @@ import { DomSanitizer, Translate } from '@singletons'; }) export class CoreProgressBarComponent implements OnChanges { - @Input() progress!: number | string; // Percentage from 0 to 100. Negative number will show an indeterminate progress bar. + @Input({ required: true }) progress!: number | string; // Percentage (0 to 100). Negative number will show an indeterminate bar. @Input() text?: string; // Percentage in text to be shown at the right. If not defined, progress will be used. @Input() a11yText?: string; // Accessibility text to read before the percentage. @Input() ariaDescribedBy?: string; // ID of the element that described the progress, if any. diff --git a/src/core/components/sheet-modal/sheet-modal.ts b/src/core/components/sheet-modal/sheet-modal.ts index e93409c7c..af8ce0f17 100644 --- a/src/core/components/sheet-modal/sheet-modal.ts +++ b/src/core/components/sheet-modal/sheet-modal.ts @@ -28,7 +28,7 @@ import { CoreDirectivesRegistry } from '@singletons/directives-registry'; }) export class CoreSheetModalComponent implements AfterViewInit { - @Input() component!: Constructor; + @Input({ required: true }) component!: Constructor; @Input() componentProps?: Record; @ViewChild('wrapper') wrapper?: ElementRef; diff --git a/src/core/components/sites-list/sites-list.ts b/src/core/components/sites-list/sites-list.ts index 0edb15b4f..d54d9d339 100644 --- a/src/core/components/sites-list/sites-list.ts +++ b/src/core/components/sites-list/sites-list.ts @@ -42,7 +42,7 @@ import { CoreSitesFactory } from '@services/sites-factory'; }) export class CoreSitesListComponent { - @Input() accountsList!: CoreAccountsList; + @Input({ required: true }) accountsList!: CoreAccountsList; @Input() sitesClickable = false; // Whether the sites are clickable. @Input() currentSiteClickable?: boolean; // If set, specify a different clickable value for current site. @Output() onSiteClicked = new EventEmitter(); diff --git a/src/core/components/tabs/tab.ts b/src/core/components/tabs/tab.ts index dd276f647..a7294e67f 100644 --- a/src/core/components/tabs/tab.ts +++ b/src/core/components/tabs/tab.ts @@ -45,7 +45,7 @@ import { CoreTabsComponent } from './tabs'; }) export class CoreTabComponent implements OnInit, OnDestroy, CoreTabBase { - @Input() title!: string; // The tab title. + @Input({ required: true }) title!: string; // The tab title. @Input() icon?: string; // The tab icon. @Input() badge?: string; // A badge to add in the tab. @Input() badgeStyle?: string; // The badge color. diff --git a/src/core/directives/user-tour.ts b/src/core/directives/user-tour.ts index 04d3636ea..cb40cb38b 100644 --- a/src/core/directives/user-tour.ts +++ b/src/core/directives/user-tour.ts @@ -25,7 +25,7 @@ import { CoreDom } from '@singletons/dom'; }) export class CoreUserTourDirective implements OnInit, OnDestroy { - @Input() userTour!: CoreUserTourDirectiveOptions; + @Input({ required: true }) userTour!: CoreUserTourDirectiveOptions; private tour?: CoreUserToursUserTour | null; private element: HTMLElement; diff --git a/src/core/features/block/classes/base-block-component.ts b/src/core/features/block/classes/base-block-component.ts index 05bec595c..cfb6402c0 100644 --- a/src/core/features/block/classes/base-block-component.ts +++ b/src/core/features/block/classes/base-block-component.ts @@ -32,10 +32,10 @@ import { CorePromisedValue } from '@classes/promised-value'; }) export abstract class CoreBlockBaseComponent implements OnInit, OnChanges, ICoreBlockComponent, AsyncDirective { - @Input() title!: string; // The block title. - @Input() block!: CoreCourseBlock; // The block to render. - @Input() contextLevel!: ContextLevel; // The context where the block will be used. - @Input() instanceId!: number; // The instance ID associated with the context level. + @Input({ required: true }) title!: string; // The block title. + @Input({ required: true }) block!: CoreCourseBlock; // The block to render. + @Input({ required: true }) contextLevel!: ContextLevel; // The context where the block will be used. + @Input({ required: true }) instanceId!: number; // The instance ID associated with the context level. @Input() link?: string; // Link to go when clicked. @Input() linkParams?: Params; // Link params to go when clicked. @Input() navOptions?: CoreNavigationOptions; // Navigation options. diff --git a/src/core/features/block/components/block/block.ts b/src/core/features/block/components/block/block.ts index a89f4ee09..684e5c7cd 100644 --- a/src/core/features/block/components/block/block.ts +++ b/src/core/features/block/components/block/block.ts @@ -32,10 +32,10 @@ export class CoreBlockComponent implements OnChanges, OnDestroy { @ViewChild(CoreDynamicComponent) dynamicComponent?: CoreDynamicComponent; - @Input() block!: CoreCourseBlock; // The block to render. - @Input() contextLevel!: ContextLevel; // The context where the block will be used. - @Input() instanceId!: number; // The instance ID associated with the context level. - @Input() extraData!: Record; // Any extra data to be passed to the block. + @Input({ required: true }) block!: CoreCourseBlock; // The block to render. + @Input({ required: true }) contextLevel!: ContextLevel; // The context where the block will be used. + @Input({ required: true }) instanceId!: number; // The instance ID associated with the context level. + @Input() extraData?: Record; // Any extra data to be passed to the block. @Input() labelledBy?: string; componentClass?: Type; // The class of the component to render. diff --git a/src/core/features/block/components/side-blocks-button/side-blocks-button.ts b/src/core/features/block/components/side-blocks-button/side-blocks-button.ts index a9d9f51ec..cf159c641 100644 --- a/src/core/features/block/components/side-blocks-button/side-blocks-button.ts +++ b/src/core/features/block/components/side-blocks-button/side-blocks-button.ts @@ -31,8 +31,8 @@ import { ContextLevel } from '@/core/constants'; }) export class CoreBlockSideBlocksButtonComponent implements OnInit, OnDestroy { - @Input() contextLevel!: ContextLevel; - @Input() instanceId!: number; + @Input({ required: true }) contextLevel!: ContextLevel; + @Input({ required: true }) instanceId!: number; @Input() myDashboardPage?: string; userTour: CoreUserTourDirectiveOptions = { diff --git a/src/core/features/block/components/side-blocks/side-blocks.ts b/src/core/features/block/components/side-blocks/side-blocks.ts index d4ac02876..23eee8649 100644 --- a/src/core/features/block/components/side-blocks/side-blocks.ts +++ b/src/core/features/block/components/side-blocks/side-blocks.ts @@ -42,8 +42,8 @@ import { CoreBlockComponentsModule } from '../components.module'; }) export class CoreBlockSideBlocksComponent implements OnInit { - @Input() contextLevel!: ContextLevel; - @Input() instanceId!: number; + @Input({ required: true }) contextLevel!: ContextLevel; + @Input({ required: true }) instanceId!: number; @Input() initialBlockInstanceId?: number; @Input() myDashboardPage?: string; diff --git a/src/core/features/comments/components/comments/comments.ts b/src/core/features/comments/components/comments/comments.ts index d780b9ebb..e465839b4 100644 --- a/src/core/features/comments/components/comments/comments.ts +++ b/src/core/features/comments/components/comments/comments.ts @@ -33,10 +33,10 @@ import { ContextLevel } from '@/core/constants'; }) export class CoreCommentsCommentsComponent implements OnInit, OnChanges, OnDestroy { - @Input() contextLevel!: ContextLevel; - @Input() instanceId!: number; - @Input() component!: string; - @Input() itemId!: number; + @Input({ required: true }) contextLevel!: ContextLevel; + @Input({ required: true }) instanceId!: number; + @Input({ required: true }) component!: string; + @Input({ required: true }) itemId!: number; @Input() area = ''; @Input() title?: string; @Output() onLoading = new EventEmitter(); // Event that indicates whether the component is loading data. diff --git a/src/core/features/compile/components/compile-html/compile-html.ts b/src/core/features/compile/components/compile-html/compile-html.ts index 10c0c3d2a..76d453d89 100644 --- a/src/core/features/compile/components/compile-html/compile-html.ts +++ b/src/core/features/compile/components/compile-html/compile-html.ts @@ -63,7 +63,7 @@ import { CoreDom } from '@singletons/dom'; }) export class CoreCompileHtmlComponent implements OnChanges, OnDestroy, DoCheck { - @Input() text!: string; // The HTML text to display. + @Input({ required: true }) text!: string; // The HTML text to display. @Input() javascript?: string; // The Javascript to execute in the component. @Input() jsData?: Record; // Data to pass to the fake component. @Input() cssCode?: string; // The styles to apply. diff --git a/src/core/features/contentlinks/components/choose-site-modal/choose-site-modal.ts b/src/core/features/contentlinks/components/choose-site-modal/choose-site-modal.ts index 15c4e29d1..fa546b317 100644 --- a/src/core/features/contentlinks/components/choose-site-modal/choose-site-modal.ts +++ b/src/core/features/contentlinks/components/choose-site-modal/choose-site-modal.ts @@ -36,7 +36,7 @@ import { CoreSharedModule } from '@/core/shared.module'; }) export class CoreContentLinksChooseSiteModalComponent implements OnInit { - @Input() url!: string; + @Input({ required: true }) url!: string; sites: CoreSiteBasicInfo[] = []; loaded = false; diff --git a/src/core/features/course/classes/main-resource-component.ts b/src/core/features/course/classes/main-resource-component.ts index e3b994b08..40a2e7cda 100644 --- a/src/core/features/course/classes/main-resource-component.ts +++ b/src/core/features/course/classes/main-resource-component.ts @@ -52,8 +52,8 @@ export type CoreCourseResourceDownloadResult = { }) export class CoreCourseModuleMainResourceComponent implements OnInit, OnDestroy, CoreCourseModuleMainComponent { - @Input() module!: CoreCourseModuleData; // The module of the component. - @Input() courseId!: number; // Course ID the component belongs to. + @Input({ required: true }) module!: CoreCourseModuleData; // The module of the component. + @Input({ required: true }) courseId!: number; // Course ID the component belongs to. @Output() dataRetrieved = new EventEmitter(); // Called to notify changes the index page from the main component. showLoading = true; // Whether to show loading. diff --git a/src/core/features/course/components/course-format/course-format.ts b/src/core/features/course/components/course-format/course-format.ts index 311864b22..c0edc183c 100644 --- a/src/core/features/course/components/course-format/course-format.ts +++ b/src/core/features/course/components/course-format/course-format.ts @@ -84,7 +84,7 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy { static readonly LOAD_MORE_ACTIVITIES = 10; // How many activities should load each time showMoreActivities is called. - @Input() course!: CoreCourseAnyCourseData; // The course to render. + @Input({ required: true }) course!: CoreCourseAnyCourseData; // The course to render. @Input() sections: CoreCourseSectionToDisplay[] = []; // List of course sections. @Input() initialSectionId?: number; // The section to load first (by ID). @Input() initialSectionNumber?: number; // The section to load first (by number). diff --git a/src/core/features/course/components/module-info/module-info.ts b/src/core/features/course/components/module-info/module-info.ts index 75999e0d8..c372b936b 100644 --- a/src/core/features/course/components/module-info/module-info.ts +++ b/src/core/features/course/components/module-info/module-info.ts @@ -35,11 +35,11 @@ import { CoreSites } from '@services/sites'; }) export class CoreCourseModuleInfoComponent implements OnInit { - @Input() module!: CoreCourseModuleData; // The module to render. - @Input() courseId!: number; // The courseId the module belongs to. + @Input({ required: true }) module!: CoreCourseModuleData; // The module to render. + @Input({ required: true }) courseId!: number; // The courseId the module belongs to. - @Input() component!: string; // Component for format text directive. - @Input() componentId!: string | number; // Component ID to use in conjunction with the component. + @Input({ required: true }) component!: string; // Component for format text directive. + @Input({ required: true }) componentId!: string | number; // Component ID to use in conjunction with the component. @Input() description?: string | false; // The description to display. If false, no description will be shown. @Input() expandDescription = false; // If the description should be expanded by default. diff --git a/src/core/features/course/components/module-navigation/module-navigation.ts b/src/core/features/course/components/module-navigation/module-navigation.ts index 33aca98d5..ce555d494 100644 --- a/src/core/features/course/components/module-navigation/module-navigation.ts +++ b/src/core/features/course/components/module-navigation/module-navigation.ts @@ -36,8 +36,8 @@ import { CoreEventObserver, CoreEvents } from '@singletons/events'; }) export class CoreCourseModuleNavigationComponent implements OnInit, OnDestroy { - @Input() courseId!: number; // Course ID. - @Input() currentModuleId!: number; // Current module Id. + @Input({ required: true }) courseId!: number; // Course ID. + @Input({ required: true }) currentModuleId!: number; // Current module Id. nextModule?: CoreCourseModuleData; previousModule?: CoreCourseModuleData; diff --git a/src/core/features/course/components/module/module.ts b/src/core/features/course/components/module/module.ts index f8c867751..d6aa7cee0 100644 --- a/src/core/features/course/components/module/module.ts +++ b/src/core/features/course/components/module/module.ts @@ -45,7 +45,7 @@ import { BehaviorSubject } from 'rxjs'; }) export class CoreCourseModuleComponent implements OnInit, OnDestroy { - @Input() module!: CoreCourseModuleData; // The module to render. + @Input({ required: true }) module!: CoreCourseModuleData; // The module to render. @Input() section?: CoreCourseSection; // The section the module belongs to. @Input() showActivityDates = false; // Whether to show activity dates. @Input() showCompletionConditions = false; // Whether to show activity completion conditions. diff --git a/src/core/features/courses/components/course-list-item/course-list-item.ts b/src/core/features/courses/components/course-list-item/course-list-item.ts index ebf2a8bdd..1fdc3d89c 100644 --- a/src/core/features/courses/components/course-list-item/course-list-item.ts +++ b/src/core/features/courses/components/course-list-item/course-list-item.ts @@ -43,7 +43,7 @@ import { CoreDownloadStatusTranslatable } from '@components/download-refresh/dow }) export class CoreCoursesCourseListItemComponent implements OnInit, OnDestroy, OnChanges { - @Input() course!: CoreCourseListItem; // The course to render. + @Input({ required: true }) course!: CoreCourseListItem; // The course to render. @Input() showDownload = false; // If true, will show download button. @Input() layout: 'listwithenrol'|'summarycard'|'list'|'card' = 'listwithenrol'; diff --git a/src/core/features/courses/components/course-options-menu/course-options-menu.ts b/src/core/features/courses/components/course-options-menu/course-options-menu.ts index b8bece69c..271c3e07f 100644 --- a/src/core/features/courses/components/course-options-menu/course-options-menu.ts +++ b/src/core/features/courses/components/course-options-menu/course-options-menu.ts @@ -27,8 +27,8 @@ import { PopoverController } from '@singletons'; }) export class CoreCoursesCourseOptionsMenuComponent implements OnInit { - @Input() course!: CoreEnrolledCourseDataWithExtraInfoAndOptions; // The course. - @Input() prefetch!: CorePrefetchStatusInfo; // The prefecth info. + @Input({ required: true }) course!: CoreEnrolledCourseDataWithExtraInfoAndOptions; // The course. + @Input({ required: true }) prefetch!: CorePrefetchStatusInfo; // The prefecth info. downloadCourseEnabled = false; diff --git a/src/core/features/fileuploader/components/audio-histogram/audio-histogram.ts b/src/core/features/fileuploader/components/audio-histogram/audio-histogram.ts index 7ced49f26..886b92ae6 100644 --- a/src/core/features/fileuploader/components/audio-histogram/audio-histogram.ts +++ b/src/core/features/fileuploader/components/audio-histogram/audio-histogram.ts @@ -31,7 +31,7 @@ export class CoreFileUploaderAudioHistogramComponent implements AfterViewInit, O private static readonly BARS_MIN_HEIGHT = 4; private static readonly BARS_GUTTER = 4; - @Input() analyser!: AnalyserNode; + @Input({ required: true }) analyser!: AnalyserNode; @Input() paused?: boolean; @ViewChild('canvas') canvasRef?: ElementRef; diff --git a/src/core/features/login/components/exceeded-attempts/exceeded-attempts.ts b/src/core/features/login/components/exceeded-attempts/exceeded-attempts.ts index 867dc4e45..57b4b8a30 100644 --- a/src/core/features/login/components/exceeded-attempts/exceeded-attempts.ts +++ b/src/core/features/login/components/exceeded-attempts/exceeded-attempts.ts @@ -23,7 +23,7 @@ import { CoreUserSupport } from '@features/user/services/support'; }) export class CoreLoginExceededAttemptsComponent implements OnInit { - @Input() supportConfig!: CoreUserSupportConfig; + @Input({ required: true }) supportConfig!: CoreUserSupportConfig; @Input() supportSubject?: string; canContactSupport = false; diff --git a/src/core/features/rating/components/aggregate/aggregate.ts b/src/core/features/rating/components/aggregate/aggregate.ts index 7837e6343..9687202ed 100644 --- a/src/core/features/rating/components/aggregate/aggregate.ts +++ b/src/core/features/rating/components/aggregate/aggregate.ts @@ -33,12 +33,12 @@ import { CoreEventObserver, CoreEvents } from '@singletons/events'; }) export class CoreRatingAggregateComponent implements OnChanges, OnDestroy { - @Input() ratingInfo!: CoreRatingInfo; - @Input() contextLevel!: ContextLevel; - @Input() instanceId!: number; - @Input() itemId!: number; - @Input() aggregateMethod!: number; - @Input() scaleId!: number; + @Input({ required: true }) ratingInfo!: CoreRatingInfo; + @Input({ required: true }) contextLevel!: ContextLevel; + @Input({ required: true }) instanceId!: number; + @Input({ required: true }) itemId!: number; + @Input({ required: true }) aggregateMethod!: number; + @Input({ required: true }) scaleId!: number; @Input() courseId?: number; item?: CoreRatingInfoItem; diff --git a/src/core/features/rating/components/rate/rate.ts b/src/core/features/rating/components/rate/rate.ts index a7b9c562e..5768ce812 100644 --- a/src/core/features/rating/components/rate/rate.ts +++ b/src/core/features/rating/components/rate/rate.ts @@ -37,15 +37,15 @@ import { CoreEventObserver, CoreEvents } from '@singletons/events'; }) export class CoreRatingRateComponent implements OnChanges, OnDestroy { - @Input() ratingInfo!: CoreRatingInfo; - @Input() contextLevel!: ContextLevel; // Context level: course, module, user, etc. - @Input() instanceId!: number; // Context instance id. - @Input() itemId!: number; // Item id. Example: forum post id. - @Input() itemSetId!: number; // Item set id. Example: forum discussion id. - @Input() courseId!: number; - @Input() aggregateMethod!: number; - @Input() scaleId!: number; - @Input() userId!: number; + @Input({ required: true }) ratingInfo!: CoreRatingInfo; + @Input({ required: true }) contextLevel!: ContextLevel; // Context level: course, module, user, etc. + @Input({ required: true }) instanceId!: number; // Context instance id. + @Input({ required: true }) itemId!: number; // Item id. Example: forum post id. + @Input({ required: true }) itemSetId!: number; // Item set id. Example: forum discussion id. + @Input({ required: true }) courseId!: number; + @Input({ required: true }) aggregateMethod!: number; + @Input({ required: true }) scaleId!: number; + @Input({ required: true }) userId!: number; @Output() protected onLoading: EventEmitter; // Eevent that indicates whether the component is loading data. @Output() protected onUpdate: EventEmitter; // Event emitted when the rating is updated online. diff --git a/src/core/features/rating/components/ratings/ratings.ts b/src/core/features/rating/components/ratings/ratings.ts index 5dc9aa6f8..005476c11 100644 --- a/src/core/features/rating/components/ratings/ratings.ts +++ b/src/core/features/rating/components/ratings/ratings.ts @@ -31,14 +31,14 @@ import { ModalController } from '@singletons'; }) export class CoreRatingRatingsComponent implements OnInit { - @Input() contextLevel!: ContextLevel; - @Input() instanceId!: number; - @Input() ratingComponent!: string; - @Input() ratingArea!: string; - @Input() aggregateMethod!: number; - @Input() itemId!: number; - @Input() scaleId!: number; - @Input() courseId!: number; + @Input({ required: true }) contextLevel!: ContextLevel; + @Input({ required: true }) instanceId!: number; + @Input({ required: true }) ratingComponent!: string; + @Input({ required: true }) ratingArea!: string; + @Input({ required: true }) aggregateMethod!: number; + @Input({ required: true }) itemId!: number; + @Input({ required: true }) scaleId!: number; + @Input({ required: true }) courseId!: number; loaded = false; ratings: CoreRatingItemRating[] = []; diff --git a/src/core/features/reportbuilder/components/report-column/report-column.ts b/src/core/features/reportbuilder/components/report-column/report-column.ts index 5d086c93a..a7c553023 100644 --- a/src/core/features/reportbuilder/components/report-column/report-column.ts +++ b/src/core/features/reportbuilder/components/report-column/report-column.ts @@ -25,12 +25,12 @@ export class CoreReportBuilderReportColumnComponent { @Input() isExpanded = false; @Input() isExpandable = false; @Input() showFirstTitle = false; - @Input() columnIndex!: number; - @Input() rowIndex!: number; - @Input() column!: string | number; - @Input() contextId!: number; - @Input() header!: string; - @Input() source!: string; + @Input({ required: true }) columnIndex!: number; + @Input({ required: true }) rowIndex!: number; + @Input({ required: true }) column!: string | number; + @Input({ required: true }) contextId!: number; + @Input({ required: true }) header!: string; + @Input({ required: true }) source!: string; @Output() onToggleRow: EventEmitter = new EventEmitter(); isString = (value: unknown): boolean => CoreReportBuilder.isString(value); diff --git a/src/core/features/reportbuilder/components/report-detail/report-detail.ts b/src/core/features/reportbuilder/components/report-detail/report-detail.ts index 5be288272..5776d71ff 100644 --- a/src/core/features/reportbuilder/components/report-detail/report-detail.ts +++ b/src/core/features/reportbuilder/components/report-detail/report-detail.ts @@ -40,7 +40,7 @@ import { map } from 'rxjs/operators'; }) export class CoreReportBuilderReportDetailComponent implements OnInit { - @Input() reportId!: string; + @Input({ required: true }) reportId!: string; @Input() isBlock = true; @Input() perPage?: number; @Input() layout: 'card' | 'table' | 'adaptative' = 'adaptative'; diff --git a/src/core/features/reportbuilder/components/report-summary/report-summary.ts b/src/core/features/reportbuilder/components/report-summary/report-summary.ts index 13b3650c5..7db580ef8 100644 --- a/src/core/features/reportbuilder/components/report-summary/report-summary.ts +++ b/src/core/features/reportbuilder/components/report-summary/report-summary.ts @@ -31,7 +31,7 @@ import { ModalController } from '@singletons'; }) export class CoreReportBuilderReportSummaryComponent implements OnInit { - @Input() reportDetail!: CoreReportBuilderReportDetail; + @Input({ required: true }) reportDetail!: CoreReportBuilderReportDetail; reportUrl!: string; reportDetailToDisplay!: { title: string; text: string }[]; diff --git a/src/core/features/search/components/global-search-result/global-search-result.ts b/src/core/features/search/components/global-search-result/global-search-result.ts index 7e60f15e6..ae02fedfb 100644 --- a/src/core/features/search/components/global-search-result/global-search-result.ts +++ b/src/core/features/search/components/global-search-result/global-search-result.ts @@ -22,7 +22,7 @@ import { CoreSearchGlobalSearchResult, CoreSearchGlobalSearchResultContext } fro }) export class CoreSearchGlobalSearchResultComponent implements OnChanges { - @Input() result!: CoreSearchGlobalSearchResult; + @Input({ required: true }) result!: CoreSearchGlobalSearchResult; @Input() showCourse?: boolean; renderedContext: CoreSearchGlobalSearchResultContext | null = null; diff --git a/src/core/features/siteplugins/classes/call-ws-directive.ts b/src/core/features/siteplugins/classes/call-ws-directive.ts index f17b7d8a4..ead49d373 100644 --- a/src/core/features/siteplugins/classes/call-ws-directive.ts +++ b/src/core/features/siteplugins/classes/call-ws-directive.ts @@ -27,7 +27,7 @@ import { CoreFormFields, CoreForms } from '@singletons/form'; @Directive() export class CoreSitePluginsCallWSBaseDirective implements OnInit, OnDestroy { - @Input() name!: string; // The name of the WS to call. + @Input({ required: true }) name!: string; // The name of the WS to call. @Input() params?: Record; // The params for the WS call. @Input() preSets?: CoreSiteWSPreSets; // The preSets for the WS call. @Input() useOtherDataForWS?: string[] | unknown; // Whether to include other data in the params for the WS. diff --git a/src/core/features/siteplugins/components/assign-feedback/assign-feedback.ts b/src/core/features/siteplugins/components/assign-feedback/assign-feedback.ts index 213f4361a..ce1b2e54d 100644 --- a/src/core/features/siteplugins/components/assign-feedback/assign-feedback.ts +++ b/src/core/features/siteplugins/components/assign-feedback/assign-feedback.ts @@ -28,10 +28,10 @@ import { CoreSitePluginsCompileInitComponent } from '@features/siteplugins/class }) export class CoreSitePluginsAssignFeedbackComponent extends CoreSitePluginsCompileInitComponent implements OnInit { - @Input() assign!: AddonModAssignAssign; // The assignment. - @Input() submission!: AddonModAssignSubmission; // The submission. - @Input() plugin!: AddonModAssignPlugin; // The plugin object. - @Input() userId!: number; // The user ID of the submission. + @Input({ required: true }) assign!: AddonModAssignAssign; // The assignment. + @Input({ required: true }) submission!: AddonModAssignSubmission; // The submission. + @Input({ required: true }) plugin!: AddonModAssignPlugin; // The plugin object. + @Input({ required: true }) userId!: number; // The user ID of the submission. @Input() configs?: Record; // The configs for the plugin. @Input() canEdit = false; // Whether the user can edit. @Input() edit = false; // Whether the user is editing. diff --git a/src/core/features/siteplugins/components/assign-submission/assign-submission.ts b/src/core/features/siteplugins/components/assign-submission/assign-submission.ts index ed7232587..a00da2054 100644 --- a/src/core/features/siteplugins/components/assign-submission/assign-submission.ts +++ b/src/core/features/siteplugins/components/assign-submission/assign-submission.ts @@ -28,9 +28,9 @@ import { CoreSitePluginsCompileInitComponent } from '@features/siteplugins/class }) export class CoreSitePluginsAssignSubmissionComponent extends CoreSitePluginsCompileInitComponent implements OnInit { - @Input() assign!: AddonModAssignAssign; // The assignment. - @Input() submission!: AddonModAssignSubmission; // The submission. - @Input() plugin!: AddonModAssignPlugin; // The plugin object. + @Input({ required: true }) assign!: AddonModAssignAssign; // The assignment. + @Input({ required: true }) submission!: AddonModAssignSubmission; // The submission. + @Input({ required: true }) plugin!: AddonModAssignPlugin; // The plugin object. @Input() configs?: Record; // The configs for the plugin. @Input() edit = false; // Whether the user is editing. @Input() allowOffline = false; // Whether to allow offline. diff --git a/src/core/features/siteplugins/components/module-index/module-index.ts b/src/core/features/siteplugins/components/module-index/module-index.ts index 6d6291235..49f51aca9 100644 --- a/src/core/features/siteplugins/components/module-index/module-index.ts +++ b/src/core/features/siteplugins/components/module-index/module-index.ts @@ -41,8 +41,8 @@ import { CoreSitePluginsPluginContentComponent, CoreSitePluginsPluginContentLoad }) export class CoreSitePluginsModuleIndexComponent implements OnInit, OnDestroy, CoreCourseModuleMainComponent { - @Input() module!: CoreCourseModuleData; // The module. - @Input() courseId!: number; // Course ID the module belongs to. + @Input({ required: true }) module!: CoreCourseModuleData; // The module. + @Input({ required: true }) courseId!: number; // Course ID the module belongs to. @Input() pageTitle?: string; // Current page title. It can be used by the "new-content" directives. @ViewChild(CoreSitePluginsPluginContentComponent) content?: CoreSitePluginsPluginContentComponent; diff --git a/src/core/features/siteplugins/components/plugin-content/plugin-content.ts b/src/core/features/siteplugins/components/plugin-content/plugin-content.ts index 49634c4a9..6a501b8d8 100644 --- a/src/core/features/siteplugins/components/plugin-content/plugin-content.ts +++ b/src/core/features/siteplugins/components/plugin-content/plugin-content.ts @@ -50,7 +50,7 @@ export class CoreSitePluginsPluginContentComponent implements OnInit, DoCheck { @ViewChild('compile') compileComponent?: CoreCompileHtmlComponent; @HostBinding('class') @Input() component = ''; - @Input() method!: string; + @Input({ required: true }) method!: string; @Input() args?: Record; @Input() initResult?: CoreSitePluginsContent | null; // Result of the init WS call of the handler. @Input() data: Record = {}; // Data to pass to the component. diff --git a/src/core/features/siteplugins/components/workshop-assessment-strategy/workshop-assessment-strategy.ts b/src/core/features/siteplugins/components/workshop-assessment-strategy/workshop-assessment-strategy.ts index 2030ab474..7b89221ff 100644 --- a/src/core/features/siteplugins/components/workshop-assessment-strategy/workshop-assessment-strategy.ts +++ b/src/core/features/siteplugins/components/workshop-assessment-strategy/workshop-assessment-strategy.ts @@ -28,13 +28,13 @@ import { CoreSitePluginsCompileInitComponent } from '@features/siteplugins/class }) export class CoreSitePluginsWorkshopAssessmentStrategyComponent extends CoreSitePluginsCompileInitComponent implements OnInit { - @Input() workshopId!: number; - @Input() assessment!: AddonModWorkshopSubmissionAssessmentWithFormData; - @Input() edit!: boolean; - @Input() selectedValues!: AddonModWorkshopGetAssessmentFormFieldsParsedData[]; - @Input() fieldErrors!: Record; - @Input() strategy!: string; - @Input() moduleId!: number; + @Input({ required: true }) workshopId!: number; + @Input({ required: true }) assessment!: AddonModWorkshopSubmissionAssessmentWithFormData; + @Input({ required: true }) edit!: boolean; + @Input({ required: true }) selectedValues!: AddonModWorkshopGetAssessmentFormFieldsParsedData[]; + @Input({ required: true }) fieldErrors!: Record; + @Input({ required: true }) strategy!: string; + @Input({ required: true }) moduleId!: number; @Input() courseId?: number; /** diff --git a/src/core/features/usertours/components/user-tour/user-tour.ts b/src/core/features/usertours/components/user-tour/user-tour.ts index 2f278d8fc..0d0aacce6 100644 --- a/src/core/features/usertours/components/user-tour/user-tour.ts +++ b/src/core/features/usertours/components/user-tour/user-tour.ts @@ -52,9 +52,9 @@ const BACKDROP_DISMISS_SAFETY_TRESHOLD = 1000; }) export class CoreUserToursUserTourComponent implements AfterViewInit, OnDestroy { - @Input() container!: HTMLElement; - @Input() id!: string; - @Input() component!: unknown; + @Input({ required: true }) container!: HTMLElement; + @Input({ required: true }) id!: string; + @Input({ required: true }) component!: unknown; @Input() componentProps?: Record; @Input() focus?: HTMLElement; @Input() side?: CoreUserToursSide;