From 20457bd89e1284786f91b9f08dc6d21ee4ad86fc Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 23 Aug 2023 15:53:34 -0700 Subject: [PATCH 01/18] Run tests for PHP 7.4, 8.0, and 8.1.1 --- .github/workflows/tests.yml | 73 +++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000000..a3ab759441 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,73 @@ +name: Tests + +on: + push: + branches: + - master + - develop + pull_request: + +jobs: + tests: + runs-on: ubuntu-latest + + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: snipeit + ports: + - 33306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + strategy: + fail-fast: false + matrix: + php-version: + - "7.4" + - "8.0" + - "8.1.1" + + name: PHP ${{ matrix.php-version }} + + steps: + - uses: shivammathur/setup-php@v2 + with: + php-version: "${{ matrix.php-version }}" + coverage: none + + - uses: actions/checkout@v3 + + - name: Get Composer Cache Directory + id: composer-cache + run: | + echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + - uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Copy .env + run: | + cp -v .env.testing.example .env + cp -v .env.testing.example .env.testing + + - name: Install Dependencies + run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + + - name: Generate key + run: php artisan key:generate + + - name: Directory Permissions + run: chmod -R 777 storage bootstrap/cache + + - name: Execute tests (Unit and Feature tests) via PHPUnit + env: + DB_CONNECTION: mysql + DB_DATABASE: snipeit + DB_PORT: ${{ job.services.mysql.ports[3306] }} + DB_USERNAME: root + run: php artisan test --parallel From 950536f59fb9f093a6b48b5d1f9f0db6894c1463 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Thu, 24 Aug 2023 15:18:51 -0600 Subject: [PATCH 02/18] Added a condition to send correct model id when cloning one --- resources/views/models/edit.blade.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/views/models/edit.blade.php b/resources/views/models/edit.blade.php index 74d3c1b83c..73220ae6ba 100755 --- a/resources/views/models/edit.blade.php +++ b/resources/views/models/edit.blade.php @@ -33,6 +33,11 @@ +@php + if (is_null($item->id)){ + $item->id = $item->getOriginal('id'); + } +@endphp @livewire('custom-field-set-default-values-for-model',["model_id" => $item->id]) From a12a68e4e9a40c1753f822b823cf912a7aa06665 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Thu, 24 Aug 2023 15:28:12 -0600 Subject: [PATCH 03/18] Add a variable so I dont ended rewriting the original model --- resources/views/models/edit.blade.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/resources/views/models/edit.blade.php b/resources/views/models/edit.blade.php index 73220ae6ba..8d33f94b15 100755 --- a/resources/views/models/edit.blade.php +++ b/resources/views/models/edit.blade.php @@ -34,12 +34,13 @@ @php - if (is_null($item->id)){ - $item->id = $item->getOriginal('id'); + $model_id = $item->id; + if (is_null($model_id)){ + $model_id = $item->getOriginal('id'); } @endphp -@livewire('custom-field-set-default-values-for-model',["model_id" => $item->id]) +@livewire('custom-field-set-default-values-for-model',["model_id" => $model_id]) @include ('partials.forms.edit.notes') @include ('partials.forms.edit.requestable', ['requestable_text' => trans('admin/models/general.requestable')]) From 582cad2dc5753b526b7eae533ea1b54493906739 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 28 Aug 2023 12:37:42 +0100 Subject: [PATCH 04/18] =?UTF-8?q?Fixed=20#13521=20-=20make=20modal=20?= =?UTF-8?q?=E2=80=9Cselect=20files=E2=80=9D=20button=20wider?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: snipe --- resources/views/modals/upload-file.blade.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/views/modals/upload-file.blade.php b/resources/views/modals/upload-file.blade.php index 09c53751ce..c5816bf175 100644 --- a/resources/views/modals/upload-file.blade.php +++ b/resources/views/modals/upload-file.blade.php @@ -15,15 +15,15 @@