Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-88944

Implement PUT for structured content with the right logic

    Details

    • Type: Story
    • Status: Closed
    • Priority: Minor
    • Resolution: Completed
    • Affects Version/s: None
    • Fix Version/s: Master
    • Component/s: Headless CMS
    • Labels:
      None
    • Story Points:
      5
    • Sprint:
      HEX #8, HEX #9

      Description

      Currently, the PUT does a PATCH operation, so it is not possible to remove properties already set.

      • Implement the logic for PUT as an overriding mechanism:
        -If the language provided already exists, it overrides the information
      • If the language provided does not exist yet as a translation, it will create the new language translation

      Acceptance criteria

      Given A Press release with the fields:

      • Headline (text)
      • Executive summary (text area)
      • Cover image (image)
      • Press brochure (docs&media)
      • Article body (text area)

      And I create a Press release with the values:

      • Headline = “New low-cost car insurance launched”
      • Executive summary = “Insurance4Every1 has launched a new type of car insurance targeting budget-minded customers with customized coverage”
      • Cover image = “test.jpg”
      • Press brochure = “press.pdf”
      • Article body = “Insurance4Every1 has launched a new type of car insurance targeting budget-minded customers with customized coverage”

      When I make a PUT request with the following content:

      • Headline = “New low-cost car insurance launched”
      • Executive summary = “Insurance4Every1 has launched a new type of car insurance targeting budget-minded customers with customized coverage”
      • Press brochure = “press.pdf”
      • Article body = “Insurance4Every1 has launched a new type of car insurance targeting budget-minded customers with customized coverage”

      Then the press release is updated removing the link to the cover image.

      Given A Press release with the fields:

      • Headline (text)
      • Executive summary (text area)
      • Cover image (image)
      • Press brochure (docs&media)
      • Article body (text area)

      And I create a Press release in english being the default language with the values:

      • Headline = “New low-cost car insurance launched”
      • Executive summary = “Insurance4Every1 has launched a new type of car insurance targeting budget-minded customers with customized coverage”
      • Cover image = “test.jpg”
      • Press brochure = “press.pdf”
      • Article body = “Insurance4Every1 has launched a new type of car insurance targeting budget-minded customers with customized coverage”

      When I make a PUT request with the translation for spanish setting "Accept-Language" to "es-ES"

      Then the press release is updated adding the new translation if it doesn't exist before.

      *****Check with Daldi

      Given A Press release with the fields:

      • Headline (text)
      • Executive summary (text area)
      • Cover image (image)
      • Press brochure (docs&media)
      • Article body (text area)

      When I create a new Press release in spanish, being the default language english, with the values:

      • Headline = “Nueva póliza de seguro de coche de bajo coste ya disponible”
      • Executive summary = “Insurance4Every1 acaba de lanzar un nuevo tipo de seguro de automóvil con el objetivo de atraer a los usuarios que buscan el seguro más barato con coberturas personalizables”
      • Cover image = “test.jpg”
      • Press brochure = “press.pdf”
      • Article body = “Insurance4Every1 acaba de lanzar un nuevo tipo de seguro de automóvil con el objetivo de atraer a los usuarios que buscan el seguro más barato con coberturas personalizables”

      Then the request is answered with 422 explaining that in order to create a structured content, it needs to be done with the default language

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Packages

                  Version Package
                  Master