Skip to content

Commit

Permalink
Fix usage of name in scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
nfour committed Oct 24, 2023
1 parent 0937cbf commit 3e80fef
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
7 changes: 7 additions & 0 deletions apps/stories/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

### Patch Changes

- Updated dependencies
- @dhi/arsenal[email protected]

## null

### Patch Changes

- Updated dependencies
- @dhi/arsenal[email protected]
- @dhi/arsenal[email protected]
Expand Down
6 changes: 6 additions & 0 deletions libs/scenarios/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @dhi/arsenal.scenarios

## 20.0.0

### Major Changes

- Fix usage of `name` in scenarios

## 19.0.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion libs/scenarios/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhi/arsenal.scenarios",
"version": "19.0.0",
"version": "20.0.0",
"main": "./x/index",
"scripts": {
"build": "tsc -p tsconfig.lib.json",
Expand Down
10 changes: 8 additions & 2 deletions libs/scenarios/src/__state/ScenariosState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ export class ScenariosState<

get scenarioListSearch() {
return new Fuse(this.scenarios ?? [], {
keys: ['Data.Name'],
keys: [
`Data.${String(this.config.scenarioDataNameKey)}`,
`data.${String(this.config.scenarioDataNameKey)}`,
],
isCaseSensitive: false,
shouldSort: true,
findAllMatches: true,
Expand Down Expand Up @@ -241,7 +244,10 @@ export class ScenariosState<
...toJS(scenario),
job: undefined,
id: uuid(),
data: { ...scenario.data, Name: `${scenario.data.Name} CLONE` },
data: {
...scenario.data,
[this.config.scenarioDataNameKey]: `${scenario.data.Name} CLONE`,
},
});

this.setScenario(this.draftScenario.value!.id);
Expand Down

0 comments on commit 3e80fef

Please sign in to comment.