From f03c1eba10f78e09a4ed786e2c81bcef7a0183b9 Mon Sep 17 00:00:00 2001 From: Denys Bohdan Date: Mon, 6 Nov 2023 15:48:44 +0100 Subject: [PATCH] UIIN-2497 Show Instance record after creating with Fast add option --- CHANGELOG.md | 1 + src/components/InstancesList/InstancesList.js | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ff4e1896..1e50ca239 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Make Inventory search and browse query boxes expandable. Refs UIIN-2493. * Added support for `containsAny` match option in Advanced search. Refs UIIN-2486. * Inventory search/browse: Do not retain checkbox selections when toggling search segment. Refs UIIN-2477. +* Show Instance record after creating with Fast add option. Refs UIIN-2497. ## [10.0.2] IN PROGRESS diff --git a/src/components/InstancesList/InstancesList.js b/src/components/InstancesList/InstancesList.js index 83dce4f6b..1e368095b 100644 --- a/src/components/InstancesList/InstancesList.js +++ b/src/components/InstancesList/InstancesList.js @@ -544,7 +544,18 @@ class InstancesList extends React.Component { } } - toggleNewFastAddModal = () => { + toggleNewFastAddModal = ({ instanceRecord }) => { + const { + history, + location, + } = this.props; + + if (instanceRecord?.id) { + history.push({ + pathname: `/inventory/view/${instanceRecord.id}`, + search: location.search, + }); + } this.setState((state) => { return { showNewFastAddModal: !state.showNewFastAddModal }; });