From e8dd8be967c71dee09a2bca9079830ffd13c23e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 21 Nov 2023 13:13:23 +0100 Subject: [PATCH 01/10] MOBILE-3947 chore: Change Ionic native imports to awesome cordova --- jest.config.js | 2 +- package-lock.json | 298 ++++++++++++++++++ package.json | 23 ++ .../mod/assign/services/assign-helper.ts | 2 +- .../assign/submission/file/component/file.ts | 2 +- .../submission/file/services/handler.ts | 2 +- .../mod/data/fields/file/services/handler.ts | 2 +- .../data/fields/picture/services/handler.ts | 2 +- .../mod/data/services/data-fields-delegate.ts | 2 +- src/addons/mod/data/services/data-helper.ts | 2 +- .../pages/new-discussion/new-discussion.ts | 2 +- src/addons/mod/forum/services/forum-helper.ts | 2 +- src/addons/mod/glossary/pages/entry/entry.ts | 2 +- .../mod/glossary/services/glossary-helper.ts | 2 +- .../mod/workshop/services/workshop-helper.ts | 2 +- src/addons/qtype/essay/component/essay.ts | 2 +- .../qtype/essay/services/handlers/essay.ts | 2 +- src/core/classes/native-to-angular-http.ts | 2 +- src/core/classes/sites/site.ts | 2 +- src/core/classes/sqlitedb.ts | 2 +- .../components/attachments/attachments.ts | 2 +- src/core/components/local-file/local-file.ts | 2 +- .../features/emulator/classes/sqlitedb.ts | 2 +- .../components/capture-media/capture-media.ts | 2 +- src/core/features/emulator/emulator.module.ts | 20 +- src/core/features/emulator/services/camera.ts | 2 +- .../emulator/services/capture-helper.ts | 4 +- .../features/emulator/services/clipboard.ts | 2 +- .../features/emulator/services/file-opener.ts | 2 +- .../emulator/services/file-transfer.ts | 2 +- src/core/features/emulator/services/file.ts | 2 +- .../features/emulator/services/geolocation.ts | 2 +- .../emulator/services/inappbrowser.ts | 2 +- .../emulator/services/local-notifications.ts | 2 +- .../emulator/services/media-capture.ts | 2 +- src/core/features/emulator/services/zip.ts | 2 +- .../services/fileuploader-delegate.ts | 2 +- .../services/fileuploader-helper.ts | 8 +- .../fileuploader/services/fileuploader.ts | 6 +- src/core/features/h5p/classes/helper.ts | 2 +- src/core/features/h5p/classes/validator.ts | 2 +- .../h5p/services/handlers/pluginfile.ts | 2 +- src/core/features/native/native.module.ts | 42 +-- .../services/pushnotifications.ts | 2 +- .../question/services/question-helper.ts | 2 +- .../features/reminders/services/reminders.ts | 2 +- .../components/list-modal/list-modal.ts | 2 +- .../sharedfiles/components/list/list.ts | 2 +- .../pages/choose-site/choose-site.ts | 2 +- .../services/sharedfiles-helper.ts | 2 +- .../sharedfiles/services/sharedfiles.ts | 2 +- src/core/features/user/services/support.ts | 2 +- src/core/services/file-helper.ts | 2 +- src/core/services/file.ts | 2 +- src/core/services/geolocation.ts | 2 +- src/core/services/local-notifications.ts | 2 +- src/core/services/network.ts | 2 +- src/core/services/plugin-file-delegate.ts | 2 +- src/core/services/utils/mimetype.ts | 2 +- src/core/services/utils/utils.ts | 4 +- src/core/services/ws.ts | 4 +- src/core/singletons/index.ts | 42 +-- src/storybook/stubs/classes/sqlitedb.ts | 2 +- 63 files changed, 439 insertions(+), 118 deletions(-) diff --git a/jest.config.js b/jest.config.js index cae628ad0..fd6c50807 100644 --- a/jest.config.js +++ b/jest.config.js @@ -12,7 +12,7 @@ module.exports = { transform: { '^.+\\.(ts|html)$': 'ts-jest', }, - transformIgnorePatterns: ['node_modules/(?!@ionic-native|@ionic|@moodlehq/ionic-native-push)'], + transformIgnorePatterns: ['node_modules/(?!@awesome-cordova-plugins|@ionic/core|@stencil/core|ionicons|@moodlehq/ionic-native-push)'], moduleNameMapper: { ...pathsToModuleNameMapper(compilerOptions.paths, { prefix: '/src/' }), '^!raw-loader!.*': 'jest-raw-loader', diff --git a/package-lock.json b/package-lock.json index 94b5a6400..729e6b7e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,29 @@ "@angular/platform-browser": "^16.2.0", "@angular/platform-browser-dynamic": "^16.2.0", "@angular/router": "^16.2.0", + "@awesome-cordova-plugins/badge": "^6.3.0", + "@awesome-cordova-plugins/camera": "^6.3.0", + "@awesome-cordova-plugins/chooser": "^6.3.0", + "@awesome-cordova-plugins/clipboard": "^6.3.0", + "@awesome-cordova-plugins/core": "^6.3.0", + "@awesome-cordova-plugins/device": "^6.3.0", + "@awesome-cordova-plugins/diagnostic": "^6.3.0", + "@awesome-cordova-plugins/file": "^6.3.0", + "@awesome-cordova-plugins/file-opener": "^6.3.0", + "@awesome-cordova-plugins/file-transfer": "^6.3.0", + "@awesome-cordova-plugins/geolocation": "^6.3.0", + "@awesome-cordova-plugins/http": "^6.3.0", + "@awesome-cordova-plugins/in-app-browser": "^6.3.0", + "@awesome-cordova-plugins/ionic-webview": "^6.3.0", + "@awesome-cordova-plugins/keyboard": "^6.3.0", + "@awesome-cordova-plugins/local-notifications": "^6.3.0", + "@awesome-cordova-plugins/media-capture": "^6.3.0", + "@awesome-cordova-plugins/network": "^6.3.0", + "@awesome-cordova-plugins/splash-screen": "^6.3.0", + "@awesome-cordova-plugins/sqlite": "^6.3.0", + "@awesome-cordova-plugins/status-bar": "^6.3.0", + "@awesome-cordova-plugins/web-intent": "^6.3.0", + "@awesome-cordova-plugins/zip": "^6.3.0", "@ionic/angular": "^7.0.0", "@ionic/cordova-builders": "^10.0.0", "@moodlehq/cordova-plugin-advanced-http": "3.3.1-moodle.1", @@ -758,6 +781,281 @@ "resolved": "https://registry.npmjs.org/@assemblyscript/loader/-/loader-0.10.1.tgz", "integrity": "sha512-H71nDOOL8Y7kWRLqf6Sums+01Q5msqBW2KhDUTemh1tvY04eSkSXrK0uj/4mmY0Xr16/3zyZmsrxN7CKuRbNRg==" }, + "node_modules/@awesome-cordova-plugins/badge": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/badge/-/badge-6.4.0.tgz", + "integrity": "sha512-4Fy1ykRH6hfSVTbVOX98g+MiJlhc3ozjEePTl7z2FsJ4kkfUT9lVPM6TdBo1PVNn+PePNR2gKCKOIMJK4BJ+jw==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/camera": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/camera/-/camera-6.4.0.tgz", + "integrity": "sha512-ApkGm5DaRet1XVTZEk2flhFqPaxbI2Ymj3I7FjqfjR+oP5GvVj0MQ17Oo8gVGRIHZIde6ifks0xn/NfdiT9ySg==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/chooser": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/chooser/-/chooser-6.4.0.tgz", + "integrity": "sha512-/0Tei8A9Ms2sE9VyWKtt0pVC9r+d9hURQxFnVmtZfKX3nM5fdYRRfzh5BBIrJzn4YMV+TIOv6g3EE1YAhvYTpA==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/clipboard": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/clipboard/-/clipboard-6.4.0.tgz", + "integrity": "sha512-oDPQ/vJe8wQi/GeqHt7bCydeiReRMQ1lcmC9EvH0GoQUa/M3MOb4dWcSAAz23CxdGY6ePeeCS+727+Hc7xpakA==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/core": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/core/-/core-6.4.0.tgz", + "integrity": "sha512-06I5JdTgAgKTby+VG+3sQF5+z4RNCEyVl6y7tz2rICx8MURL1biuh3oGGN1rCQQjsuMZcX5siMBr0NF/OHqxLQ==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/device": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/device/-/device-6.4.0.tgz", + "integrity": "sha512-uGwlkNH7siiMvgC6PijCDySn59JY0qwxXLvOvhhumX1Lh8VjCEUfVRjkrgJEPEcJGY6lHjw4jChCWY2Tr1g/UQ==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/diagnostic": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/diagnostic/-/diagnostic-6.4.0.tgz", + "integrity": "sha512-XvYYviet10nRLeNDLcYkO9EdWxxTKWKt4XFHscmhP1Nyg7QFi2vJS8FwZj6u4y/u3JBlCe+/4s3xXC/6jpQTbg==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/file": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/file/-/file-6.4.0.tgz", + "integrity": "sha512-KOpYpUYA9PU37qiNS1QsTwtms1bX6YsOY2ASxwCqhD+gOqpCfkFHW0kJ9yFmO68gRR2vK3k6PgUimwJXkG6RgA==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/file-opener": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/file-opener/-/file-opener-6.4.0.tgz", + "integrity": "sha512-1IIFvnz8gPL4mQNqkA1LOUQeWoF8aUAbFGSVLfcvEwJlgXvzT6yC/t8F3Czf0se2TX4tbaoqCiAtxnwBaoIItA==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/file-transfer": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/file-transfer/-/file-transfer-6.4.0.tgz", + "integrity": "sha512-0FCtWSJQh62tlRu6GZdila6Yz5Z4D538zoIDvbmPNJfH8Urhops5ihscatebYHjNAt2UF8WmxzVjDyGOljcCbQ==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/geolocation": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/geolocation/-/geolocation-6.4.0.tgz", + "integrity": "sha512-Jyn3pB1sPBqpZrv6/6A1gT7/FIDSYOaGbYNEeF9EHm9hz2maLXIVVdwYY8Hp9vggZ2g2mDpRLRNbXRfSo+R9Gw==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/http": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/http/-/http-6.4.0.tgz", + "integrity": "sha512-nv8Az1bYnEm/MQSA6Oec0FFAGFu5bmubQXypp08ZUJA4uGkps3IJS02F0451PF/vM0Jcpnb+W6ZRqRCNJ34ZJA==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/in-app-browser": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/in-app-browser/-/in-app-browser-6.4.0.tgz", + "integrity": "sha512-AaHg/hpXrfKtX+HCzENJDjR9z2wYyNe86o2VeKZlQQP/teuo8SleOIsmN4yTVI1nqnGrQTuD4sKQIhiNeS836g==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/ionic-webview": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/ionic-webview/-/ionic-webview-6.4.0.tgz", + "integrity": "sha512-w45CjIn/CqZ3D5pXG5t+QyXwdUnBskFmbdN/A6Tv0NVu6uYl3cz0ZWFN+4bK2X/5IPlSC1orQAHaEHrGFomvpw==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/keyboard": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/keyboard/-/keyboard-6.4.0.tgz", + "integrity": "sha512-9CNRYlnqbi47FyRPzcPGUkW8kQNv0nowxPAmBFkda51GNXvtw+BQ7YLDQSkthyBZr5RlU3GmtGibyYIMeOlLkQ==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/local-notifications": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/local-notifications/-/local-notifications-6.4.0.tgz", + "integrity": "sha512-q6oeVqLx6SSOkeSCu46PvX6twdY3GevRz5aIlOtroNhqmCmeDmIq2OppDnL3DmnqOY0VVO3spYdQEuo2uYRCwQ==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/media-capture": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/media-capture/-/media-capture-6.4.0.tgz", + "integrity": "sha512-HP6OsvIDr1V76UgBfNvhoy9dM1IC7Eo0ACisbPoJECZKVSNfTwWoVZonyCvp76U0xaoXuF10GRN6WlQisoWXIw==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/network": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/network/-/network-6.4.0.tgz", + "integrity": "sha512-opEQo8c/KeGH2bSqJ6F7jOxgC2lMkTZD2PxIsN5jId4KsbOMfvB4cE5ljVcx8TCmeKwHj7pGPlLcR9Eze1BawA==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/splash-screen": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/splash-screen/-/splash-screen-6.4.0.tgz", + "integrity": "sha512-0JlJysmxOPiU+wCMfo4ocHTPBWrhyTsh34Kig6t+lgO5fLUUtrLXW3LCOxx0TaXJt5XjYdfXXQciLYGXcQ4gww==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/sqlite": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/sqlite/-/sqlite-6.4.0.tgz", + "integrity": "sha512-2CXSZxp0pQUabSv4kLzCMpicNjuKmwraJ3xCP3+6QVvZr0kZ10Xh8cgIU5nPL/x9G2zzG9fVubLewh3hEgR8Zg==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/status-bar": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/status-bar/-/status-bar-6.4.0.tgz", + "integrity": "sha512-BQ0Nip16YFQ7PvQvu5+SJASDl8Uomxm1wn9tZpk+8NcQGLKTf8fL94Z2MA5HjFsHaAlzw+fFo7UJ9+9qfd1hPA==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/web-intent": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/web-intent/-/web-intent-6.4.0.tgz", + "integrity": "sha512-JJJpQ/viDCCkdhvq0A3ZnY5mmnNPd1IHGlB8tDR0jfunWzh2wK5EbETt0RVAF7zYxRnHKltx6Ep3FAd7JIY0Kw==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, + "node_modules/@awesome-cordova-plugins/zip": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@awesome-cordova-plugins/zip/-/zip-6.4.0.tgz", + "integrity": "sha512-s6Bg+sBepwhVvN+8fdns8QOOY5Mo5pg9Iy1aJiFDBUipuQOLaO++zw5u+no0igObnYcaQAdSO2XyEBX/h0T59g==", + "dependencies": { + "@types/cordova": "latest" + }, + "peerDependencies": { + "@awesome-cordova-plugins/core": "^6.0.1", + "rxjs": "^5.5.0 || ^6.5.0 || ^7.3.0" + } + }, "node_modules/@babel/code-frame": { "version": "7.23.4", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.4.tgz", diff --git a/package.json b/package.json index 11f19e95b..433ff5496 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,29 @@ "@angular/platform-browser": "^16.2.0", "@angular/platform-browser-dynamic": "^16.2.0", "@angular/router": "^16.2.0", + "@awesome-cordova-plugins/badge": "^6.3.0", + "@awesome-cordova-plugins/camera": "^6.3.0", + "@awesome-cordova-plugins/chooser": "^6.3.0", + "@awesome-cordova-plugins/clipboard": "^6.3.0", + "@awesome-cordova-plugins/core": "^6.3.0", + "@awesome-cordova-plugins/device": "^6.3.0", + "@awesome-cordova-plugins/diagnostic": "^6.3.0", + "@awesome-cordova-plugins/file": "^6.3.0", + "@awesome-cordova-plugins/file-opener": "^6.3.0", + "@awesome-cordova-plugins/file-transfer": "^6.3.0", + "@awesome-cordova-plugins/geolocation": "^6.3.0", + "@awesome-cordova-plugins/http": "^6.3.0", + "@awesome-cordova-plugins/in-app-browser": "^6.3.0", + "@awesome-cordova-plugins/ionic-webview": "^6.3.0", + "@awesome-cordova-plugins/keyboard": "^6.3.0", + "@awesome-cordova-plugins/local-notifications": "^6.3.0", + "@awesome-cordova-plugins/media-capture": "^6.3.0", + "@awesome-cordova-plugins/network": "^6.3.0", + "@awesome-cordova-plugins/splash-screen": "^6.3.0", + "@awesome-cordova-plugins/sqlite": "^6.3.0", + "@awesome-cordova-plugins/status-bar": "^6.3.0", + "@awesome-cordova-plugins/web-intent": "^6.3.0", + "@awesome-cordova-plugins/zip": "^6.3.0", "@ionic/angular": "^7.0.0", "@ionic/cordova-builders": "^10.0.0", "@moodlehq/cordova-plugin-advanced-http": "3.3.1-moodle.1", diff --git a/src/addons/mod/assign/services/assign-helper.ts b/src/addons/mod/assign/services/assign-helper.ts index 36691cf68..49384adee 100644 --- a/src/addons/mod/assign/services/assign-helper.ts +++ b/src/addons/mod/assign/services/assign-helper.ts @@ -15,7 +15,7 @@ import { Injectable } from '@angular/core'; import { CoreFileUploader, CoreFileUploaderStoreFilesResult } from '@features/fileuploader/services/fileuploader'; import { CoreSites, CoreSitesCommonWSOptions } from '@services/sites'; -import { FileEntry, DirectoryEntry } from '@ionic-native/file/ngx'; +import { FileEntry, DirectoryEntry } from '@awesome-cordova-plugins/file/ngx'; import { AddonModAssignProvider, AddonModAssignAssign, diff --git a/src/addons/mod/assign/submission/file/component/file.ts b/src/addons/mod/assign/submission/file/component/file.ts index 560757263..dd43def99 100644 --- a/src/addons/mod/assign/submission/file/component/file.ts +++ b/src/addons/mod/assign/submission/file/component/file.ts @@ -20,7 +20,7 @@ import { CoreFileUploaderStoreFilesResult } from '@features/fileuploader/service import { CoreFileSession } from '@services/file-session'; import { CoreUtils } from '@services/utils/utils'; import { AddonModAssignSubmissionFileHandlerService } from '../services/handler'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { AddonModAssignSubmissionPluginBaseComponent } from '@addons/mod/assign/classes/base-submission-plugin-component'; import { CoreFileEntry } from '@services/file-helper'; diff --git a/src/addons/mod/assign/submission/file/services/handler.ts b/src/addons/mod/assign/submission/file/services/handler.ts index 07f87e6a9..a919b5ac4 100644 --- a/src/addons/mod/assign/submission/file/services/handler.ts +++ b/src/addons/mod/assign/submission/file/services/handler.ts @@ -30,7 +30,7 @@ import { CoreUtils } from '@services/utils/utils'; import { CoreWSFile } from '@services/ws'; import { makeSingleton } from '@singletons'; import { AddonModAssignSubmissionFileComponent } from '../component/file'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import type { AddonModAssignSubmissionPluginBaseComponent } from '@addons/mod/assign/classes/base-submission-plugin-component'; /** diff --git a/src/addons/mod/data/fields/file/services/handler.ts b/src/addons/mod/data/fields/file/services/handler.ts index 46c665809..28db29431 100644 --- a/src/addons/mod/data/fields/file/services/handler.ts +++ b/src/addons/mod/data/fields/file/services/handler.ts @@ -22,7 +22,7 @@ import { import { AddonModDataFieldHandler } from '@addons/mod/data/services/data-fields-delegate'; import { Injectable, Type } from '@angular/core'; import { CoreFileUploader, CoreFileUploaderStoreFilesResult } from '@features/fileuploader/services/fileuploader'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreFileSession } from '@services/file-session'; import { CoreFormFields } from '@singletons/form'; import { makeSingleton, Translate } from '@singletons'; diff --git a/src/addons/mod/data/fields/picture/services/handler.ts b/src/addons/mod/data/fields/picture/services/handler.ts index 386b59231..809f3ef7f 100644 --- a/src/addons/mod/data/fields/picture/services/handler.ts +++ b/src/addons/mod/data/fields/picture/services/handler.ts @@ -22,7 +22,7 @@ import { import { AddonModDataFieldHandler } from '@addons/mod/data/services/data-fields-delegate'; import { Injectable, Type } from '@angular/core'; import { CoreFileUploader, CoreFileUploaderStoreFilesResult } from '@features/fileuploader/services/fileuploader'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreFileSession } from '@services/file-session'; import { CoreFormFields } from '@singletons/form'; import { makeSingleton, Translate } from '@singletons'; diff --git a/src/addons/mod/data/services/data-fields-delegate.ts b/src/addons/mod/data/services/data-fields-delegate.ts index 4332cefc9..ba0a103d3 100644 --- a/src/addons/mod/data/services/data-fields-delegate.ts +++ b/src/addons/mod/data/services/data-fields-delegate.ts @@ -22,7 +22,7 @@ import { AddonModDataEntryField, AddonModDataSubfieldData, } from './data'; import { CoreFormFields } from '@singletons/form'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreFileEntry } from '@services/file-helper'; import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component'; diff --git a/src/addons/mod/data/services/data-helper.ts b/src/addons/mod/data/services/data-helper.ts index 8227bd512..a5df40d37 100644 --- a/src/addons/mod/data/services/data-helper.ts +++ b/src/addons/mod/data/services/data-helper.ts @@ -17,7 +17,7 @@ import { Injectable } from '@angular/core'; import { CoreCourse } from '@features/course/services/course'; import { CoreFileUploader, CoreFileUploaderStoreFilesResult } from '@features/fileuploader/services/fileuploader'; import { CoreRatingOffline } from '@features/rating/services/rating-offline'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreSites, CoreSitesReadingStrategy } from '@services/sites'; import { CoreDomUtils, ToastDuration } from '@services/utils/dom'; import { CoreFormFields } from '@singletons/form'; diff --git a/src/addons/mod/forum/pages/new-discussion/new-discussion.ts b/src/addons/mod/forum/pages/new-discussion/new-discussion.ts index c69537590..6eb86ce9a 100644 --- a/src/addons/mod/forum/pages/new-discussion/new-discussion.ts +++ b/src/addons/mod/forum/pages/new-discussion/new-discussion.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Component, OnDestroy, ViewChild, ElementRef, OnInit, Optional } from '@angular/core'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { FormControl } from '@angular/forms'; import { CoreEvents, CoreEventObserver } from '@singletons/events'; import { CoreGroup, CoreGroups, CoreGroupsProvider } from '@services/groups'; diff --git a/src/addons/mod/forum/services/forum-helper.ts b/src/addons/mod/forum/services/forum-helper.ts index 68c86e7aa..a3c45cd35 100644 --- a/src/addons/mod/forum/services/forum-helper.ts +++ b/src/addons/mod/forum/services/forum-helper.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreFileUploader, CoreFileUploaderStoreFilesResult } from '@features/fileuploader/services/fileuploader'; import { CoreUser } from '@features/user/services/user'; import { CoreNetwork } from '@services/network'; diff --git a/src/addons/mod/glossary/pages/entry/entry.ts b/src/addons/mod/glossary/pages/entry/entry.ts index d40f875d6..cc15c5dcb 100644 --- a/src/addons/mod/glossary/pages/entry/entry.ts +++ b/src/addons/mod/glossary/pages/entry/entry.ts @@ -23,7 +23,7 @@ import { CoreCommentsCommentsComponent } from '@features/comments/components/com import { CoreComments } from '@features/comments/services/comments'; import { CoreRatingInfo } from '@features/rating/services/rating'; import { CoreTag } from '@features/tag/services/tag'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreNavigator } from '@services/navigator'; import { CoreNetwork } from '@services/network'; import { CoreDomUtils, ToastDuration } from '@services/utils/dom'; diff --git a/src/addons/mod/glossary/services/glossary-helper.ts b/src/addons/mod/glossary/services/glossary-helper.ts index 46e4e25ca..e4f9e3067 100644 --- a/src/addons/mod/glossary/services/glossary-helper.ts +++ b/src/addons/mod/glossary/services/glossary-helper.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreFileUploader, CoreFileUploaderStoreFilesResult } from '@features/fileuploader/services/fileuploader'; import { CoreFile } from '@services/file'; import { CoreUtils } from '@services/utils/utils'; diff --git a/src/addons/mod/workshop/services/workshop-helper.ts b/src/addons/mod/workshop/services/workshop-helper.ts index 367148474..898ab0166 100644 --- a/src/addons/mod/workshop/services/workshop-helper.ts +++ b/src/addons/mod/workshop/services/workshop-helper.ts @@ -15,7 +15,7 @@ import { Injectable } from '@angular/core'; import { CoreError } from '@classes/errors/error'; import { CoreFileUploader, CoreFileUploaderStoreFilesResult } from '@features/fileuploader/services/fileuploader'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreFile } from '@services/file'; import { CoreFileEntry } from '@services/file-helper'; import { CoreSites } from '@services/sites'; diff --git a/src/addons/qtype/essay/component/essay.ts b/src/addons/qtype/essay/component/essay.ts index 2b2313f8b..d216b87f4 100644 --- a/src/addons/qtype/essay/component/essay.ts +++ b/src/addons/qtype/essay/component/essay.ts @@ -14,7 +14,7 @@ import { Component, ElementRef } from '@angular/core'; import { FormBuilder, FormControl } from '@angular/forms'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreFileUploaderStoreFilesResult } from '@features/fileuploader/services/fileuploader'; import { AddonModQuizEssayQuestion, CoreQuestionBaseComponent } from '@features/question/classes/base-question-component'; diff --git a/src/addons/qtype/essay/services/handlers/essay.ts b/src/addons/qtype/essay/services/handlers/essay.ts index 96c39cd18..5d5ad3d7a 100644 --- a/src/addons/qtype/essay/services/handlers/essay.ts +++ b/src/addons/qtype/essay/services/handlers/essay.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable, Type } from '@angular/core'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreFileUploader, CoreFileUploaderStoreFilesResult } from '@features/fileuploader/services/fileuploader'; import { AddonModQuizEssayQuestion } from '@features/question/classes/base-question-component'; diff --git a/src/core/classes/native-to-angular-http.ts b/src/core/classes/native-to-angular-http.ts index 08349dd30..a5c12dc0f 100644 --- a/src/core/classes/native-to-angular-http.ts +++ b/src/core/classes/native-to-angular-http.ts @@ -13,7 +13,7 @@ // limitations under the License. import { HttpResponse as AngularHttpResponse, HttpHeaders } from '@angular/common/http'; -import { HTTPResponse as NativeHttpResponse } from '@ionic-native/http'; +import { HTTPResponse as NativeHttpResponse } from '@awesome-cordova-plugins/http'; const HTTP_STATUS_MESSAGES = { 100: 'Continue', diff --git a/src/core/classes/sites/site.ts b/src/core/classes/sites/site.ts index 53cce59c8..b19afa532 100644 --- a/src/core/classes/sites/site.ts +++ b/src/core/classes/sites/site.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { InAppBrowserObject, InAppBrowserOptions } from '@ionic-native/in-app-browser'; +import { InAppBrowserObject, InAppBrowserOptions } from '@awesome-cordova-plugins/in-app-browser'; import { CoreNetwork } from '@services/network'; import { CoreDB } from '@services/db'; diff --git a/src/core/classes/sqlitedb.ts b/src/core/classes/sqlitedb.ts index a406f7e43..f6793f8cb 100644 --- a/src/core/classes/sqlitedb.ts +++ b/src/core/classes/sqlitedb.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { SQLiteObject } from '@ionic-native/sqlite/ngx'; +import { SQLiteObject } from '@awesome-cordova-plugins/sqlite/ngx'; import { SQLite } from '@singletons'; import { CoreError } from '@classes/errors/error'; diff --git a/src/core/components/attachments/attachments.ts b/src/core/components/attachments/attachments.ts index 97999dd16..d8b9ad346 100644 --- a/src/core/components/attachments/attachments.ts +++ b/src/core/components/attachments/attachments.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Component, Input, OnInit } from '@angular/core'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreFileUploader, CoreFileUploaderTypeList } from '@features/fileuploader/services/fileuploader'; import { CoreSites } from '@services/sites'; diff --git a/src/core/components/local-file/local-file.ts b/src/core/components/local-file/local-file.ts index 290979e0d..a61142734 100644 --- a/src/core/components/local-file/local-file.ts +++ b/src/core/components/local-file/local-file.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Component, Input, Output, OnInit, EventEmitter, ViewChild, ElementRef } from '@angular/core'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreIonLoadingElement } from '@classes/ion-loading'; import { CoreFile } from '@services/file'; diff --git a/src/core/features/emulator/classes/sqlitedb.ts b/src/core/features/emulator/classes/sqlitedb.ts index 9111fd84b..f0243ba6f 100644 --- a/src/core/features/emulator/classes/sqlitedb.ts +++ b/src/core/features/emulator/classes/sqlitedb.ts @@ -13,7 +13,7 @@ // limitations under the License. import { SQLiteDB } from '@classes/sqlitedb'; -import { DbTransaction, SQLiteObject } from '@ionic-native/sqlite/ngx'; +import { DbTransaction, SQLiteObject } from '@awesome-cordova-plugins/sqlite/ngx'; import { CoreDB } from '@services/db'; /** diff --git a/src/core/features/emulator/components/capture-media/capture-media.ts b/src/core/features/emulator/components/capture-media/capture-media.ts index 34f9390e9..dfa829888 100644 --- a/src/core/features/emulator/components/capture-media/capture-media.ts +++ b/src/core/features/emulator/components/capture-media/capture-media.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Component, OnInit, OnDestroy, ViewChild, ElementRef, ChangeDetectorRef, Input } from '@angular/core'; -import { MediaFile } from '@ionic-native/media-capture/ngx'; +import { MediaFile } from '@awesome-cordova-plugins/media-capture/ngx'; import { CoreFile, CoreFileProvider } from '@services/file'; import { CoreDomUtils } from '@services/utils/dom'; diff --git a/src/core/features/emulator/emulator.module.ts b/src/core/features/emulator/emulator.module.ts index e82936fe0..a5436fa31 100644 --- a/src/core/features/emulator/emulator.module.ts +++ b/src/core/features/emulator/emulator.module.ts @@ -18,16 +18,16 @@ import { CoreEmulatorHelper } from './services/emulator-helper'; import { CoreEmulatorComponentsModule } from './components/components.module'; // Ionic Native services. -import { Camera } from '@ionic-native/camera/ngx'; -import { Clipboard } from '@ionic-native/clipboard/ngx'; -import { File } from '@ionic-native/file/ngx'; -import { FileOpener } from '@ionic-native/file-opener/ngx'; -import { FileTransfer } from '@ionic-native/file-transfer/ngx'; -import { Geolocation } from '@ionic-native/geolocation/ngx'; -import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; -import { LocalNotifications } from '@ionic-native/local-notifications/ngx'; -import { MediaCapture } from '@ionic-native/media-capture/ngx'; -import { Zip } from '@ionic-native/zip/ngx'; +import { Camera } from '@awesome-cordova-plugins/camera/ngx'; +import { Clipboard } from '@awesome-cordova-plugins/clipboard/ngx'; +import { File } from '@awesome-cordova-plugins/file/ngx'; +import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx'; +import { FileTransfer } from '@awesome-cordova-plugins/file-transfer/ngx'; +import { Geolocation } from '@awesome-cordova-plugins/geolocation/ngx'; +import { InAppBrowser } from '@awesome-cordova-plugins/in-app-browser/ngx'; +import { LocalNotifications } from '@awesome-cordova-plugins/local-notifications/ngx'; +import { MediaCapture } from '@awesome-cordova-plugins/media-capture/ngx'; +import { Zip } from '@awesome-cordova-plugins/zip/ngx'; // Mock services. import { CameraMock } from './services/camera'; diff --git a/src/core/features/emulator/services/camera.ts b/src/core/features/emulator/services/camera.ts index 5718ca7a3..871fc2235 100644 --- a/src/core/features/emulator/services/camera.ts +++ b/src/core/features/emulator/services/camera.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { Camera, CameraOptions } from '@ionic-native/camera/ngx'; +import { Camera, CameraOptions } from '@awesome-cordova-plugins/camera/ngx'; import { CoreEmulatorCaptureHelper } from './capture-helper'; diff --git a/src/core/features/emulator/services/capture-helper.ts b/src/core/features/emulator/services/capture-helper.ts index 42c0288a5..e984b3cb4 100644 --- a/src/core/features/emulator/services/capture-helper.ts +++ b/src/core/features/emulator/services/capture-helper.ts @@ -13,8 +13,8 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CameraOptions } from '@ionic-native/camera/ngx'; -import { CaptureImageOptions, CaptureVideoOptions, MediaFile } from '@ionic-native/media-capture/ngx'; +import { CameraOptions } from '@awesome-cordova-plugins/camera/ngx'; +import { CaptureImageOptions, CaptureVideoOptions, MediaFile } from '@awesome-cordova-plugins/media-capture/ngx'; import { CoreMimetypeUtils } from '@services/utils/mimetype'; import { makeSingleton, ModalController } from '@singletons'; diff --git a/src/core/features/emulator/services/clipboard.ts b/src/core/features/emulator/services/clipboard.ts index 3a4615fc2..24c45dbcd 100644 --- a/src/core/features/emulator/services/clipboard.ts +++ b/src/core/features/emulator/services/clipboard.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { Clipboard } from '@ionic-native/clipboard/ngx'; +import { Clipboard } from '@awesome-cordova-plugins/clipboard/ngx'; /** * Emulates the Cordova Clipboard plugin in browser. diff --git a/src/core/features/emulator/services/file-opener.ts b/src/core/features/emulator/services/file-opener.ts index 89835c2ab..38fc0ff22 100644 --- a/src/core/features/emulator/services/file-opener.ts +++ b/src/core/features/emulator/services/file-opener.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { FileOpener } from '@ionic-native/file-opener/ngx'; +import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx'; import { CoreFile } from '@services/file'; diff --git a/src/core/features/emulator/services/file-transfer.ts b/src/core/features/emulator/services/file-transfer.ts index 174ad8a42..7b758bb4d 100644 --- a/src/core/features/emulator/services/file-transfer.ts +++ b/src/core/features/emulator/services/file-transfer.ts @@ -14,7 +14,7 @@ import { CoreTextUtils } from '@services/utils/text'; import { Injectable } from '@angular/core'; -import { FileTransfer, FileTransferObject, FileUploadResult, FileTransferError } from '@ionic-native/file-transfer/ngx'; +import { FileTransfer, FileTransferObject, FileUploadResult, FileTransferError } from '@awesome-cordova-plugins/file-transfer/ngx'; import { CoreFile } from '@services/file'; diff --git a/src/core/features/emulator/services/file.ts b/src/core/features/emulator/services/file.ts index b98d70e9b..a9a61a124 100644 --- a/src/core/features/emulator/services/file.ts +++ b/src/core/features/emulator/services/file.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { File, Entry, DirectoryEntry, FileEntry, IWriteOptions, RemoveResult } from '@ionic-native/file/ngx'; +import { File, Entry, DirectoryEntry, FileEntry, IWriteOptions, RemoveResult } from '@awesome-cordova-plugins/file/ngx'; import { CorePath } from '@singletons/path'; /** diff --git a/src/core/features/emulator/services/geolocation.ts b/src/core/features/emulator/services/geolocation.ts index 2f7ef778b..729993ac8 100644 --- a/src/core/features/emulator/services/geolocation.ts +++ b/src/core/features/emulator/services/geolocation.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { Geolocation, GeolocationOptions, Geoposition } from '@ionic-native/geolocation/ngx'; +import { Geolocation, GeolocationOptions, Geoposition } from '@awesome-cordova-plugins/geolocation/ngx'; import { Observable, Subscriber, TeardownLogic } from 'rxjs'; /** diff --git a/src/core/features/emulator/services/inappbrowser.ts b/src/core/features/emulator/services/inappbrowser.ts index 4a5dd709c..f91f78207 100644 --- a/src/core/features/emulator/services/inappbrowser.ts +++ b/src/core/features/emulator/services/inappbrowser.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { InAppBrowser, InAppBrowserObject } from '@ionic-native/in-app-browser/ngx'; +import { InAppBrowser, InAppBrowserObject } from '@awesome-cordova-plugins/in-app-browser/ngx'; /** * Emulates the Cordova InAppBrowser plugin in desktop apps. diff --git a/src/core/features/emulator/services/local-notifications.ts b/src/core/features/emulator/services/local-notifications.ts index 006b78230..02ef0cdd9 100644 --- a/src/core/features/emulator/services/local-notifications.ts +++ b/src/core/features/emulator/services/local-notifications.ts @@ -13,7 +13,7 @@ // limitations under the License. import { CoreError } from '@classes/errors/error'; -import { ILocalNotification, ILocalNotificationAction, LocalNotifications } from '@ionic-native/local-notifications/ngx'; +import { ILocalNotification, ILocalNotificationAction, LocalNotifications } from '@awesome-cordova-plugins/local-notifications/ngx'; import { Observable, Subject } from 'rxjs'; /** diff --git a/src/core/features/emulator/services/media-capture.ts b/src/core/features/emulator/services/media-capture.ts index 8c8985fbd..a84aced0c 100644 --- a/src/core/features/emulator/services/media-capture.ts +++ b/src/core/features/emulator/services/media-capture.ts @@ -18,7 +18,7 @@ import { CaptureImageOptions, CaptureVideoOptions, MediaFile, -} from '@ionic-native/media-capture/ngx'; +} from '@awesome-cordova-plugins/media-capture/ngx'; import { CoreEmulatorCaptureHelper } from './capture-helper'; diff --git a/src/core/features/emulator/services/zip.ts b/src/core/features/emulator/services/zip.ts index a511661f0..eb2c869c6 100644 --- a/src/core/features/emulator/services/zip.ts +++ b/src/core/features/emulator/services/zip.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { Zip } from '@ionic-native/zip/ngx'; +import { Zip } from '@awesome-cordova-plugins/zip/ngx'; import * as JSZip from 'jszip'; import { CorePath } from '@singletons/path'; import { File } from '@singletons'; diff --git a/src/core/features/fileuploader/services/fileuploader-delegate.ts b/src/core/features/fileuploader/services/fileuploader-delegate.ts index 1b2f2eb34..04683f7d6 100644 --- a/src/core/features/fileuploader/services/fileuploader-delegate.ts +++ b/src/core/features/fileuploader/services/fileuploader-delegate.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreDelegate, CoreDelegateHandler } from '@classes/delegate'; import { CoreEvents } from '@singletons/events'; diff --git a/src/core/features/fileuploader/services/fileuploader-helper.ts b/src/core/features/fileuploader/services/fileuploader-helper.ts index 6db1e65d3..d1d2cf9c1 100644 --- a/src/core/features/fileuploader/services/fileuploader-helper.ts +++ b/src/core/features/fileuploader/services/fileuploader-helper.ts @@ -14,10 +14,10 @@ import { Injectable } from '@angular/core'; import { ActionSheetButton } from '@ionic/core'; -import { CameraOptions } from '@ionic-native/camera/ngx'; -import { ChooserResult } from '@ionic-native/chooser/ngx'; -import { FileEntry, IFile } from '@ionic-native/file/ngx'; -import { MediaFile } from '@ionic-native/media-capture/ngx'; +import { CameraOptions } from '@awesome-cordova-plugins/camera/ngx'; +import { ChooserResult } from '@awesome-cordova-plugins/chooser/ngx'; +import { FileEntry, IFile } from '@awesome-cordova-plugins/file/ngx'; +import { MediaFile } from '@awesome-cordova-plugins/media-capture/ngx'; import { CoreNetwork } from '@services/network'; import { CoreFile, CoreFileProvider, CoreFileProgressEvent } from '@services/file'; diff --git a/src/core/features/fileuploader/services/fileuploader.ts b/src/core/features/fileuploader/services/fileuploader.ts index b9565d276..00c0d3af6 100644 --- a/src/core/features/fileuploader/services/fileuploader.ts +++ b/src/core/features/fileuploader/services/fileuploader.ts @@ -13,9 +13,9 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { CameraOptions } from '@ionic-native/camera/ngx'; -import { FileEntry } from '@ionic-native/file/ngx'; -import { MediaFile, CaptureError, CaptureVideoOptions } from '@ionic-native/media-capture/ngx'; +import { CameraOptions } from '@awesome-cordova-plugins/camera/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; +import { MediaFile, CaptureError, CaptureVideoOptions } from '@awesome-cordova-plugins/media-capture/ngx'; import { Subject } from 'rxjs'; import { CoreFile, CoreFileProvider } from '@services/file'; diff --git a/src/core/features/h5p/classes/helper.ts b/src/core/features/h5p/classes/helper.ts index f79ed7304..ba3c25a12 100644 --- a/src/core/features/h5p/classes/helper.ts +++ b/src/core/features/h5p/classes/helper.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreFile, CoreFileProvider } from '@services/file'; import { CoreSites } from '@services/sites'; diff --git a/src/core/features/h5p/classes/validator.ts b/src/core/features/h5p/classes/validator.ts index cabe33d35..2a7e7ea34 100644 --- a/src/core/features/h5p/classes/validator.ts +++ b/src/core/features/h5p/classes/validator.ts @@ -13,7 +13,7 @@ // limitations under the License. import { CoreError } from '@classes/errors/error'; -import { FileEntry, DirectoryEntry } from '@ionic-native/file/ngx'; +import { FileEntry, DirectoryEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreFile, CoreFileFormat } from '@services/file'; import { Translate } from '@singletons'; import { CorePath } from '@singletons/path'; diff --git a/src/core/features/h5p/services/handlers/pluginfile.ts b/src/core/features/h5p/services/handlers/pluginfile.ts index aff8d9095..a370b7cbb 100644 --- a/src/core/features/h5p/services/handlers/pluginfile.ts +++ b/src/core/features/h5p/services/handlers/pluginfile.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreFilepoolOnProgressCallback } from '@services/filepool'; import { CorePluginFileDownloadableResult, CorePluginFileHandler } from '@services/plugin-file-delegate'; diff --git a/src/core/features/native/native.module.ts b/src/core/features/native/native.module.ts index ae1248de5..1e1404954 100644 --- a/src/core/features/native/native.module.ts +++ b/src/core/features/native/native.module.ts @@ -14,29 +14,29 @@ import { NgModule } from '@angular/core'; -import { Badge } from '@ionic-native/badge/ngx'; -import { Camera } from '@ionic-native/camera/ngx'; -import { Chooser } from '@ionic-native/chooser/ngx'; -import { Clipboard } from '@ionic-native/clipboard/ngx'; -import { Device } from '@ionic-native/device/ngx'; -import { Diagnostic } from '@ionic-native/diagnostic/ngx'; -import { File } from '@ionic-native/file/ngx'; -import { FileOpener } from '@ionic-native/file-opener/ngx'; -import { FileTransfer } from '@ionic-native/file-transfer/ngx'; -import { Geolocation } from '@ionic-native/geolocation/ngx'; -import { HTTP } from '@ionic-native/http/ngx'; -import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; -import { WebView } from '@ionic-native/ionic-webview/ngx'; -import { Keyboard } from '@ionic-native/keyboard/ngx'; -import { LocalNotifications } from '@ionic-native/local-notifications/ngx'; -import { MediaCapture } from '@ionic-native/media-capture/ngx'; +import { Badge } from '@awesome-cordova-plugins/badge/ngx'; +import { Camera } from '@awesome-cordova-plugins/camera/ngx'; +import { Chooser } from '@awesome-cordova-plugins/chooser/ngx'; +import { Clipboard } from '@awesome-cordova-plugins/clipboard/ngx'; +import { Device } from '@awesome-cordova-plugins/device/ngx'; +import { Diagnostic } from '@awesome-cordova-plugins/diagnostic/ngx'; +import { File } from '@awesome-cordova-plugins/file/ngx'; +import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx'; +import { FileTransfer } from '@awesome-cordova-plugins/file-transfer/ngx'; +import { Geolocation } from '@awesome-cordova-plugins/geolocation/ngx'; +import { HTTP } from '@awesome-cordova-plugins/http/ngx'; +import { InAppBrowser } from '@awesome-cordova-plugins/in-app-browser/ngx'; +import { WebView } from '@awesome-cordova-plugins/ionic-webview/ngx'; +import { Keyboard } from '@awesome-cordova-plugins/keyboard/ngx'; +import { LocalNotifications } from '@awesome-cordova-plugins/local-notifications/ngx'; +import { MediaCapture } from '@awesome-cordova-plugins/media-capture/ngx'; import { Push } from '@moodlehq/ionic-native-push/ngx'; import { QRScanner } from '@ionic-native/qr-scanner/ngx'; -import { SplashScreen } from '@ionic-native/splash-screen/ngx'; -import { SQLite } from '@ionic-native/sqlite/ngx'; -import { StatusBar } from '@ionic-native/status-bar/ngx'; -import { WebIntent } from '@ionic-native/web-intent/ngx'; -import { Zip } from '@ionic-native/zip/ngx'; +import { SplashScreen } from '@awesome-cordova-plugins/splash-screen/ngx'; +import { SQLite } from '@awesome-cordova-plugins/sqlite/ngx'; +import { StatusBar } from '@awesome-cordova-plugins/status-bar/ngx'; +import { WebIntent } from '@awesome-cordova-plugins/web-intent/ngx'; +import { Zip } from '@awesome-cordova-plugins/zip/ngx'; export const CORE_NATIVE_SERVICES = [ Badge, diff --git a/src/core/features/pushnotifications/services/pushnotifications.ts b/src/core/features/pushnotifications/services/pushnotifications.ts index 4453fbdd0..aec8d807c 100644 --- a/src/core/features/pushnotifications/services/pushnotifications.ts +++ b/src/core/features/pushnotifications/services/pushnotifications.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { ILocalNotification } from '@ionic-native/local-notifications'; +import { ILocalNotification } from '@awesome-cordova-plugins/local-notifications'; import { NotificationEventResponse, PushOptions, RegistrationEventResponse } from '@moodlehq/ionic-native-push/ngx'; import { CoreApp } from '@services/app'; diff --git a/src/core/features/question/services/question-helper.ts b/src/core/features/question/services/question-helper.ts index aad1dd3b8..44e89b3f1 100644 --- a/src/core/features/question/services/question-helper.ts +++ b/src/core/features/question/services/question-helper.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable, EventEmitter } from '@angular/core'; -import { FileEntry, DirectoryEntry } from '@ionic-native/file/ngx'; +import { FileEntry, DirectoryEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreFile } from '@services/file'; import { CoreFileHelper } from '@services/file-helper'; diff --git a/src/core/features/reminders/services/reminders.ts b/src/core/features/reminders/services/reminders.ts index d7afcff2d..75c846c54 100644 --- a/src/core/features/reminders/services/reminders.ts +++ b/src/core/features/reminders/services/reminders.ts @@ -18,7 +18,7 @@ import { CoreSites } from '@services/sites'; import { CoreTimeUtils } from '@services/utils/time'; import { makeSingleton, Translate } from '@singletons'; import { CoreReminderDBRecord, REMINDERS_TABLE } from './database/reminders'; -import { ILocalNotification } from '@ionic-native/local-notifications'; +import { ILocalNotification } from '@awesome-cordova-plugins/local-notifications'; import { CorePlatform } from '@services/platform'; import { CoreConstants } from '@/core/constants'; import { CoreConfig } from '@services/config'; diff --git a/src/core/features/sharedfiles/components/list-modal/list-modal.ts b/src/core/features/sharedfiles/components/list-modal/list-modal.ts index 6f0b206bf..34f9cd550 100644 --- a/src/core/features/sharedfiles/components/list-modal/list-modal.ts +++ b/src/core/features/sharedfiles/components/list-modal/list-modal.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Component, OnInit, Input } from '@angular/core'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreFile } from '@services/file'; import { ModalController, Translate } from '@singletons'; diff --git a/src/core/features/sharedfiles/components/list/list.ts b/src/core/features/sharedfiles/components/list/list.ts index b2d802af2..827d06205 100644 --- a/src/core/features/sharedfiles/components/list/list.ts +++ b/src/core/features/sharedfiles/components/list/list.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Component, OnInit, OnDestroy, Input, Output, EventEmitter } from '@angular/core'; -import { FileEntry, DirectoryEntry } from '@ionic-native/file/ngx'; +import { FileEntry, DirectoryEntry } from '@awesome-cordova-plugins/file/ngx'; import { Md5 } from 'ts-md5'; import { CoreSharedFiles } from '@features/sharedfiles/services/sharedfiles'; diff --git a/src/core/features/sharedfiles/pages/choose-site/choose-site.ts b/src/core/features/sharedfiles/pages/choose-site/choose-site.ts index 84407e809..271ce4ada 100644 --- a/src/core/features/sharedfiles/pages/choose-site/choose-site.ts +++ b/src/core/features/sharedfiles/pages/choose-site/choose-site.ts @@ -15,7 +15,7 @@ import { Component, OnInit } from '@angular/core'; import { CoreAccountsList, CoreLoginHelper } from '@features/login/services/login-helper'; import { CoreSharedFilesHelper } from '@features/sharedfiles/services/sharedfiles-helper'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreFile } from '@services/file'; import { CoreNavigator } from '@services/navigator'; import { CoreSiteBasicInfo } from '@services/sites'; diff --git a/src/core/features/sharedfiles/services/sharedfiles-helper.ts b/src/core/features/sharedfiles/services/sharedfiles-helper.ts index 4fa26d913..6fcba0679 100644 --- a/src/core/features/sharedfiles/services/sharedfiles-helper.ts +++ b/src/core/features/sharedfiles/services/sharedfiles-helper.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreCanceledError } from '@classes/errors/cancelederror'; import { CoreFileUploader } from '@features/fileuploader/services/fileuploader'; diff --git a/src/core/features/sharedfiles/services/sharedfiles.ts b/src/core/features/sharedfiles/services/sharedfiles.ts index 151d4b515..f0a732e72 100644 --- a/src/core/features/sharedfiles/services/sharedfiles.ts +++ b/src/core/features/sharedfiles/services/sharedfiles.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { FileEntry, DirectoryEntry } from '@ionic-native/file/ngx'; +import { FileEntry, DirectoryEntry } from '@awesome-cordova-plugins/file/ngx'; import { Md5 } from 'ts-md5/dist/md5'; import { SQLiteDB } from '@classes/sqlitedb'; diff --git a/src/core/features/user/services/support.ts b/src/core/features/user/services/support.ts index beefcb5e3..1e85f5848 100644 --- a/src/core/features/user/services/support.ts +++ b/src/core/features/user/services/support.ts @@ -15,7 +15,7 @@ import { Injectable } from '@angular/core'; import { CoreUserSupportConfig } from '@features/user/classes/support/support-config'; import { CoreUserAuthenticatedSupportConfig } from '@features/user/classes/support/authenticated-support-config'; -import { InAppBrowserObject } from '@ionic-native/in-app-browser'; +import { InAppBrowserObject } from '@awesome-cordova-plugins/in-app-browser'; import { CorePlatform } from '@services/platform'; import { CoreSites } from '@services/sites'; import { CoreUtils } from '@services/utils/utils'; diff --git a/src/core/services/file-helper.ts b/src/core/services/file-helper.ts index 93825ee38..4914dab06 100644 --- a/src/core/services/file-helper.ts +++ b/src/core/services/file-helper.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreNetwork } from '@services/network'; import { CoreFile } from '@services/file'; diff --git a/src/core/services/file.ts b/src/core/services/file.ts index 939cea4ee..f5988f8b6 100644 --- a/src/core/services/file.ts +++ b/src/core/services/file.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; -import { FileEntry, DirectoryEntry, Entry, Metadata, IFile } from '@ionic-native/file/ngx'; +import { FileEntry, DirectoryEntry, Entry, Metadata, IFile } from '@awesome-cordova-plugins/file/ngx'; import { CoreMimetypeUtils } from '@services/utils/mimetype'; import { CoreTextUtils } from '@services/utils/text'; diff --git a/src/core/services/geolocation.ts b/src/core/services/geolocation.ts index dbbd977c0..c696550f3 100644 --- a/src/core/services/geolocation.ts +++ b/src/core/services/geolocation.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { Coordinates } from '@ionic-native/geolocation'; +import { Coordinates } from '@awesome-cordova-plugins/geolocation'; import { CoreApp } from '@services/app'; import { CoreAnyError, CoreError } from '@classes/errors/error'; diff --git a/src/core/services/local-notifications.ts b/src/core/services/local-notifications.ts index 3a776001d..87fa6ff1e 100644 --- a/src/core/services/local-notifications.ts +++ b/src/core/services/local-notifications.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { Subject, Subscription } from 'rxjs'; -import { ILocalNotification } from '@ionic-native/local-notifications'; +import { ILocalNotification } from '@awesome-cordova-plugins/local-notifications'; import { CoreApp } from '@services/app'; import { CoreConfig } from '@services/config'; diff --git a/src/core/services/network.ts b/src/core/services/network.ts index b50a87601..bedc9549b 100644 --- a/src/core/services/network.ts +++ b/src/core/services/network.ts @@ -14,7 +14,7 @@ import { Injectable } from '@angular/core'; import { CorePlatform } from '@services/platform'; -import { Network } from '@ionic-native/network/ngx'; +import { Network } from '@awesome-cordova-plugins/network/ngx'; import { makeSingleton } from '@singletons'; import { Observable, Subject, merge } from 'rxjs'; diff --git a/src/core/services/plugin-file-delegate.ts b/src/core/services/plugin-file-delegate.ts index 8cfb3f32f..65b0b8e12 100644 --- a/src/core/services/plugin-file-delegate.ts +++ b/src/core/services/plugin-file-delegate.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreFilepool, CoreFilepoolOnProgressCallback } from '@services/filepool'; import { CoreWSFile } from '@services/ws'; diff --git a/src/core/services/utils/mimetype.ts b/src/core/services/utils/mimetype.ts index e563cf843..69d6496a9 100644 --- a/src/core/services/utils/mimetype.ts +++ b/src/core/services/utils/mimetype.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { CoreFile } from '@services/file'; import { CoreTextUtils } from '@services/utils/text'; diff --git a/src/core/services/utils/utils.ts b/src/core/services/utils/utils.ts index 16ccfe1f2..84cbf839c 100644 --- a/src/core/services/utils/utils.ts +++ b/src/core/services/utils/utils.ts @@ -13,8 +13,8 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { InAppBrowserObject, InAppBrowserOptions } from '@ionic-native/in-app-browser'; -import { FileEntry } from '@ionic-native/file/ngx'; +import { InAppBrowserObject, InAppBrowserOptions } from '@awesome-cordova-plugins/in-app-browser'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { Subscription } from 'rxjs'; import { CoreEvents } from '@singletons/events'; diff --git a/src/core/services/ws.ts b/src/core/services/ws.ts index 3f8d682eb..0c299c56c 100644 --- a/src/core/services/ws.ts +++ b/src/core/services/ws.ts @@ -15,8 +15,8 @@ import { Injectable } from '@angular/core'; import { HttpResponse, HttpParams, HttpErrorResponse } from '@angular/common/http'; -import { FileEntry } from '@ionic-native/file/ngx'; -import { FileUploadOptions, FileUploadResult } from '@ionic-native/file-transfer/ngx'; +import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; +import { FileUploadOptions, FileUploadResult } from '@awesome-cordova-plugins/file-transfer/ngx'; import { Md5 } from 'ts-md5/dist/md5'; import { Observable, firstValueFrom } from 'rxjs'; import { timeout } from 'rxjs/operators'; diff --git a/src/core/singletons/index.ts b/src/core/singletons/index.ts index 493dd35a0..52e8fea21 100644 --- a/src/core/singletons/index.ts +++ b/src/core/singletons/index.ts @@ -37,29 +37,29 @@ import { PopoverController as PopoverControllerService, } from '@ionic/angular'; -import { Badge as BadgeService } from '@ionic-native/badge/ngx'; -import { Camera as CameraService } from '@ionic-native/camera/ngx'; -import { Chooser as ChooserService } from '@ionic-native/chooser/ngx'; -import { Clipboard as ClipboardService } from '@ionic-native/clipboard/ngx'; -import { Diagnostic as DiagnosticService } from '@ionic-native/diagnostic/ngx'; -import { Device as DeviceService } from '@ionic-native/device/ngx'; -import { File as FileService } from '@ionic-native/file/ngx'; -import { FileOpener as FileOpenerService } from '@ionic-native/file-opener/ngx'; -import { FileTransfer as FileTransferService } from '@ionic-native/file-transfer/ngx'; -import { Geolocation as GeolocationService } from '@ionic-native/geolocation/ngx'; -import { HTTP } from '@ionic-native/http/ngx'; -import { InAppBrowser as InAppBrowserService } from '@ionic-native/in-app-browser/ngx'; -import { WebView as WebViewService } from '@ionic-native/ionic-webview/ngx'; -import { Keyboard as KeyboardService } from '@ionic-native/keyboard/ngx'; -import { LocalNotifications as LocalNotificationsService } from '@ionic-native/local-notifications/ngx'; -import { MediaCapture as MediaCaptureService } from '@ionic-native/media-capture/ngx'; +import { Badge as BadgeService } from '@awesome-cordova-plugins/badge/ngx'; +import { Camera as CameraService } from '@awesome-cordova-plugins/camera/ngx'; +import { Chooser as ChooserService } from '@awesome-cordova-plugins/chooser/ngx'; +import { Clipboard as ClipboardService } from '@awesome-cordova-plugins/clipboard/ngx'; +import { Diagnostic as DiagnosticService } from '@awesome-cordova-plugins/diagnostic/ngx'; +import { Device as DeviceService } from '@awesome-cordova-plugins/device/ngx'; +import { File as FileService } from '@awesome-cordova-plugins/file/ngx'; +import { FileOpener as FileOpenerService } from '@awesome-cordova-plugins/file-opener/ngx'; +import { FileTransfer as FileTransferService } from '@awesome-cordova-plugins/file-transfer/ngx'; +import { Geolocation as GeolocationService } from '@awesome-cordova-plugins/geolocation/ngx'; +import { HTTP } from '@awesome-cordova-plugins/http/ngx'; +import { InAppBrowser as InAppBrowserService } from '@awesome-cordova-plugins/in-app-browser/ngx'; +import { WebView as WebViewService } from '@awesome-cordova-plugins/ionic-webview/ngx'; +import { Keyboard as KeyboardService } from '@awesome-cordova-plugins/keyboard/ngx'; +import { LocalNotifications as LocalNotificationsService } from '@awesome-cordova-plugins/local-notifications/ngx'; +import { MediaCapture as MediaCaptureService } from '@awesome-cordova-plugins/media-capture/ngx'; import { Push as PushService } from '@moodlehq/ionic-native-push/ngx'; import { QRScanner as QRScannerService } from '@ionic-native/qr-scanner/ngx'; -import { StatusBar as StatusBarService } from '@ionic-native/status-bar/ngx'; -import { SplashScreen as SplashScreenService } from '@ionic-native/splash-screen/ngx'; -import { SQLite as SQLiteService } from '@ionic-native/sqlite/ngx'; -import { WebIntent as WebIntentService } from '@ionic-native/web-intent/ngx'; -import { Zip as ZipService } from '@ionic-native/zip/ngx'; +import { StatusBar as StatusBarService } from '@awesome-cordova-plugins/status-bar/ngx'; +import { SplashScreen as SplashScreenService } from '@awesome-cordova-plugins/splash-screen/ngx'; +import { SQLite as SQLiteService } from '@awesome-cordova-plugins/sqlite/ngx'; +import { WebIntent as WebIntentService } from '@awesome-cordova-plugins/web-intent/ngx'; +import { Zip as ZipService } from '@awesome-cordova-plugins/zip/ngx'; import { TranslateService } from '@ngx-translate/core'; diff --git a/src/storybook/stubs/classes/sqlitedb.ts b/src/storybook/stubs/classes/sqlitedb.ts index 94d81b5a1..f35345951 100644 --- a/src/storybook/stubs/classes/sqlitedb.ts +++ b/src/storybook/stubs/classes/sqlitedb.ts @@ -13,7 +13,7 @@ // limitations under the License. import { SQLiteDB } from '@classes/sqlitedb'; -import { SQLiteObject } from '@ionic-native/sqlite/ngx'; +import { SQLiteObject } from '@awesome-cordova-plugins/sqlite/ngx'; /** * SQlite database stub. From c773a4d42632cc2e77a01029a7d3f8fdac6a6c99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Fri, 10 Nov 2023 15:38:25 +0100 Subject: [PATCH 02/10] MOBILE-3947 chore: Fix Ionic package name conflicts --- src/core/components/tabs-outlet/tabs-outlet.ts | 4 ++-- src/core/services/navigator.ts | 6 +++--- src/types/angular.d.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/components/tabs-outlet/tabs-outlet.ts b/src/core/components/tabs-outlet/tabs-outlet.ts index 81f56cb08..725b92b29 100644 --- a/src/core/components/tabs-outlet/tabs-outlet.ts +++ b/src/core/components/tabs-outlet/tabs-outlet.ts @@ -28,7 +28,7 @@ import { Subscription } from 'rxjs'; import { CoreUtils } from '@services/utils/utils'; import { Params } from '@angular/router'; import { CoreNavBarButtonsComponent } from '../navbar-buttons/navbar-buttons'; -import { StackEvent } from '@ionic/angular/directives/navigation/stack-utils'; +import { StackDidChangeEvent } from '@ionic/angular/common/directives/navigation/stack-utils'; import { CoreNavigator } from '@services/navigator'; import { CoreTabBase, CoreTabsBaseComponent } from '@classes/tabs'; import { CoreDirectivesRegistry } from '@singletons/directives-registry'; @@ -90,7 +90,7 @@ export class CoreTabsOutletComponent extends CoreTabsBaseComponent { + this.stackEventsSubscription = this.ionTabs.outlet.stackDidChange.subscribe(async (stackEvent: StackDidChangeEvent) => { if (!this.isCurrentView) { return; } diff --git a/src/core/services/navigator.ts b/src/core/services/navigator.ts index a0f33b6f4..2c164ce84 100644 --- a/src/core/services/navigator.ts +++ b/src/core/services/navigator.ts @@ -15,7 +15,7 @@ import { Injectable } from '@angular/core'; import { ActivatedRoute, ActivatedRouteSnapshot, NavigationEnd, Params } from '@angular/router'; -import { NavigationOptions } from '@ionic/angular/providers/nav-controller'; +import { NavigationOptions } from '@ionic/angular/common/providers/nav-controller'; import { CoreConstants } from '@/core/constants'; import { CoreDomUtils } from '@services/utils/dom'; @@ -437,8 +437,8 @@ export class CoreNavigatorService { * * @returns Promise resolved when done. */ - back(): Promise { - return NavController.pop(); + async back(): Promise { + await NavController.pop(); } /** diff --git a/src/types/angular.d.ts b/src/types/angular.d.ts index 4f63bb656..ca503972d 100644 --- a/src/types/angular.d.ts +++ b/src/types/angular.d.ts @@ -13,7 +13,7 @@ // limitations under the License. import { UrlTree } from '@angular/router'; -import { NavigationOptions } from '@ionic/angular/providers/nav-controller'; +import { NavigationOptions } from '@ionic/angular/common/providers/nav-controller'; declare module '@ionic/angular' { From fa7607a0d319fc386b7b650d11287174deb826b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Thu, 23 Nov 2023 11:12:46 +0100 Subject: [PATCH 03/10] MOBILE-3947 lint: Fix jsdocs --- src/app/app.module.ts | 7 +- src/core/classes/tests/database-table.test.ts | 41 ++++++ .../rich-text-editor/rich-text-editor.ts | 4 +- src/core/initializers/clear-tmp-folder.ts | 3 + .../initializers/consume-storage-redirect.ts | 3 + src/core/initializers/index.ts | 6 + src/core/initializers/initialize-services.ts | 3 + src/core/initializers/initialize-urlscheme.ts | 3 + .../initializers/initialize-user-agent.ts | 3 + src/core/initializers/override-window-open.ts | 5 +- src/core/initializers/prepare-devtools.ts | 8 ++ src/core/initializers/restore-session.ts | 3 + .../subscribe-to-keyboard-events.ts | 3 + .../initializers/wait-for-platform-ready.ts | 3 + src/core/initializers/watch-screen-status.ts | 4 + src/core/utils/rxjs.ts | 4 +- src/testing/testing.module.ts | 5 + src/testing/utils.ts | 117 ++++++++++++++++++ 18 files changed, 219 insertions(+), 6 deletions(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 99683c1f7..b295b1723 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -34,7 +34,12 @@ import { CoreSiteInfoCronHandler } from '@services/handlers/site-info-cron'; import { moodleTransitionAnimation } from '@classes/page-transition'; import { TestingModule } from '@/testing/testing.module'; -// For translate loader. AoT requires an exported function for factories. +/** + * For translate loader. AoT requires an exported function for factories. + * + * @param http Http client. + * @returns Translate loader. + */ export function createTranslateLoader(http: HttpClient): TranslateHttpLoader { return new TranslateHttpLoader(http, './assets/lang/', '.json'); } diff --git a/src/core/classes/tests/database-table.test.ts b/src/core/classes/tests/database-table.test.ts index 3b9c2bca2..005bf0ff8 100644 --- a/src/core/classes/tests/database-table.test.ts +++ b/src/core/classes/tests/database-table.test.ts @@ -24,10 +24,24 @@ type User = { surname: string; }; +/** + * Checks if a user object matches specified conditions. + * + * @param user The user object to be checked. + * @param conditions The conditions to match against the user object. + * @returns Returns true if the user matches the conditions, false otherwise. + */ function userMatches(user: User, conditions: Partial) { return !Object.entries(conditions).some(([column, value]) => user[column] !== value); } +/** + * Prepares stubs for testing with a mock database configuration. + * + * @param config The partial CoreDatabaseConfiguration to use for the mock database. + * @returns An array containing a mock user records array, a mock SQLite database, + * and a CoreDatabaseTable instance for the 'users' table. + */ function prepareStubs(config: Partial = {}): [User[], SQLiteDB, CoreDatabaseTable] { const records: User[] = []; const database = mock({ @@ -68,6 +82,12 @@ function prepareStubs(config: Partial = {}): [User[], return [records, database, table]; } +/** + * Test function for finding items in the database. + * + * @param records An array of user records to use for testing. + * @param table The CoreDatabaseTable instance to test. + */ async function testFindItems(records: User[], table: CoreDatabaseTable) { const john = { id: 1, name: 'John', surname: 'Doe' }; const amy = { id: 2, name: 'Amy', surname: 'Doe' }; @@ -83,6 +103,13 @@ async function testFindItems(records: User[], table: CoreDatabaseTable) { await expect(table.getOneByPrimaryKey({ id: 2 })).resolves.toEqual(amy); } +/** + * Tests the insertion of items into a database table. + * + * @param records An array of User records. + * @param database The SQLite database instance. + * @param table The database table instance. + */ async function testInsertItems(records: User[], database: SQLiteDB, table: CoreDatabaseTable) { // Arrange. const john = { id: 1, name: 'John', surname: 'Doe' }; @@ -98,6 +125,13 @@ async function testInsertItems(records: User[], database: SQLiteDB, table: CoreD await expect(table.getOneByPrimaryKey({ id: 1 })).resolves.toEqual(john); } +/** + * Tests the deletion of items from a database table based on a condition. + * + * @param records An array of User records. + * @param database The SQLite database instance. + * @param table The database table instance. + */ async function testDeleteItems(records: User[], database: SQLiteDB, table: CoreDatabaseTable) { // Arrange. const john = { id: 1, name: 'John', surname: 'Doe' }; @@ -121,6 +155,13 @@ async function testDeleteItems(records: User[], database: SQLiteDB, table: CoreD await expect(table.getOneByPrimaryKey({ id: 3 })).resolves.toEqual(jane); } +/** + * Tests the deletion of items from a database table based on primary key values. + * + * @param records An array of User records. + * @param database The SQLite database instance. + * @param table The database table instance. + */ async function testDeleteItemsByPrimaryKey(records: User[], database: SQLiteDB, table: CoreDatabaseTable) { // Arrange. const john = { id: 1, name: 'John', surname: 'Doe' }; diff --git a/src/core/features/editor/components/rich-text-editor/rich-text-editor.ts b/src/core/features/editor/components/rich-text-editor/rich-text-editor.ts index 74bf1f1f5..990abdb66 100644 --- a/src/core/features/editor/components/rich-text-editor/rich-text-editor.ts +++ b/src/core/features/editor/components/rich-text-editor/rich-text-editor.ts @@ -656,8 +656,8 @@ export class CoreEditorRichTextEditorComponent implements OnInit, AfterViewInit, /** * Replace tags for a11y. * - * @param originTag Origin tags to be replaced. - * @param destinationTag Destination tags to replace. + * @param originTags Origin tags to be replaced. + * @param destinationTags Destination tags to replace. */ protected replaceTags(originTags: string[], destinationTags: string[]): void { if (!this.editorElement) { diff --git a/src/core/initializers/clear-tmp-folder.ts b/src/core/initializers/clear-tmp-folder.ts index 6249f79a4..44c3e2d82 100644 --- a/src/core/initializers/clear-tmp-folder.ts +++ b/src/core/initializers/clear-tmp-folder.ts @@ -14,6 +14,9 @@ import { CoreFile } from '@services/file'; +/** + * Clears the temporary folder. + */ export default async function(): Promise { await CoreFile.clearTmpFolder(); } diff --git a/src/core/initializers/consume-storage-redirect.ts b/src/core/initializers/consume-storage-redirect.ts index 990636a0c..20b776ae3 100644 --- a/src/core/initializers/consume-storage-redirect.ts +++ b/src/core/initializers/consume-storage-redirect.ts @@ -15,6 +15,9 @@ import { CoreApp } from '@services/app'; import { CoreUpdateManager } from '@services/update-manager'; +/** + * Read redirect data from local storage and clear it if it existed. + */ export default async function(): Promise { await CoreUpdateManager.donePromise; diff --git a/src/core/initializers/index.ts b/src/core/initializers/index.ts index 56c30b171..993ba5d32 100644 --- a/src/core/initializers/index.ts +++ b/src/core/initializers/index.ts @@ -14,6 +14,12 @@ import { APP_INITIALIZER, Provider } from '@angular/core'; +/** + * Get the providers for the initializers. + * Please use the APP_INITIALIZER token to provide the initializers. + * + * @returns List of providers. + */ export function getInitializerProviders(): Provider[] { const context = require.context('./', false, /\.ts$/); diff --git a/src/core/initializers/initialize-services.ts b/src/core/initializers/initialize-services.ts index 77d7b4ae8..bffdd03e0 100644 --- a/src/core/initializers/initialize-services.ts +++ b/src/core/initializers/initialize-services.ts @@ -22,6 +22,9 @@ import { CoreSites } from '@services/sites'; import { CoreUpdateManager } from '@services/update-manager'; import { CoreTimeUtils } from '@services/utils/time'; +/** + * Initializes various core components asynchronously. + */ export default async function(): Promise { await Promise.all([ CoreConfig.initialize(), diff --git a/src/core/initializers/initialize-urlscheme.ts b/src/core/initializers/initialize-urlscheme.ts index af0aee7dd..312d53c1f 100644 --- a/src/core/initializers/initialize-urlscheme.ts +++ b/src/core/initializers/initialize-urlscheme.ts @@ -16,6 +16,9 @@ import { CoreCustomURLSchemes } from '@services/urlschemes'; import { NgZone } from '@singletons'; import { CoreEvents } from '@singletons/events'; +/** + * Asynchronous function to handle custom URLs when the app is launched. + */ export default async function(): Promise { const lastUrls: Record = {}; diff --git a/src/core/initializers/initialize-user-agent.ts b/src/core/initializers/initialize-user-agent.ts index 2b87862be..3a6ab0852 100644 --- a/src/core/initializers/initialize-user-agent.ts +++ b/src/core/initializers/initialize-user-agent.ts @@ -15,6 +15,9 @@ import { CorePlatform } from '@services/platform'; import { NativeHttp } from '@singletons'; +/** + * This function sets the User-Agent header using NativeHttp for mobile platform. + */ export default async function(): Promise { if (!CorePlatform.isMobile()) { return; diff --git a/src/core/initializers/override-window-open.ts b/src/core/initializers/override-window-open.ts index 04e4ec995..d48dc9436 100644 --- a/src/core/initializers/override-window-open.ts +++ b/src/core/initializers/override-window-open.ts @@ -14,7 +14,10 @@ import { CorePlatform } from '@services/platform'; -export default async function(): Promise { +/** + * Initializes the application and sets up the InAppBrowser if available. + */ +export default async function initializeApp(): Promise { await CorePlatform.ready(); if (!window.cordova?.InAppBrowser) { diff --git a/src/core/initializers/prepare-devtools.ts b/src/core/initializers/prepare-devtools.ts index 7e0d4d255..f2442ebad 100644 --- a/src/core/initializers/prepare-devtools.ts +++ b/src/core/initializers/prepare-devtools.ts @@ -29,6 +29,11 @@ type DevelopmentWindow = Window & { pushNotifications?: CorePushNotificationsProvider; }; +/** + * Initializes the development window with necessary providers and configurations. + * + * @param window The development window object to be initialized. + */ function initializeDevelopmentWindow(window: DevelopmentWindow) { window.browser = CoreBrowser; window.appProvider = CoreApp.instance; @@ -38,6 +43,9 @@ function initializeDevelopmentWindow(window: DevelopmentWindow) { window.pushNotifications = CorePushNotifications.instance; } +/** + * Initializes the development tools if enabled by CoreConstants. + */ export default function(): void { if (!CoreConstants.enableDevTools()) { return; diff --git a/src/core/initializers/restore-session.ts b/src/core/initializers/restore-session.ts index 41914ea02..d96b32927 100644 --- a/src/core/initializers/restore-session.ts +++ b/src/core/initializers/restore-session.ts @@ -15,6 +15,9 @@ import { CoreSites } from '@services/sites'; import { CoreUpdateManager } from '@services/update-manager'; +/** + * Restores the session to the previous one so the user doesn't has to login everytime the app is started. + */ export default async function(): Promise { await CoreUpdateManager.donePromise; diff --git a/src/core/initializers/subscribe-to-keyboard-events.ts b/src/core/initializers/subscribe-to-keyboard-events.ts index 9bb7deb14..56728d493 100644 --- a/src/core/initializers/subscribe-to-keyboard-events.ts +++ b/src/core/initializers/subscribe-to-keyboard-events.ts @@ -15,6 +15,9 @@ import { CoreApp } from '@services/app'; import { NgZone, Keyboard } from '@singletons'; +/** + * Initializes keyboard event listeners and ensures Angular zone is properly managed for change detection. + */ export default function(): void { const zone = NgZone.instance; const app = CoreApp.instance; diff --git a/src/core/initializers/wait-for-platform-ready.ts b/src/core/initializers/wait-for-platform-ready.ts index 7604edb5a..90e521685 100644 --- a/src/core/initializers/wait-for-platform-ready.ts +++ b/src/core/initializers/wait-for-platform-ready.ts @@ -14,6 +14,9 @@ import { CorePlatform } from '@services/platform'; +/** + * Initializes the application when the CorePlatform is ready. + */ export default async function(): Promise { await CorePlatform.ready(); } diff --git a/src/core/initializers/watch-screen-status.ts b/src/core/initializers/watch-screen-status.ts index ee4d5fcf1..326cced43 100644 --- a/src/core/initializers/watch-screen-status.ts +++ b/src/core/initializers/watch-screen-status.ts @@ -14,6 +14,10 @@ import { CoreScreen } from '@services/screen'; +/** + * Initializes the application by watching the viewport and orientation changes. + * This function should be called to set up necessary event listeners for proper functionality. + */ export default function(): void { CoreScreen.watchViewport(); diff --git a/src/core/utils/rxjs.ts b/src/core/utils/rxjs.ts index bc29138e6..63b959856 100644 --- a/src/core/utils/rxjs.ts +++ b/src/core/utils/rxjs.ts @@ -77,6 +77,8 @@ export function asyncObservable(createObservable: () => Promise }); } +export function ignoreErrors(observable: Observable): Observable; +export function ignoreErrors(observable: Observable, fallback: Fallback): Observable; /** * Ignore errors from an observable, returning a certain value instead. * @@ -84,8 +86,6 @@ export function asyncObservable(createObservable: () => Promise * @param fallback Value to return if the observer errors. * @returns Observable with ignored errors, returning the fallback result if provided. */ -export function ignoreErrors(observable: Observable): Observable; -export function ignoreErrors(observable: Observable, fallback: Fallback): Observable; export function ignoreErrors( observable: Observable, fallback?: Fallback, diff --git a/src/testing/testing.module.ts b/src/testing/testing.module.ts index 479df360d..3b92ac120 100644 --- a/src/testing/testing.module.ts +++ b/src/testing/testing.module.ts @@ -21,6 +21,11 @@ type AutomatedTestsWindow = Window & { behat?: TestingBehatRuntimeService; }; +/** + * Initialize automated tests. + * + * @param window Window. + */ function initializeAutomatedTests(window: AutomatedTestsWindow) { if (!CoreAppProvider.isAutomated()) { return; diff --git a/src/testing/utils.ts b/src/testing/utils.ts index 092adaf13..7c78b93d8 100644 --- a/src/testing/utils.ts +++ b/src/testing/utils.ts @@ -80,6 +80,13 @@ const DEFAULT_SERVICE_SINGLETON_MOCKS: [CoreSingletonProxy, unknown][] = [ })], ]; +/** + * Renders an Angular component for testing. + * + * @param component The Angular component to render. + * @param config Configuration options for rendering. + * @returns A promise that resolves to the testing component fixture. + */ async function renderAngularComponent(component: Type, config: RenderConfig): Promise> { config.declarations.push(component); @@ -114,6 +121,13 @@ async function renderAngularComponent(component: Type, config: RenderConfi return fixture; } +/** + * Creates a wrapper component for testing. + * + * @param template The template for the wrapper component. + * @param componentClass The class of the component to be wrapped. + * @returns The wrapper component class. + */ function createWrapperComponent(template: string, componentClass: Type): Type> { @Component({ template }) class HostComponent extends WrapperComponent { @@ -125,6 +139,11 @@ function createWrapperComponent(template: string, componentClass: Type): T return HostComponent; } +/** + * Gets the default declarations for testing. + * + * @returns An array of default declarations. + */ function getDefaultDeclarations(): unknown[] { return [ TranslatePipeStub, @@ -132,6 +151,12 @@ function getDefaultDeclarations(): unknown[] { ]; } +/** + * Gets the default providers for testing. + * + * @param config Configuration options for rendering. + * @returns An array of default providers. + */ function getDefaultProviders(config: RenderConfig): unknown[] { const serviceProviders = DEFAULT_SERVICE_SINGLETON_MOCKS.map( ([singleton, mockInstance]) => ({ @@ -159,6 +184,12 @@ function getDefaultProviders(config: RenderConfig): unknown[] { ]; } +/** + * Resolves a service instance from the TestBed. + * + * @param injectionToken The injection token for the service. + * @returns The service instance or null if not found. + */ function resolveServiceInstanceFromTestBed(injectionToken: Exclude): Record | null { if (!testBedInitialized) { return null; @@ -167,6 +198,12 @@ function resolveServiceInstanceFromTestBed(injectionToken: Exclude | null; } +/** + * Creates a new instance of a service. + * + * @param injectionToken The injection token for the service. + * @returns The new service instance or null if an error occurs. + */ function createNewServiceInstance(injectionToken: Exclude): Record | null { try { const constructor = injectionToken as { new (): Record }; @@ -192,6 +229,14 @@ export type TestingComponentFixture = Omit, 'na export type WrapperComponentFixture = TestingComponentFixture>; +/** + * Finds an element in the fixture's native element. + * + * @param fixture The testing component fixture. + * @param selector The CSS selector for the element. + * @param content The text content or regular expression to match. + * @returns The element or null if not found. + */ export function findElement( fixture: TestingComponentFixture, selector: string, @@ -215,6 +260,14 @@ export function findElement( return null; } +/** + * Requires an element in the fixture's native element. + * + * @param fixture The testing component fixture. + * @param selector The CSS selector for the element. + * @param content The text content or regular expression to match. + * @returns The element. + */ export function requireElement( fixture: TestingComponentFixture, selector: string, @@ -272,6 +325,15 @@ export function mockSingleton( methods: string[], instance?: Record, ): T; + +/** + * Mocks a singleton instance for testing purposes. + * + * @param singleton The singleton class or proxy. + * @param methodsOrProperties An array of method names to mock or an object containing property names and values. + * @param properties If `methodsOrProperties` is an array, this object contains the properties to mock. + * @returns The mocked singleton instance. + */ export function mockSingleton( singleton: CoreSingletonProxy, methodsOrProperties: string[] | Record = [], @@ -299,6 +361,10 @@ export function mockSingleton( return mockInstance; } +/** + * Resets the testing environment by marking the test bed as uninitialized and + * restoring default service singleton mocks. + */ export function resetTestingEnvironment(): void { testBedInitialized = false; @@ -307,6 +373,15 @@ export function resetTestingEnvironment(): void { } } +/** + * Retrieves the service instance corresponding to the provided injection token. + * If the injection token is a string, an empty object is returned. + * If the service instance is found in the test bed, it is returned. + * If not found, a new service instance is created, or an empty object is returned if creation fails. + * + * @param injectionToken The injection token for the desired service. + * @returns The service instance or an empty object. + */ export function getServiceInstance(injectionToken: ServiceInjectionToken): Record { if (typeof injectionToken === 'string') { return {}; @@ -317,6 +392,13 @@ export function getServiceInstance(injectionToken: ServiceInjectionToken): Recor ?? {}; } +/** + * Renders a component with the given configuration. + * + * @param component The Angular component to render. + * @param config Configuration options for rendering. + * @returns A promise that resolves to the testing component fixture. + */ export async function renderComponent( component: Type, config: Partial = {}, @@ -329,6 +411,13 @@ export async function renderComponent( }); } +/** + * Renders a page component with the given configuration. + * + * @param component The Angular component to render. + * @param config Configuration options for rendering a page component. + * @returns A promise that resolves to the testing component fixture. + */ export async function renderPageComponent( component: Type, config: Partial = {}, @@ -347,6 +436,14 @@ export async function renderPageComponent( return renderComponent(component, config); } +/** + * Renders a template with the given configuration. + * + * @param component The Angular component to wrap in a template. + * @param template The template for the wrapper component. + * @param config Configuration options for rendering. + * @returns A promise that resolves to the wrapper component fixture. + */ export async function renderTemplate( component: Type, template: string, @@ -366,6 +463,15 @@ export async function renderTemplate( ); } +/** + * Renders a wrapper component with the given configuration. + * + * @param component The Angular component to wrap. + * @param tag The HTML tag for the wrapper component. + * @param inputs Input attributes for the wrapper component. + * @param config Configuration options for rendering. + * @returns A promise that resolves to the wrapper component fixture. + */ export async function renderWrapperComponent( component: Type, tag: string, @@ -423,10 +529,21 @@ export function mockTranslate(translations: Record = {}): void { }); } +/** + * Creates a test function that asserts that two types are equal. + * + * @param equal The equality check function for types A and B. + * @returns A test function that asserts equality. + */ export function expectSameTypes(equal: Equal): () => void { return () => expect(equal).toBe(true); } +/** + * Creates a test function that always asserts true, used for testing generic types. + * + * @returns A test function that always asserts true. + */ // eslint-disable-next-line @typescript-eslint/no-unused-vars export function expectAnyType(): () => void { return () => expect(true).toBe(true); From 730c26e5d8aedeffb828fe9a73b3ca6557392b17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 7 Nov 2023 13:32:19 +0100 Subject: [PATCH 04/10] MOBILE-3947 styles: Use math.div instead of division --- src/addons/mod/quiz/pages/player/player.scss | 7 ++++--- src/theme/components/format-text.scss | 7 ++++--- src/theme/helpers/custom.mixins.scss | 18 +++++++++--------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/addons/mod/quiz/pages/player/player.scss b/src/addons/mod/quiz/pages/player/player.scss index 1242fc6f4..417040e35 100644 --- a/src/addons/mod/quiz/pages/player/player.scss +++ b/src/addons/mod/quiz/pages/player/player.scss @@ -1,4 +1,5 @@ -@import "~theme/globals"; +@use "theme/globals" as *; +@use "sass:math" as math; $quiz-timer-warn-color: $red !default; $quiz-timer-iterations: 15 !default; @@ -13,9 +14,9 @@ $quiz-timer-iterations: 15 !default; // Make the timer go red when it's reaching 0. @for $i from 0 through $quiz-timer-iterations { &.core-timer-timeleft-#{$i} { - $timer-background: rgba($quiz-timer-warn-color, 1 - ($i / $quiz-timer-iterations)); + $timer-background: rgba($quiz-timer-warn-color, 1 - math.div($i, $quiz-timer-iterations)); --timer-background: #{$timer-background}; - @if $i <= $quiz-timer-iterations / 2 { + @if $i <= math.div($quiz-timer-iterations, 2) { --timer-text-color: var(--white); } } diff --git a/src/theme/components/format-text.scss b/src/theme/components/format-text.scss index 2b937a7d8..9a1a635f6 100644 --- a/src/theme/components/format-text.scss +++ b/src/theme/components/format-text.scss @@ -1,6 +1,7 @@ /** Format Text - Show more styles. */ /** Styles of elements inside the directive should be placed in format-text.scss */ @use "theme/globals.variables" as global; +@use "sass:math" as math; core-format-text { --core-format-text-background: var(--background, var(--ion-item-background)); @@ -182,19 +183,19 @@ core-format-text { .embed-responsive-21by9 { &::before { - padding-top: percentage(9 / 21); + padding-top: percentage(math.div(9, 21)); } } .embed-responsive-16by9 { &::before { - padding-top: percentage(9 / 16); + padding-top: percentage(math.div(9, 16)); } } .embed-responsive-4by3 { &::before { - padding-top: percentage(3 / 4); + padding-top: percentage(math.div(3, 4)); } } diff --git a/src/theme/helpers/custom.mixins.scss b/src/theme/helpers/custom.mixins.scss index dfafaa7b0..87e419ad9 100644 --- a/src/theme/helpers/custom.mixins.scss +++ b/src/theme/helpers/custom.mixins.scss @@ -248,7 +248,7 @@ // Color mixins. @function get_brightness($color) { - @return (red($color) + green($color) + blue($color)) / 3; + @return math.div(red($color) + green($color) + blue($color), 3); } // Get the better color contrast using WCAG algorythm. @@ -256,9 +256,9 @@ $lumiance: luminance($color); // White lumiance is 1. - $whiteContrast: ($lumiance + 0.05) / (1 + 0.05); + $whiteContrast: math.div($lumiance + 0.05, 1 + 0.05); // White lumiance is 0. - $blackContrast: (0.05) / ($lumiance + 0.05); + $blackContrast: math.div(0.05, $lumiance + 0.05); @return if($whiteContrast < $blackContrast, white, black); } @@ -269,7 +269,7 @@ $g: green($color); $b: blue($color); - $yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000; + $yiq: math.div(($r * 299) + ($g * 587) + ($b * 114), 1000); @return if($yiq >= 128, $dark, $light); } @@ -280,9 +280,9 @@ $backgroundLuminance: luminance($background); @if ($backgroundLuminance < $foregroundLumiance) { - @return ($backgroundLuminance + 0.05) / ($foregroundLumiance + 0.05); + @return math.div($backgroundLuminance + 0.05, $foregroundLumiance + 0.05); } @else { - @return ($foregroundLumiance + 0.05) / ($backgroundLuminance + 0.05); + @return math.div($foregroundLumiance + 0.05, $backgroundLuminance + 0.05); } } @@ -299,11 +299,11 @@ } @function component-luminance($value) { - $value: $value / 255; + $value: math.div($value, 255); @if ($value <= 0.03928) { - @return $value / 12.92; + @return math.div($value, 12.92); } @else { - @return math.pow(($value + 0.055) / 1.055, 2.4); + @return math.pow(math.div($value + 0.055, 1.055), 2.4); } } From 8e65abcd489c52c707ef17f4fbe65d4f494f1f43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Thu, 16 Nov 2023 15:22:30 +0100 Subject: [PATCH 05/10] MOBILE-3947 styles: Fix new Ionic shadow DOM styles --- src/core/classes/modal-lateral-transition.ts | 8 +++---- src/theme/theme.base.scss | 24 ++++++++++---------- src/theme/theme.light.scss | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/core/classes/modal-lateral-transition.ts b/src/core/classes/modal-lateral-transition.ts index 45fafb626..95476b607 100644 --- a/src/core/classes/modal-lateral-transition.ts +++ b/src/core/classes/modal-lateral-transition.ts @@ -27,7 +27,7 @@ export function CoreModalLateralTransitionEnter(baseEl: HTMLElement): Animation const otherAnimations: Animation[] = []; - const backdrop = baseEl.querySelector('ion-backdrop'); + const backdrop = baseEl.shadowRoot?.querySelector('ion-backdrop'); if (backdrop) { const backdropAnimation = createAnimation() .addElement(backdrop) @@ -36,7 +36,7 @@ export function CoreModalLateralTransitionEnter(baseEl: HTMLElement): Animation otherAnimations.push(backdropAnimation); } - const wrapper = baseEl.querySelector('.modal-wrapper'); + const wrapper = baseEl.shadowRoot?.querySelector('.modal-wrapper'); if (wrapper) { const wrapperAnimation = createAnimation() .addElement(wrapper) @@ -64,7 +64,7 @@ export function CoreModalLateralTransitionLeave(baseEl: HTMLElement): Animation const otherAnimations: Animation[] = []; - const backdrop = baseEl.querySelector('ion-backdrop'); + const backdrop = baseEl.shadowRoot?.querySelector('ion-backdrop'); if (backdrop) { const backdropAnimation = createAnimation() .addElement(backdrop) @@ -73,7 +73,7 @@ export function CoreModalLateralTransitionLeave(baseEl: HTMLElement): Animation otherAnimations.push(backdropAnimation); } - const wrapper = baseEl.querySelector('.modal-wrapper'); + const wrapper = baseEl.shadowRoot?.querySelector('.modal-wrapper'); if (wrapper) { const wrapperAnimation = createAnimation() .addElement(wrapper) diff --git a/src/theme/theme.base.scss b/src/theme/theme.base.scss index c6ef546ae..2cd899729 100644 --- a/src/theme/theme.base.scss +++ b/src/theme/theme.base.scss @@ -680,7 +680,7 @@ body.core-iframe-fullscreen ion-router-outlet { } // Modals. -.core-modal-fullscreen .modal-wrapper { +.core-modal-fullscreen::part(content) { position: absolute; @include position(0 !important, null, null, 0 !important); display: block; @@ -690,11 +690,11 @@ body.core-iframe-fullscreen ion-router-outlet { .core-modal-transparent { - ion-backdrop { + &::part(backdrop) { backdrop-filter: blur(8px); } - .modal-wrapper { + &::part(content) { backdrop-filter: blur(12px); --background: rgba(10, 10, 10, 0.2); @@ -717,7 +717,7 @@ body.core-iframe-fullscreen ion-router-outlet { --ion-safe-area-left: 0px; --ion-safe-area-right: 0px; - .modal-wrapper { + &::part(content) { @include margin-horizontal(var(--modal-lateral-margin), null); position: absolute; @@ -729,7 +729,7 @@ body.core-iframe-fullscreen ion-router-outlet { box-shadow: 0 28px 48px rgba(0, 0, 0, 0.4); } - ion-backdrop { + &::part(backdrop) { visibility: visible; } @@ -740,10 +740,10 @@ body.core-iframe-fullscreen ion-router-outlet { .core-modal-transparent-no-filter { @extend .core-modal-transparent; - ion-backdrop { + &::part(backdrop) { backdrop-filter: none; } - .modal-wrapper { + &::part(content) { backdrop-filter: none; } } @@ -1107,7 +1107,7 @@ ion-checkbox, input[type=checkbox] { --border-radius: 2px; --border-color-checked: var(--text-color); - --background-checked: var(--text-color); + --checkbox-background-checked: var(--text-color); --checkmark-color: var(--contrast-background); --border-width: 2px; --outer-border-width: 2px; @@ -1318,7 +1318,7 @@ mark, .matchtext { } .core-scanning-qr { - .ion-page, .modal-wrapper { + .ion-page, ion-modal::part(content) { background-color: transparent !important; --background: transparent; } @@ -1887,14 +1887,14 @@ ion-modal { --box-shadow: none !important; pointer-events: none; - ion-backdrop { + &::part(backdrop) { display: none; } } } ion-popover { - .popover-wrapper .popover-content { + &::part(content) { border-radius: var(--modal-radius); } &.md { @@ -1903,7 +1903,7 @@ ion-popover { // Never show backdrop on popovers on Android // @todo Apply box shadow on ios and make it transparent too. The main problem is the box arrow. - ion-backdrop { + &::part(backdrop) { background: transparent; } } diff --git a/src/theme/theme.light.scss b/src/theme/theme.light.scss index 4778e4428..60dc20775 100644 --- a/src/theme/theme.light.scss +++ b/src/theme/theme.light.scss @@ -146,7 +146,7 @@ html { --core-header-buttons-background: var(--core-header-toolbar-background); --core-header-buttons-color: var(--core-header-toolbar-color); - ion-header { + ion-header, ion-header.header-md { box-shadow: var(--core-header-shadow, none); transition: box-shadow 0.5s; From 34147fceb7f20d2ef169cfa4da730656ba595466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Fri, 17 Nov 2023 11:08:26 +0100 Subject: [PATCH 06/10] MOBILE-3947 styles: Now Ionic support HTML hidden feature but it breaks --- src/theme/theme.base.scss | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/theme/theme.base.scss b/src/theme/theme.base.scss index 2cd899729..49d4242a3 100644 --- a/src/theme/theme.base.scss +++ b/src/theme/theme.base.scss @@ -1926,3 +1926,10 @@ ion-popover { inset: initial; color: initial; } + +/** + * https://github.com/ionic-team/ionic-framework/blob/6ffbdbb3b2b69290cf25753d535bc7483bd7c6e8/BREAKING.md#css-utilities + */ +[hidden] { + display: none !important; +} From 7c31e79bbdd44697d8c14def533e54bae6d68dc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Mon, 20 Nov 2023 16:46:29 +0100 Subject: [PATCH 07/10] MOBILE-3947 slides: Use Swiper instead of IonSlides --- package-lock.json | 19 ++ package.json | 1 + .../components/calendar/calendar.scss | 2 +- .../calendar/components/calendar/calendar.ts | 13 +- src/addons/calendar/pages/day/day.ts | 11 +- .../mod/book/pages/contents/contents.html | 2 +- .../mod/book/pages/contents/contents.ts | 8 +- .../mod/book/tests/behat/basic_usage.feature | 16 +- src/app/app.component.ts | 3 + src/core/classes/tabs.ts | 278 ++++++++---------- src/core/components/components.module.ts | 3 +- .../components/swipe-slides/swipe-slides.html | 9 +- .../components/swipe-slides/swipe-slides.scss | 16 +- .../components/swipe-slides/swipe-slides.ts | 86 +++--- .../tabs-outlet/core-tabs-outlet.html | 8 +- .../components/tabs-outlet/tabs-outlet.ts | 13 +- src/core/components/tabs/core-tabs.html | 8 +- src/core/components/tabs/tabs.scss | 4 +- src/core/components/tabs/tabs.ts | 22 +- .../editor/components/components.module.ts | 3 +- .../core-editor-rich-text-editor.html | 60 ++-- .../rich-text-editor/rich-text-editor.scss | 2 +- .../rich-text-editor/rich-text-editor.ts | 59 ++-- .../viewer/components/components.module.ts | 3 +- .../viewer/components/image/image.html | 12 +- .../viewer/components/image/image.scss | 2 +- .../features/viewer/components/image/image.ts | 54 ++-- src/testing/services/behat-blocking.ts | 2 +- src/testing/services/behat-dom.ts | 2 +- src/testing/services/behat-runtime.ts | 8 +- src/theme/theme.base.scss | 44 ++- src/theme/theme.light.scss | 2 +- upgrade.txt | 1 + 33 files changed, 424 insertions(+), 352 deletions(-) diff --git a/package-lock.json b/package-lock.json index 729e6b7e9..7d74f0f81 100644 --- a/package-lock.json +++ b/package-lock.json @@ -94,6 +94,7 @@ "nl.kingsquare.cordova.background-audio": "^1.0.1", "ogv": "^1.8.9", "rxjs": "~7.8.0", + "swiper": "^11.0.3", "ts-md5": "^1.2.7", "tslib": "^2.3.0", "video.js": "^7.21.1", @@ -27566,6 +27567,24 @@ "es6-symbol": "^3.1.1" } }, + "node_modules/swiper": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/swiper/-/swiper-11.0.5.tgz", + "integrity": "sha512-rhCwupqSyRnWrtNzWzemnBLMoyYuoDgGgspAm/8iBD3jCvAWycPLH4Z3TB0O5520DHLzMx94yUMH/B9Efpa48w==", + "funding": [ + { + "type": "patreon", + "url": "https://www.patreon.com/swiperjs" + }, + { + "type": "open_collective", + "url": "http://opencollective.com/swiper" + } + ], + "engines": { + "node": ">= 4.7.0" + } + }, "node_modules/symbol-observable": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", diff --git a/package.json b/package.json index 433ff5496..7eb597346 100644 --- a/package.json +++ b/package.json @@ -129,6 +129,7 @@ "nl.kingsquare.cordova.background-audio": "^1.0.1", "ogv": "^1.8.9", "rxjs": "~7.8.0", + "swiper": "^11.0.3", "ts-md5": "^1.2.7", "tslib": "^2.3.0", "video.js": "^7.21.1", diff --git a/src/addons/calendar/components/calendar/calendar.scss b/src/addons/calendar/components/calendar/calendar.scss index f3d27322f..2403bf1a1 100644 --- a/src/addons/calendar/components/calendar/calendar.scss +++ b/src/addons/calendar/components/calendar/calendar.scss @@ -142,7 +142,7 @@ } } - ion-slide { + swiper-slide { display: block; font-size: inherit; justify-content: start; diff --git a/src/addons/calendar/components/calendar/calendar.ts b/src/addons/calendar/components/calendar/calendar.ts index 1d9c2eea9..3561366a8 100644 --- a/src/addons/calendar/components/calendar/calendar.ts +++ b/src/addons/calendar/components/calendar/calendar.ts @@ -64,7 +64,7 @@ import { Translate } from '@singletons'; }) export class AddonCalendarCalendarComponent implements OnInit, DoCheck, OnDestroy { - @ViewChild(CoreSwipeSlidesComponent) slides?: CoreSwipeSlidesComponent; + @ViewChild(CoreSwipeSlidesComponent) swipeSlidesComponent?: CoreSwipeSlidesComponent; @Input() initialYear?: number; // Initial year to load. @Input() initialMonth?: number; // Initial month to load. @@ -185,7 +185,7 @@ export class AddonCalendarCalendarComponent implements OnInit, DoCheck, OnDestro this.hiddenDiffer = this.hidden; if (!this.hidden) { - this.slides?.slides?.getSwiper().then(swipper => swipper.update()); + this.swipeSlidesComponent?.updateSlidesComponent(); } } } @@ -248,14 +248,14 @@ export class AddonCalendarCalendarComponent implements OnInit, DoCheck, OnDestro * Load next month. */ loadNext(): void { - this.slides?.slideNext(); + this.swipeSlidesComponent?.slideNext(); } /** * Load previous month. */ loadPrevious(): void { - this.slides?.slidePrev(); + this.swipeSlidesComponent?.slidePrev(); } /** @@ -343,8 +343,7 @@ export class AddonCalendarCalendarComponent implements OnInit, DoCheck, OnDestro */ async viewMonth(month: number, year: number): Promise { const manager = this.manager; - const slides = this.slides; - if (!manager || !slides) { + if (!manager || !this.swipeSlidesComponent) { return; } @@ -360,7 +359,7 @@ export class AddonCalendarCalendarComponent implements OnInit, DoCheck, OnDestro // Make sure the day is loaded. await manager.getSource().loadItem(item); - slides.slideToItem(item); + this.swipeSlidesComponent.slideToItem(item); } catch (error) { CoreDomUtils.showErrorModalDefault(error, 'addon.calendar.errorloadevents', true); } finally { diff --git a/src/addons/calendar/pages/day/day.ts b/src/addons/calendar/pages/day/day.ts index 83c8e41a8..6097d8af7 100644 --- a/src/addons/calendar/pages/day/day.ts +++ b/src/addons/calendar/pages/day/day.ts @@ -60,7 +60,7 @@ import { CoreTime } from '@singletons/time'; }) export class AddonCalendarDayPage implements OnInit, OnDestroy { - @ViewChild(CoreSwipeSlidesComponent) slides?: CoreSwipeSlidesComponent; + @ViewChild(CoreSwipeSlidesComponent) swipeSlidesComponent?: CoreSwipeSlidesComponent; protected currentSiteId: string; @@ -434,8 +434,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { */ async goToCurrentDay(): Promise { const manager = this.manager; - const slides = this.slides; - if (!manager || !slides) { + if (!manager || !this.swipeSlidesComponent) { return; } @@ -448,7 +447,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { // Make sure the day is loaded. await manager.getSource().loadItem(currentDay); - slides.slideToItem(currentDay); + this.swipeSlidesComponent.slideToItem(currentDay); } catch (error) { CoreDomUtils.showErrorModalDefault(error, 'addon.calendar.errorloadevents', true); } finally { @@ -460,14 +459,14 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { * Load next day. */ async loadNext(): Promise { - this.slides?.slideNext(); + this.swipeSlidesComponent?.slideNext(); } /** * Load previous day. */ async loadPrevious(): Promise { - this.slides?.slidePrev(); + this.swipeSlidesComponent?.slidePrev(); } /** diff --git a/src/addons/mod/book/pages/contents/contents.html b/src/addons/mod/book/pages/contents/contents.html index ac443ffd7..c776d1290 100644 --- a/src/addons/mod/book/pages/contents/contents.html +++ b/src/addons/mod/book/pages/contents/contents.html @@ -30,7 +30,7 @@ - +
[] = []; - slidesOpts: CoreSwipeSlidesOptions = { + swiperOpts: CoreSwipeSlidesOptions = { + modules: [IonicSlides], autoHeight: true, observer: true, observeParents: true, @@ -222,7 +224,7 @@ export class AddonModBookContentsPage implements OnInit, OnDestroy { return; } - this.slides?.slideToItem({ id: chapterId }); + this.swipeSlidesComponent?.slideToItem({ id: chapterId }); } /** diff --git a/src/addons/mod/book/tests/behat/basic_usage.feature b/src/addons/mod/book/tests/behat/basic_usage.feature index a20893125..7231a77c7 100755 --- a/src/addons/mod/book/tests/behat/basic_usage.feature +++ b/src/addons/mod/book/tests/behat/basic_usage.feature @@ -134,22 +134,22 @@ Feature: Test basic usage of book activity in app But I should not find "This is the first chapter" in the app # Navigate using swipe. - When I swipe to the left in "Chapt 3" "ion-slides" in the app + When I swipe to the left in "Chapt 3" "swiper-container" in the app Then I should find "Chapt 3" in the app And I should find "This is the third chapter" in the app And I should find "4 / 4" in the app - When I swipe to the right in "Chapt 3" "ion-slides" in the app + When I swipe to the right in "Chapt 3" "swiper-container" in the app Then I should find "Chapt 2" in the app And I should find "This is the second chapter" in the app And I should find "3 / 4" in the app - When I swipe to the right in "Chapt 2" "ion-slides" in the app + When I swipe to the right in "Chapt 2" "swiper-container" in the app Then I should find "Chapt 1.1" in the app And I should find "This is a subchapter" in the app And I should find "2 / 4" in the app - When I swipe to the left in "Chapt 1.1" "ion-slides" in the app + When I swipe to the left in "Chapt 1.1" "swiper-container" in the app Then I should find "Chapt 2" in the app And I should find "This is the second chapter" in the app And I should find "3 / 4" in the app @@ -208,22 +208,22 @@ Scenario: View and navigate book contents (teacher) But I should not find "This is the first chapter" in the app # Navigate using swipe. - When I swipe to the left in "Hidden subchapter" "ion-slides" in the app + When I swipe to the left in "Hidden subchapter" "swiper-container" in the app Then I should find "Chapt 3" in the app And I should find "This is the third chapter" in the app And I should find "6 / 7" in the app - When I swipe to the left in "Chapt 3" "ion-slides" in the app + When I swipe to the left in "Chapt 3" "swiper-container" in the app Then I should find "Last hidden" in the app And I should find "Another hidden subchapter" in the app And I should find "7 / 7" in the app - When I swipe to the left in "Last hidden" "ion-slides" in the app + When I swipe to the left in "Last hidden" "swiper-container" in the app Then I should find "Last hidden" in the app And I should find "Another hidden subchapter" in the app And I should find "7 / 7" in the app - When I swipe to the right in "Last hidden" "ion-slides" in the app + When I swipe to the right in "Last hidden" "swiper-container" in the app Then I should find "Chapt 3" in the app And I should find "This is the third chapter" in the app And I should find "6 / 7" in the app diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 4f8005305..0c3b63393 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -35,11 +35,14 @@ import { CorePlatform } from '@services/platform'; import { CoreUrl } from '@singletons/url'; import { CoreLogger } from '@singletons/logger'; import { CorePromisedValue } from '@classes/promised-value'; +import { register } from 'swiper/element/bundle'; const MOODLE_SITE_URL_PREFIX = 'url-'; const MOODLE_VERSION_PREFIX = 'version-'; const MOODLEAPP_VERSION_PREFIX = 'moodleapp-'; +register(); + @Component({ selector: 'app-root', templateUrl: 'app.component.html', diff --git a/src/core/classes/tabs.ts b/src/core/classes/tabs.ts index f74babe68..2758cbaf6 100644 --- a/src/core/classes/tabs.ts +++ b/src/core/classes/tabs.ts @@ -25,7 +25,6 @@ import { SimpleChange, ElementRef, } from '@angular/core'; -import { IonSlides } from '@ionic/angular'; import { BackButtonEvent } from '@ionic/core'; import { Subscription } from 'rxjs'; @@ -40,6 +39,9 @@ import { CorePromisedValue } from './promised-value'; import { AsyncDirective } from './async-directive'; import { CoreDirectivesRegistry } from '@singletons/directives-registry'; import { CorePlatform } from '@services/platform'; +import { Swiper } from 'swiper'; +import { SwiperOptions } from 'swiper/types'; +import { IonicSlides } from '@ionic/angular'; /** * Class to abstract some common code for tabs. @@ -56,7 +58,34 @@ export class CoreTabsBaseComponent implements OnInit, Aft @Input() hideUntil = false; // Determine when should the contents be shown. @Output() protected ionChange = new EventEmitter(); // Emitted when the tab changes. - @ViewChild(IonSlides) protected slides?: IonSlides; + protected swiper?: Swiper; + @ViewChild('swiperRef') + set swiperRef(swiperRef: ElementRef) { + /** + * This setTimeout waits for Ionic's async initialization to complete. + * Otherwise, an outdated swiper reference will be used. + */ + setTimeout(() => { + if (swiperRef?.nativeElement?.swiper && !this.swiper) { + this.swiper = swiperRef.nativeElement.swiper as Swiper; + + this.swiper.changeLanguageDirection(CorePlatform.isRTL ? 'rtl' : 'ltr'); + + Object.keys(this.swiperOpts).forEach((key) => { + if (this.swiper) { + this.swiper.params[key] = this.swiperOpts[key]; + } + }); + + // Subscribe to changes. + this.swiper.on('slideChangeTransitionEnd', () => { + this.slideChanged(); + }); + + this.init(); + } + }, 0); + } tabs: T[] = []; // List of tabs. @@ -66,18 +95,14 @@ export class CoreTabsBaseComponent implements OnInit, Aft showNextButton = false; maxSlides = 3; numTabsShown = 0; - direction = 'ltr'; description = ''; - slidesOpts = { - initialSlide: 0, + swiperOpts: SwiperOptions = { + modules: [IonicSlides], slidesPerView: 3, centerInsufficientSlides: true, threshold: 10, }; - protected slidesElement?: HTMLIonSlidesElement; - protected initialized = false; - protected resizeListener?: CoreEventObserver; protected isDestroyed = false; protected isCurrentView = true; @@ -87,7 +112,7 @@ export class CoreTabsBaseComponent implements OnInit, Aft protected firstSelectedTab?: string; // ID of the first selected tab to control history. protected backButtonFunction: (event: BackButtonEvent) => void; - // Swiper 6 documentation: https://swiper6.vercel.app/ + // Swiper documentation: https://swiperjs.com/swiper-api protected isInTransition = false; // Wether Slides is in transition. protected subscriptions: Subscription[] = []; protected onReadyPromise = new CorePromisedValue(); @@ -106,12 +131,10 @@ export class CoreTabsBaseComponent implements OnInit, Aft * @inheritdoc */ async ngOnInit(): Promise { - this.direction = CorePlatform.isRTL ? 'rtl' : 'ltr'; - // Change the side when the language changes. this.subscriptions.push(Translate.onLangChange.subscribe(() => { setTimeout(() => { - this.direction = CorePlatform.isRTL ? 'rtl' : 'ltr'; + this.swiper?.changeLanguageDirection(CorePlatform.isRTL ? 'rtl' : 'ltr'); }); })); } @@ -125,6 +148,10 @@ export class CoreTabsBaseComponent implements OnInit, Aft } this.init(); + + this.resizeListener = CoreDom.onWindowResize(() => { + this.calculateSlides(); + }); } /** @@ -136,7 +163,7 @@ export class CoreTabsBaseComponent implements OnInit, Aft } /** - * User entered the page that contains the component. + * @inheritdoc */ ionViewDidEnter(): void { this.isCurrentView = true; @@ -179,7 +206,7 @@ export class CoreTabsBaseComponent implements OnInit, Aft } /** - * User left the page that contains the component. + * @inheritdoc */ ionViewDidLeave(): void { // Unregister the custom back button action for this component. @@ -189,16 +216,15 @@ export class CoreTabsBaseComponent implements OnInit, Aft } /** - * Calculate slides. + * Updates the number of slides to show. */ protected async calculateSlides(): Promise { - if (!this.isCurrentView || !this.initialized) { + if (!this.isCurrentView || !this.swiper) { // Don't calculate if component isn't in current view, the calculations are wrong. return; } this.numTabsShown = this.tabs.reduce((prev: number, current) => current.enabled ? prev + 1 : prev, 0); - if (this.numTabsShown <= 1) { this.hideTabs = true; @@ -209,7 +235,32 @@ export class CoreTabsBaseComponent implements OnInit, Aft await this.calculateMaxSlides(); - await this.updateSlides(); + this.swiperOpts.slidesPerView = Math.min(this.maxSlides, this.numTabsShown); + + this.slideChanged(); + + this.swiper.update(); + await CoreUtils.nextTick(); + + if (!this.hasSliddenToInitial && this.selectedIndex && this.selectedIndex >= this.swiper.slidesPerViewDynamic()) { + this.hasSliddenToInitial = true; + this.shouldSlideToInitial = true; + + setTimeout(() => { + if (this.shouldSlideToInitial) { + this.swiper?.slideTo(this.selectedIndex, 0); + this.shouldSlideToInitial = false; + } + }, 400); + + return; + } else if (this.selectedIndex) { + this.hasSliddenToInitial = true; + } + + setTimeout(() => { + this.slideChanged(); // Call slide changed again, sometimes the slide active index takes a while to be updated. + }, 400); } /** @@ -218,8 +269,12 @@ export class CoreTabsBaseComponent implements OnInit, Aft * @param tabId Tab ID. * @returns Selected tab. */ - protected getTabIndex(tabId: string): number { - return this.tabs.findIndex((tab) => tabId == tab.id); + protected getTabIndex(tabId?: string): number { + if (!tabId) { + return -1; + } + + return this.tabs.findIndex((tab) => tabId === tab.id); } /** @@ -228,89 +283,39 @@ export class CoreTabsBaseComponent implements OnInit, Aft * @returns Selected tab. */ getSelected(): T | undefined { - const index = this.selected && this.getTabIndex(this.selected); + const index = this.getTabIndex(this.selected); - return index !== undefined && index >= 0 ? this.tabs[index] : undefined; + return index >= 0 ? this.tabs[index] : undefined; } /** * Init the component. */ protected async init(): Promise { - if (!this.hideUntil) { + if (!this.hideUntil || !this.swiper) { // Hidden, do nothing. return; } try { - await this.initializeSlider(); - await this.initializeTabs(); + const selectedTab = this.calculateInitialTab(); + if (!selectedTab) { + // No enabled tabs, return. + throw new CoreError('No enabled tabs.'); + } + + this.firstSelectedTab = selectedTab.id; + if (this.firstSelectedTab !== undefined) { + this.selectTab(this.firstSelectedTab); + } + + // Check which arrows should be shown. + this.calculateSlides(); } catch { // Something went wrong, ignore. } } - /** - * Initialize the slider elements. - */ - protected async initializeSlider(): Promise { - if (this.initialized) { - return; - } - - if (this.slidesElement) { - // Already initializated, await for ready. - await this.slidesElement.componentOnReady(); - - return; - } - - if (!this.slides) { - await CoreUtils.nextTick(); - } - const slidesSwiper = await this.slides?.getSwiper(); - if (!slidesSwiper || !this.slides) { - throw new CoreError('Swiper not found, will try on next change.'); - } - - this.slidesElement = slidesSwiper.el; - await this.slidesElement.componentOnReady(); - - this.initialized = true; - - // Subscribe to changes. - this.subscriptions.push(this.slides.ionSlideDidChange.subscribe(() => { - this.slideChanged(); - })); - } - - /** - * Initialize the tabs, determining the first tab to be shown. - */ - protected async initializeTabs(): Promise { - if (!this.initialized || !this.slidesElement) { - return; - } - - const selectedTab = this.calculateInitialTab(); - if (!selectedTab) { - // No enabled tabs, return. - throw new CoreError('No enabled tabs.'); - } - - this.firstSelectedTab = selectedTab.id; - if (this.firstSelectedTab !== undefined) { - this.selectTab(this.firstSelectedTab); - } - - // Check which arrows should be shown. - this.calculateSlides(); - - this.resizeListener = CoreDom.onWindowResize(() => { - this.calculateSlides(); - }); - } - /** * Calculate the initial tab to load. * @@ -330,116 +335,71 @@ export class CoreTabsBaseComponent implements OnInit, Aft /** * Method executed when the slides are changed. */ - async slideChanged(): Promise { - if (!this.slidesElement) { + slideChanged(): void { + if (!this.swiper) { return; } this.isInTransition = false; - const slidesCount = await this.slides?.length() || 0; + const slidesCount = this.swiper.slides.length || 0; if (slidesCount > 0) { - this.showPrevButton = !await this.slides?.isBeginning(); - this.showNextButton = !await this.slides?.isEnd(); + this.showPrevButton = !this.swiper.isBeginning; + this.showNextButton = !this.swiper.isEnd; } else { this.showPrevButton = false; this.showNextButton = false; } - const currentIndex = await this.slides?.getActiveIndex(); + const currentIndex = this.swiper.activeIndex; if (this.shouldSlideToInitial && currentIndex != this.selectedIndex) { // Current tab has changed, don't slide to initial anymore. this.shouldSlideToInitial = false; } } - /** - * Updates the number of slides to show. - */ - protected async updateSlides(): Promise { - if (!this.slides) { - return; - } - - this.slidesOpts = { ...this.slidesOpts, slidesPerView: Math.min(this.maxSlides, this.numTabsShown) }; - - await this.slideChanged(); - - await this.slides.update(); - - if (!this.hasSliddenToInitial && this.selectedIndex && this.selectedIndex >= this.slidesOpts.slidesPerView) { - this.hasSliddenToInitial = true; - this.shouldSlideToInitial = true; - - setTimeout(() => { - if (this.shouldSlideToInitial) { - this.slides?.slideTo(this.selectedIndex, 0); - this.shouldSlideToInitial = false; - } - }, 400); - - return; - } else if (this.selectedIndex) { - this.hasSliddenToInitial = true; - } - - setTimeout(() => { - this.slideChanged(); // Call slide changed again, sometimes the slide active index takes a while to be updated. - }, 400); - } - /** * Calculate the number of slides that can fit on the screen. */ protected async calculateMaxSlides(): Promise { - if (!this.slidesElement || !this.slides) { + if (!this.swiper) { return; } this.maxSlides = 3; await CoreUtils.nextTick(); - let width: number = this.slidesElement.getBoundingClientRect().width; - if (!width) { - const slidesSwiper = await this.slides.getSwiper(); - - await slidesSwiper.updateSize(); - await CoreUtils.nextTick(); - - width = slidesSwiper.width; - if (!width) { - - return; - } + if (!this.swiper.width) { + return; } const zoomLevel = await CoreSettingsHelper.getZoom(); - this.maxSlides = Math.floor(width / (zoomLevel / 100 * CoreTabsBaseComponent.MIN_TAB_WIDTH)); + this.maxSlides = Math.floor(this.swiper.width / (zoomLevel / 100 * CoreTabsBaseComponent.MIN_TAB_WIDTH)); } /** * Method that shows the next tab. */ - async slideNext(): Promise { + slideNext(): void { // Stop if slides are in transition. - if (!this.showNextButton || this.isInTransition || !this.slides) { + if (!this.showNextButton || this.isInTransition || !this.swiper) { return; } - if (await this.slides.isBeginning()) { + if (this.swiper.isBeginning) { // Slide to the second page. - this.slides.slideTo(this.maxSlides); + this.swiper.slideTo(this.maxSlides); } else { - const currentIndex = await this.slides.getActiveIndex(); + const currentIndex = this.swiper.activeIndex; if (currentIndex !== undefined) { const nextSlideIndex = currentIndex + this.maxSlides; this.isInTransition = true; if (nextSlideIndex < this.numTabsShown) { // Slide to the next page. - await this.slides.slideTo(nextSlideIndex); + this.swiper.slideTo(nextSlideIndex); } else { // Slide to the latest slide. - await this.slides.slideTo(this.numTabsShown - 1); + this.swiper.slideTo(this.numTabsShown - 1); } } @@ -449,26 +409,26 @@ export class CoreTabsBaseComponent implements OnInit, Aft /** * Method that shows the previous tab. */ - async slidePrev(): Promise { + slidePrev(): void { // Stop if slides are in transition. - if (!this.showPrevButton || this.isInTransition || !this.slides) { + if (!this.showPrevButton || this.isInTransition || !this.swiper) { return; } - if (await this.slides.isEnd()) { - this.slides.slideTo(this.numTabsShown - this.maxSlides * 2); + if (this.swiper.isEnd) { + this.swiper.slideTo(this.numTabsShown - this.maxSlides * 2); // Slide to the previous of the latest page. } else { - const currentIndex = await this.slides.getActiveIndex(); + const currentIndex = this.swiper.activeIndex; if (currentIndex !== undefined) { const prevSlideIndex = currentIndex - this.maxSlides; this.isInTransition = true; if (prevSlideIndex >= 0) { // Slide to the previous page. - await this.slides.slideTo(prevSlideIndex); + this.swiper.slideTo(prevSlideIndex); } else { // Slide to the first page. - await this.slides.slideTo(0); + this.swiper.slideTo(0); } } } @@ -517,12 +477,12 @@ export class CoreTabsBaseComponent implements OnInit, Aft return; } - if (this.selected && this.slides) { + if (this.selected && this.swiper) { // Check if we need to slide to the tab because it's not visible. - const firstVisibleTab = await this.slides.getActiveIndex(); - const lastVisibleTab = firstVisibleTab + this.slidesOpts.slidesPerView - 1; + const firstVisibleTab = this.swiper.activeIndex; + const lastVisibleTab = firstVisibleTab + this.swiper.slidesPerViewDynamic() - 1; if (index < firstVisibleTab || index > lastVisibleTab) { - await this.slides.slideTo(index, 0, true); + this.swiper.slideTo(index, 0, true); } } diff --git a/src/core/components/components.module.ts b/src/core/components/components.module.ts index fd78701a6..8e35e23e2 100644 --- a/src/core/components/components.module.ts +++ b/src/core/components/components.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { NgModule } from '@angular/core'; +import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { IonicModule } from '@ionic/angular'; import { TranslateModule } from '@ngx-translate/core'; @@ -170,5 +170,6 @@ import { CoreSitesListComponent } from './sites-list/sites-list'; CoreSheetModalComponent, CoreSitesListComponent, ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], }) export class CoreComponentsModule {} diff --git a/src/core/components/swipe-slides/swipe-slides.html b/src/core/components/swipe-slides/swipe-slides.html index 65ab4c92a..088172613 100644 --- a/src/core/components/swipe-slides/swipe-slides.html +++ b/src/core/components/swipe-slides/swipe-slides.html @@ -1,6 +1,7 @@ - - + + - - + + diff --git a/src/core/components/swipe-slides/swipe-slides.scss b/src/core/components/swipe-slides/swipe-slides.scss index 90b467e57..4f221edf4 100644 --- a/src/core/components/swipe-slides/swipe-slides.scss +++ b/src/core/components/swipe-slides/swipe-slides.scss @@ -1,13 +1,13 @@ :host { - ion-slides { + swiper-container { height: 100%; - } - ion-slide { - display: block; - font-size: inherit; - justify-content: start; - align-items: start; - text-align: start; + swiper-slide { + display: block; + font-size: inherit; + justify-content: start; + align-items: start; + text-align: start; + } } } diff --git a/src/core/components/swipe-slides/swipe-slides.ts b/src/core/components/swipe-slides/swipe-slides.ts index e411d6748..a2569739e 100644 --- a/src/core/components/swipe-slides/swipe-slides.ts +++ b/src/core/components/swipe-slides/swipe-slides.ts @@ -13,16 +13,17 @@ // limitations under the License. import { - Component, ContentChild, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, Output, TemplateRef, ViewChild, + Component, ContentChild, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, Output, SimpleChange, TemplateRef, ViewChild, } from '@angular/core'; import { CoreSwipeSlidesItemsManager } from '@classes/items-management/swipe-slides-items-manager'; -import { IonContent, IonSlides } from '@ionic/angular'; +import { IonContent } from '@ionic/angular'; import { CoreDomUtils, VerticalPoint } from '@services/utils/dom'; import { CoreUtils } from '@services/utils/utils'; import { CoreDom } from '@singletons/dom'; import { CoreEventObserver } from '@singletons/events'; import { CoreMath } from '@singletons/math'; - +import { Swiper } from 'swiper'; +import { SwiperOptions } from 'swiper/types'; /** * Helper component to display swipable slides. */ @@ -38,13 +39,31 @@ export class CoreSwipeSlidesComponent implements OnChanges, OnDe @Output() onWillChange = new EventEmitter>(); @Output() onDidChange = new EventEmitter>(); - @ViewChild(IonSlides) slides?: IonSlides; + protected swiper?: Swiper; + @ViewChild('swiperRef') + set swiperRef(swiperRef: ElementRef) { + /** + * This setTimeout waits for Ionic's async initialization to complete. + * Otherwise, an outdated swiper reference will be used. + */ + setTimeout(() => { + if (swiperRef?.nativeElement?.swiper) { + this.swiper = swiperRef.nativeElement.swiper as Swiper; + + Object.keys(this.options).forEach((key) => { + if (this.swiper) { + this.swiper.params[key] = this.options[key]; + } + }); + } + }, 0); + } + @ContentChild(TemplateRef) template?: TemplateRef; // Template defined by the content. protected hostElement: HTMLElement; protected unsubscribe?: () => void; protected resizeListener: CoreEventObserver; - protected updateSlidesPromise?: Promise; protected activeSlideIndexes: number[] = []; constructor( @@ -53,18 +72,26 @@ export class CoreSwipeSlidesComponent implements OnChanges, OnDe ) { this.hostElement = elementRef.nativeElement; - this.resizeListener = CoreDom.onWindowResize(async () => { - await this.updateSlidesComponent(); + this.resizeListener = CoreDom.onWindowResize(() => { + this.updateSlidesComponent(); }); } /** * @inheritdoc */ - ngOnChanges(): void { + ngOnChanges(changes: { [name: string]: SimpleChange }): void { if (!this.unsubscribe && this.manager) { this.initialize(this.manager); } + + if (changes.options) { + Object.keys(this.options).forEach((key) => { + if (this.swiper) { + this.swiper.params[key] = this.options[key]; + } + }); + } } get items(): Item[] { @@ -133,23 +160,20 @@ export class CoreSwipeSlidesComponent implements OnChanges, OnDe * @param speed Animation speed. * @param runCallbacks Whether to run callbacks. */ - async slideToIndex(index: number, speed?: number, runCallbacks?: boolean): Promise { + slideToIndex(index: number, speed?: number, runCallbacks?: boolean): void { // If slides are being updated, wait for the update to finish. - await this.updateSlidesPromise; - - const slides = this.slides; - if (!slides) { + if (!this.swiper) { return; } // Verify that the number of slides matches the number of items. - const slidesLength = await slides.length(); + const slidesLength = this.swiper.slides.length; if (slidesLength !== this.items.length) { // Number doesn't match, do a new update to try to match them. - await this.updateSlidesComponent(); + this.updateSlidesComponent(); } - this.slides?.slideTo(index, speed, runCallbacks); + this.swiper?.slideTo(index, speed, runCallbacks); } /** @@ -173,7 +197,7 @@ export class CoreSwipeSlidesComponent implements OnChanges, OnDe * @param runCallbacks Whether to run callbacks. */ slideNext(speed?: number, runCallbacks?: boolean): void { - this.slides?.slideNext(speed, runCallbacks); + this.swiper?.slideNext(speed, runCallbacks); } /** @@ -183,7 +207,7 @@ export class CoreSwipeSlidesComponent implements OnChanges, OnDe * @param runCallbacks Whether to run callbacks. */ slidePrev(speed?: number, runCallbacks?: boolean): void { - this.slides?.slidePrev(speed, runCallbacks); + this.swiper?.slidePrev(speed, runCallbacks); } /** @@ -194,7 +218,7 @@ export class CoreSwipeSlidesComponent implements OnChanges, OnDe await CoreUtils.nextTick(); // Update the slides component so the slides list reflects the new items. - await this.updateSlidesComponent(); + this.updateSlidesComponent(); const currentItem = this.manager?.getSelectedItem(); @@ -205,7 +229,7 @@ export class CoreSwipeSlidesComponent implements OnChanges, OnDe // Keep the same slide in case the list has changed. const newIndex = this.manager.getSource().getItemIndex(currentItem) ?? -1; if (newIndex != -1) { - this.slides?.slideTo(newIndex, 0, false); + this.swiper?.slideTo(newIndex, 0, false); } } @@ -270,11 +294,11 @@ export class CoreSwipeSlidesComponent implements OnChanges, OnDe * @returns Promise resolved with current item data. Null if not found. */ protected async getCurrentSlideItemData(): Promise | null> { - if (!this.slides || !this.manager) { + if (!this.swiper || !this.manager) { return null; } - const index = await this.slides.getActiveIndex(); + const index = this.swiper.activeIndex; const items = this.manager.getSource().getItems(); const currentItem = items && items[index]; @@ -291,19 +315,8 @@ export class CoreSwipeSlidesComponent implements OnChanges, OnDe /** * Update slides component. */ - protected async updateSlidesComponent(): Promise { - if (!this.slides) { - return; - } - - const promise = this.slides.update(); - this.updateSlidesPromise = promise; - - await promise; - - if (this.updateSlidesPromise === promise) { - delete this.updateSlidesPromise; - } + updateSlidesComponent(): void { + this.swiper?.update(); } /** @@ -321,8 +334,7 @@ export class CoreSwipeSlidesComponent implements OnChanges, OnDe * * @todo Change unknown with the right type once Swiper library is used. */ -export type CoreSwipeSlidesOptions = Record & { - initialSlide?: number; +export type CoreSwipeSlidesOptions = SwiperOptions & { scrollOnChange?: 'top' | 'none'; // Scroll behaviour on change slide. By default, none. }; diff --git a/src/core/components/tabs-outlet/core-tabs-outlet.html b/src/core/components/tabs-outlet/core-tabs-outlet.html index 0f2af04ea..f7f2fdea5 100644 --- a/src/core/components/tabs-outlet/core-tabs-outlet.html +++ b/src/core/components/tabs-outlet/core-tabs-outlet.html @@ -6,9 +6,9 @@ [attr.aria-label]="'core.previous' | translate"> - + - - + - + diff --git a/src/core/components/tabs-outlet/tabs-outlet.ts b/src/core/components/tabs-outlet/tabs-outlet.ts index 725b92b29..34b6a2724 100644 --- a/src/core/components/tabs-outlet/tabs-outlet.ts +++ b/src/core/components/tabs-outlet/tabs-outlet.ts @@ -23,7 +23,6 @@ import { SimpleChange, } from '@angular/core'; import { IonRouterOutlet, IonTabs, ViewDidEnter, ViewDidLeave } from '@ionic/angular'; -import { Subscription } from 'rxjs'; import { CoreUtils } from '@services/utils/utils'; import { Params } from '@angular/router'; @@ -63,8 +62,6 @@ export class CoreTabsOutletComponent extends CoreTabsBaseComponent; protected existsInNavigationStack = false; @@ -90,7 +87,7 @@ export class CoreTabsOutletComponent extends CoreTabsBaseComponent { + this.subscriptions.push(this.ionTabs.outlet.stackDidChange.subscribe(async (stackEvent: StackDidChangeEvent) => { if (!this.isCurrentView) { return; } @@ -110,10 +107,10 @@ export class CoreTabsOutletComponent extends CoreTabsBaseComponent { + })); + this.subscriptions.push(this.ionTabs.outlet.activateEvents.subscribe(() => { this.lastActiveComponent = this.ionTabs.outlet.component; - }); + })); } /** @@ -221,8 +218,6 @@ export class CoreTabsOutletComponent extends CoreTabsBaseComponent - + - - + - + diff --git a/src/core/components/tabs/tabs.scss b/src/core/components/tabs/tabs.scss index 66a57c342..8784d0e4a 100644 --- a/src/core/components/tabs/tabs.scss +++ b/src/core/components/tabs/tabs.scss @@ -44,12 +44,12 @@ } } - ion-slides { + swiper-container { text-align: center; line-height: 1.6rem; flex-grow: 1; - ion-slide { + swiper-slide { border-bottom: 2px solid transparent; min-width: 100px; height: var(--height); diff --git a/src/core/components/tabs/tabs.ts b/src/core/components/tabs/tabs.ts index 9d213583b..ae8782a56 100644 --- a/src/core/components/tabs/tabs.ts +++ b/src/core/components/tabs/tabs.ts @@ -47,7 +47,18 @@ export class CoreTabsComponent extends CoreTabsBaseComponent i @Input() parentScrollable = false; // Determine if the scroll should be in the parent content or the tab itself. @Input() layout: 'icon-top' | 'icon-start' | 'icon-end' | 'icon-bottom' | 'icon-hide' | 'label-hide' = 'icon-hide'; - @ViewChild('originalTabs') originalTabsRef?: ElementRef; + @ViewChild('originalTabs') + set originalTabs(originalTabs: ElementRef) { + /** + * This setTimeout waits for Ionic's async initialization to complete. + * Otherwise, an outdated swiper reference will be used. + */ + setTimeout(() => { + if (originalTabs.nativeElement && !this.originalTabsContainer) { + this.originalTabsContainer = this.originalTabs?.nativeElement; + } + }, 0); + } protected originalTabsContainer?: HTMLElement; // The container of the original tabs. It will include each tab's content. @@ -60,15 +71,6 @@ export class CoreTabsComponent extends CoreTabsBaseComponent i if (this.isDestroyed) { return; } - - this.originalTabsContainer = this.originalTabsRef?.nativeElement; - } - - /** - * Initialize the tabs, determining the first tab to be shown. - */ - protected async initializeTabs(): Promise { - await super.initializeTabs(); } /** diff --git a/src/core/features/editor/components/components.module.ts b/src/core/features/editor/components/components.module.ts index 3c46c84a7..8bc9e4105 100644 --- a/src/core/features/editor/components/components.module.ts +++ b/src/core/features/editor/components/components.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { NgModule } from '@angular/core'; +import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { CoreEditorRichTextEditorComponent } from './rich-text-editor/rich-text-editor'; import { CoreSharedModule } from '@/core/shared.module'; @@ -29,5 +29,6 @@ import { CoreSharedModule } from '@/core/shared.module'; exports: [ CoreEditorRichTextEditorComponent, ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], }) export class CoreEditorComponentsModule {} diff --git a/src/core/features/editor/components/rich-text-editor/core-editor-rich-text-editor.html b/src/core/features/editor/components/rich-text-editor/core-editor-rich-text-editor.html index 2d260dbd3..023a13ea2 100644 --- a/src/core/features/editor/components/rich-text-editor/core-editor-rich-text-editor.html +++ b/src/core/features/editor/components/rich-text-editor/core-editor-rich-text-editor.html @@ -21,103 +21,103 @@ [attr.aria-label]="'core.previous' | translate" [tabindex]="toolbarPrevHidden ? -1 : 0"> - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +
@@ -26,8 +24,7 @@ - + (ionCancel)="filterTextChanged($event.target)" [placeholder]="'core.courses.filtermycourses' | translate" /> @@ -70,8 +67,7 @@ - + (ionCancel)="filterTextChanged($event.target)" [placeholder]="'core.courses.filtermycourses' | translate" /> - + - + @@ -114,8 +110,7 @@ {{'addon.block_myoverview.nocoursesenrolleddescription' | translate}}

- + @@ -128,8 +123,7 @@ - + [layout]="layout" /> diff --git a/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/addon-block-recentlyaccessedcourses.html b/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/addon-block-recentlyaccessedcourses.html index ea4e9891a..1b76456b0 100644 --- a/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/addon-block-recentlyaccessedcourses.html +++ b/src/addons/block/recentlyaccessedcourses/components/recentlyaccessedcourses/addon-block-recentlyaccessedcourses.html @@ -3,21 +3,19 @@

{{ 'addon.block_recentlyaccessedcourses.pluginname' | translate }}

- - +
+ [message]="'addon.block_recentlyaccessedcourses.nocourses' | translate" />
- - +
diff --git a/src/addons/block/recentlyaccesseditems/components/recentlyaccesseditems/addon-block-recentlyaccesseditems.html b/src/addons/block/recentlyaccesseditems/components/recentlyaccesseditems/addon-block-recentlyaccesseditems.html index 9d157d6d1..c72044e87 100644 --- a/src/addons/block/recentlyaccesseditems/components/recentlyaccesseditems/addon-block-recentlyaccesseditems.html +++ b/src/addons/block/recentlyaccesseditems/components/recentlyaccesseditems/addon-block-recentlyaccesseditems.html @@ -3,8 +3,7 @@

{{ 'addon.block_recentlyaccesseditems.pluginname' | translate }}

- - +
@@ -16,18 +15,16 @@ - + [componentId]="item.cmid" [showAlt]="false" [purpose]="item.purpose" /> {{ item.iconTitle }}

+ [courseId]="item.courseid" />

- - +

@@ -38,6 +35,6 @@
+ [message]="'addon.block_recentlyaccesseditems.noitems' | translate" />
diff --git a/src/addons/block/sitemainmenu/components/sitemainmenu/addon-block-sitemainmenu.html b/src/addons/block/sitemainmenu/components/sitemainmenu/addon-block-sitemainmenu.html index 4b6d5b6ba..6885e5146 100644 --- a/src/addons/block/sitemainmenu/components/sitemainmenu/addon-block-sitemainmenu.html +++ b/src/addons/block/sitemainmenu/components/sitemainmenu/addon-block-sitemainmenu.html @@ -8,10 +8,10 @@ + [contextInstanceId]="siteHomeId" /> - + diff --git a/src/addons/block/starredcourses/components/starredcourses/addon-block-starredcourses.html b/src/addons/block/starredcourses/components/starredcourses/addon-block-starredcourses.html index debe61210..f022f3e2c 100644 --- a/src/addons/block/starredcourses/components/starredcourses/addon-block-starredcourses.html +++ b/src/addons/block/starredcourses/components/starredcourses/addon-block-starredcourses.html @@ -3,21 +3,19 @@

{{ 'addon.block_starredcourses.pluginname' | translate }}

- - +
+ [message]="'addon.block_starredcourses.nocourses' | translate" />
- - +
diff --git a/src/addons/block/timeline/components/events/addon-block-timeline-events.html b/src/addons/block/timeline/components/events/addon-block-timeline-events.html index d84981b96..8e31ce4ba 100644 --- a/src/addons/block/timeline/components/events/addon-block-timeline-events.html +++ b/src/addons/block/timeline/components/events/addon-block-timeline-events.html @@ -2,8 +2,7 @@

{{ 'core.courses.aria:coursename' | translate }} - - +

@@ -23,15 +22,13 @@ {{event.timesort * 1000 | coreFormatDate:"strftimetime24" }} - + [modname]="event.modulename" [purpose]="event.purpose" />

- + [contextInstanceId]="event.id" [courseId]="event.course?.id" /> {{ 'addon.block_timeline.overdue' | translate }} @@ -39,15 +36,13 @@

- + [contextInstanceId]="event.course.id" />

- + [contextInstanceId]="event.id" />

@@ -72,5 +67,5 @@ {{ 'core.loadmore' | translate }} - +
diff --git a/src/addons/block/timeline/components/timeline/addon-block-timeline.html b/src/addons/block/timeline/components/timeline/addon-block-timeline.html index b20b7952d..a5bc3a312 100644 --- a/src/addons/block/timeline/components/timeline/addon-block-timeline.html +++ b/src/addons/block/timeline/components/timeline/addon-block-timeline.html @@ -9,7 +9,7 @@ + searchArea="AddonBlockTimeline" /> @@ -31,7 +31,7 @@ + searchArea="AddonBlockTimeline" /> + [loadingMore]="data.loadingMore" (loadMore)="section.loadMore()" [course]="section.course" /> + [message]="'addon.block_timeline.noevents' | translate" />
diff --git a/src/addons/blog/pages/entries/entries.html b/src/addons/blog/pages/entries/entries.html index df97ac484..9fac4dfb2 100644 --- a/src/addons/blog/pages/entries/entries.html +++ b/src/addons/blog/pages/entries/entries.html @@ -1,37 +1,35 @@ - +

{{ title | translate }}

- +
- + {{ 'addon.blog.showonlyyourentries' | translate }} - + - - + - +

- + [contextInstanceId]="contextInstanceId" />

{{ 'addon.blog.' + entry.publishTranslated! | translate}} @@ -49,35 +47,32 @@ - + [contextLevel]="contextLevel" [contextInstanceId]="contextInstanceId" />
{{ 'core.tag.tags' | translate }}:
- +
- + [instanceId]="entry.userid" contextLevel="user" [showItem]="true" /> - + [componentId]="entry.id" /> {{ 'addon.blog.linktooriginalentry' | translate }}
- {{entry.lastmodified + {{entry.lastmodified | coreTimeAgo}}
- + diff --git a/src/addons/calendar/components/calendar/addon-calendar-calendar.html b/src/addons/calendar/components/calendar/addon-calendar-calendar.html index 02bab4b3b..2d543551b 100644 --- a/src/addons/calendar/components/calendar/addon-calendar-calendar.html +++ b/src/addons/calendar/components/calendar/addon-calendar-calendar.html @@ -2,8 +2,7 @@ - + [content]="'addon.calendar.currentmonth' | translate" iconAction="fas-calendar-day" (action)="goToCurrentMonth()" /> @@ -14,19 +13,18 @@ - +

{{ periodName }} - - +

- +
@@ -50,8 +48,7 @@ - - + + [attr.aria-label]="'core.notsent' | translate" /> + [attr.aria-label]="'core.deletedoffline' | translate" /> {{ event.timestart * 1000 | coreFormatDate: timeFormat }} @@ -98,8 +95,7 @@
- - + diff --git a/src/addons/calendar/components/filter/filter.html b/src/addons/calendar/components/filter/filter.html index 65dee4fd4..365e7e72f 100644 --- a/src/addons/calendar/components/filter/filter.html +++ b/src/addons/calendar/components/filter/filter.html @@ -2,7 +2,7 @@ - + @@ -10,18 +10,18 @@ - + - + - + - + diff --git a/src/addons/calendar/components/upcoming-events/addon-calendar-upcoming-events.html b/src/addons/calendar/components/upcoming-events/addon-calendar-upcoming-events.html index c16291fdc..1224e95ef 100644 --- a/src/addons/calendar/components/upcoming-events/addon-calendar-upcoming-events.html +++ b/src/addons/calendar/components/upcoming-events/addon-calendar-upcoming-events.html @@ -1,6 +1,6 @@ - - + @@ -8,9 +8,8 @@ - + [componentId]="event.instance" [showAlt]="false" [purpose]="event.purpose" /> + diff --git a/src/addons/calendar/pages/day/day.html b/src/addons/calendar/pages/day/day.html index acdb94351..373e65cdd 100644 --- a/src/addons/calendar/pages/day/day.html +++ b/src/addons/calendar/pages/day/day.html @@ -1,30 +1,28 @@ - +

{{ 'addon.calendar.calendarevents' | translate }}

- + - + iconAction="fas-calendar-day" (action)="goToCurrentDay()" /> - + [closeOnClick]="false" />
- + @@ -34,7 +32,7 @@ - + @@ -42,7 +40,7 @@ - + @@ -54,14 +52,13 @@ - + - + [message]="'addon.calendar.noevents' | translate" /> @@ -70,11 +67,9 @@ (click)="gotoEvent(event.id, day)" [class.item-dimmed]="event.ispast" [ngClass]="['addon-calendar-eventtype-'+event.eventtype]" button [detail]="false"> - + [modname]="event.modulename" [componentId]="event.instance" [purpose]="event.purpose" /> + aria-hidden="true" /> @@ -84,18 +79,18 @@

+ [contextInstanceId]="event.contextInstanceId" />

- +

- + - +
@@ -111,7 +106,7 @@ - + diff --git a/src/addons/calendar/pages/edit-event/edit-event.html b/src/addons/calendar/pages/edit-event/edit-event.html index 09a702814..f949796e8 100644 --- a/src/addons/calendar/pages/edit-event/edit-event.html +++ b/src/addons/calendar/pages/edit-event/edit-event.html @@ -1,7 +1,7 @@ - +

{{ title | translate }}

@@ -10,7 +10,7 @@
- + @@ -20,9 +20,8 @@

{{ 'addon.calendar.eventname' | translate }}

- - - + + @@ -31,9 +30,8 @@

{{ 'core.date' | translate }}

- - + [max]="maxDate" [min]="minDate" [displayTimezone]="displayTimezone" /> + @@ -108,7 +106,7 @@ - +
@@ -121,7 +119,7 @@ - + @@ -129,7 +127,7 @@

{{ reminder.label }}

- +
@@ -146,31 +144,30 @@

{{ 'addon.calendar.durationnone' | translate }}

- +

{{ 'addon.calendar.durationuntil' | translate }}

- +
- + - + [displayTimezone]="displayTimezone" />

{{ 'addon.calendar.durationminutes' | translate }}

- +
{{ 'addon.calendar.durationminutes' | translate }} + [placeholder]="'addon.calendar.durationminutes' | translate" formControlName="timedurationminutes" /> @@ -181,14 +178,13 @@

{{ 'addon.calendar.repeatevent' | translate }}

- +

{{ 'addon.calendar.repeatweeksl' | translate }}

- - +
@@ -204,13 +200,13 @@

{{ 'addon.calendar.repeateditall' | translate:{$a: otherEventsCount} }}

- +

{{ 'addon.calendar.repeateditthis' | translate }}

- +
@@ -222,7 +218,7 @@ + [autoSave]="false" /> @@ -230,8 +226,7 @@

{{ 'core.location' | translate }}

- - +
diff --git a/src/addons/calendar/pages/event/event.html b/src/addons/calendar/pages/event/event.html index 81a83d325..1af4abd75 100644 --- a/src/addons/calendar/pages/event/event.html +++ b/src/addons/calendar/pages/event/event.html @@ -1,42 +1,38 @@ - +

- - +

- + [iconAction]="syncIcon" [closeOnClick]="false" /> - + [content]="'core.edit' | translate" (action)="openEdit()" iconAction="fas-pen" /> + [content]="'core.delete' | translate" (action)="deleteEvent()" iconAction="fas-trash" /> + (action)="undoDelete()" iconAction="fas-rotate-left" />
- + - + [componentId]="event.instance" slot="start" [purpose]="event.purpose" /> + - +

{{ 'addon.calendar.when' | translate }}

- +
- {{ 'core.deletedoffline' | translate }} +
@@ -76,8 +71,7 @@

{{ 'core.course' | translate}}

- - +

@@ -85,8 +79,7 @@

{{ 'core.group' | translate}}

- - +

@@ -94,8 +87,7 @@

{{ 'core.category' | translate}}

- - +

@@ -104,7 +96,7 @@

{{ 'core.description' | translate}}

+ [contextInstanceId]="event.contextInstanceId" />

@@ -114,7 +106,7 @@

+ [contextInstanceId]="event.contextInstanceId" />

@@ -142,7 +134,7 @@ - + diff --git a/src/addons/calendar/pages/index/index.html b/src/addons/calendar/pages/index/index.html index 39f929563..6e3c382bb 100644 --- a/src/addons/calendar/pages/index/index.html +++ b/src/addons/calendar/pages/index/index.html @@ -1,55 +1,52 @@ - +

{{ (showCalendar ? 'addon.calendar.calendarevents' : 'addon.calendar.upcomingevents') | translate }}

- + + iconAction="fas-table-list" (action)="toggleDisplay()" /> + iconAction="fas-calendar-days" (action)="toggleDisplay()" /> - + iconAction="fas-gears" /> + [iconAction]="syncIcon" [closeOnClick]="false" /> - +
- + - + - + [displayNavButtons]="showCalendar" (onEventClicked)="gotoEvent($event)" (onDayClicked)="gotoDay($event)" /> - - + - + diff --git a/src/addons/calendar/pages/settings/settings.html b/src/addons/calendar/pages/settings/settings.html index d8982f79b..7ca79cf28 100644 --- a/src/addons/calendar/pages/settings/settings.html +++ b/src/addons/calendar/pages/settings/settings.html @@ -1,7 +1,7 @@ - +

{{ 'core.settings.settings' | translate }}

diff --git a/src/addons/competency/pages/competencies/competencies.html b/src/addons/competency/pages/competencies/competencies.html index 33b3afe43..9a4b264c5 100644 --- a/src/addons/competency/pages/competencies/competencies.html +++ b/src/addons/competency/pages/competencies/competencies.html @@ -1,12 +1,11 @@ - +

- - +

@@ -14,7 +13,7 @@ - + @@ -24,8 +23,7 @@

- {{competency.competency.idnumber}} + [contextInstanceId]="contextInstanceId" /> {{competency.competency.idnumber}}

- +

- {{ competency.competency.competency.idnumber }} + [contextInstanceId]="contextInstanceId" /> {{ competency.competency.competency.idnumber }}

- + - +

{{ user.fullname }}

@@ -30,8 +29,7 @@ - + [contextInstanceId]="contextInstanceId" /> @@ -40,26 +38,22 @@

- + [contextInstanceId]="contextInstanceId" /> - + [contextInstanceId]="contextInstanceId" />  /  - + [contextInstanceId]="contextInstanceId" />  /  @@ -76,8 +70,7 @@

@@ -91,12 +84,10 @@

- - + - + [courseId]="courseId" /> @@ -136,7 +127,7 @@ - +

{{ evidence.actionuser.fullname }}

{{ evidence.timemodified * 1000 | coreFormatDate }}

diff --git a/src/addons/competency/pages/competencysummary/competencysummary.html b/src/addons/competency/pages/competencysummary/competencysummary.html index 3c354f39f..7271d983c 100644 --- a/src/addons/competency/pages/competencysummary/competencysummary.html +++ b/src/addons/competency/pages/competencysummary/competencysummary.html @@ -1,28 +1,26 @@ - +

- {{ competency.competency.idnumber }} + [contextInstanceId]="contextInstanceId" /> {{ competency.competency.idnumber }}

- + - + [contextInstanceId]="contextInstanceId" /> @@ -30,14 +28,12 @@

{{ 'addon.competency.path' | translate }}

- + [contextInstanceId]="contextInstanceId" />  / 

diff --git a/src/addons/competency/pages/coursecompetencies/coursecompetencies.html b/src/addons/competency/pages/coursecompetencies/coursecompetencies.html index 687d8f88c..1547cbb80 100644 --- a/src/addons/competency/pages/coursecompetencies/coursecompetencies.html +++ b/src/addons/competency/pages/coursecompetencies/coursecompetencies.html @@ -1,7 +1,7 @@ - +

{{ 'addon.competency.coursecompetencies' | translate }}

@@ -10,7 +10,7 @@
- + @@ -29,8 +29,7 @@ {x: courseCompetencies.statistics.proficientcompetencycount, y: courseCompetencies.statistics.competencycount} } }} - + ariaDescribedBy="addon-competency-course-{{courseId}}-progress" />
{{ 'addon.competency.competenciesmostoftennotproficientincourse' | translate }}

@@ -52,15 +51,14 @@ - +

{{ user.fullname }}

- + message="{{ 'addon.competency.nocompetenciesincourse' | translate }}" />
@@ -68,8 +66,8 @@ [attr.aria-label]="competency.competency.shortname" [detail]="true" button>

- - {{competency.competency.idnumber}} + {{competency.competency.idnumber}}

- + [contextInstanceId]="courseId" />

{{ 'addon.competency.path' | translate }}

@@ -90,24 +87,20 @@ - + [contextInstanceId]="courseId" /> - + [contextInstanceId]="courseId" />  /  - - +  /  @@ -126,12 +119,10 @@

- - + - + [courseId]="courseId" />
@@ -143,8 +134,7 @@ - - +
diff --git a/src/addons/competency/pages/plan/plan.html b/src/addons/competency/pages/plan/plan.html index 8bbcd992d..be91b266e 100644 --- a/src/addons/competency/pages/plan/plan.html +++ b/src/addons/competency/pages/plan/plan.html @@ -1,25 +1,24 @@ - +

- - +

- + - +

{{ user.fullname }}

@@ -29,8 +28,7 @@

- - +

@@ -50,8 +48,7 @@

{{ 'addon.competency.template' | translate }}

- - +

@@ -64,8 +61,7 @@

- + ariaDescribedBy="addon-competency-plan-{{plan.plan.id}}-progress" />
@@ -85,8 +81,7 @@

- {{competency.competency.idnumber}} + [contextInstanceId]="plan.plan.userid" /> {{competency.competency.idnumber}}

- +

{{ 'addon.competency.userplans' | translate }}

@@ -11,19 +11,16 @@ - + - - - +

- - +

{{ 'addon.competency.duedate' | translate }}:  diff --git a/src/addons/coursecompletion/pages/report/report.html b/src/addons/coursecompletion/pages/report/report.html index d31d01da6..b94dd4763 100644 --- a/src/addons/coursecompletion/pages/report/report.html +++ b/src/addons/coursecompletion/pages/report/report.html @@ -1,7 +1,7 @@ - +

{{ 'addon.coursecompletion.coursecompletion' | translate }}

@@ -10,11 +10,11 @@ - + - +

{{user.fullname}}

@@ -44,10 +44,10 @@

- +

- +

{{ 'core.yes' | translate }} @@ -65,23 +65,23 @@ - + - + - + - + {{ 'core.yes' | translate }} {{ 'core.no' | translate }} {{ criteria.timecompleted * 1000 | coreFormatDate :'strftimedatetimeshort' }} - +
@@ -103,7 +103,7 @@ - + diff --git a/src/addons/messageoutput/airnotifier/pages/devices/devices.html b/src/addons/messageoutput/airnotifier/pages/devices/devices.html index 2a84773ea..ffecacf69 100644 --- a/src/addons/messageoutput/airnotifier/pages/devices/devices.html +++ b/src/addons/messageoutput/airnotifier/pages/devices/devices.html @@ -1,7 +1,7 @@ - +

{{ 'addon.messageoutput_airnotifier.processorsettingsdesc' | translate }}

@@ -10,7 +10,7 @@
- + @@ -33,8 +33,7 @@

- - +
diff --git a/src/addons/messages/components/conversation-info/conversation-info.html b/src/addons/messages/components/conversation-info/conversation-info.html index 8d53b3dce..1e8b058d3 100644 --- a/src/addons/messages/components/conversation-info/conversation-info.html +++ b/src/addons/messages/components/conversation-info/conversation-info.html @@ -5,14 +5,14 @@
- +
- + @@ -23,12 +23,11 @@ onError="this.src='assets/img/group-avatar.svg'">

- +

- + [contextInstanceId]="0" />

{{ 'addon.messages.numparticipants' | translate:{$a: conversation.membercount} }}

@@ -36,19 +35,16 @@ - - +

{{ member.fullname }} - + [attr.aria-label]="'addon.messages.contactblocked' | translate" />

- - +
diff --git a/src/addons/messages/pages/contacts-35/contacts.html b/src/addons/messages/pages/contacts-35/contacts.html index 4086c4c08..209e28930 100644 --- a/src/addons/messages/pages/contacts-35/contacts.html +++ b/src/addons/messages/pages/contacts-35/contacts.html @@ -1,32 +1,32 @@ - +

{{ 'addon.messages.contacts' | translate }}

- +
- + + autocorrect="off" spellcheck="false" lengthCheck="2" [disabled]="!loaded" searchArea="AddonMessagesContacts" /> + [message]="'addon.messages.contactlistempty' | translate" /> + [message]="'addon.messages.nousersfound' | translate" /> @@ -44,7 +44,7 @@ *ngIf="contact.profileimageurl || contact.profileimageurlsmall" [attr.aria-label]="contact.fullname" (click)="gotoDiscussion(contact.id)" [detail]="true" button [attr.aria-current]="contact.id === discussionUserId ? 'page' : 'false'"> - +

{{ contact.fullname }}

diff --git a/src/addons/messages/pages/contacts/contacts.html b/src/addons/messages/pages/contacts/contacts.html index 5903b00ee..613d674f0 100644 --- a/src/addons/messages/pages/contacts/contacts.html +++ b/src/addons/messages/pages/contacts/contacts.html @@ -1,17 +1,17 @@ - +

{{ 'addon.messages.contacts' | translate }}

- + - +
@@ -23,7 +23,7 @@ - + @@ -31,27 +31,22 @@ *ngFor="let contact of confirmedContacts" [attr.aria-label]="contact.fullname" [detail]="true" [attr.aria-current]="contact.id === selectedUserId ? 'page' : 'false'"> - + [linkProfile]="false" />

- - + - + [attr.aria-label]="'addon.messages.contactblocked' | translate" />

- + [message]="'addon.messages.nocontactsgetstarted' | translate" /> - + position="bottom" />
@@ -61,17 +56,16 @@ badgeA11yText="addon.messages.pendingcontactrequests"> - + - + - - +

{{ 'addon.messages.wouldliketocontactyou' | translate }}

@@ -79,11 +73,9 @@
- + [message]="'addon.messages.nocontactrequests' | translate" /> - + position="bottom" />
diff --git a/src/addons/messages/pages/discussion/discussion.html b/src/addons/messages/pages/discussion/discussion.html index 3a6610ec0..db3c27112 100644 --- a/src/addons/messages/pages/discussion/discussion.html +++ b/src/addons/messages/pages/discussion/discussion.html @@ -1,67 +1,57 @@ - +

- - + [checkOnline]="otherMember.showonlinestatus" /> + - + [attr.aria-label]="'core.favourites' | translate" /> - + [attr.aria-label]="'addon.messages.mutedconversation' | translate" />

- +
+ [content]="'addon.messages.info' | translate" (action)="viewInfo()" iconAction="fas-circle-info" /> - + [content]="'addon.messages.groupinfo' | translate" (action)="viewInfo()" iconAction="fas-circle-info" /> - + 'addon.messages.addtofavourites') | translate" [iconAction]="favouriteIcon" [iconSlash]="favouriteIconSlash" /> - + [content]="'addon.messages.blockuser' | translate" (action)="blockUser()" [iconAction]="blockIcon" /> - + [content]="'addon.messages.unblockuser' | translate" (action)="unblockUser()" [iconAction]="blockIcon" /> + 'addon.messages.muteconversation') | translate" [iconAction]="muteIcon" /> - + [content]="'addon.messages.showdeletemessages' | translate" iconAction="toggle" [(toggle)]="showDelete" /> + [closeOnClick]="false" [iconAction]="deleteIcon" /> - + [content]="'addon.messages.addtoyourcontacts' | translate" (action)="createContactRequest()" [iconAction]="addRemoveIcon" /> + [iconSlash]="true" />
- - +

{{ 'addon.messages.selfconversation' | translate }}

@@ -78,25 +68,23 @@ {{ 'addon.messages.newmessages' | translate }} - + - + [time]="message.timecreated" />
- + [message]="'addon.messages.nomessagesfound' | translate" />
- + {{ newMessages }} @@ -138,6 +126,6 @@

+ [placeholder]="'addon.messages.newmessage' | translate" /> diff --git a/src/addons/messages/pages/discussions-35/discussions.html b/src/addons/messages/pages/discussions-35/discussions.html index a778f18f2..8995fb3cd 100644 --- a/src/addons/messages/pages/discussions-35/discussions.html +++ b/src/addons/messages/pages/discussions-35/discussions.html @@ -1,27 +1,27 @@ - +

{{ 'addon.messages.messages' | translate }}

- - + +
- + + [autoFocus]="false" /> @@ -29,7 +29,7 @@ - + diff --git a/src/addons/messages/pages/group-conversations/group-conversations.html b/src/addons/messages/pages/group-conversations/group-conversations.html index 7a9af7157..de0dd6db5 100644 --- a/src/addons/messages/pages/group-conversations/group-conversations.html +++ b/src/addons/messages/pages/group-conversations/group-conversations.html @@ -1,34 +1,34 @@ - +

{{ 'addon.messages.messages' | translate }}

- + - + - - + +
- + - +
- - + + [error]="favourites.loadMoreError" />

{{ 'addon.messages.nofavourites' | translate }}

@@ -68,7 +66,7 @@
- + @@ -77,8 +75,7 @@ [attr.aria-label]="(group.expanded ? 'core.collapse' : 'core.expand') | translate" [attr.aria-expanded]="group.expanded" aria-controls="addon-messages-groupconversations-group" role="heading" [detail]="false"> + [class.expandable-status-icon-expanded]="group.expanded" />

{{ 'addon.messages.groupconversations' | translate }} ({{ group.count }})

@@ -89,11 +86,10 @@
- - + + [error]="group.loadMoreError" />

{{ 'addon.messages.nogroupconversations' | translate }}

@@ -102,7 +98,7 @@
- + @@ -111,8 +107,7 @@ [attr.aria-expanded]="individual.expanded" aria-controls="addon-messages-groupconversations-individual" role="heading" [detail]="false"> + [class.expandable-status-icon-expanded]="individual.expanded" />

{{ 'addon.messages.individualconversations' | translate }} ({{ individual.count }})

@@ -123,11 +118,10 @@
- - + + [error]="individual.loadMoreError" />

{{ 'addon.messages.noindividualconversations' | translate }}

@@ -136,7 +130,7 @@
- + @@ -148,9 +142,9 @@ @@ -161,16 +155,15 @@ + [checkOnline]="conversation.showonlinestatus" slot="start" />

- - - - - + + +

@@ -183,7 +176,7 @@

- +

@@ -192,7 +185,7 @@ {{ conversation.members[0].fullname + ':' }} + contextLevel="system" [contextInstanceId]="0" />

diff --git a/src/addons/messages/pages/search/search.html b/src/addons/messages/pages/search/search.html index 933c0b2bb..60fa3c1ca 100644 --- a/src/addons/messages/pages/search/search.html +++ b/src/addons/messages/pages/search/search.html @@ -1,35 +1,34 @@ - +

{{ 'addon.messages.searchcombined' | translate }}

- +
+ [spellcheck]="false" [autoFocus]="true" [lengthCheck]="1" searchArea="AddonMessagesSearch" /> - - - + + + + [error]="messages.loadMoreError" /> - + icon="fas-magnifying-glass" [message]="'core.noresults' | translate" /> @@ -46,13 +45,11 @@ - +

- - - - + +

{{result.lastmessagedate | coreDateDayOrTime}} @@ -62,7 +59,7 @@ {{ 'addon.messages.you' | translate }} + contextLevel="system" [contextInstanceId]="0" class="addon-message-last-message-text" />

@@ -75,7 +72,7 @@
- +
diff --git a/src/addons/messages/pages/settings/settings.html b/src/addons/messages/pages/settings/settings.html index fe58ac796..c5c8a9c40 100644 --- a/src/addons/messages/pages/settings/settings.html +++ b/src/addons/messages/pages/settings/settings.html @@ -1,7 +1,7 @@ - +

{{ 'addon.messages.messages' | translate }}

@@ -10,7 +10,7 @@
- + @@ -25,7 +25,7 @@

{{ 'addon.messages.useentertosend' | translate }}

- +
@@ -36,8 +36,7 @@

{{ 'addon.messages.blocknoncontacts' | translate }}

- - + @@ -51,19 +50,19 @@

{{ 'addon.messages.contactableprivacy_onlycontacts' | translate }}

- +

{{ 'addon.messages.contactableprivacy_coursemember' | translate }}

- +

{{ 'addon.messages.contactableprivacy_site' | translate }}

- +
@@ -72,10 +71,10 @@ - + - +
@@ -109,8 +108,7 @@ - + (ngModelChange)="changePreferenceLegacy(notification, processor, state)" /> {{'core.settings.forced' | translate }} @@ -145,8 +143,7 @@ - - + {{ processor.lockedmessage }} diff --git a/src/addons/mod/assign/components/edit-feedback-modal/edit-feedback-modal.html b/src/addons/mod/assign/components/edit-feedback-modal/edit-feedback-modal.html index 38aa16a83..174c766bd 100644 --- a/src/addons/mod/assign/components/edit-feedback-modal/edit-feedback-modal.html +++ b/src/addons/mod/assign/components/edit-feedback-modal/edit-feedback-modal.html @@ -5,15 +5,14 @@ - +
- - + {{ 'core.done' | translate }}
diff --git a/src/addons/mod/assign/components/feedback-plugin/addon-mod-assign-feedback-plugin.html b/src/addons/mod/assign/components/feedback-plugin/addon-mod-assign-feedback-plugin.html index 3a61b78e2..81d2f09e0 100644 --- a/src/addons/mod/assign/components/feedback-plugin/addon-mod-assign-feedback-plugin.html +++ b/src/addons/mod/assign/components/feedback-plugin/addon-mod-assign-feedback-plugin.html @@ -9,12 +9,10 @@

- + contextLevel="module" [contextInstanceId]="assign.cmid" [courseId]="assign.course" />

- + [alwaysDownload]="true" /> diff --git a/src/addons/mod/assign/components/index/addon-mod-assign-index.html b/src/addons/mod/assign/components/index/addon-mod-assign-index.html index 3f65bb593..cef082331 100644 --- a/src/addons/mod/assign/components/index/addon-mod-assign-index.html +++ b/src/addons/mod/assign/components/index/addon-mod-assign-index.html @@ -1,7 +1,7 @@ - + @@ -12,8 +12,7 @@
- - +
@@ -21,8 +20,7 @@ - - + @@ -115,19 +113,17 @@ - +
- - +
- + [moduleId]="module.id" /> diff --git a/src/addons/mod/assign/components/submission-plugin/addon-mod-assign-submission-plugin.html b/src/addons/mod/assign/components/submission-plugin/addon-mod-assign-submission-plugin.html index 29818a878..389c7ed53 100644 --- a/src/addons/mod/assign/components/submission-plugin/addon-mod-assign-submission-plugin.html +++ b/src/addons/mod/assign/components/submission-plugin/addon-mod-assign-submission-plugin.html @@ -9,12 +9,10 @@

- + contextLevel="module" [contextInstanceId]="assign.cmid" [courseId]="assign.course" />

- + [alwaysDownload]="true" /> diff --git a/src/addons/mod/assign/components/submission/addon-mod-assign-submission.html b/src/addons/mod/assign/components/submission/addon-mod-assign-submission.html index fc5a16654..a0f9a4e70 100644 --- a/src/addons/mod/assign/components/submission/addon-mod-assign-submission.html +++ b/src/addons/mod/assign/components/submission/addon-mod-assign-submission.html @@ -3,7 +3,7 @@ - + @@ -136,8 +135,7 @@ - + [submission]="userSubmission" [plugin]="plugin" /> @@ -149,7 +147,7 @@ - +

{{ user.fullname }}

@@ -213,7 +211,7 @@ {{ 'core.openinbrowser' | translate }} - +
@@ -229,10 +227,9 @@ - + - - + @@ -253,8 +250,7 @@ - - +
@@ -268,12 +264,12 @@

{{ 'addon.mod_assign.currentgrade' | translate }}

- +

- + @@ -285,8 +281,7 @@

{{ 'addon.mod_assign.gradeoutof' | translate: {$a: gradeInfo!.grade} }}

- + [lang]="grade.lang" />

{{ 'addon.mod_assign.gradelocked' | translate }}

@@ -345,8 +340,7 @@ - + [submission]="userSubmission" [userId]="submitId" [plugin]="plugin" [canEdit]="canSaveGrades" /> @@ -363,7 +357,7 @@

{{ 'addon.mod_assign.groupsubmissionsettings' | translate }}

{{ 'addon.mod_assign.applytoteam' | translate }}

- + @@ -387,14 +381,14 @@ {{ 'addon.mod_assign.addattempt' | translate }} - + - +

{{ 'addon.mod_assign.gradedby' | translate }}

{{ grader!.fullname }}

@@ -413,12 +407,12 @@ - + @@ -434,8 +428,7 @@

- + [wsNotFiltered]="true" />

- + [contextInstanceId]="assign.cmid" [courseId]="assign.course" />

- +
- {{ 'core.notsent' | translate }} +
@@ -25,6 +24,5 @@ {{ plugin.name }} - + elementId="assignfeedbackcomments_editor" [draftExtraParams]="{userid: userId, action: 'grade'}" /> diff --git a/src/addons/mod/assign/feedback/editpdf/component/addon-mod-assign-feedback-editpdf.html b/src/addons/mod/assign/feedback/editpdf/component/addon-mod-assign-feedback-editpdf.html index d50b9ae85..e3facd7a1 100644 --- a/src/addons/mod/assign/feedback/editpdf/component/addon-mod-assign-feedback-editpdf.html +++ b/src/addons/mod/assign/feedback/editpdf/component/addon-mod-assign-feedback-editpdf.html @@ -3,8 +3,8 @@

{{plugin.name}}

- - +
diff --git a/src/addons/mod/assign/feedback/file/component/addon-mod-assign-feedback-file.html b/src/addons/mod/assign/feedback/file/component/addon-mod-assign-feedback-file.html index d50b9ae85..e3facd7a1 100644 --- a/src/addons/mod/assign/feedback/file/component/addon-mod-assign-feedback-file.html +++ b/src/addons/mod/assign/feedback/file/component/addon-mod-assign-feedback-file.html @@ -3,8 +3,8 @@

{{plugin.name}}

- - +
diff --git a/src/addons/mod/assign/pages/edit/edit.html b/src/addons/mod/assign/pages/edit/edit.html index 9b1cecbaa..a05415641 100644 --- a/src/addons/mod/assign/pages/edit/edit.html +++ b/src/addons/mod/assign/pages/edit/edit.html @@ -1,12 +1,11 @@ - +

- - +

@@ -22,38 +21,33 @@ - + [underTimeClassThresholds]="[300, 900]" /> - + [contextInstanceId]="moduleId" [courseId]="courseId" /> - - +
- - + - + - + [submission]="userSubmission" [plugin]="plugin" [edit]="true" [allowOffline]="allowOffline" />
diff --git a/src/addons/mod/assign/pages/index/index.html b/src/addons/mod/assign/pages/index/index.html index 0ee3bc5a8..4bcdb2e52 100644 --- a/src/addons/mod/assign/pages/index/index.html +++ b/src/addons/mod/assign/pages/index/index.html @@ -1,24 +1,21 @@ - +

- - +

- - - +
- + - + diff --git a/src/addons/mod/assign/pages/submission-list/submission-list.html b/src/addons/mod/assign/pages/submission-list/submission-list.html index dfc608421..2dc9b43e2 100644 --- a/src/addons/mod/assign/pages/submission-list/submission-list.html +++ b/src/addons/mod/assign/pages/submission-list/submission-list.html @@ -1,35 +1,33 @@ - +

- - +

- +
- + - + [courseId]="courseId" /> - +

{{submission.userfullname}}

@@ -37,8 +35,7 @@

- - + @@ -68,8 +65,7 @@ - + [message]="'addon.mod_assign.submissionstatus_' | translate" /> diff --git a/src/addons/mod/assign/pages/submission-review/submission-review.html b/src/addons/mod/assign/pages/submission-review/submission-review.html index 370086cb0..fe477e715 100644 --- a/src/addons/mod/assign/pages/submission-review/submission-review.html +++ b/src/addons/mod/assign/pages/submission-review/submission-review.html @@ -1,16 +1,15 @@ - +

- - +

- +
@@ -21,10 +20,9 @@
- + - - + diff --git a/src/addons/mod/assign/submission/comments/component/addon-mod-assign-submission-comments.html b/src/addons/mod/assign/submission/comments/component/addon-mod-assign-submission-comments.html index 912151506..aeb861c11 100644 --- a/src/addons/mod/assign/submission/comments/component/addon-mod-assign-submission-comments.html +++ b/src/addons/mod/assign/submission/comments/component/addon-mod-assign-submission-comments.html @@ -2,7 +2,6 @@

{{plugin.name}}

- + area="submission_comments" [title]="plugin.name" [courseId]="assign.course" />
diff --git a/src/addons/mod/assign/submission/file/component/addon-mod-assign-submission-file.html b/src/addons/mod/assign/submission/file/component/addon-mod-assign-submission-file.html index 9dff2e4d5..5e4e45293 100644 --- a/src/addons/mod/assign/submission/file/component/addon-mod-assign-submission-file.html +++ b/src/addons/mod/assign/submission/file/component/addon-mod-assign-submission-file.html @@ -3,7 +3,7 @@

{{ plugin.name }}

- +
@@ -16,6 +16,5 @@ - + [component]="component" [componentId]="assign.cmid" [acceptedTypes]="acceptedTypes" [allowOffline]="allowOffline" /> diff --git a/src/addons/mod/assign/submission/onlinetext/component/addon-mod-assign-submission-onlinetext.html b/src/addons/mod/assign/submission/onlinetext/component/addon-mod-assign-submission-onlinetext.html index b417a1286..80ee10649 100644 --- a/src/addons/mod/assign/submission/onlinetext/component/addon-mod-assign-submission-onlinetext.html +++ b/src/addons/mod/assign/submission/onlinetext/component/addon-mod-assign-submission-onlinetext.html @@ -5,8 +5,7 @@

{{ 'addon.mod_assign.numwords' | translate: {'$a': words} }}

- + [contextInstanceId]="assign.cmid" [courseId]="assign.course" />

@@ -29,7 +28,6 @@ - + [draftExtraParams]="{userid: currentUserId, action: 'editsubmission'}" /> diff --git a/src/addons/mod/bigbluebuttonbn/components/index/index.html b/src/addons/mod/bigbluebuttonbn/components/index/index.html index bb1d82c25..eb5ae623d 100644 --- a/src/addons/mod/bigbluebuttonbn/components/index/index.html +++ b/src/addons/mod/bigbluebuttonbn/components/index/index.html @@ -1,7 +1,7 @@ - + @@ -10,12 +10,10 @@ - + [courseId]="courseId" (completionChanged)="onCompletionChange()" /> - + [multipleGroupsMessage]="'addon.mod_bigbluebuttonbn.view_groups_selection_warning' | translate" [courseId]="module.course" /> @@ -78,7 +76,7 @@ - + @@ -94,8 +92,7 @@ + [class.expandable-status-icon-expanded]="recording.expanded" />

{{ recording.type }}

{{ recording.name }}

@@ -113,7 +110,7 @@

{{ playback.name }}

- +
@@ -121,7 +118,7 @@

{{ data.label }}

+ [contextInstanceId]="module.id" [courseId]="module.course" />

{{ data.value }}

@@ -130,8 +127,7 @@
- + [message]="'addon.mod_bigbluebuttonbn.view_message_norecordings' | translate" />
@@ -146,7 +142,6 @@
- - + diff --git a/src/addons/mod/bigbluebuttonbn/pages/index/index.html b/src/addons/mod/bigbluebuttonbn/pages/index/index.html index 506ef400b..538e267fe 100644 --- a/src/addons/mod/bigbluebuttonbn/pages/index/index.html +++ b/src/addons/mod/bigbluebuttonbn/pages/index/index.html @@ -1,23 +1,20 @@ - +

- - +

- - - +
- + - + diff --git a/src/addons/mod/book/components/index/addon-mod-book-index.html b/src/addons/mod/book/components/index/addon-mod-book-index.html index 704677aee..6f60eaf28 100644 --- a/src/addons/mod/book/components/index/addon-mod-book-index.html +++ b/src/addons/mod/book/components/index/addon-mod-book-index.html @@ -1,7 +1,7 @@ - + @@ -10,8 +10,7 @@ - + [courseId]="courseId" (completionChanged)="onCompletionChange()" /> @@ -26,8 +25,7 @@

{{chapter.indexNumber}} - - +

@@ -41,7 +39,6 @@ - - + diff --git a/src/addons/mod/book/components/toc/toc.html b/src/addons/mod/book/components/toc/toc.html index 64a99d665..e68109ac6 100644 --- a/src/addons/mod/book/components/toc/toc.html +++ b/src/addons/mod/book/components/toc/toc.html @@ -5,7 +5,7 @@ - + @@ -20,8 +20,8 @@

{{chapter.indexNumber}} - - +

diff --git a/src/addons/mod/book/pages/contents/contents.html b/src/addons/mod/book/pages/contents/contents.html index c776d1290..b1169bfeb 100644 --- a/src/addons/mod/book/pages/contents/contents.html +++ b/src/addons/mod/book/pages/contents/contents.html @@ -1,31 +1,30 @@ - +

- - +

- +
- +
- + @@ -34,10 +33,10 @@
+ [contextInstanceId]="cmId" [courseId]="courseId" [disabled]="!active" />
{{ 'core.tag.tags' | translate }}: - +
@@ -47,6 +46,5 @@ - + (action)="changeChapter($event.id)" slot="fixed" /> diff --git a/src/addons/mod/book/pages/index/index.html b/src/addons/mod/book/pages/index/index.html index 5b58f63cc..525f74785 100644 --- a/src/addons/mod/book/pages/index/index.html +++ b/src/addons/mod/book/pages/index/index.html @@ -1,24 +1,20 @@ - +

- - +

- - - +
- + - - + diff --git a/src/addons/mod/chat/components/index/addon-mod-chat-index.html b/src/addons/mod/chat/components/index/addon-mod-chat-index.html index a10e1a5f1..74b7c4e80 100644 --- a/src/addons/mod/chat/components/index/addon-mod-chat-index.html +++ b/src/addons/mod/chat/components/index/addon-mod-chat-index.html @@ -1,7 +1,7 @@ - + @@ -10,12 +10,11 @@ - + [courseId]="courseId" (completionChanged)="onCompletionChange()" /> - + @@ -31,7 +30,6 @@
- - +
diff --git a/src/addons/mod/chat/components/users-modal/users-modal.html b/src/addons/mod/chat/components/users-modal/users-modal.html index df6fcd304..dd98dc8f9 100644 --- a/src/addons/mod/chat/components/users-modal/users-modal.html +++ b/src/addons/mod/chat/components/users-modal/users-modal.html @@ -5,7 +5,7 @@ - + @@ -14,16 +14,16 @@ - +

{{ user.fullname }}

- + - + diff --git a/src/addons/mod/chat/pages/chat/chat.html b/src/addons/mod/chat/pages/chat/chat.html index ba9f9bc44..fd15a114c 100644 --- a/src/addons/mod/chat/pages/chat/chat.html +++ b/src/addons/mod/chat/pages/chat/chat.html @@ -1,17 +1,16 @@ - +

- - +

- +
@@ -28,7 +27,7 @@
- + @@ -36,7 +35,7 @@ - + @@ -44,7 +43,7 @@ - + @@ -53,7 +52,7 @@ - + @@ -62,7 +61,7 @@ - + @@ -70,12 +69,11 @@ - + @@ -83,13 +81,11 @@ - + [courseId]="courseId" /> - - + @@ -99,8 +95,7 @@

- + (onSubmit)="sendMessage($event)" [placeholder]="'addon.messages.newmessage' | translate" /> {{ 'core.login.reconnect' | translate }} diff --git a/src/addons/mod/chat/pages/index/index.html b/src/addons/mod/chat/pages/index/index.html index 8516625cf..07c6b8fc0 100644 --- a/src/addons/mod/chat/pages/index/index.html +++ b/src/addons/mod/chat/pages/index/index.html @@ -1,23 +1,20 @@ - +

- - +

- - - +
- + - + diff --git a/src/addons/mod/chat/pages/session-messages/session-messages.html b/src/addons/mod/chat/pages/session-messages/session-messages.html index 484ec12c8..601bd68fc 100644 --- a/src/addons/mod/chat/pages/session-messages/session-messages.html +++ b/src/addons/mod/chat/pages/session-messages/session-messages.html @@ -1,7 +1,7 @@ - +

{{ 'addon.mod_chat.messages' | translate }}

@@ -10,7 +10,7 @@
- + @@ -23,7 +23,7 @@
- + @@ -31,7 +31,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -48,7 +48,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -65,19 +65,18 @@ - +
- + [time]="message.timestamp * 1000" contextLevel="module" [instanceId]="cmId" [courseId]="courseId" />
diff --git a/src/addons/mod/chat/pages/sessions/sessions.html b/src/addons/mod/chat/pages/sessions/sessions.html index c2e1b3371..8fc39d7c1 100644 --- a/src/addons/mod/chat/pages/sessions/sessions.html +++ b/src/addons/mod/chat/pages/sessions/sessions.html @@ -1,7 +1,7 @@ - +

{{ 'addon.mod_chat.chatreport' | translate }}

@@ -11,15 +11,14 @@ - + - - + {{ 'addon.mod_chat.showincompletesessions' | translate }} - + - - + diff --git a/src/addons/mod/choice/components/index/addon-mod-choice-index.html b/src/addons/mod/choice/components/index/addon-mod-choice-index.html index 08e56bc8a..a362558bb 100644 --- a/src/addons/mod/choice/components/index/addon-mod-choice-index.html +++ b/src/addons/mod/choice/components/index/addon-mod-choice-index.html @@ -1,7 +1,7 @@ - + @@ -9,13 +9,12 @@ - + [courseId]="courseId" [hasDataToSync]="hasOffline" (completionChanged)="onCompletionChange()" /> - +
- - +
@@ -153,8 +148,7 @@

- - + {{ 'addon.mod_choice.full' | translate }} diff --git a/src/addons/mod/choice/pages/index/index.html b/src/addons/mod/choice/pages/index/index.html index b1837e151..4f5850db2 100644 --- a/src/addons/mod/choice/pages/index/index.html +++ b/src/addons/mod/choice/pages/index/index.html @@ -1,23 +1,20 @@ - +

- - +

- - - + - + - + diff --git a/src/addons/mod/data/components/action/addon-mod-data-action.html b/src/addons/mod/data/components/action/addon-mod-data-action.html index 2fca169f6..26315c8b0 100644 --- a/src/addons/mod/data/components/action/addon-mod-data-action.html +++ b/src/addons/mod/data/components/action/addon-mod-data-action.html @@ -1,49 +1,48 @@ - + - + - + - + - + - + - + - + component="mod_data" [itemId]="entry.id" area="database_entry" [courseId]="database.course" /> {{ entry.timecreated * 1000 | coreFormatDate }} {{ entry.timemodified * 1000 | coreFormatDate }} + [profileUrl]="userPicture" /> {{entry.fullname}} - + diff --git a/src/addons/mod/data/components/actionsmenu/actionsmenu.html b/src/addons/mod/data/components/actionsmenu/actionsmenu.html index eadbe7c6a..70fe1df31 100644 --- a/src/addons/mod/data/components/actionsmenu/actionsmenu.html +++ b/src/addons/mod/data/components/actionsmenu/actionsmenu.html @@ -5,7 +5,7 @@

{{ item.text | translate }}

- +
diff --git a/src/addons/mod/data/components/field-plugin/addon-mod-data-field-plugin.html b/src/addons/mod/data/components/field-plugin/addon-mod-data-field-plugin.html index c738b7d01..6a9ff5ec9 100644 --- a/src/addons/mod/data/components/field-plugin/addon-mod-data-field-plugin.html +++ b/src/addons/mod/data/components/field-plugin/addon-mod-data-field-plugin.html @@ -1,4 +1,4 @@ - + diff --git a/src/addons/mod/data/components/index/addon-mod-data-index.html b/src/addons/mod/data/components/index/addon-mod-data-index.html index 841034633..269610acf 100644 --- a/src/addons/mod/data/components/index/addon-mod-data-index.html +++ b/src/addons/mod/data/components/index/addon-mod-data-index.html @@ -1,19 +1,17 @@ - + - + (action)="gotoAddEntries()" /> - + (action)="gotoEntry(firstEntry)" /> - + @@ -22,30 +20,28 @@ - + [courseId]="courseId" [hasDataToSync]="hasOffline || hasOfflineRatings" (completionChanged)="onCompletionChange()" /> - + [courseId]="database?.course" /> - + - + - + @@ -32,23 +31,21 @@ class="expandable-status-icon" (ariaButtonClick)="toggleExpand($event, section)" [attr.aria-label]="(section.expanded ? 'core.collapse' : 'core.expand') | translate" [attr.aria-expanded]="section.expanded" [attr.aria-controls]="'core-course-index-section-' + section.id" - [class.expandable-status-icon-expanded]="section.expanded"> - - + [class.expandable-status-icon-expanded]="section.expanded" /> + {{ siteUrl }} @@ -36,15 +35,14 @@

- - +

- +

{{ siteInfo.fullname }}

@@ -52,14 +50,14 @@ - + - + - +