Skip to content

Commit a71cc8d

Browse files
Merge pull request #2037 from nextcloud/refactor/rework-recipe-list-filter
Refactor/rework recipe list filter
2 parents 34176fe + 3d73d73 commit a71cc8d

32 files changed

+2737
-210
lines changed

.eslintrc.yml

+3
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,7 @@ overrides:
5353
- files: [ "src/composables/**/*.js" ]
5454
rules:
5555
import/prefer-default-export: off
56+
- files: [ "src/tests/**/*.test.js"]
57+
env:
58+
jest: true
5659

.github/workflows/tests.yml

+31
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,36 @@ jobs:
435435
- name: Check the code base
436436
run: docker run --rm -v $(pwd):/work:ro php-lint-tester
437437

438+
439+
run-jest:
440+
name: "Run JS tests"
441+
runs-on: ubuntu-22.04
442+
defaults:
443+
run:
444+
shell: bash
445+
446+
steps:
447+
- name: Checkout of the app
448+
uses: actions/checkout@v4
449+
- name: Get the date
450+
id: date
451+
run: echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
452+
- name: Cache NPM cache
453+
uses: actions/[email protected]
454+
with:
455+
path: |
456+
~/.npm
457+
node_modules
458+
key: ${{ runner.os }}-node-${{ steps.date.outputs.date }}-${{ hashFiles('package-lock.json') }}
459+
restore-keys: |
460+
${{ runner.os }}-node-${{ steps.date.outputs.date }}-
461+
${{ runner.os }}-node-
462+
- name: Install the NPM dependencies
463+
run: npm ci
464+
- name: Run the tests
465+
run: npm run ci-test
466+
467+
438468
successful_run:
439469
name: The tests have successfully run
440470
runs-on: ubuntu-22.04
@@ -444,6 +474,7 @@ jobs:
444474
- source-package
445475
- lint-php
446476
- event_file
477+
- run-jest
447478
steps:
448479
- name: Run successfully
449480
shell: bash

CHANGELOG.md

+16-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
11
## [Unreleased]
22

33
### Added
4-
- Toast with success/error message after trying to copy ingredients [#2040](https://github.com./nextcloud/cookbook/pull/2040) @seyfeb
5-
- Seconds can now be specified for recipe times [#2014](https://github.com./nextcloud/cookbook/pull/2014) @seyfeb
4+
- Toast with success/error message after trying to copy ingredients
5+
[#2040](https://github.com./nextcloud/cookbook/pull/2040) @seyfeb
6+
- Seconds can now be specified for recipe times
7+
[#2014](https://github.com./nextcloud/cookbook/pull/2014) @seyfeb
8+
- New filter UI in recipe lists
9+
[#2037](https://github.com./nextcloud/cookbook/pull/2037) @seyfeb
610

711
### Fixed
8-
- Prevent yield calculation for ## as ingredient headline [#1998](https://github.com./nextcloud/cookbook/pull/1998) @j0hannesr0th
9-
- Improved styling of times in recipe view [#2014](https://github.com./nextcloud/cookbook/pull/2014) @seyfeb
10-
- Add missing translatable string for recipe-creation button in empty list view [#2015](https://github.com./nextcloud/cookbook/pull/2015) @seyfeb
11-
- Prevent recalculation algorithm if no yield is given [#2003](https://github.com./nextcloud/cookbook/pull/2003) @j0hannesr0th
12+
- Prevent yield calculation for ## as ingredient headline
13+
[#1998](https://github.com./nextcloud/cookbook/pull/1998) @j0hannesr0th
14+
- Improved styling of times in recipe view
15+
[#2014](https://github.com./nextcloud/cookbook/pull/2014) @seyfeb
16+
- Add missing translatable string for recipe-creation button in empty list view
17+
[#2015](https://github.com./nextcloud/cookbook/pull/2015) @seyfeb
18+
- Prevent recalculation algorithm if no yield is given
19+
[#2003](https://github.com./nextcloud/cookbook/pull/2003) @j0hannesr0th
1220

1321
### Documentation
14-
- Improve structure of `README.md` [#1989](https://github.com./nextcloud/cookbook/pull/1989) @seyfeb
22+
- Improve structure of `README.md`
23+
[#1989](https://github.com./nextcloud/cookbook/pull/1989) @seyfeb
1524

1625
## 0.11.0 - 2023-12-14
1726

babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const babelConfig = require('@nextcloud/babel-config');
2+
3+
module.exports = babelConfig;

jest.config.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Jest configuration
2+
module.exports = {
3+
testEnvironment: 'node',
4+
moduleFileExtensions: ['js', 'vue'],
5+
modulePaths: [
6+
'<rootDir>/src/'
7+
],
8+
modulePathIgnorePatterns: [
9+
'<rootDir>/.github/'
10+
],
11+
transform: {
12+
'.*\\.js$': '<rootDir>/node_modules/babel-jest',
13+
'.*\\.(vue)$': '<rootDir>/node_modules/@vue/vue2-jest',
14+
},
15+
transformIgnorePatterns: ['node_modules/(?!variables/.*)'],
16+
};

0 commit comments

Comments
 (0)