#bookbrainz

/

      • Shubh joined the channel
      • Shubh has quit
      • Shubh joined the channel
      • Shubh has quit
      • Shubh joined the channel
      • Shubh
        Hello , i need some help related to passing namevalue props to EntityEditor(NameSection) Component using generateEntityProp ..
      • Shubh has quit
      • Shubh joined the channel
      • monkey
        What's your question Shubh ?
      • Always best to ask the question so that I'll be able to see it when I reconnect :)
      • Shubh
        I'm kinda stuck for a while figuring out how can i pass the query parameter to NameSection component
      • there is generateEntityProps thingy which maybe generate props given if edit page or not , so
      • and it return props which i think include initialState where value for name is stored for edit page
      • this props passed to EntityEditorMarkup which accepts two props initalState and entity type ( then how we pass it so many props ? )
      • EntityEditorMarkup then send rest props ( everything accept initalState which is only entityType ) to EntityEditor which furthur passes it props to NameSection as it is
      • NameSection (where i need that name=query prop) accept defaultName value for entity name field this is where i need to pass that query name.
      • but i can't understand how it is getting its defaultName if EntityEditorMarkup only sending 'rest' which in case entityType props to EntityEditor ...
      • what i'm missing here :,
      • rest isn't entitytype only ..
      • monkey
        I'll be with you shortly
      • Shubh
        Thanks
      • monkey
        So, I'm not sure I follow everything, but here are some clues: when you see something like `const {initialState, ...rest} = props;`, the `…rest` in there actually represents all the other items that were in `props` except `initialState`. So it's not a prop name in itself, rather "all the other props"
      • Shubh
        i understand that but there is no field name nameValue in rest object
      • but there is name key in rest.entity object
      • monkey
        So we use Redux to manage state, and the nameValue prop is derived from the state here: https://github.com/bookbrainz/bookbrainz-site/b...
      • This 'name' state item is in a section of the state called `nameSection`
      • Currently I think there is no place where we set the name initially, and so the default `name` prop set to an empty string can be found in src/client/entity-editor/name-section/reducer.js
      • Now let me see what is the right way to set an initial `name` in the state
      • Shubh
        so so that connect thing is for redux ?
      • monkey
        "that connect thing" ?
      • Shubh
        sorry just read the redux connect api docs , everthing make sense now
      • monkey
        Here's an example of how we set the initial redux state depending on the value of the request query parameters: https://github.com/bookbrainz/bookbrainz-site/b...
      • It looks like we get `initialState` returned by generateEntityProps, and we can modify this initial state at will before sending the markup
      • In your case you'll be looking to modify `initialState.nameSection.name` I think
      • Shubh
        so modifying name value in initalState.nameSection and passing it to EnityEditorMarkup will do the trick ?
      • monkey
        That should do the trick I'm a bit rusty, but it does look like that's what we're doing in that last bit of code I sent a link to
      • Shubh
        All done just one little issue ..
      • all other require field in namesection (like sortname) is giving invlid field hint although i provided the default values for other field (like sortname:"") in namesection same as redux .
      • monkey
        Not sure. At this point I think it'll be easier if you open a PR so I can have a look too if you don't find what the issue might be
      • Looking at your message, could it be a case issue? `sortName` instead of `sortname` ?
      • Shubh
        i'm making a PR then
      • monkey
        Great :)
      • Shubh
        one more thing ..
      • i'm making calltoaction component appear on every search acc to ticket ..
      • monkey
        I'm with you so far, what's your question?
      • Shubh
        i'm confirming if you are okay with having the missing entry option for every search anyway i made the PR :)
      • monkey
        I think that's a good idea, and what the ticket suggested. Not sure what the best placement is, maybe below the pagination ?
      • Shubh
        i did that please have a look
      • monkey
        Will do. I'm working on something else at the moment and ask for your patience.
      • Shubh
        thanks for all the help @monkey
      • monkey
        And thank you for all the new PRs ! :)
      • Shubh
        :)
      • Shubh has quit
      • Shubh joined the channel
      • BB-268 , is it fixed ?
      • BrainzBot
        BB-268: Can't set Author of EditionGroup https://tickets.metabrainz.org/browse/BB-268
      • monkey
        Not yet, no
      • Shubh
        Oh
      • monkey
        Yes, there's another Work In Progress™ to add Author Credits: https://github.com/bookbrainz/bookbrainz-site/p...
      • A bit complex to explain but MusicBrainz has a good explanation of how it works: https://musicbrainz.org/doc/Artist_Credits
      • ("Artist" in MusicBrainz = "Author" in BookBrainz)
      • CatQuest
        can we get author credits up on beta soon?
      • agatzk joined the channel
      • monkey
        As soon as I find time to finish implementing the feature…
      • Shubh has quit
      • CatQuest
        :O
      • in january maybe?
      • agatzk has quit
      • agatzk joined the channel