Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major overhaul (RecipeView update, sections support, recipes list view, ...) #2115

Draft
wants to merge 188 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
188 commits
Select commit Hold shift + click to select a range
6689c86
refactor: Migrate, cleanup, and document `helper.js`, `logging.js`, a…
seyfeb Jan 13, 2024
88050c6
refactor: Add multiple TS classes for representing recipe-related sch…
seyfeb Jan 19, 2024
b17cca2
test: Allow testing typescript with Jest
seyfeb Jan 19, 2024
bb6816c
test: Add tests for TS schema.org model classes
seyfeb Jan 19, 2024
d0ec007
test: Add cookbook aliases to Jest config
seyfeb Jan 20, 2024
c66380f
feat: Add utility methods for mapping objects to integer, string, or …
seyfeb Jan 20, 2024
26a427a
test: Add tests for object-mapping utility methods
seyfeb Jan 20, 2024
d15f3b3
feat: Add `fromJSON` method mapping JSON to a NutritionInformation ob…
seyfeb Jan 21, 2024
f46fe6b
feat: Add `fromJSON` method mapping JSON to a `QuantitativeValue` obj…
seyfeb Jan 21, 2024
4dbe1c0
feat: Add `fromJSON` method mapping JSON to a `HowToSupply` and `HowT…
seyfeb Jan 21, 2024
8d6095a
feat: Add `fromJSON` method mapping JSON to a `HowToSection` and `How…
seyfeb Jan 21, 2024
94300a6
feat: Add `fromJSON` method mapping JSON to a `Recipe` and object.
seyfeb Jan 21, 2024
5710085
test(js): Add tests for `fromJSON` method of `NutritionInformation` a…
seyfeb Jan 21, 2024
6723100
test(js): Add tests for `fromJSON` method of `HowToSupply` and `HowTo…
seyfeb Jan 21, 2024
21605b2
test(js): Add tests for `fromJSON` method of `HowToDirection` and `Ho…
seyfeb Jan 21, 2024
3ff6ab5
test(js): Add tests for `fromJSON` method of `Recipe`.
seyfeb Jan 21, 2024
3706bc1
test(js): Add tests for `fromJSON` method of `Recipe`: Test mapping s…
seyfeb Jan 21, 2024
37bcaed
feat: Add support for mapping simple strings for `tool`, `recipeInstr…
seyfeb Jan 21, 2024
a8861a1
fix: Migrate `api-interface.js` to Typescript, fix incorrect @nextclo…
seyfeb Jan 21, 2024
d183a04
test: Add test class for `helpers`
seyfeb Jan 31, 2024
f737a54
feat: Add `HowToTip` class
seyfeb Jan 31, 2024
62cdd1a
feat: Add option to split comma-separated string to array in `jsonMap…
seyfeb Jan 31, 2024
f58df4b
feat: Use `Recipe` in store
seyfeb Jan 31, 2024
9e963ea
feat: Multiple improvements in schema.org model classes
seyfeb Jan 31, 2024
fd00646
test: Update for schema.org model classes
seyfeb Jan 31, 2024
c3c28b6
fix: Multiple updates to `RecipeView` to consider usage of new model …
seyfeb Jan 31, 2024
6ebeba5
feat: Add mapper for API responses.
seyfeb Jan 31, 2024
1b47e45
test: Add tests for jsonMapper
seyfeb Jan 31, 2024
785bee3
feat: Add support for HowToStep and HowToTip in HowToSection class. A…
seyfeb Feb 6, 2024
4e6b573
test: Migrate applyRecipeFilters test to typescript
seyfeb Feb 6, 2024
6ebf658
fix: Add missing exports to `Models/schema` and multiple style fixes
seyfeb Feb 8, 2024
859410e
feat: Add `RecipeInstructionsTip` vue component
seyfeb Feb 8, 2024
8a9a800
feat: Add `RecipeInstructionsDirection` vue component
seyfeb Feb 8, 2024
c172d38
feat: Add `RecipeInstructionsStep` vue component
seyfeb Feb 8, 2024
86eaac4
feat: Add `RecipeInstructionsSection` vue component
seyfeb Feb 8, 2024
89247c2
feat: Add `RecipeInstructions` vue component
seyfeb Feb 8, 2024
5530108
fix: Alignment, padding, and margin issues
seyfeb Feb 8, 2024
e8a3e67
fix: schema.org JSON parsing and tests
seyfeb Feb 8, 2024
986eb3a
refactor: Add @type property and base class to schema.org models
seyfeb Feb 8, 2024
55814de
fix: Numbering of step items
seyfeb Feb 8, 2024
fdb3720
fix: Prevent direction click toggling parent step completion. Rework …
seyfeb Feb 8, 2024
fbf1ff3
dependencies: Add vueuse package.
seyfeb Feb 8, 2024
2208d3c
feat: Add normalization to recipe instructions steps, etc.
seyfeb Feb 8, 2024
09b7d6c
feat: Add Markdown support to recipe instructions steps, etc.
seyfeb Feb 8, 2024
213cfaf
feat: Add initial states for normalized instructions
seyfeb Feb 8, 2024
c334d57
feat: Replace instructions in RecipeView with new components
seyfeb Feb 8, 2024
174ef5b
fix: Allow null or undefined for HowToSection name in JSON parser and…
seyfeb Feb 9, 2024
9ad1d20
test: Update tests for schema.org models
seyfeb Feb 10, 2024
eb3e33c
fix: Update schema.org models `HowToSection`, `QuantitativeValue`, an…
seyfeb Feb 10, 2024
5d6d9ca
feat: Support `HowToTool` objects in `RecipeView
seyfeb Feb 10, 2024
a490508
feat: Update recipe-yield input and extract to a separate component
seyfeb Feb 12, 2024
9de47df
test: Add tests for adjustToInteger method
seyfeb Feb 12, 2024
1110a85
fix: Several spacings and headline sizes in `RecipeView`
seyfeb Feb 12, 2024
88a3c0b
feat: Add and include main scss file
seyfeb Feb 12, 2024
76e54a1
fix: Hide overflowing recipe title on mobile in RecipeView
seyfeb Feb 12, 2024
147e7dd
refactor: Remove recipe image collapsability. Change flex in image an…
seyfeb Feb 13, 2024
a925379
refactor: Move several scoped css utility classes to global scope.
seyfeb Feb 13, 2024
6e57089
feat: Add popup for viewing full main image in recipe view
seyfeb Feb 13, 2024
9870ce6
fix: Update headline font weights and margin in recipe view
seyfeb Feb 13, 2024
1245e06
feat: Update styles of timer and recipe yield in recipe view
seyfeb Feb 13, 2024
80ce1b5
refactor: Extract ingredients list from RecipeView.vue to separate co…
seyfeb Feb 14, 2024
13b45d8
refactor: Simplify RecipeIngredient subgroup rendering.
seyfeb Feb 14, 2024
e1b0403
fix: Make ingredient font-style non-bold, consistent with rest. Compl…
seyfeb Feb 14, 2024
12d84f7
feat: Add support for showing HowToSupply items in main part of the r…
seyfeb Feb 14, 2024
81a65fa
style: Make eslint & co happy.
seyfeb Feb 14, 2024
af87ff4
feat: Add `ISchemaOrgVisitor` and implementing class `SupplyCollector…
seyfeb Feb 15, 2024
3abd11a
test: Add unit tests for `SupplyCollector`.
seyfeb Feb 15, 2024
64b6a1c
fix: Remove unnecessary import of compiler macros `defineEmits` and `…
seyfeb Feb 15, 2024
2db1688
feat: Add `ToolsCollector` visitor for collecting `HowToTool`s from s…
seyfeb Feb 15, 2024
4ae961c
test: Add unit tests for `ToolsCollector`
seyfeb Feb 15, 2024
f6ae1b2
feat: Add supply/ingredients area to a section in recipe view
seyfeb Feb 16, 2024
b039c4a
feat: Add tools' area to a section in recipe view
seyfeb Feb 16, 2024
a12d1ea
fix: Don't show subitem number if HowToDirection is only element of H…
seyfeb Feb 17, 2024
d487126
style: Make eslint & co happy again.
seyfeb Feb 17, 2024
e7b8288
fix(recipe-view): Toggle parent step completed state with child state…
seyfeb Feb 17, 2024
21a9a74
feat(recipe-view): Extract nutrition information to separate component.
seyfeb Feb 17, 2024
c93f8a9
fix(recipe-view): Unify indents of tools, ingredients, and nutrition …
seyfeb Feb 17, 2024
a439a4f
fix(recipe-view): Fix completion toggling of instructions. Extract co…
seyfeb Feb 18, 2024
328ac47
refactor(recipe-view): Extract times to component.
seyfeb Feb 18, 2024
cf76a22
refactor(recipe-view): Extract dates to component.
seyfeb Feb 18, 2024
cdb1e8a
refactor(recipe-view): Extract keywords to component.
seyfeb Feb 18, 2024
54de35b
fix(recipe-view): Give instructions more space on larger screens with…
seyfeb Feb 19, 2024
62d644b
feat(recipe-view): Move metadata with ingredients below main image. M…
seyfeb Mar 14, 2024
5075a74
feat(recipe-view): Add sidebar to recipe view
seyfeb Mar 17, 2024
d69c788
feat(recipe-view): Add organizational items section with category to …
seyfeb Mar 17, 2024
c1f8abf
feat(recipe-view): Redesign nutritional values and move to sidebar
seyfeb Mar 17, 2024
21f9373
feat(recipe-view): Redesign dates component and move to metadata in s…
seyfeb Mar 17, 2024
5727b97
feat(recipe-view): Add keywords to sidebar and adjust category display
seyfeb Mar 17, 2024
bf94531
feat(recipe-view): Navigate to category when clicked in sidebar
seyfeb Mar 17, 2024
5c0f6d2
feat(recipe-view): Hide sidebar button when sidebar is open
seyfeb Mar 17, 2024
1c2a7af
refactor(recipe-view): Move sidebar-visibility state from store to `A…
seyfeb Mar 18, 2024
95e2802
feat(recipe-view): Move ingredient-calculation error to popover
seyfeb Mar 18, 2024
e4afb4a
feat(recipe-view): Move tools section next to ingredients in header. …
seyfeb Mar 18, 2024
4cf9976
feat(recipe-view): Use grid layout. Show single column in sections wi…
seyfeb Mar 21, 2024
dc0ca74
feat(recipe-view): Add multiple main-image display and slideshow
seyfeb Mar 21, 2024
4578c0e
feat(lazy-picture): Add placeholder slot, require src, allow percenta…
seyfeb Apr 4, 2024
70e222b
feat(loading-skeleton): Add skeleton loading placeholder component
seyfeb Apr 4, 2024
af83d29
fix(recipe-card): Use size with unit for LazyPicture
seyfeb Apr 4, 2024
2c1975f
fix(recipe-images): Show loading skeleton for main image
seyfeb Apr 4, 2024
7e72df7
docs(hooks): Fix typos in hooks README
seyfeb Apr 5, 2024
760a150
feat(loading-skeleton): Add avatar, list-item, paragraph types. Multi…
seyfeb Apr 5, 2024
a2b15e1
feat(skeleton-loading): Add skeleton-loader component for recipe view
seyfeb Apr 5, 2024
6faec10
Fix code style
seyfeb Apr 5, 2024
284cd79
feat(loading-skeleton): recipe-loading skeleton to `RecipeView`
seyfeb Apr 5, 2024
5579668
feat(divider): Add divider component and Licenses following SPDX stan…
seyfeb Apr 5, 2024
4a6aff5
feat(sheet): Add sheet component and rearrange SCSS styles files
seyfeb Apr 5, 2024
c9a40b5
refactor(instructions-section): Add Sheet as container, update title,…
seyfeb Apr 5, 2024
bb2a6d0
refactor(recipe-view): Update details sections label style
seyfeb Apr 5, 2024
c44c428
fix(recipe-details): Fix translation
seyfeb Apr 5, 2024
56e99a0
fix: Fix elevation.scss and styles
seyfeb Apr 5, 2024
562f181
feat(recipe-sidebar): Add loading skeleton for recipe sidebar
seyfeb Apr 5, 2024
ee4db80
refactor(recipe-list): Rename list to grid
seyfeb Apr 6, 2024
d06a4d7
feat(recipe-repository): Add `Recipe` repository
seyfeb Apr 9, 2024
a4222cb
feat: Add recipe category to mapper from API DTO
seyfeb Apr 9, 2024
9b2d5ec
fix: Allow arrays for keywords and category in recipe-filter composable
seyfeb Apr 9, 2024
eed4570
fix(recipe-view): Unify label colors
seyfeb Apr 9, 2024
2b35bc2
refactor: Rename RecipeList/RecipeGrid to RecipesGrid
seyfeb Apr 9, 2024
e7d1fb2
feat: Inject recipe repository and store in AppMain
seyfeb Apr 9, 2024
53c9ce1
fix(app-navi): Only highlight "All recipes when on root path"
seyfeb Apr 20, 2024
0b28f5f
fix(recipe-details): Ensure categories is an array for rendering
seyfeb Apr 20, 2024
64fb92e
fix(lazy-picture): Reload new image when image source is updated.
seyfeb Apr 22, 2024
ed4bba1
fix(divider): Set correct type for DividerType prop (which is typescr…
seyfeb Apr 22, 2024
901baf2
feat(css): Add several utility classes.
seyfeb Apr 25, 2024
0db5734
feat(Recipe): Allow array for category in `Recipe` model
seyfeb Apr 25, 2024
c9d0545
refactor(logic operators): Migrate to typescript. Add operator type e…
seyfeb Apr 25, 2024
24d7bda
feat(recipe filters): Add `equals` function for comparing filters. Ad…
seyfeb Apr 25, 2024
12de190
test: Add tests for logic operators and recipe filters
seyfeb Apr 25, 2024
270d8ec
feat(recipe card): Use current path and add queries to routing target…
seyfeb Apr 25, 2024
8ef4e65
feat(utils): Add new navigation utility in frontend.
seyfeb Apr 25, 2024
f1805e1
feat(utils): Add new route utility in frontend which allows decoding …
seyfeb Apr 25, 2024
f2e14b0
feat(utils): Add new utility for removing duplicates from array in fr…
seyfeb Apr 25, 2024
6c8d637
test(utils): Add test for utility for removing duplicates from array …
seyfeb Apr 25, 2024
b4c72b1
fix(main): make eslint happy
seyfeb Apr 25, 2024
8175ae8
feat(utils): Add utility for creating a list of `RecipeFilter`s from …
seyfeb Apr 25, 2024
72ab864
test(utils): Add test for utility for creating a list of `RecipeFilte…
seyfeb Apr 25, 2024
95f582e
feat(filtering): Add `SearchMode` enum
seyfeb Apr 25, 2024
a3855ee
refactor(filtering): Add typescript annotations to `applyRecipeFilters`
seyfeb Apr 25, 2024
3c0f867
feat(utils): Add more options to string normalization method.
seyfeb Apr 25, 2024
a50a597
feat(routing): Add new `RouteName` enum for specifying the name of ro…
seyfeb Apr 25, 2024
c6ca9fb
feat(comparison): Add utility for comparing two lists of `RecipeFilter`s
seyfeb Apr 25, 2024
81b4431
feat(comparison): Add utility for comparing two arrays
seyfeb Apr 25, 2024
b2f4d7c
feat(api mapping): Add function for mapping category response to `Rec…
seyfeb Apr 25, 2024
007264a
feat(json): Auto-convert integer to string in `mapString` function.
seyfeb Apr 25, 2024
2898948
feat(routing): Add new routes, partially switch to `RouteName` enum.
seyfeb Apr 25, 2024
82bba01
feat(RecipeRepository): Add logging, fix recipe mapping, make eslint …
seyfeb Apr 25, 2024
7a11a27
feat(list): Add enum for style of recipes list (grid vs list)
seyfeb Apr 25, 2024
ee5d9d6
feat(recipe view): Add content informing the user when loading failed…
seyfeb Apr 25, 2024
c964db4
feat(store): Add recipe-filter manipulation actions and a variable fo…
seyfeb Apr 25, 2024
33a0c97
refactor(AppControls): Use RouteName enum
seyfeb Apr 25, 2024
455043a
feat(List/Filtering): Completely rework recipe filtering. Introduce n…
seyfeb Apr 25, 2024
2f41be5
fix(Recipe Repository): Fix response of recipe-update call
seyfeb Apr 25, 2024
b4e3660
feat(Recipes List): Add loading skeleton
seyfeb Apr 25, 2024
f2a0c0b
fix(Recipe View): Improve left alignment of title and sections.
seyfeb Apr 27, 2024
358cb42
fix(App controls): Remove "viewing recipe" and "editing recipe" from …
seyfeb Apr 27, 2024
e25034b
refactor(Recipe view): Left-align tools and section content with titles
seyfeb Apr 29, 2024
b38b498
feat(Recipe view): Show empty tools and supplies section in instructi…
seyfeb Apr 29, 2024
8b8a4ee
feat(Recipe view): Use h4 for section titles
seyfeb Apr 29, 2024
d841f2a
feat(Recipe view): Only show icon in edit button for small screen sizes
seyfeb Apr 29, 2024
c108dd9
feat(Recipe view): Show visible recipe section as subtitle in app con…
seyfeb Apr 30, 2024
ff0b5c3
feat(Recipe view): Add empty space at the bottom to allow further scr…
seyfeb May 1, 2024
14e46b0
fix(Recipe view): Remove top padding of wrapper for larger screens
seyfeb May 1, 2024
84d60b5
fix(Recipe view): Fix description-text style of loading error
seyfeb May 1, 2024
4ae6119
fix(store): Default to recipe grid
seyfeb May 2, 2024
8ecc1ea
fix(AppControls): Link to current path + `/edit` from edit button
seyfeb May 2, 2024
276edf7
fix(Routes): Add routes for X+`/edit`. Cleanup code duplication in ro…
seyfeb May 2, 2024
e407eab
feat(Search results): Add recipe base path for remaining search routes
seyfeb May 2, 2024
4a3bf3d
fix(Recipe view): Improve padding
seyfeb May 2, 2024
32120ad
fix(js helpers): Fix `adjustToInteger`
seyfeb May 2, 2024
f0b5072
test(frontend): Fix multiple frontend tests
seyfeb May 2, 2024
ddecc10
fix(Recipe list item): Use API directly for renaming recipes from list
seyfeb May 2, 2024
f1754ee
style: Make eslint, stylelint, prettier happy
seyfeb May 2, 2024
f5ce6f5
fix: Remove `AppIndex` component & use `SearchResults` instead. Add m…
seyfeb May 3, 2024
2018d37
feat(RecipesList): Update recipe name immediately after rename succes…
seyfeb May 3, 2024
22dd11b
fix(AppMain): Allow viewing recipes for Index and GeneralSearch routes
seyfeb May 3, 2024
b2a76e8
fix(routing): Keep query params for /recipe routes
seyfeb May 3, 2024
250dcf9
fix(RecipeEdit): Expect integer id consistent with RecipeView
seyfeb May 3, 2024
18bd58f
fix(RecipeView): Add text for empty list of instructions in section
seyfeb May 3, 2024
5bd75b2
fix(routing): Fix navigating to recipe editor from recipes list
seyfeb May 3, 2024
69839c4
fix(recipe view): Limit number of decimals to two for recalculated am…
seyfeb May 3, 2024
065f357
refactor(utils): Move `adjustToInteger` and `clamp` to `mathUtils` an…
seyfeb May 3, 2024
5712bc9
fix(editor): Fix navigating to next input field on enter in input gro…
seyfeb May 3, 2024
af7aee1
style: Fix style
seyfeb May 3, 2024
4065d94
feat(recipe view): Move URL to sidebar details tab
seyfeb May 3, 2024
cc855f1
fix(recipe list): Fix scrolling scrolling
seyfeb May 4, 2024
6c27422
feat(recipe lists): Add bottom margin for improved scrolling to grid …
seyfeb May 4, 2024
d9a91c4
fix(recipe lists): On mobile, show recipe view when recipe is selecte…
seyfeb May 5, 2024
321c8bd
fix(logging utils): Confirm parameter is not null
seyfeb Jul 11, 2024
4bce545
feat(recipe filters): Add alphabetical sorting of keywords and catego…
seyfeb Jul 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ extends:
parser: "vue-eslint-parser"

parserOptions:
parser: "@typescript-eslint/parser"
project: './tsconfig.json'
tsconfigRootDir: './'
parser: "@typescript-eslint/parser"
project: './tsconfig.json'

plugins:
- vue
- '@typescript-eslint'

env:
browser: true
# jest: true

globals:
OC: readonly
Expand Down Expand Up @@ -74,9 +74,13 @@ rules:
# While we are still on Vue2, we need this. Remove once on Vue3
vue/no-deprecated-v-bind-sync: off


overrides:
- files: [ "src/composables/**/*.js" ]
rules:
import/prefer-default-export: off
- files: [ "./src/tests/**/*.test.{js,ts}"]
env:
jest: true


12 changes: 7 additions & 5 deletions .hooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ This folder holds some default hooks, you can use while developing.
Before installing make sure, you have no existing hooks installed that might get overwritten.

To install them, you can (under Linux) do from the root folder of the repository
```
ln -sr .hook/* .git/hooks

```shell
ln -sr .hooks/* .git/hooks
```

## Security considerations
Please be aware, that this is sort of a security risk to do this. When checking out foreign code (aka `checkout` a branch you want to inspect that is from a foreign source), the foreign user might have introduced arbirtrary malicious code into the hook scripts. This code can then be executed depending on your local settings and command line options. Be aware that this might destroy your data!
Please be aware, that this is sort of a security risk to do this. When checking out foreign code (aka `checkout` a branch you want to inspect that is from a foreign source), the foreign user might have introduced arbitrary malicious code into the hook scripts. This code can then be executed depending on your local settings and command line options. Be aware that this might destroy your data!

One option is to copy instead of link the hooks in the folder. That way, you can be sure the hooks are safe (as far as you trust them at the time of copying). The downside is that the hooks will never be updated automatically once you configure it this way.
```
cp .hook/* .git/hooks

```shell
cp .hooks/* .git/hooks
```

When you need to work with untrusted code (for inspection), you could also remove the links in the `.git/hooks` folder. That way you disabled the hooks. After being sure, the hooks are clear of malicious code, you can reenable them.
Expand Down
21 changes: 21 additions & 0 deletions LICENSES/LicenseRef-MudBlazor-MIT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 MudBlazor

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
661 changes: 661 additions & 0 deletions LICENSES/LicenseRef-cookbook-AGPL.txt

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
const babelConfig = require('@nextcloud/babel-config');

// https://jestjs.io/docs/getting-started#using-typescript
babelConfig.presets.push('@babel/preset-typescript');

module.exports = babelConfig;
15 changes: 8 additions & 7 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
// Jest configuration
module.exports = {
testEnvironment: 'node',
moduleFileExtensions: ['js', 'vue'],
modulePaths: [
'<rootDir>/src/'
],
modulePathIgnorePatterns: [
'<rootDir>/.github/'
],
moduleFileExtensions: ['js', 'ts', 'vue'],
moduleNameMapper: {
'^cookbook/(.*)$': '<rootDir>/src/$1',
'^icons/(.*)$': '<rootDir>/node_modules/vue-material-design-icons/$1',
},
modulePaths: ['<rootDir>/src/'],
modulePathIgnorePatterns: ['<rootDir>/.github/'],
transform: {
'.*\\.js$': '<rootDir>/node_modules/babel-jest',
'.*\\.ts$': '<rootDir>/node_modules/babel-jest',
'.*\\.(vue)$': '<rootDir>/node_modules/@vue/vue2-jest',
},
transformIgnorePatterns: ['node_modules/(?!variables/.*)'],
Expand Down
1 change: 1 addition & 0 deletions lib/Helper/Filter/JSON/FixInstructionsFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public function __construct(
}

public function apply(array &$json): bool {
return true;
if (!isset($json[self::INSTRUCTIONS])) {
$json[self::INSTRUCTIONS] = [];
return true;
Expand Down
21 changes: 12 additions & 9 deletions lib/Helper/Filter/JSON/FixToolsFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,19 @@ public function apply(array &$json): bool {
if($t != "") {
$tools[] = $t;
}
} else {
$tools = array_map(function ($t) {
$t = trim($t);
$t = $this->textCleaner->cleanUp($t, false);
return $t;
}, $json[self::TOOLS]);
$tools = array_filter($tools, fn ($t) => ($t));
ksort($tools);
$tools = array_values($tools);
}
// else {
// $tools = array_map(function ($t) {
// $t = trim($t);
// $t = $this->textCleaner->cleanUp($t, false);
// return $t;
// }, $json[self::TOOLS]);
// $tools = array_filter($tools, fn ($t) => ($t));
// ksort($tools);
// $tools = array_values($tools);
// }
return false;


$changed = $tools !== $json[self::TOOLS];
$json[self::TOOLS] = $tools;
Expand Down
71 changes: 59 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"@nextcloud/moment": "^1.2.2",
"@nextcloud/router": "^2.2.0",
"@nextcloud/vue": "^8.3.0",
"@vueuse/core": "^10.7.2",
"axios": "^1.6.5",
"caret-pos": "^2.0.0",
"fuse.js": "^7.0.0",
"linkifyjs": "^4.1.1",
Expand All @@ -53,10 +55,12 @@
"vuex": "^3.6.2"
},
"devDependencies": {
"@babel/preset-typescript": "^7.23.3",
"@nextcloud/babel-config": "^1.0.0",
"@nextcloud/browserslist-config": "^3.0.0",
"@nextcloud/stylelint-config": "^2.3.1",
"@nextcloud/webpack-vue-config": "^6.0.0",
"@types/jest": "^29.5.11",
"@typescript-eslint/eslint-plugin": "^6.18.0",
"@typescript-eslint/parser": "^6.18.0",
"@vue/cli-plugin-typescript": "~5.0.8",
Expand Down
Loading
Loading