#bookbrainz

/

      • Shubh joined the channel
      • 2021-11-30 33423, 2021

      • Shubh has quit
      • 2021-11-30 33432, 2021

      • Shubh joined the channel
      • 2021-11-30 33440, 2021

      • Shubh has quit
      • 2021-11-30 33429, 2021

      • Shubh joined the channel
      • 2021-11-30 33413, 2021

      • Shubh
        Hello , i need some help related to passing namevalue props to EntityEditor(NameSection) Component using generateEntityProp ..
      • 2021-11-30 33452, 2021

      • Shubh has quit
      • 2021-11-30 33432, 2021

      • Shubh joined the channel
      • 2021-11-30 33458, 2021

      • monkey
        What's your question Shubh ?
      • 2021-11-30 33436, 2021

      • monkey
        Always best to ask the question so that I'll be able to see it when I reconnect :)
      • 2021-11-30 33425, 2021

      • Shubh
        I'm kinda stuck for a while figuring out how can i pass the query parameter to NameSection component
      • 2021-11-30 33448, 2021

      • Shubh
        there is generateEntityProps thingy which maybe generate props given if edit page or not , so
      • 2021-11-30 33435, 2021

      • Shubh
        and it return props which i think include initialState where value for name is stored for edit page
      • 2021-11-30 33407, 2021

      • Shubh
        this props passed to EntityEditorMarkup which accepts two props initalState and entity type ( then how we pass it so many props ? )
      • 2021-11-30 33426, 2021

      • Shubh
        EntityEditorMarkup then send rest props ( everything accept initalState which is only entityType ) to EntityEditor which furthur passes it props to NameSection as it is
      • 2021-11-30 33419, 2021

      • Shubh
        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.
      • 2021-11-30 33412, 2021

      • Shubh
        but i can't understand how it is getting its defaultName if EntityEditorMarkup only sending 'rest' which in case entityType props to EntityEditor ...
      • 2021-11-30 33446, 2021

      • Shubh
        what i'm missing here :,
      • 2021-11-30 33403, 2021

      • Shubh
        rest isn't entitytype only ..
      • 2021-11-30 33419, 2021

      • monkey
        I'll be with you shortly
      • 2021-11-30 33426, 2021

      • Shubh
        Thanks
      • 2021-11-30 33412, 2021

      • 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"
      • 2021-11-30 33438, 2021

      • Shubh
        i understand that but there is no field name nameValue in rest object
      • 2021-11-30 33413, 2021

      • Shubh
        but there is name key in rest.entity object
      • 2021-11-30 33450, 2021

      • monkey
        So we use Redux to manage state, and the nameValue prop is derived from the state here: https://github.com/bookbrainz/bookbrainz-site/blo…
      • 2021-11-30 33453, 2021

      • monkey
        This 'name' state item is in a section of the state called `nameSection`
      • 2021-11-30 33410, 2021

      • monkey
        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
      • 2021-11-30 33430, 2021

      • monkey
      • 2021-11-30 33457, 2021

      • monkey
        Now let me see what is the right way to set an initial `name` in the state
      • 2021-11-30 33406, 2021

      • Shubh
        so so that connect thing is for redux ?
      • 2021-11-30 33408, 2021

      • monkey
        "that connect thing" ?
      • 2021-11-30 33412, 2021

      • Shubh
        sorry just read the redux connect api docs , everthing make sense now
      • 2021-11-30 33410, 2021

      • 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/blo…
      • 2021-11-30 33409, 2021

      • monkey
        It looks like we get `initialState` returned by generateEntityProps, and we can modify this initial state at will before sending the markup
      • 2021-11-30 33458, 2021

      • monkey
        In your case you'll be looking to modify `initialState.nameSection.name` I think
      • 2021-11-30 33452, 2021

      • Shubh
        so modifying name value in initalState.nameSection and passing it to EnityEditorMarkup will do the trick ?
      • 2021-11-30 33407, 2021

      • 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
      • 2021-11-30 33414, 2021

      • Shubh
        All done just one little issue ..
      • 2021-11-30 33444, 2021

      • Shubh
        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 .
      • 2021-11-30 33427, 2021

      • 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
      • 2021-11-30 33406, 2021

      • monkey
        Looking at your message, could it be a case issue? `sortName` instead of `sortname` ?
      • 2021-11-30 33443, 2021

      • Shubh
        i'm making a PR then
      • 2021-11-30 33450, 2021

      • monkey
        Great :)
      • 2021-11-30 33425, 2021

      • Shubh
        one more thing ..
      • 2021-11-30 33410, 2021

      • Shubh
        i'm making calltoaction component appear on every search acc to ticket ..
      • 2021-11-30 33443, 2021

      • monkey
        I'm with you so far, what's your question?
      • 2021-11-30 33454, 2021

      • Shubh
        i'm confirming if you are okay with having the missing entry option for every search anyway i made the PR :)
      • 2021-11-30 33424, 2021

      • monkey
        I think that's a good idea, and what the ticket suggested. Not sure what the best placement is, maybe below the pagination ?
      • 2021-11-30 33412, 2021

      • Shubh
        i did that please have a look
      • 2021-11-30 33412, 2021

      • monkey
        Will do. I'm working on something else at the moment and ask for your patience.
      • 2021-11-30 33428, 2021

      • Shubh
        thanks for all the help @monkey
      • 2021-11-30 33446, 2021

      • monkey
        And thank you for all the new PRs ! :)
      • 2021-11-30 33406, 2021

      • Shubh
        :)
      • 2021-11-30 33452, 2021

      • Shubh has quit
      • 2021-11-30 33410, 2021

      • Shubh joined the channel
      • 2021-11-30 33401, 2021

      • Shubh
        BB-268 , is it fixed ?
      • 2021-11-30 33402, 2021

      • BrainzBot
        BB-268: Can't set Author of EditionGroup https://tickets.metabrainz.org/browse/BB-268
      • 2021-11-30 33454, 2021

      • monkey
        Not yet, no
      • 2021-11-30 33452, 2021

      • Shubh
        Oh
      • 2021-11-30 33447, 2021

      • monkey
        Yes, there's another Work In Progress™ to add Author Credits: https://github.com/bookbrainz/bookbrainz-site/pul…
      • 2021-11-30 33413, 2021

      • monkey
        A bit complex to explain but MusicBrainz has a good explanation of how it works: https://musicbrainz.org/doc/Artist_Credits
      • 2021-11-30 33414, 2021

      • monkey
        ("Artist" in MusicBrainz = "Author" in BookBrainz)
      • 2021-11-30 33449, 2021

      • CatQuest
        can we get author credits up on beta soon?
      • 2021-11-30 33454, 2021

      • agatzk joined the channel
      • 2021-11-30 33424, 2021

      • monkey
        As soon as I find time to finish implementing the feature…
      • 2021-11-30 33450, 2021

      • Shubh has quit
      • 2021-11-30 33407, 2021

      • CatQuest
        :O
      • 2021-11-30 33412, 2021

      • CatQuest
        in january maybe?
      • 2021-11-30 33440, 2021

      • agatzk has quit
      • 2021-11-30 33422, 2021

      • agatzk joined the channel