Skip to content

Commit

Permalink
Merge pull request #4264 from dpalou/MOBILE-4716
Browse files Browse the repository at this point in the history
MOBILE-4716 core: Fix regressions caused by boolean initializers
  • Loading branch information
crazyserver authored Dec 12, 2024
2 parents 22736e3 + db93359 commit e129f29
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/core/components/sites-list/sites-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class CoreSitesListComponent<T extends CoreSiteBasicInfo> {

@Input({ required: true }) accountsList!: CoreAccountsList<T>;
@Input({ transform: toBoolean }) sitesClickable = false; // Whether the sites are clickable.
@Input({ transform: toBoolean }) currentSiteClickable = false; // If set, specify a different clickable value for current site.
@Input({ transform: toBoolean }) currentSiteClickable?: boolean; // If set, set a different clickable value for current site.
@Output() onSiteClicked = new EventEmitter<T>();

@ContentChild('siteItem') siteItemTemplate?: TemplateRef<{site: T; isCurrentSite: boolean}>;
Expand Down
2 changes: 1 addition & 1 deletion src/core/directives/format-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class CoreFormatTextDirective implements OnChanges, OnDestroy, AsyncDirec
@Input() courseId?: number; // Course ID the text belongs to. It can be used to improve performance with filters.
@Input({ transform: toBoolean }) wsNotFiltered = false; // If true it means the WS didn't filter the text for some reason.
@Input({ transform: toBoolean }) captureLinks = true; // Whether links should tried to be opened inside the app.
@Input({ transform: toBoolean }) openLinksInApp = false; // Whether links should be opened in InAppBrowser.
@Input({ transform: toBoolean }) openLinksInApp?: boolean; // Whether links should be opened in InAppBrowser.
@Input({ transform: toBoolean }) disabled = false; // If disabled, autoplay elements will be disabled.

/**
Expand Down
6 changes: 5 additions & 1 deletion src/core/directives/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ export class CoreLinkDirective implements OnInit {

@Input() href?: string | SafeUrl; // Link URL.
@Input({ transform: toBoolean }) capture = false; // If the link needs to be captured by the app.
@Input({ transform: toBoolean }) inApp = false; // True to open in embedded browser, false to open in system browser.
/**
* True to force open in embedded browser, false to force open in system browser, undefined to determine it based on
* forceOpenLinksIn setting and data-open-in attribute.
*/
@Input({ transform: toBoolean }) inApp?: boolean;
@Input({ transform: toBoolean }) autoLogin = true; // Whether to try to use auto-login.
@Input({ transform: toBoolean }) showBrowserWarning = true; // Whether to show a warning before opening browser.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy {
@Input() initialSectionNumber?: number; // The section to load first (by number).
@Input() initialBlockInstanceId?: number; // The instance to focus.
@Input() moduleId?: number; // The module ID to scroll to. Must be inside the initial selected section.
@Input({ transform: toBoolean }) isGuest = false; // If user is accessing using an ACCESS_GUEST enrolment method.
@Input({ transform: toBoolean }) isGuest?: boolean; // If user is accessing using an ACCESS_GUEST enrolment method.

// eslint-disable-next-line @typescript-eslint/no-explicit-any
@ViewChildren(CoreDynamicComponent) dynamicComponents?: QueryList<CoreDynamicComponent<any>>;
Expand Down
2 changes: 1 addition & 1 deletion src/types/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export interface EnvironmentConfig {
appstores: Record<string, string>;
displayqroncredentialscreen?: boolean;
displayqronsitescreen?: boolean;
forceOpenLinksIn: 'app' | 'browser';
forceOpenLinksIn?: 'app' | 'browser';
iOSDefaultOpenFileAction?: OpenFileAction;
customMainMenuItems?: CoreMainMenuLocalizedCustomItem[];
feedbackFormUrl?: string | false;
Expand Down

0 comments on commit e129f29

Please sign in to comment.