Skip to content
This repository was archived by the owner on Mar 25, 2021. It is now read-only.

Extract EntityLookup and add ItemValueLookup#111

Merged
micgro42 merged 4 commits into
masterfrom
ItemValueLookup
Jan 4, 2021
Merged

Extract EntityLookup and add ItemValueLookup#111
micgro42 merged 4 commits into
masterfrom
ItemValueLookup

Conversation

@micgro42
Copy link
Copy Markdown
Collaborator

@micgro42 micgro42 commented Dec 18, 2020

ItemValueLookup and PropertyLookup share a lot of logic, yet there are
subtle differences, both in logic and in semantics.

This is passing down a method as a prop. While that might be more
unusual in vuejs than in react, it seems that having the parent maintain
the state only for it to be passed down to the child and having the
child ask for more items on scroll would seem to be much more convoluted
and clumsy.

TODO:

  • agree on the basic approach
  • tests
  • messages

Bug: T270256

@Ladsgroup
Copy link
Copy Markdown
Contributor

I'm not 100% we should do this. The amount of duplicated code is small and if it grows, it should be moved the pure ts/js instead of being in Vue. Some of the code you put here can be moved to pure ts/js and reuse that in the components.

@micgro42
Copy link
Copy Markdown
Collaborator Author

micgro42 commented Jan 4, 2021

Rebased it on top of master

@micgro42
Copy link
Copy Markdown
Collaborator Author

micgro42 commented Jan 4, 2021

I'm not 100% we should do this. The amount of duplicated code is small and if it grows, it should be moved the pure ts/js instead of being in Vue. Some of the code you put here can be moved to pure ts/js and reuse that in the components.

Yeah, at some point we might want to share code with a "Unit Lookup" 🤔

@micgro42 micgro42 force-pushed the ItemValueLookup branch 2 times, most recently from 4ff4365 to 394fcc7 Compare January 4, 2021 13:31
@micgro42 micgro42 marked this pull request as ready for review January 4, 2021 13:43
ItemValueLookup and PropertyLookup share a lot of logic, yet there are
subtle differences, both in logic and in semantics.

This is passing down a method as a prop. While that might be more
unusual in vuejs than in react, it seems that having the parent maintain
the state only for it to be passed down to the child and having the
child ask for more items on scroll would seem to be much more convoluted
and clumsy.

Bug: T270256
},
},
props: {
searchForMenuItems: {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Passing it as a prop. Nice idea!

Copy link
Copy Markdown
Contributor

@Ladsgroup Ladsgroup left a comment

Choose a reason for hiding this comment

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

Thanks!

@micgro42 micgro42 merged commit 563f441 into master Jan 4, 2021
@micgro42 micgro42 deleted the ItemValueLookup branch January 4, 2021 16:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants