Skip to content

Commit

Permalink
fix: reset flow id to avoid flow overriding in AM
Browse files Browse the repository at this point in the history
  • Loading branch information
leleueri authored and gcusnieux committed Jun 25, 2021
1 parent 52c3710 commit 7c5ea31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/policy-studio/gv-policy-studio.js
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,8 @@ export class GvPolicyStudio extends KeyboardElement(LitElement) {
: {
...duplicate,
_id: null,
// reset the id to avoid issue with AM that persists the ID
id: null,
_dirty: true,
};

Expand Down
1 change: 1 addition & 0 deletions stories/policy-studio/gv-policy-studio.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ describe('P O L I C Y S T U D I O', () => {
...flow,
_dirty: true,
_id: expect.any(String),
id: null,
post: [{ _id: expect.any(String), policy: 'rate-limit', name: 'Rate limit' }],
};
expect(component.definition.flows.length).toEqual(2);
Expand Down

0 comments on commit 7c5ea31

Please sign in to comment.