Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile 3947: Pre Ionic 7 changes #3855

Merged
merged 17 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

[*.json]
indent_size = 2

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
18 changes: 0 additions & 18 deletions .github/workflows/migration.yml

This file was deleted.

66 changes: 52 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,70 @@
.tmp
*.tmp
*.tmp.*
*.sublime-project
*.sublime-workspace
.DS_Store
Thumbs.db
UserInterfaceState.xcuserstate
$RECYCLE.BIN/

*.log
log.txt
npm-debug.log*

/.idea
/.ionic
/.sass-cache
/.sourcemaps
/.versions
/coverage
/dist
/node_modules

# Ionic
/.ionic
/www
/platforms
/plugins
/www
/src/assets/lib

/moodle.config.*.json
!/moodle.config.example.json
# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-project
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*


# Miscellaneous
/.angular
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings

# System files
.DS_Store
Thumbs.db

# Moodle App
/src/assets/lib
/src/assets/lang/*
/src/assets/env.json

/moodle.config.*.json
!/moodle.config.example.json
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"recommendations": [
"ionic.ionic",
"dbaeumer.vscode-eslint",
"angular.ng-template"
]
Expand Down
6 changes: 3 additions & 3 deletions config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="43001" id="com.moodle.moodlemobile" ios-CFBundleVersion="4.3.0.1" version="4.3.0" versionCode="43001" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget android-versionCode="44000" id="com.moodle.moodlemobile" ios-CFBundleVersion="4.4.0.0" version="4.4.0" versionCode="44000" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Moodle</name>
<description>Moodle official app</description>
<author email="[email protected]" href="http://moodle.com">Moodle Mobile team</author>
Expand Down Expand Up @@ -28,7 +28,7 @@
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="AppendUserAgent" value="MoodleMobile 4.3.0 (43001)" />
<preference name="AppendUserAgent" value="MoodleMobile 4.4.0 (44000)" />
<preference name="BackupWebStorage" value="none" />
<preference name="ScrollEnabled" value="false" />
<preference name="KeyboardDisplayRequiresUserAction" value="false" />
Expand Down Expand Up @@ -220,7 +220,7 @@
<true />
</edit-config>
<edit-config file="*-Info.plist" mode="merge" target="CFBundleShortVersionString">
<string>4.3.0</string>
<string>4.4.0</string>
</edit-config>
<edit-config file="*-Info.plist" mode="overwrite" target="CFBundleLocalizations">
<array>
Expand Down
43 changes: 0 additions & 43 deletions ionic-migration.json

This file was deleted.

4 changes: 2 additions & 2 deletions moodle.config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"app_id": "com.moodle.moodlemobile",
"appname": "Moodle Mobile",
"versioncode": 43001,
"versionname": "4.3.0",
"versioncode": 44000,
"versionname": "4.4.0",
"cache_update_frequency_usually": 420000,
"cache_update_frequency_often": 1200000,
"cache_update_frequency_sometimes": 3600000,
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "moodlemobile",
"version": "4.3.0",
"version": "4.4.0",
"description": "The official app for Moodle.",
"author": {
"name": "Moodle Pty Ltd.",
Expand Down
3 changes: 1 addition & 2 deletions src/addons/badges/pages/issued-badge/issued-badge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// limitations under the License.

import { Component, OnDestroy, OnInit } from '@angular/core';
import { IonRefresher } from '@ionic/angular';
import { CoreTimeUtils } from '@services/utils/time';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreSites } from '@services/sites';
Expand Down Expand Up @@ -130,7 +129,7 @@ export class AddonBadgesIssuedBadgePage implements OnInit, OnDestroy {
*
* @param refresher Refresher.
*/
async refreshBadges(refresher?: IonRefresher): Promise<void> {
async refreshBadges(refresher?: HTMLIonRefresherElement): Promise<void> {
await CoreUtils.ignoreErrors(Promise.all([
AddonBadges.invalidateUserBadges(this.courseId, this.userId),
]));
Expand Down
2 changes: 1 addition & 1 deletion src/addons/badges/pages/user-badges/user-badges.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h1>{{ 'addon.badges.badges' | translate }}</h1>

<ion-list *ngIf="!badges.empty" class="ion-no-margin">
<ion-item button class="ion-text-wrap" *ngFor="let badge of badges.items" [attr.aria-label]="badge.name"
(click)="badges.select(badge)" [attr.aria-current]="badges.getItemAriaCurrent(badge)" detail="true">
(click)="badges.select(badge)" [attr.aria-current]="badges.getItemAriaCurrent(badge)" [detail]="true">
<ion-avatar slot="start">
<img [src]="badge.badgeurl" [alt]="badge.name" core-external-content>
</ion-avatar>
Expand Down
3 changes: 1 addition & 2 deletions src/addons/badges/pages/user-badges/user-badges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// limitations under the License.

import { AfterViewInit, Component, OnDestroy, ViewChild } from '@angular/core';
import { IonRefresher } from '@ionic/angular';
import { AddonBadges, AddonBadgesUserBadge } from '../../services/badges';
import { CoreTimeUtils } from '@services/utils/time';
import { CoreDomUtils } from '@services/utils/dom';
Expand Down Expand Up @@ -90,7 +89,7 @@ export class AddonBadgesUserBadgesPage implements AfterViewInit, OnDestroy {
*
* @param refresher Refresher.
*/
async refreshBadges(refresher?: IonRefresher): Promise<void> {
async refreshBadges(refresher?: HTMLIonRefresherElement): Promise<void> {
await CoreUtils.ignoreErrors(
AddonBadges.invalidateUserBadges(
this.badges.getSource().COURSE_ID,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<ion-item-divider sticky="true">
<ion-item-divider [sticky]="true">
<ion-label>
<h2>{{ 'addon.block_activitymodules.pluginname' | translate }}</h2>
</ion-label>
</ion-item-divider>
<core-loading [hideUntil]="loaded">
<ion-item class="ion-text-wrap" *ngFor="let entry of entries" detail="true" button (click)="gotoCoureListModType(entry)">
<ion-item class="ion-text-wrap" *ngFor="let entry of entries" [detail]="true" button (click)="gotoCoureListModType(entry)">
<core-mod-icon slot="start" [modicon]="entry.icon" [modname]="entry.iconModName" [showAlt]="false">
</core-mod-icon>
<ion-label>{{ entry.name }}</ion-label>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ion-item-divider sticky="true">
<ion-item-divider [sticky]="true">
<ion-label>
<h2>{{ 'addon.block_myoverview.pluginname' | translate }}</h2>
</ion-label>
Expand Down Expand Up @@ -88,11 +88,11 @@ <h2>{{ 'addon.block_myoverview.pluginname' | translate }}</h2>
</core-combobox>
</ion-col>
<ion-col size="auto" *ngIf="isLayoutSwitcherAvailable">
<ion-button *ngIf="layout == 'card'" fill="outline" (click)="toggleLayout('list')"
<ion-button *ngIf="layout === 'card'" fill="outline" (click)="toggleLayout('list')"
[attr.aria-label]="'addon.block_myoverview.aria:list' | translate">
<ion-icon slot="icon-only" name="fas-list" aria-hidden="true"></ion-icon>
</ion-button>
<ion-button *ngIf="layout == 'list'" fill="outline" (click)="toggleLayout('card')"
<ion-button *ngIf="layout === 'list'" fill="outline" (click)="toggleLayout('card')"
[attr.aria-label]="'addon.block_myoverview.aria:card' | translate">
<ion-icon slot="icon-only" name="fas-table-cells-large" aria-hidden="true"></ion-icon>
</ion-button>
Expand Down Expand Up @@ -123,7 +123,7 @@ <h2>{{ 'addon.block_myoverview.pluginname' | translate }}</h2>

<!-- List of courses. -->
<div class="safe-area-padding" *ngIf="hasCourses">
<ion-grid class="ion-no-padding" [class.core-no-grid]="layout != 'card'" [class.list-item-limited-width]="layout != 'card'">
<ion-grid class="ion-no-padding" [class.core-no-grid]="layout !== 'card'" [class.list-item-limited-width]="layout !== 'card'">
<ion-row class="ion-no-padding">
<ion-col *ngFor="let course of filteredCourses" class="ion-no-padding" size="12" size-sm="6" size-md="6" size-lg="4"
size-xl="3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { CoreUtils } from '@services/utils/utils';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreTextUtils } from '@services/utils/text';
import { AddonCourseCompletion } from '@addons/coursecompletion/services/coursecompletion';
import { IonRefresher, IonSearchbar } from '@ionic/angular';
import { IonSearchbar } from '@ionic/angular';
import { CoreNavigator } from '@services/navigator';
import { PageLoadWatcher } from '@classes/page-load-watcher';
import { PageLoadsManager } from '@classes/page-loads-manager';
Expand Down Expand Up @@ -191,7 +191,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem
* @param done Function to call when done.
* @returns Promise resolved when done.
*/
async doRefresh(refresher?: IonRefresher, done?: () => void): Promise<void> {
async doRefresh(refresher?: HTMLIonRefresherElement, done?: () => void): Promise<void> {
if (this.loaded) {
return this.refreshContent().finally(() => {
refresher?.complete();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "~theme/globals";
@use "theme/globals" as *;
:host {
--core-avatar-size: 30px;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "~theme/globals";
@use "theme/globals" as *;

:host .core-block-content ::ng-deep {
.activitydate, .activityhead {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ion-item-divider sticky="true">
<ion-item-divider [sticky]="true">
<ion-label>
<h2>{{ 'addon.block_recentlyaccessedcourses.pluginname' | translate }}</h2>
</ion-label>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ion-item-divider sticky="true">
<ion-item-divider [sticky]="true">
<ion-label>
<h2>{{ 'addon.block_recentlyaccesseditems.pluginname' | translate }}</h2>
</ion-label>
Expand All @@ -14,7 +14,7 @@ <h2>{{ 'addon.block_recentlyaccesseditems.pluginname' | translate }}</h2>
<div class="safe-area-pseudo-padding-start"></div>
<div *ngFor="let item of items" class="core-horizontal-scroll-item">
<ion-card>
<ion-item class="core-course-module-handler ion-text-wrap" detail="false" (click)="action($event, item)" button>
<ion-item class="core-course-module-handler ion-text-wrap" [detail]="false" (click)="action($event, item)" button>
<core-mod-icon slot="start" *ngIf="item.iconUrl" [modicon]="item.iconUrl" [modname]="item.modname"
[componentId]="item.cmid" [showAlt]="false" [purpose]="item.purpose">
</core-mod-icon>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "~theme/globals";
@use "theme/globals" as *;

:host {
.core-horizontal-scroll div.core-horizontal-scroll-item {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ion-item-divider sticky="true">
<ion-item-divider [sticky]="true">
<ion-label>
<h2>{{ 'addon.block_sitemainmenu.pluginname' | translate }}</h2>
</ion-label>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ion-item-divider sticky="true">
<ion-item-divider [sticky]="true">
<ion-label>
<h2>{{ 'addon.block_starredcourses.pluginname' | translate }}</h2>
</ion-label>
Expand Down
2 changes: 1 addition & 1 deletion src/addons/block/timeline/classes/section.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class AddonBlockTimelineSection {
this.overdue = overdue;
this.dateRange = dateRange;
this.course = course;
this.dataSubject$ = new BehaviorSubject({
this.dataSubject$ = new BehaviorSubject<AddonBlockTimelineSectionData>({
events: [],
lastEventId: canLoadMore,
canLoadMore: typeof canLoadMore !== 'undefined',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h4 [class.core-bold]="!course">{{ dayEvents.dayTimestamp * 1000 | coreFormatDat
</ion-label>
</ion-item>
<ng-container *ngFor="let event of dayEvents.events">
<ion-item class="addon-block-timeline-activity" detail="false" (click)="action($event, event.url)" [attr.aria-label]="event.name"
<ion-item class="addon-block-timeline-activity" [detail]="false" (click)="action($event, event.url)" [attr.aria-label]="event.name"
button lines="full">
<ion-label>
<ion-row class="ion-justify-content-between ion-align-items-center ion-no-padding">
Expand Down
Loading
Loading