From 475924a620b61a6696a7278b162538e3a80d29f9 Mon Sep 17 00:00:00 2001 From: jacalvar Date: Wed, 10 Jul 2024 19:35:34 +0200 Subject: [PATCH 01/17] Update jquery validate periodically --- .github/workflows/update-jquery-validate.yml | 45 ++++++++++++++++++++ src/Mvc/build/copy-files.mjs | 37 ++++++++++++++++ src/Mvc/build/package.json | 11 +++++ 3 files changed, 93 insertions(+) create mode 100644 .github/workflows/update-jquery-validate.yml create mode 100644 src/Mvc/build/copy-files.mjs create mode 100644 src/Mvc/build/package.json diff --git a/.github/workflows/update-jquery-validate.yml b/.github/workflows/update-jquery-validate.yml new file mode 100644 index 000000000000..5894b9a57a03 --- /dev/null +++ b/.github/workflows/update-jquery-validate.yml @@ -0,0 +1,45 @@ +name: Update jquery.validate + +on: + schedule: + - cron: '0 0 1 * *' # Run on the first day of the month + workflow_dispatch: # Allow manual runs + +jobs: + update: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: Set RepoRoot + run: echo "RepoRoot=$(pwd)" >> $GITHUB_ENV + + - name: Update dependencies + working-directory: ${{ env.RepoRoot }}/src/Mvc/build + run: | + npm install --no-lockfile + npm run build + echo "JQUERY_VALIDATE_VERSION=$(npm ls jquery-validation --json | jq -r '.dependencies["jquery-validation"].version')" >> $GITHUB_ENV + + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Update jquery.validate to ${{ env.JQUERY_VALIDATE_VERSION }} + title: Update jquery.validate to ${{ env.JQUERY_VALIDATE_VERSION }} + body: | + Update jquery.validate to the latest version. + # The branch name is based on the date in the format YYYY-MM-DD + branch: update-jquery-validate-$(date +'%Y-%m-%d') + base: main + paths: | + **/jquery.validate.js + **/jquery.validate.min.js diff --git a/src/Mvc/build/copy-files.mjs b/src/Mvc/build/copy-files.mjs new file mode 100644 index 000000000000..31e77c862ea6 --- /dev/null +++ b/src/Mvc/build/copy-files.mjs @@ -0,0 +1,37 @@ +import * as fs from 'fs'; +import * as path from 'path'; + +const repoRoot = process.env.RepoRoot; +if (!repoRoot) { + throw new Error('RepoRoot environment variable is not set') +} + +// Search all the folders in the src directory for the files "jquery.validate.js" and "jquery.validate.min.js" but skip this +// folder as well as the "node_modules" folder, the "bin" folder, and the "obj" folder. Recurse over subfolders. + +const srcDir = path.join(repoRoot, 'src'); +const files = []; +const search = (dir) => { + const entries = fs.readdirSync(dir, { withFileTypes: true }); + for (const entry of entries) { + if (entry.isDirectory() && entry.name !== 'node_modules' && entry.name !== 'bin' && entry.name !== 'obj') { + search(path.join(dir, entry.name)); + } else if (entry.isFile() && (entry.name === 'jquery.validate.js' || entry.name === 'jquery.validate.min.js')) { + files.push(path.join(dir, entry.name)); + } + } +} + +search(srcDir); + +// Replace the files found with the versions from <>/node_modules/jquery-validation/dist. +// Note that <>/node_modules/jquery-validation/dist/jquery.validate.js needs to override the +// jquery.validate.js file found in the files array and the same for jquery.validate.min.js. +const nodeModulesDir = path.join(import.meta.dirname, 'node_modules', 'jquery-validation', 'dist'); + +for (const file of files) { + const source = path.join(nodeModulesDir, path.basename(file)); + const target = file; + fs.copyFileSync(source, target); + console.log(`Copied ${path.basename(file)} to ${target}`); +} diff --git a/src/Mvc/build/package.json b/src/Mvc/build/package.json new file mode 100644 index 000000000000..bf080793c75e --- /dev/null +++ b/src/Mvc/build/package.json @@ -0,0 +1,11 @@ +{ + "name": "jquery-validation-dependency", + "version": "1.0.0", + "private": true, + "scripts": { + "build": "node copy-files.mjs" + }, + "devDependencies": { + "jquery-validation": "^1.20.1" + } +} From b3746549b7499335b6ac769b4249814f556b8ae3 Mon Sep 17 00:00:00 2001 From: jacalvar Date: Wed, 10 Jul 2024 19:45:12 +0200 Subject: [PATCH 02/17] Update create pr action --- .github/workflows/update-jquery-validate.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/update-jquery-validate.yml b/.github/workflows/update-jquery-validate.yml index 5894b9a57a03..71288fb9068e 100644 --- a/.github/workflows/update-jquery-validate.yml +++ b/.github/workflows/update-jquery-validate.yml @@ -29,8 +29,7 @@ jobs: echo "JQUERY_VALIDATE_VERSION=$(npm ls jquery-validation --json | jq -r '.dependencies["jquery-validation"].version')" >> $GITHUB_ENV - name: Create Pull Request - id: cpr - uses: peter-evans/create-pull-request@v6 + uses: dotnet/actions-create-pull-request@v4 with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: Update jquery.validate to ${{ env.JQUERY_VALIDATE_VERSION }} From e244aa73647040bcf998c709f01449f04096fcce Mon Sep 17 00:00:00 2001 From: jacalvar Date: Wed, 10 Jul 2024 19:46:40 +0200 Subject: [PATCH 03/17] Update trigger so that it can be tested --- .github/workflows/update-jquery-validate.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-jquery-validate.yml b/.github/workflows/update-jquery-validate.yml index 71288fb9068e..a356d1525d12 100644 --- a/.github/workflows/update-jquery-validate.yml +++ b/.github/workflows/update-jquery-validate.yml @@ -1,9 +1,11 @@ -name: Update jquery.validate +name: Update jquery-validation on: schedule: - cron: '0 0 1 * *' # Run on the first day of the month workflow_dispatch: # Allow manual runs + pull_request: + branches: [main] jobs: update: From 59c278d58c2b1028c73dc7bbf469093ec1c1337d Mon Sep 17 00:00:00 2001 From: jacalvar Date: Wed, 10 Jul 2024 19:50:08 +0200 Subject: [PATCH 04/17] Fix branch name --- .github/workflows/update-jquery-validate.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update-jquery-validate.yml b/.github/workflows/update-jquery-validate.yml index a356d1525d12..3b06e2a146bb 100644 --- a/.github/workflows/update-jquery-validate.yml +++ b/.github/workflows/update-jquery-validate.yml @@ -4,11 +4,9 @@ on: schedule: - cron: '0 0 1 * *' # Run on the first day of the month workflow_dispatch: # Allow manual runs - pull_request: - branches: [main] jobs: - update: + update-jquery-validate: runs-on: ubuntu-latest steps: @@ -39,7 +37,7 @@ jobs: body: | Update jquery.validate to the latest version. # The branch name is based on the date in the format YYYY-MM-DD - branch: update-jquery-validate-$(date +'%Y-%m-%d') + branch: update-jquery-validate-to-${{ env.JQUERY_VALIDATE_VERSION }} base: main paths: | **/jquery.validate.js From 1373d71d306848030e52038f0c0a6b79de13b687 Mon Sep 17 00:00:00 2001 From: jacalvar Date: Wed, 10 Jul 2024 19:51:55 +0200 Subject: [PATCH 05/17] update trigger so that it can be tested --- .github/workflows/update-jquery-validate.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/update-jquery-validate.yml b/.github/workflows/update-jquery-validate.yml index 3b06e2a146bb..091e35278c14 100644 --- a/.github/workflows/update-jquery-validate.yml +++ b/.github/workflows/update-jquery-validate.yml @@ -4,6 +4,9 @@ on: schedule: - cron: '0 0 1 * *' # Run on the first day of the month workflow_dispatch: # Allow manual runs + pull_request: + branches: + - main jobs: update-jquery-validate: From 46ccc35688c2adb79e45591737ff707335c96940 Mon Sep 17 00:00:00 2001 From: jacalvar Date: Wed, 10 Jul 2024 19:58:45 +0200 Subject: [PATCH 06/17] Set permissions --- .github/workflows/update-jquery-validate.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/update-jquery-validate.yml b/.github/workflows/update-jquery-validate.yml index 091e35278c14..a23082ff55ef 100644 --- a/.github/workflows/update-jquery-validate.yml +++ b/.github/workflows/update-jquery-validate.yml @@ -8,6 +8,11 @@ on: branches: - main +permissions: + contents: write + issues: write + pull-requests: write + jobs: update-jquery-validate: runs-on: ubuntu-latest From b9d70247038c06e6dee6138fe216a4e140dbd4fb Mon Sep 17 00:00:00 2001 From: jacalvar Date: Wed, 10 Jul 2024 20:03:05 +0200 Subject: [PATCH 07/17] Remove the pull request trigger --- .github/workflows/update-jquery-validate.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/update-jquery-validate.yml b/.github/workflows/update-jquery-validate.yml index a23082ff55ef..1a92b27dd5fa 100644 --- a/.github/workflows/update-jquery-validate.yml +++ b/.github/workflows/update-jquery-validate.yml @@ -4,9 +4,6 @@ on: schedule: - cron: '0 0 1 * *' # Run on the first day of the month workflow_dispatch: # Allow manual runs - pull_request: - branches: - - main permissions: contents: write From 37c04904da45aceb10717d63c8c52c176aa5a1d7 Mon Sep 17 00:00:00 2001 From: Javier Calvarro Nelson Date: Wed, 10 Jul 2024 20:33:26 +0200 Subject: [PATCH 08/17] Update .github/workflows/update-jquery-validate.yml --- .github/workflows/update-jquery-validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-jquery-validate.yml b/.github/workflows/update-jquery-validate.yml index 1a92b27dd5fa..543c39796569 100644 --- a/.github/workflows/update-jquery-validate.yml +++ b/.github/workflows/update-jquery-validate.yml @@ -38,7 +38,7 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: Update jquery.validate to ${{ env.JQUERY_VALIDATE_VERSION }} - title: Update jquery.validate to ${{ env.JQUERY_VALIDATE_VERSION }} + title: [Templates][Identity] Update jquery-validation to ${{ env.JQUERY_VALIDATE_VERSION }} body: | Update jquery.validate to the latest version. # The branch name is based on the date in the format YYYY-MM-DD From 5f6250f5d6b2e7397e8217d65945f83f0a2de28e Mon Sep 17 00:00:00 2001 From: Javier Calvarro Nelson Date: Wed, 10 Jul 2024 20:35:06 +0200 Subject: [PATCH 09/17] Update .github/workflows/update-jquery-validate.yml --- .github/workflows/update-jquery-validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-jquery-validate.yml b/.github/workflows/update-jquery-validate.yml index 543c39796569..81be7467572d 100644 --- a/.github/workflows/update-jquery-validate.yml +++ b/.github/workflows/update-jquery-validate.yml @@ -40,7 +40,7 @@ jobs: commit-message: Update jquery.validate to ${{ env.JQUERY_VALIDATE_VERSION }} title: [Templates][Identity] Update jquery-validation to ${{ env.JQUERY_VALIDATE_VERSION }} body: | - Update jquery.validate to the latest version. + Updates the jquery-validation scripts to ${{ env.JQUERY_VALIDATE_VERSION }} # The branch name is based on the date in the format YYYY-MM-DD branch: update-jquery-validate-to-${{ env.JQUERY_VALIDATE_VERSION }} base: main From 5a5e9c5636c520fc2398da781e23823a7a03c547 Mon Sep 17 00:00:00 2001 From: Javier Calvarro Nelson Date: Wed, 10 Jul 2024 20:38:43 +0200 Subject: [PATCH 10/17] Apply suggestions from code review Cleanups --- .github/workflows/update-jquery-validate.yml | 1 - src/Mvc/build/copy-files.mjs | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/update-jquery-validate.yml b/.github/workflows/update-jquery-validate.yml index 81be7467572d..610ead795c2c 100644 --- a/.github/workflows/update-jquery-validate.yml +++ b/.github/workflows/update-jquery-validate.yml @@ -41,7 +41,6 @@ jobs: title: [Templates][Identity] Update jquery-validation to ${{ env.JQUERY_VALIDATE_VERSION }} body: | Updates the jquery-validation scripts to ${{ env.JQUERY_VALIDATE_VERSION }} - # The branch name is based on the date in the format YYYY-MM-DD branch: update-jquery-validate-to-${{ env.JQUERY_VALIDATE_VERSION }} base: main paths: | diff --git a/src/Mvc/build/copy-files.mjs b/src/Mvc/build/copy-files.mjs index 31e77c862ea6..51c14a880204 100644 --- a/src/Mvc/build/copy-files.mjs +++ b/src/Mvc/build/copy-files.mjs @@ -6,8 +6,7 @@ if (!repoRoot) { throw new Error('RepoRoot environment variable is not set') } -// Search all the folders in the src directory for the files "jquery.validate.js" and "jquery.validate.min.js" but skip this -// folder as well as the "node_modules" folder, the "bin" folder, and the "obj" folder. Recurse over subfolders. +// Search recursively over all the folders in the src directory for the files "jquery.validate.js" and "jquery.validate.min.js" except for node_modules, bin, and obj const srcDir = path.join(repoRoot, 'src'); const files = []; @@ -24,9 +23,7 @@ const search = (dir) => { search(srcDir); -// Replace the files found with the versions from <>/node_modules/jquery-validation/dist. -// Note that <>/node_modules/jquery-validation/dist/jquery.validate.js needs to override the -// jquery.validate.js file found in the files array and the same for jquery.validate.min.js. +// Replace each found file with the file of the same name that we downloaded during install and that is located in node_modules/jquery-validation/dist/ const nodeModulesDir = path.join(import.meta.dirname, 'node_modules', 'jquery-validation', 'dist'); for (const file of files) { From 64ab638189538230458909ab2803cdc6458de044 Mon Sep 17 00:00:00 2001 From: jacalvar Date: Wed, 10 Jul 2024 21:11:12 +0200 Subject: [PATCH 11/17] Fix syntax error --- .github/workflows/update-jquery-validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-jquery-validate.yml b/.github/workflows/update-jquery-validate.yml index 610ead795c2c..e5d7855a21ab 100644 --- a/.github/workflows/update-jquery-validate.yml +++ b/.github/workflows/update-jquery-validate.yml @@ -38,7 +38,7 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: Update jquery.validate to ${{ env.JQUERY_VALIDATE_VERSION }} - title: [Templates][Identity] Update jquery-validation to ${{ env.JQUERY_VALIDATE_VERSION }} + title: '[Templates][Identity] Update jquery-validation to ${{ env.JQUERY_VALIDATE_VERSION }}' body: | Updates the jquery-validation scripts to ${{ env.JQUERY_VALIDATE_VERSION }} branch: update-jquery-validate-to-${{ env.JQUERY_VALIDATE_VERSION }} From 018be628814f8c30272ee18ea23452d7f7bfc5b8 Mon Sep 17 00:00:00 2001 From: jacalvar Date: Thu, 11 Jul 2024 16:59:54 +0200 Subject: [PATCH 12/17] Update Identity UI script tags --- .github/workflows/update-jquery-validate.yml | 1 + src/Identity/UI/jquery-validate-versions.json | 4 ++ src/Identity/UI/update-jquery-validate.mjs | 60 +++++++++++++++++++ src/Mvc/build/package.json | 3 +- .../build/update-identity-ui-integrity.mjs | 32 ++++++++++ 5 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 src/Identity/UI/jquery-validate-versions.json create mode 100644 src/Identity/UI/update-jquery-validate.mjs create mode 100644 src/Mvc/build/update-identity-ui-integrity.mjs diff --git a/.github/workflows/update-jquery-validate.yml b/.github/workflows/update-jquery-validate.yml index e5d7855a21ab..eab18c69f337 100644 --- a/.github/workflows/update-jquery-validate.yml +++ b/.github/workflows/update-jquery-validate.yml @@ -31,6 +31,7 @@ jobs: run: | npm install --no-lockfile npm run build + npm run update-identity-ui-scripts echo "JQUERY_VALIDATE_VERSION=$(npm ls jquery-validation --json | jq -r '.dependencies["jquery-validation"].version')" >> $GITHUB_ENV - name: Create Pull Request diff --git a/src/Identity/UI/jquery-validate-versions.json b/src/Identity/UI/jquery-validate-versions.json new file mode 100644 index 000000000000..43a2172641ef --- /dev/null +++ b/src/Identity/UI/jquery-validate-versions.json @@ -0,0 +1,4 @@ +{ + "currentVersion": "1.19.5", + "integrity": "sha256-JwUksNJ6/R07ZiLRoXbGeNrtlFZMFDKX4hemPiHOmCA=" +} diff --git a/src/Identity/UI/update-jquery-validate.mjs b/src/Identity/UI/update-jquery-validate.mjs new file mode 100644 index 000000000000..978a0fac6821 --- /dev/null +++ b/src/Identity/UI/update-jquery-validate.mjs @@ -0,0 +1,60 @@ + +// Iterate over all the .razor files in Pages and replace +// https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/<>/jquery.validate.min.js +// with the new version. +// Also replace the integrity attribute with the new integrity attribute. +// The current integrity attribute and the current version can be read from a json file on this script folder +// called jquery-validate-versions.json that has the following structure: +// { +// "currentVersion": "1.19.5", +// "integrity": "sha256-JwUksNJ6/R07ZiLRoXbGeNrtlFZMFDKX4hemPiHOmCA=", +// "newVersion": "1.20.1", +// "newIntegrity": "sha256-7Z6+1q1Z2+7e5Z2e5Z2+7e5Z2+7e5Z2+7e5Z2+7e5Z2=" +// } +// After we've updated the files, we'll update the json file with the new version and integrity. + +// Read the JSON file +import fs from 'fs'; + +const jqueryValidateVersions = JSON.parse(fs.readFileSync('./jquery-validate-versions.json', 'utf8')); + +// Get the current version and integrity +const currentVersion = jqueryValidateVersions.currentVersion; +const integrity = jqueryValidateVersions.integrity; + +// Get the new version and integrity +const newVersion = jqueryValidateVersions.newVersion; +const newIntegrity = jqueryValidateVersions.newIntegrity; + +// Iterate recursively over all the .razor files in the Pages folder +const replaceIntegrity = (dir) => { + const files = fs.readdirSync(dir); + files.forEach((file) => { + const filePath = `${dir}/${file}`; + const stat = fs.statSync(filePath); + if (stat.isDirectory()) { + replaceIntegrity(filePath); + } else { + if (filePath.endsWith('.cshtml')) { + // Read the file + let content = fs.readFileSync(filePath, 'utf8'); + // Replace the old version with the new version + content = content.replace(`https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/${currentVersion}/jquery.validate.min.js`, `https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/${newVersion}/jquery.validate.min.js`); + // Replace the old integrity with the new integrity + content = content.replace(`integrity="${integrity}"`, `integrity="${newIntegrity}"`); + // Write the file + fs.writeFileSync(filePath, content); + } + } + }); +} + +replaceIntegrity('./src/Areas/Identity'); + +// Update the JSON file with the new version and integrity +jqueryValidateVersions.currentVersion = newVersion; +jqueryValidateVersions.integrity = newIntegrity; +delete jqueryValidateVersions.newVersion; +delete jqueryValidateVersions.newIntegrity; + +fs.writeFileSync('./jquery-validate-versions.json', JSON.stringify(jqueryValidateVersions, null, 2)); diff --git a/src/Mvc/build/package.json b/src/Mvc/build/package.json index bf080793c75e..05bdaf359697 100644 --- a/src/Mvc/build/package.json +++ b/src/Mvc/build/package.json @@ -3,7 +3,8 @@ "version": "1.0.0", "private": true, "scripts": { - "build": "node copy-files.mjs" + "build": "node copy-files.mjs", + "update-identity-ui-scripts": "node update-identity-ui-integrity.mjs" }, "devDependencies": { "jquery-validation": "^1.20.1" diff --git a/src/Mvc/build/update-identity-ui-integrity.mjs b/src/Mvc/build/update-identity-ui-integrity.mjs new file mode 100644 index 000000000000..225de20bef1a --- /dev/null +++ b/src/Mvc/build/update-identity-ui-integrity.mjs @@ -0,0 +1,32 @@ +// Get jquery.validate.min.js from node_modules/jquery-validation/dist/ and compute its sha256 integrity attribute +// Get the version from node_modules/jquery-validation/package.json +// Update <>/src/Identity/UI/jquery-validate-versions.json with the version and integrity attribute +// by adding the newVersion and newIntegrity properties to the top level object. + +import crypto from 'crypto'; +import * as fs from 'fs'; +import * as path from 'path'; + +const repoRoot = process.env.RepoRoot; +if (!repoRoot) { + throw new Error('RepoRoot environment variable is not set') +} + +// Get the version from node_modules/jquery-validation/package.json +const packageJson = JSON.parse(fs.readFileSync(path.join(import.meta.dirname, 'node_modules', 'jquery-validation', 'package.json'))); +const newVersion = packageJson.version; + +// Get jquery.validate.min.js from node_modules/jquery-validation/dist/ and compute its sha256 integrity attribute +const nodeModulesDir = path.join(import.meta.dirname, 'node_modules', 'jquery-validation', 'dist'); +const source = path.join(nodeModulesDir, 'jquery.validate.min.js'); +// Compute Base64(SHA256(jquery.validate.min.js bytes)) +const sha256Hash = crypto.createHash('sha256').update(fs.readFileSync(source)).digest('base64'); +console.log(`Computed integrity hash for jquery.validate.min.js: sha256-${sha256Hash}`); + +// Update <>/src/Identity/UI/jquery-validate-versions.json with the version and integrity attribute +const jqueryValidateVersionsFile = path.join(repoRoot, 'src', 'Identity', 'UI', 'jquery-validate-versions.json'); +const jqueryValidateVersions = JSON.parse(fs.readFileSync(jqueryValidateVersionsFile)); +jqueryValidateVersions.newVersion = newVersion; +jqueryValidateVersions.newIntegrity = `sha256-${sha256Hash}`; +fs.writeFileSync(jqueryValidateVersionsFile, JSON.stringify(jqueryValidateVersions, null, 2)); +console.log(`Updated ${jqueryValidateVersionsFile} with new version and integrity hash`); From 065c4217b2f0e0b8f32123b083f9b178ca05cd36 Mon Sep 17 00:00:00 2001 From: jacalvar Date: Thu, 11 Jul 2024 17:06:49 +0200 Subject: [PATCH 13/17] Fix paths --- .github/workflows/update-jquery-validate.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/update-jquery-validate.yml b/.github/workflows/update-jquery-validate.yml index eab18c69f337..567efc3f18f9 100644 --- a/.github/workflows/update-jquery-validate.yml +++ b/.github/workflows/update-jquery-validate.yml @@ -47,3 +47,5 @@ jobs: paths: | **/jquery.validate.js **/jquery.validate.min.js + **/*.cshtml + src/Identity/UI/jquery-validate-versions.json From afaa867b72b017245d3bd0df20181f12f7001b1e Mon Sep 17 00:00:00 2001 From: jacalvar Date: Thu, 11 Jul 2024 17:09:56 +0200 Subject: [PATCH 14/17] Fix workflow --- .github/workflows/update-jquery-validate.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/update-jquery-validate.yml b/.github/workflows/update-jquery-validate.yml index 567efc3f18f9..126b74fe25ec 100644 --- a/.github/workflows/update-jquery-validate.yml +++ b/.github/workflows/update-jquery-validate.yml @@ -34,6 +34,10 @@ jobs: npm run update-identity-ui-scripts echo "JQUERY_VALIDATE_VERSION=$(npm ls jquery-validation --json | jq -r '.dependencies["jquery-validation"].version')" >> $GITHUB_ENV + - name: Update script tags + working-directory: ${{ env.RepoRoot }}/src/Identity/UI + run: node update-jquery-validate.mjs + - name: Create Pull Request uses: dotnet/actions-create-pull-request@v4 with: From b63b37ca4f3df1873de9a84eea3debd7ffd9da9f Mon Sep 17 00:00:00 2001 From: jacalvar Date: Thu, 11 Jul 2024 17:13:48 +0200 Subject: [PATCH 15/17] Remove base --- .github/workflows/update-jquery-validate.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/update-jquery-validate.yml b/.github/workflows/update-jquery-validate.yml index 126b74fe25ec..839a28f24f5a 100644 --- a/.github/workflows/update-jquery-validate.yml +++ b/.github/workflows/update-jquery-validate.yml @@ -47,7 +47,6 @@ jobs: body: | Updates the jquery-validation scripts to ${{ env.JQUERY_VALIDATE_VERSION }} branch: update-jquery-validate-to-${{ env.JQUERY_VALIDATE_VERSION }} - base: main paths: | **/jquery.validate.js **/jquery.validate.min.js From b2aac34741a50e57cdc54901c28530cbc898fdf7 Mon Sep 17 00:00:00 2001 From: Javier Calvarro Nelson Date: Mon, 15 Jul 2024 16:04:04 +0200 Subject: [PATCH 16/17] Pin jquery to 1.20.0 as 1.20.1 is not on cdnjs --- src/Mvc/build/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mvc/build/package.json b/src/Mvc/build/package.json index 05bdaf359697..9676c2415364 100644 --- a/src/Mvc/build/package.json +++ b/src/Mvc/build/package.json @@ -7,6 +7,6 @@ "update-identity-ui-scripts": "node update-identity-ui-integrity.mjs" }, "devDependencies": { - "jquery-validation": "^1.20.1" + "jquery-validation": "1.20.0" } } From e4c0252ff6ceb96612c1f584988b0b86b99565dc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 09:05:42 -0700 Subject: [PATCH 17/17] Update jquery.validate to 1.20.0 (#56803) Co-authored-by: javiercn --- src/Identity/UI/jquery-validate-versions.json | 6 +- .../Pages/V4/_ValidationScriptsPartial.cshtml | 4 +- .../Pages/V5/_ValidationScriptsPartial.cshtml | 4 +- .../jquery-validation/dist/jquery.validate.js | 65 +++++++++++++++---- .../dist/jquery.validate.min.js | 6 +- .../jquery-validation/dist/jquery.validate.js | 65 +++++++++++++++---- .../dist/jquery.validate.min.js | 6 +- .../jquery-validation/dist/jquery.validate.js | 65 +++++++++++++++---- .../dist/jquery.validate.min.js | 6 +- src/Mvc/build/package-lock.json | 31 +++++++++ .../jquery-validation/dist/jquery.validate.js | 65 +++++++++++++++---- .../dist/jquery.validate.min.js | 6 +- .../jquery-validation/dist/jquery.validate.js | 65 +++++++++++++++---- .../dist/jquery.validate.min.js | 6 +- .../jquery-validation/dist/jquery.validate.js | 65 +++++++++++++++---- .../dist/jquery.validate.min.js | 6 +- .../jquery-validation/dist/jquery.validate.js | 65 +++++++++++++++---- .../dist/jquery.validate.min.js | 6 +- .../jquery-validation/dist/jquery.validate.js | 65 +++++++++++++++---- .../dist/jquery.validate.min.js | 6 +- .../jquery-validation/dist/jquery.validate.js | 65 +++++++++++++++---- .../jquery-validation/dist/jquery.validate.js | 65 +++++++++++++++---- .../jquery-validation/dist/jquery.validate.js | 65 +++++++++++++++---- .../dist/jquery.validate.min.js | 6 +- .../jquery-validation/dist/jquery.validate.js | 65 +++++++++++++++---- .../dist/jquery.validate.min.js | 6 +- 26 files changed, 692 insertions(+), 193 deletions(-) create mode 100644 src/Mvc/build/package-lock.json diff --git a/src/Identity/UI/jquery-validate-versions.json b/src/Identity/UI/jquery-validate-versions.json index 43a2172641ef..93e60afcb759 100644 --- a/src/Identity/UI/jquery-validate-versions.json +++ b/src/Identity/UI/jquery-validate-versions.json @@ -1,4 +1,4 @@ { - "currentVersion": "1.19.5", - "integrity": "sha256-JwUksNJ6/R07ZiLRoXbGeNrtlFZMFDKX4hemPiHOmCA=" -} + "currentVersion": "1.20.0", + "integrity": "sha256-ic6hxNWCB3IBDsXq0z5KpKHmcJc1anmnh0xGOi0C5Dw=" +} \ No newline at end of file diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V4/_ValidationScriptsPartial.cshtml b/src/Identity/UI/src/Areas/Identity/Pages/V4/_ValidationScriptsPartial.cshtml index b242171a9adb..b11e2f5af1f2 100644 --- a/src/Identity/UI/src/Areas/Identity/Pages/V4/_ValidationScriptsPartial.cshtml +++ b/src/Identity/UI/src/Areas/Identity/Pages/V4/_ValidationScriptsPartial.cshtml @@ -3,11 +3,11 @@ - -