Problem:
My includes line is very long, as I have many nested relationships. I do not have a good overview of the includes.

Suggestion:
Would me more conviniend to have a textarea with multiple lines instead of small textbox.

Possible regression:
We should create an update script to migrate old configuration from comma-separation to the multilined separation.

My includes example:

uid,
field_channel,
field_copyright,
field_source,
field_image,
field_image.field_copyright,
field_image.field_image,
field_paragraphs,
field_paragraphs.field_image,
field_paragraphs.field_image.field_image,
field_paragraphs.field_image.field_copyright,
field_paragraphs.field_video,
field_paragraphs.field_video.field_copyright,
field_paragraphs.field_social_embed,
field_paragraphs.field_slides,
field_paragraphs.field_slides.field_image,
field_paragraphs.field_slides.field_image.field_image,
field_paragraphs.field_slides.field_image.field_copyright,
field_paragraphs.field_slides.field_video,
field_paragraphs.field_slides.field_video.field_copyright,
field_paragraphs.field_slides.field_social_embed,
field_channel.parent

Comments

a.milkovsky created an issue. See original summary.

a.milkovsky’s picture

Status: Active » Needs review
StatusFileSize
new1.57 KB

A quick prototype how it can look like. I have changed textfield to textarea and allowed to have new lines in the textarea.

a.milkovsky’s picture

StatusFileSize
new13.92 KB

Now the form looks like this:
New Defaults

mkolar’s picture

@a.milkovsky Since there are newlines what about throwing out those commas?

a.milkovsky’s picture

StatusFileSize
new1.91 KB

New patch with exploding based on newlines.
I do not provide update path since the module does not have any release so far.

a.milkovsky’s picture

StatusFileSize
new3.54 KB

I have changed default_includes to be a sequence.

a.milkovsky’s picture

StatusFileSize
new3.64 KB

Fixed usage of implode.

a.milkovsky’s picture

StatusFileSize
new3.68 KB

Sorry for spaming here :) Another improvement: remove empty values.

krina.addweb’s picture

@a.milkovsky, Like a good change, as far as I reviewed & Checked it, Thanks for providing the solution & changes.
The only query I've is, do we have a need to validate user when they add comma separator? Because I think it should remove the comma separator & move includes in the new line, When I add it. What say?
PFA screenshots.

krina.addweb’s picture

StatusFileSize
new29.15 KB
new78.15 KB
a.milkovsky’s picture

StatusFileSize
new11.77 KB

@krina.addweb, you do not need commas anymore. This is how the form should look like:
New screenshot after patch. Multiline includes.

krina.addweb’s picture

@a.milkovsky, Thanks for the quick response to clarify my query, I moved it to RTBC as it works well for me.

krina.addweb’s picture

Status: Needs review » Reviewed & tested by the community
mkolar’s picture

Status: Reviewed & tested by the community » Needs work

Thanks. This needs update hook to change active configuration in order to commit this into module. Feel free to do it or I'll do it later.. some info is here how to do it https://www.drupal.org/docs/8/api/update-api/updating-configuration-in-d...

siva01’s picture

StatusFileSize
new4.93 KB

Here is database update patch based on jsonapi_defaults-2921800-8.patch

a.milkovsky’s picture

Status: Needs work » Needs review

needs review

siva01’s picture

StatusFileSize
new4.93 KB

Typo fix

mkolar’s picture

StatusFileSize
new4.94 KB

Some adjustments...

  • siva01 authored 2ffc48e on 8.x-1.x
    Issue #2921800 by a.milkovsky, siva01, mkolar, krina.addweb: Allow users...
mkolar’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.