Skip to content

ITEP-66910 - Fix adding a label on a subgroup #229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web_ui/src/core/projects/hooks/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe('Projects hooks utils', () => {
name: 'Ly',
color: '#f7dab3ff',
group: 'Gz___Gy',
parentLabelId: 'Lz',
parentLabelId: '151ac58f-59cc-437a-a168-fd239f3ee5a7',
behaviour: LABEL_BEHAVIOUR.LOCAL,
isEmpty: false,
},
Expand Down
2 changes: 1 addition & 1 deletion web_ui/src/core/projects/hooks/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const getEditLabelsPayload = (
return getNewLabelPayloadNew(label, shouldRevisit);
}

return getNewLabelPayloadNew({ ...label, parentLabelId: parentElement.name }, shouldRevisit);
return getNewLabelPayloadNew({ ...label, parentLabelId: parentElement.id }, shouldRevisit);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this also work when creating a new group hiearchy? I.e. when the parentElement is also a new label (so therefore not having an id)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also thought about that case - the problem is that during creation we do not have id, only the name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does : )

}

if (state === LabelItemEditionState.REMOVED) {
Expand Down
Loading