From 27314be9a85493458ed68065f36d47aef7568be5 Mon Sep 17 00:00:00 2001 From: Ari Date: Wed, 27 Jul 2022 19:29:28 -0400 Subject: [PATCH] added delete to story --- .../AutomationListV2/index.stories.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/webapp/src/components/AutomationListV2/index.stories.tsx b/webapp/src/components/AutomationListV2/index.stories.tsx index ebba24a..7852003 100644 --- a/webapp/src/components/AutomationListV2/index.stories.tsx +++ b/webapp/src/components/AutomationListV2/index.stories.tsx @@ -117,7 +117,22 @@ export const Mocked: ComponentStory = (args) => { [eid]: a.state, }); }} - onTagUpdate={() => {}} + onTagUpdate={(tags, aid) => { + args.onTagUpdate(tags, aid); + const index = mockAutos.findIndex( + ({ metadata }) => metadata.id === aid + ); + if (index >= 0) { + setAutos([ + ...mockAutos.slice(0, index), + { + ...mockAutos[index], + tags, + }, + ...mockAutos.slice(index + 1), + ]); + } + }} /> );