A new component separate from the relationship editor, where the user can search for entities to add to the series (and modify the positioning and numbering) straight on the page.
2021-07-26 20754, 2021
monkey
In the background, it will still work with relationships, so there's some extra logic that will be needed to concatenate the relationships from that component and the ones from the relationship editor, but that shouldn't be tricky.
2021-07-26 20758, 2021
monkey
What are your thoughts?
2021-07-26 20755, 2021
akashgp09
this looks great.
2021-07-26 20739, 2021
akashgp09
I have some questions.
2021-07-26 20714, 2021
akashgp09
The series items as well as the relationships will be stored in the relationship table right ?
2021-07-26 20729, 2021
monkey
Correct
2021-07-26 20750, 2021
akashgp09
So when we fetch the results from the relationship table
2021-07-26 20715, 2021
monkey
We're using the relationships as they are now to convey all this information, we're just presenting it certain relationships ("x part of series") in a separate component
2021-07-26 20740, 2021
akashgp09
on what parameter we can differentiate the series items and other relationship ?
2021-07-26 20746, 2021
monkey
Indeed we'll have to filter which relationships we send to the new component and which ones we send to the relationship editor
2021-07-26 20747, 2021
akashgp09
> We're using the relationships as they are now to convey all this information, we're just presenting it certain relationships ("x part of series") in a separate component
2021-07-26 20751, 2021
akashgp09
ooh got it
2021-07-26 20719, 2021
monkey
We already do this for other relationship, for example presenting the Works of an Author in a separate table
This is currently used for displaying only, so it's a bit simpler. For example there's no Redux state to modify
2021-07-26 20728, 2021
monkey
But I think this is all achievable. It will move some of the complexity that was added to the relationships section (for example the drag-and-drop sorting) to another component, which is probably a good thing.
2021-07-26 20756, 2021
monkey
And as far as UI goes, I think this is easier to understand and interact with compared to using the rel editor.
2021-07-26 20715, 2021
monkey
Let me know if you think this is achievable within our timeframe, if we should keep it for very last (after all we do have a working feature in the rel editor), or even just make it a ticket for the future
2021-07-26 20723, 2021
akashgp09
> For example there's no Redux state to modify
2021-07-26 20757, 2021
akashgp09
i didn't understand this. can you elaborate a bit more
2021-07-26 20735, 2021
monkey
Right. The code example I sent only deals with displaying the entity, and not with the editing part
2021-07-26 20754, 2021
monkey
In the editing part it's currently all just done with the relationship editor.
2021-07-26 20724, 2021
akashgp09
yea but incase of series that would be different because we will not be using the rel editor any more
2021-07-26 20726, 2021
monkey
In these modifications I'm suggesting for the editing page, we'll need to have some logic somewhere to separate the relationships between the rel editor component and this new "series parts" component.
2021-07-26 20715, 2021
monkey
I think we might want to also keep the relationship editor, as there may be other types of relationships for series other than "x is part of series" in the future
2021-07-26 20754, 2021
monkey
So for example when editing an existing series, we'll get an array of relationships. We select the "x is part of series" relationships and use that in the "series parts" component's redux state, and the rest of the relationships are used in the relationship editor's redux state.
2021-07-26 20740, 2021
monkey
At the end when saving the changes, we reassemble these two separate redux states into a relationship array.
2021-07-26 20708, 2021
monkey
Does that make sense?
2021-07-26 20719, 2021
akashgp09
Yes now it's very clear
2021-07-26 20755, 2021
akashgp09
I can achieve this within our timeframe.
2021-07-26 20724, 2021
monkey
The reassembling part will be done in the `transformNewForm` functions in src/server/routes/entity/series.js
2021-07-26 20705, 2021
monkey
And separating the relationships between the rel editor and the new component should be in `seriesToFormState` in the same file
2021-07-26 20727, 2021
monkey
We'll have the original `relationshipSection` and a new redux state section for the new component. The relationship sorting based on `seriesOrderingType.label` can then be done on the new component relationships only.
2021-07-26 20749, 2021
akashgp09
yeah sounds great 👍
2021-07-26 20705, 2021
monkey
Great :) Don't hesitate if you need a hand !
2021-07-26 20717, 2021
akashgp09
should we revert the relationship editor to it's previous state ?
2021-07-26 20723, 2021
monkey
I'll get a cleaned up example fo the html markup I used for the mockup
2021-07-26 20726, 2021
monkey
I need to look closer at the relationship editor. I think some part should be reverted (i.e drag n' drop ordering), but some parts will be useful in the future (i.e. the ability to show a relationship's attributes - we were showing the 'position' attribute which we probably won't need to anymore, but we'll want to show the date attributes there in the future)