Skip to content

Commit

Permalink
Merge pull request #3897 from moodlehq/ionic7
Browse files Browse the repository at this point in the history
MOBILE-3947: Upgrade to Ionic 7
  • Loading branch information
dpalou authored Jan 17, 2024
2 parents ba50fb8 + 57b9965 commit a9f6d2c
Show file tree
Hide file tree
Showing 685 changed files with 31,671 additions and 34,735 deletions.
75 changes: 44 additions & 31 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const appConfig = {
node: true,
},
plugins: [
'@angular-eslint',
'@typescript-eslint',
'header',
'jsdoc',
Expand All @@ -13,12 +14,13 @@ const appConfig = {
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:@angular-eslint/recommended',
'plugin:@angular-eslint/template/process-inline-templates',
'plugin:promise/recommended',
'plugin:jsdoc/recommended',
"plugin:deprecation/recommended",
'plugin:deprecation/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
Expand Down Expand Up @@ -46,6 +48,7 @@ const appConfig = {
Object: {
message: 'Use {} instead.',
},
Function: false,
},
},
],
Expand All @@ -61,16 +64,6 @@ const appConfig = {
allowArgumentsExplicitlyTypedAsAny: true,
},
],
'@typescript-eslint/indent': [
'error',
4,
{
SwitchCase: 1,
ignoredNodes: [
'ClassProperty *',
],
},
],
'@typescript-eslint/lines-between-class-members': [
'error',
'always',
Expand Down Expand Up @@ -103,6 +96,20 @@ const appConfig = {
],
'@typescript-eslint/naming-convention': [
'error',
{
selector: [
'classProperty',
'objectLiteralProperty',
'typeProperty',
'classMethod',
'objectLiteralMethod',
'typeMethod',
'accessor',
'enumMember'
],
modifiers: ['requiresQuotes'],
format: null,
},
{
selector: 'property',
format: ['camelCase'],
Expand Down Expand Up @@ -200,22 +207,28 @@ const appConfig = {
],
'id-match': 'error',
'jsdoc/check-alignment': 'error',
'jsdoc/newline-after-description': 'error',
'jsdoc/require-param-type': 'off',
'jsdoc/require-returns-type': 'off',
'jsdoc/require-param': 'off',
'jsdoc/check-values': 'off',
'jsdoc/check-tag-names': [
'jsdoc/check-param-names': [
'warn',
{
"definedTags": ["deprecatedonmoodle"]
checkDestructured: false,
enableFixer: true
},
],
'jsdoc/check-param-names': [
'jsdoc/check-tag-names': [
'warn',
{
checkDestructured: false,
enableFixer: true
'definedTags': ['deprecatedonmoodle']
},
],
'jsdoc/check-values': 'off',
'jsdoc/require-param-type': 'off',
'jsdoc/require-param': 'off',
'jsdoc/require-returns-type': 'off',
'jsdoc/tag-lines': [
'error',
'any',
{
startLines: 1,
},
],
'linebreak-style': [
Expand All @@ -240,7 +253,7 @@ const appConfig = {
'no-fallthrough': 'off',
'no-invalid-this': 'error',
'no-irregular-whitespace': 'error',
'no-multiple-empty-lines': ['error', { "max": 1 }],
'no-multiple-empty-lines': ['error', { max: 1 }],
'no-new-wrappers': 'error',
'no-sequences': 'error',
'no-trailing-spaces': 'error',
Expand Down Expand Up @@ -318,15 +331,15 @@ module.exports = {
files: ['*.html'],
extends: ['plugin:@angular-eslint/template/recommended'],
rules: {
'max-len': ['warn', { code: 140 }],
'@angular-eslint/template/accessibility-valid-aria': 'warn',
'@angular-eslint/template/accessibility-alt-text': 'error',
'@angular-eslint/template/accessibility-elements-content': 'error',
'@angular-eslint/template/accessibility-label-for': 'error',
'@angular-eslint/template/no-positive-tabindex': 'error',
'@angular-eslint/template/accessibility-table-scope': 'error',
'@angular-eslint/template/accessibility-valid-aria': 'error',
'@angular-eslint/template/alt-text': 'error',
'@angular-eslint/template/elements-content': 'error',
'@angular-eslint/template/label-has-associated-control': 'error',
'@angular-eslint/template/no-duplicate-attributes': 'error',
'@angular-eslint/template/no-positive-tabindex': 'error',
'@angular-eslint/template/prefer-self-closing-tags': 'error',
'@angular-eslint/template/table-scope': 'error',
'@angular-eslint/template/valid-aria': 'error',
'max-len': ['warn', { code: 140 }],
},
},
{
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ on:
moodle_branch:
description: 'Moodle branch'
required: true
default: 'master'
default: 'main'
moodle_repository:
description: 'Moodle repository'
required: true
default: 'https://github.com/moodle/moodle'
pull_request:
branches: [ main, v*.x ]
branches: [ main, ionic7, v*.x ]

jobs:
behat:
runs-on: ubuntu-latest
env:
MOODLE_DOCKER_DB: pgsql
MOODLE_DOCKER_BROWSER: chrome
MOODLE_DOCKER_PHP_VERSION: '8.0'
MOODLE_BRANCH: ${{ github.event.inputs.moodle_branch || 'master' }}
MOODLE_DOCKER_PHP_VERSION: '8.1'
MOODLE_BRANCH: ${{ github.event.inputs.moodle_branch || 'main' }}
MOODLE_REPOSITORY: ${{ github.event.inputs.moodle_repository || 'https://github.com/moodle/moodle' }}
BEHAT_TAGS: ${{ github.event.inputs.behat_tags || '~@performance' }}

Expand All @@ -37,7 +37,7 @@ jobs:
- name: Additional checkouts
run: |
git clone --branch $MOODLE_BRANCH --depth 1 $MOODLE_REPOSITORY $GITHUB_WORKSPACE/moodle
git clone --branch master --depth 1 https://github.com/moodlehq/moodle-docker $GITHUB_WORKSPACE/moodle-docker
git clone --branch main --depth 1 https://github.com/moodlehq/moodle-docker $GITHUB_WORKSPACE/moodle-docker
- name: Install npm packages
run: npm ci --no-audit
- name: Create Behat faildumps folder
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
node-version-file: '.nvmrc'
- name: Additional checkouts
run: |
git clone --branch master --depth 1 https://github.com/moodle/moodle $GITHUB_WORKSPACE/moodle
git clone --branch master --depth 1 https://github.com/moodlehq/moodle-docker $GITHUB_WORKSPACE/moodle-docker
git clone --branch main --depth 1 https://github.com/moodle/moodle $GITHUB_WORKSPACE/moodle
git clone --branch main --depth 1 https://github.com/moodlehq/moodle-docker $GITHUB_WORKSPACE/moodle-docker
- name: Install npm packages
run: npm ci --no-audit
- name: Generate Behat tests plugin
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install npm packages
Expand Down Expand Up @@ -59,4 +59,8 @@ jobs:
npm run build:prod
npm run prod --prefix cordova-plugin-moodleapp
- name: JavaScript code compatibility
run: result=$(npx check-es-compat www/*.js 2> /dev/null | grep -v -E "Array\.prototype\.includes|Promise\.prototype\.finally|String\.prototype\.(matchAll|trimRight)|globalThis" | grep -Po "(?<=error).*?(?=\s+ecmascript)" | wc -l); test $result -eq 1
# 6 BigInt usage errors are expected, they are fine without polyfill because they are only used if available.
# See https://github.com/videojs/mpd-parser/blob/v0.22.1/src/segment/urlType.js
run: |
result=$(npx check-es-compat www/*.js --polyfills="{Array,String,TypedArray}.prototype.at,Array.prototype.flatMap,Array.prototype.flat,Array.prototype.includes,globalThis,Object.fromEntries,Object.hasOwn,Promise.prototype.finally,String.prototype.matchAll,String.prototype.trimRight" | grep "6 problems (6 errors, 0 warnings)" | wc -l); test $result -eq 1
npx check-es-compat cordova-plugin-moodleapp/www/*.js
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Thumbs.db
/src/assets/lib
/src/assets/lang/*
/src/assets/env.json
/src/assets/fonts/icons.json

/moodle.config.*.json
!/moodle.config.example.json
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14.15.0
v18.18.2
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
},
"editor.formatOnSave": true,
"eslint.format.enable": true,
"html.format.endWithNewline": true,
"html.format.wrapLineLength": 140,
"files.eol": "\n",
"files.trimFinalNewlines": true,
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"typescript.tsdk": "./node_modules/typescript/lib",

/**
* Config files.
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## BUILD STAGE
FROM node:14 as build-stage
FROM node:18 as build-stage

WORKDIR /app

Expand Down
56 changes: 0 additions & 56 deletions MainActivity.java

This file was deleted.

Loading

0 comments on commit a9f6d2c

Please sign in to comment.