From fbf11ff61eb31b7725169c86238975372c55a41f Mon Sep 17 00:00:00 2001 From: Pascal Baljet Date: Fri, 4 Oct 2024 22:07:45 +0200 Subject: [PATCH] Fixed `usePage()` call --- .github/workflows/eslint.yml | 2 +- .github/workflows/tests.yml | 17 ++++++++++------- react/src/ModalRoot.jsx | 4 ++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 8dc5c38..c47627b 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -18,7 +18,7 @@ permissions: jobs: eslint: runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[only-tests]') && !contains(github.event.head_commit.message, '[only-dusk]')" + if: "!contains(github.event.head_commit.message, '[only-tests]') && !contains(github.event.head_commit.message, '[only-dusk]') && !contains(github.event.head_commit.message, '[ci-skip]') && !contains(github.event.head_commit.message, '[skip-ci]')" timeout-minutes: 5 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1baac3e..a4f0fd1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: true matrix: - stack: [vue] + stack: [react, vue] name: Tests @@ -72,15 +72,18 @@ jobs: - name: Build React library if: ${{ matrix.stack == 'react' }} run: | - cd react + cd vue + npm install + # we need eslint-plugin-vue for files like helpers.js + cd ../react npm install npm run build - - name: Test React library - if: ${{ matrix.stack == 'react' }} - run: | - cd react - npm run test + # - name: Test React library + # if: ${{ matrix.stack == 'react' }} + # run: | + # cd react + # npm run test - name: Build Vue library if: ${{ matrix.stack == 'vue' }} diff --git a/react/src/ModalRoot.jsx b/react/src/ModalRoot.jsx index 3f1d523..cb34a5c 100644 --- a/react/src/ModalRoot.jsx +++ b/react/src/ModalRoot.jsx @@ -1,7 +1,7 @@ import { useState } from 'react' import { default as Axios } from 'axios' import { except, only } from './helpers' -import { router, usePage } from '@inertiajs/react' +import { router } from '@inertiajs/react' import { mergeDataIntoQueryString } from '@inertiajs/core' import { createContext, useContext } from 'react' import ModalRenderer from './ModalRenderer' @@ -214,7 +214,7 @@ export const ModalStackProvider = ({ children }) => { Accept: 'text/html, application/xhtml+xml', 'X-Requested-With': 'XMLHttpRequest', 'X-Inertia': true, - // 'X-Inertia-Version': usePage().version, + 'X-Inertia-Version': router.page.version, 'X-InertiaUI-Modal': true, }, })