Skip to content
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

EZP-29746: Selected item blinking while loading its children in UDW #111

Merged
merged 4 commits into from
Oct 24, 2018

Conversation

sunpietro
Copy link
Contributor

locationsMap: this.locationsMap,
activeLocations: this.activeLocations,
}),
() => ({ locationsMap: this.locationsMap, activeLocations: this.activeLocations }),
Copy link
Member

Choose a reason for hiding this comment

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

If you created setPreselectedState method you can use it here.

return null;
}

return (
<SelectContentButtonComponent
multiple={multiple}
selectedContent={selectedContent}
isSelected={selectedContent.find((content) => content.id === location.id)}
Copy link
Member

Choose a reason for hiding this comment

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

isSelected suggests it's boolean but is passed content?

@sunpietro
Copy link
Contributor Author

ping @dew326

@@ -69,13 +61,14 @@ export default class FinderTreeBranchComponent extends Component {
const contentTypeHref = location.ContentInfo.Content.ContentType._href;
const isContainer = contentTypesMap && contentTypesMap[contentTypeHref] && contentTypesMap[contentTypeHref].isContainer;
const isSelectable = !(this.props.allowContainersOnly && !isContainer);
const selected = location.id === this.state.selectedItem;
Copy link
Contributor

Choose a reason for hiding this comment

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

I would go for selectedLocationId instead of selectedItem because for the former is more descriptive.

isLocationAllowed,
isPreviewMetaReady: false,
}));
this.setState(() => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

Why we are setting these state's variables here and not in the first callback? We are waiting for this.props.cotfAllowedLocations to change or somehow influence rendering order? I don't understand idea behind it.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems to me that we want to reset something? Why would we need that?

hasChildrenClassName,
isLoadingChildrenClassName,
isNotSelectableClassName,
].join(' '),
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

Choose a reason for hiding this comment

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

I would go for helper function accepting object { 'some-class-name': true | false }.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I get your point, but we won't do it now.

@micszo micszo self-assigned this Oct 23, 2018
@micszo
Copy link
Member

micszo commented Oct 23, 2018

@sunpietro looks like it needs a rebase. :)

@sunpietro
Copy link
Contributor Author

@micszo branch has just been rebased

@micszo
Copy link
Member

micszo commented Oct 24, 2018

Follow-up issue https://jira.ez.no/browse/EZP-29759.

@micszo micszo removed their assignment Oct 24, 2018
@lserwatka lserwatka merged commit d80ff05 into 1.3 Oct 24, 2018
@lserwatka lserwatka deleted the fix-udw-selecting-items branch October 24, 2018 13:07
@lserwatka
Copy link
Member

@sunpietro you can merge it up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants