Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a6b2d91

Browse files
committedAug 3, 2023
fix(backoffice-v2): no longer sharing data between cases (different workflows)
1 parent 542c0d6 commit a6b2d91

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const keyFactory = (...keys: Array<string>) => {
2+
return keys?.join(':');
3+
};

‎apps/backoffice-v2/src/pages/Entity/Entity.page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const Entity = () => {
99

1010
// Selected entity
1111
return (
12-
<Case>
12+
<Case key={workflow?.id}>
1313
{/* Reject and approve header */}
1414
<Case.Actions
1515
id={workflow?.id}

‎apps/backoffice-v2/src/pages/Entity/components/EditableDetails/EditableDetails.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { SelectTrigger } from '../../../../common/components/atoms/Select/Select
2020
import { SelectValue } from '../../../../common/components/atoms/Select/Select.Value';
2121
import { Select } from '../../../../common/components/atoms/Select/Select';
2222
import { useWatchDropdownOptions } from './hooks/useWatchDropdown';
23+
import { keyFactory } from '../../../../common/utils/key-factory/key-factory';
2324

2425
const useInitialCategorySetValue = ({ form, data }) => {
2526
useEffect(() => {
@@ -143,9 +144,12 @@ export const EditableDetails: FunctionComponent<IEditableDetails> = ({
143144
</SelectTrigger>
144145
</FormControl>
145146
<SelectContent>
146-
{dropdownOptions?.map(({ label, value }) => {
147+
{dropdownOptions?.map(({ label, value }, index) => {
147148
return (
148-
<SelectItem key={value} value={value}>
149+
<SelectItem
150+
key={keyFactory(id, valueId, label, index?.toString())}
151+
value={value}
152+
>
149153
{label}
150154
</SelectItem>
151155
);

0 commit comments

Comments
 (0)
Please sign in to comment.