Skip to content

Commit

Permalink
Merge pull request moodlehq#4135 from dpalou/MOBILE-4612
Browse files Browse the repository at this point in the history
Mobile 4612
  • Loading branch information
crazyserver authored Jul 30, 2024
2 parents 23da49d + 1f8ddac commit ba0f71d
Show file tree
Hide file tree
Showing 140 changed files with 597 additions and 527 deletions.
14 changes: 7 additions & 7 deletions src/addons/badges/pages/issued-badge/issued-badge.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h2>{{ 'addon.badges.issuerdetails' | translate}}</h2>
<ion-item class="ion-text-wrap" *ngIf="badge.issuercontact">
<ion-label>
<p class="item-heading">{{ 'addon.badges.contact' | translate}}</p>
<p><a href="mailto:{{badge.issuercontact}}" core-link auto-login="no" [showBrowserWarning]="false">
<p><a href="mailto:{{badge.issuercontact}}" core-link [autoLogin]="false" [showBrowserWarning]="false">
{{ badge.issuercontact }}
</a></p>
</ion-label>
Expand Down Expand Up @@ -95,15 +95,15 @@ <h2>{{ 'addon.badges.badgedetails' | translate}}</h2>
<ion-item class="ion-text-wrap" *ngIf="badge.imageauthoremail">
<ion-label>
<p class="item-heading">{{ 'addon.badges.imageauthoremail' | translate}}</p>
<p><a href="mailto:{{badge.imageauthoremail}}" core-link auto-login="no" [showBrowserWarning]="false">
<p><a href="mailto:{{badge.imageauthoremail}}" core-link [autoLogin]="false" [showBrowserWarning]="false">
{{ badge.imageauthoremail }}
</a></p>
</ion-label>
</ion-item>
<ion-item class="ion-text-wrap" *ngIf="badge.imageauthorurl">
<ion-label>
<p class="item-heading">{{ 'addon.badges.imageauthorurl' | translate}}</p>
<p><a [href]="badge.imageauthorurl" core-link auto-login="no"> {{ badge.imageauthorurl }} </a></p>
<p><a [href]="badge.imageauthorurl" core-link [autoLogin]="false"> {{ badge.imageauthorurl }} </a></p>
</ion-label>
</ion-item>
<ion-item class="ion-text-wrap" *ngIf="badge.imagecaption">
Expand Down Expand Up @@ -166,7 +166,7 @@ <h2>{{ 'addon.badges.bendorsement' | translate}}</h2>
<ion-label>
<p class="item-heading">{{ 'addon.badges.issueremail' | translate}}</p>
<p>
<a href="mailto:{{badge.endorsement.issueremail}}" core-link auto-login="no" [showBrowserWarning]="false">
<a href="mailto:{{badge.endorsement.issueremail}}" core-link [autoLogin]="false" [showBrowserWarning]="false">
{{ badge.endorsement.issueremail }}
</a>
</p>
Expand All @@ -175,7 +175,7 @@ <h2>{{ 'addon.badges.bendorsement' | translate}}</h2>
<ion-item class="ion-text-wrap" *ngIf="badge.endorsement.issuerurl">
<ion-label>
<p class="item-heading">{{ 'addon.badges.issuerurl' | translate}}</p>
<p><a [href]="badge.endorsement.issuerurl" core-link auto-login="no"> {{ badge.endorsement.issuerurl }} </a></p>
<p><a [href]="badge.endorsement.issuerurl" core-link [autoLogin]="false"> {{ badge.endorsement.issuerurl }} </a></p>
</ion-label>
</ion-item>
<ion-item class="ion-text-wrap" *ngIf="badge.endorsement.dateissued">
Expand All @@ -187,7 +187,7 @@ <h2>{{ 'addon.badges.bendorsement' | translate}}</h2>
<ion-item class="ion-text-wrap" *ngIf="badge.endorsement.claimid">
<ion-label>
<p class="item-heading">{{ 'addon.badges.claimid' | translate}}</p>
<p><a [href]="badge.endorsement.claimid" core-link auto-login="no"> {{ badge.endorsement.claimid }} </a></p>
<p><a [href]="badge.endorsement.claimid" core-link [autoLogin]="false"> {{ badge.endorsement.claimid }} </a></p>
</ion-label>
</ion-item>
<ion-item class="ion-text-wrap" *ngIf="badge.endorsement.claimcomment">
Expand Down Expand Up @@ -225,7 +225,7 @@ <h2>{{ 'addon.badges.alignment' | translate}}</h2>
</ion-label>
</ion-item-divider>
<ion-item class="ion-text-wrap" *ngFor="let alignment of badge.alignment" [href]="alignment.targeturl" core-link
auto-login="no">
[autoLogin]="false">
<ion-label>
<p class="item-heading">{{ alignment.targetname }}</p>
</ion-label>
Expand Down
7 changes: 4 additions & 3 deletions src/addons/block/timeline/components/events/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { CoreTextUtils } from '@services/utils/text';
import { CoreEnrolledCourseDataWithOptions } from '@features/courses/services/courses-helper';
import { AddonBlockTimelineDayEvents } from '@addons/block/timeline/classes/section';
import { CoreSharedModule } from '@/core/shared.module';
import { toBoolean } from '@/core/transforms/boolean';

/**
* Directive to render a list of events in course overview.
Expand All @@ -36,9 +37,9 @@ export class AddonBlockTimelineEventsComponent implements OnInit {

@Input() events: AddonBlockTimelineDayEvents[] = []; // The events to render.
@Input() course?: CoreEnrolledCourseDataWithOptions; // Whether to show the course name.
@Input() showInlineCourse = true; // Whether to show the course name within event items.
@Input() canLoadMore = false; // Whether more events can be loaded.
@Input() loadingMore = false; // Whether loading is ongoing.
@Input({ transform: toBoolean }) showInlineCourse = true; // Whether to show the course name within event items.
@Input({ transform: toBoolean }) canLoadMore = false; // Whether more events can be loaded.
@Input({ transform: toBoolean }) loadingMore = false; // Whether loading is ongoing.
@Output() loadMore = new EventEmitter(); // Notify that more events should be loaded.

colorizeIcons = false;
Expand Down
11 changes: 4 additions & 7 deletions src/addons/calendar/components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
import { CoreUrl } from '@singletons/url';
import { CoreTime } from '@singletons/time';
import { Translate } from '@singletons';
import { toBoolean } from '@/core/transforms/boolean';

/**
* Component that displays a calendar.
Expand All @@ -69,9 +70,9 @@ export class AddonCalendarCalendarComponent implements OnInit, DoCheck, OnDestro
@Input() initialYear?: number; // Initial year to load.
@Input() initialMonth?: number; // Initial month to load.
@Input() filter?: AddonCalendarFilter; // Filter to apply.
@Input() hidden?: boolean; // Whether the component is hidden.
@Input() canNavigate?: string | boolean; // Whether to include arrows to change the month. Defaults to true.
@Input() displayNavButtons?: string | boolean; // Whether to display nav buttons created by this component. Defaults to true.
@Input({ transform: toBoolean }) hidden = false; // Whether the component is hidden.
@Input({ transform: toBoolean }) canNavigate = true; // Whether to include arrows to change the month
@Input({ transform: toBoolean }) displayNavButtons = true; // Whether to display nav buttons created by this component.
@Output() onEventClicked = new EventEmitter<number>();
@Output() onDayClicked = new EventEmitter<{day: number; month: number; year: number}>();

Expand Down Expand Up @@ -145,10 +146,6 @@ export class AddonCalendarCalendarComponent implements OnInit, DoCheck, OnDestro
* @inheritdoc
*/
ngOnInit(): void {
this.canNavigate = typeof this.canNavigate == 'undefined' ? true : CoreUtils.isTrueOrOne(this.canNavigate);
this.displayNavButtons = typeof this.displayNavButtons == 'undefined' ? true :
CoreUtils.isTrueOrOne(this.displayNavButtons);

const source = new AddonCalendarMonthSlidesItemsManagerSource(this, moment({
year: this.initialYear,
month: this.initialMonth ? this.initialMonth - 1 : undefined,
Expand Down
2 changes: 1 addition & 1 deletion src/addons/calendar/pages/event/event.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ <h1>
<ion-label>
<p class="item-heading">{{ 'core.location' | translate}}</p>
<p>
<a [href]="event.encodedLocation" core-link auto-login="no">
<a [href]="event.encodedLocation" core-link [autoLogin]="false">
<core-format-text [text]="event.location" [contextLevel]="event.contextLevel"
[contextInstanceId]="event.contextInstanceId" />
</a>
Expand Down
13 changes: 7 additions & 6 deletions src/addons/mod/assign/classes/base-feedback-plugin-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { CoreError } from '@classes/errors/error';
import { CoreModals } from '@services/modals';
import { AddonModAssignFeedbackCommentsTextData } from '../feedback/comments/services/handler';
import { AddonModAssignAssign, AddonModAssignPlugin, AddonModAssignSubmission } from '../services/assign';
import { toBoolean } from '@/core/transforms/boolean';

/**
* Base class for component to render a feedback plugin.
Expand All @@ -27,13 +28,13 @@ 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<string,string>; // The configs for the plugin.
@Input() canEdit = false; // Whether the user can edit.
@Input() edit = false; // Whether the user is editing.
@Input({ transform: toBoolean }) canEdit = false; // Whether the user can edit.
@Input({ transform: toBoolean }) edit = false; // Whether the user is editing.

/**
* Open a modal to edit the feedback plugin.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import { Component, Input } from '@angular/core';
import { AddonModAssignAssign, AddonModAssignPlugin, AddonModAssignSubmission } from '../services/assign';
import { toBoolean } from '@/core/transforms/boolean';

/**
* Base class for component to render a submission plugin.
Expand All @@ -23,12 +24,12 @@ 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<string, string>; // The configs for the plugin.
@Input() edit = false; // Whether the user is editing.
@Input() allowOffline = false; // Whether to allow offline.
@Input({ transform: toBoolean }) edit = false; // Whether the user is editing.
@Input({ transform: toBoolean }) allowOffline = false; // Whether to allow offline.

/**
* Invalidate the data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
import { AddonModAssignHelper, AddonModAssignPluginConfig } from '../../services/assign-helper';
import { AddonModAssignFeedbackDelegate } from '../../services/feedback-delegate';
import { ADDON_MOD_ASSIGN_COMPONENT } from '../../constants';
import { toBoolean } from '@/core/transforms/boolean';

/**
* Component that displays an assignment feedback plugin.
Expand All @@ -37,12 +38,12 @@ export class AddonModAssignFeedbackPluginComponent implements OnInit {

@ViewChild(CoreDynamicComponent) dynamicComponent!: CoreDynamicComponent<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() canEdit = false; // Whether the user can edit.
@Input() edit = false; // Whether the user is editing.
@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({ transform: toBoolean }) canEdit = false; // Whether the user can edit.
@Input({ transform: toBoolean }) edit = false; // Whether the user is editing.

pluginComponent?: Type<IAddonModAssignFeedbackPluginComponent>; // Component to render the plugin.
data?: AddonModAssignFeedbackPluginData; // Data to pass to the component.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { AddonModAssignSubmissionDelegate } from '../../services/submission-dele
import { CoreFileEntry } from '@services/file-helper';
import type { AddonModAssignSubmissionPluginBaseComponent } from '@addons/mod/assign/classes/base-submission-plugin-component';
import { ADDON_MOD_ASSIGN_COMPONENT } from '../../constants';
import { toBoolean } from '@/core/transforms/boolean';

/**
* Component that displays an assignment submission plugin.
Expand All @@ -37,11 +38,11 @@ export class AddonModAssignSubmissionPluginComponent implements OnInit {

@ViewChild(CoreDynamicComponent) dynamicComponent!: CoreDynamicComponent<AddonModAssignSubmissionPluginBaseComponent>;

@Input() assign!: AddonModAssignAssign; // The assignment.
@Input() submission!: AddonModAssignSubmission; // The submission.
@Input() plugin!: AddonModAssignPlugin; // The plugin object.
@Input() edit = false; // Whether the user is editing.
@Input() allowOffline = false; // Whether to allow offline.
@Input({ required: true }) assign!: AddonModAssignAssign; // The assignment.
@Input({ required: true }) submission!: AddonModAssignSubmission; // The submission.
@Input({ required: true }) plugin!: AddonModAssignPlugin; // The plugin object.
@Input({ transform: toBoolean }) edit = false; // Whether the user is editing.
@Input({ transform: toBoolean }) allowOffline = false; // Whether to allow offline.

pluginComponent?: Type<AddonModAssignSubmissionPluginBaseComponent>; // Component to render the plugin.
data?: AddonModAssignSubmissionPluginData; // Data to pass to the component.
Expand Down
6 changes: 3 additions & 3 deletions src/addons/mod/assign/components/submission/submission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can
@ViewChildren(AddonModAssignSubmissionPluginComponent) submissionComponents!:
QueryList<AddonModAssignSubmissionPluginComponent>;

@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.
Expand Down
4 changes: 2 additions & 2 deletions src/addons/mod/chat/components/users-modal/users-modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/addons/mod/data/classes/base-field-plugin-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<AddonModDataEntryField>; // The value of the field.
@Input() database?: AddonModDataData; // Database object.
@Input() error?: string; // Error when editing.
Expand Down
8 changes: 4 additions & 4 deletions src/addons/mod/data/components/action/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/addons/mod/data/components/field-plugin/field-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export class AddonModDataFieldPluginComponent implements OnInit, OnChanges {

@ViewChild(CoreDynamicComponent) dynamicComponent?: CoreDynamicComponent<AddonModDataFieldPluginBaseComponent>;

@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.
Expand Down
6 changes: 3 additions & 3 deletions src/addons/mod/data/components/search-modal/search-modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ export class AddonModDataSearchModalComponent implements OnInit {

@ViewChild('searchFormEl') formElement!: ElementRef;

@Input() search!: AddonModDataSearchDataParams;
@Input() fields!: Record<number, AddonModDataField>;
@Input() database!: AddonModDataData;
@Input({ required: true }) search!: AddonModDataSearchDataParams;
@Input({ required: true }) fields!: Record<number, AddonModDataField>;
@Input({ required: true }) database!: AddonModDataData;

advancedSearch = '';
advancedIndexed: CoreFormFields = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Loading

0 comments on commit ba0f71d

Please sign in to comment.