dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
860 stars 467 forks source link

EC: Allow users to write code when create a file #23603

Closed fmontes closed 1 year ago

fmontes commented 1 year ago

Is your feature request related to a problem? Please describe.

As a user, I want to be able to create code file easily.

VTL files are widely used in dotCMS and the only way to create one is created one with a code editor and then upload it.

Describe the solution you'd like

  1. When create a file, add a new code field, so users can write code and save the file.

  2. Keep the functionality of the file input field, so the user can upload files from the file system.

Design

Use a code editor for the code. We'll have another issue for the final UI.

Acceptance criteria

fmontes commented 1 year ago

There is a part two of this to do the UI

fmontes commented 1 year ago

The part two of this is here: https://github.com/dotCMS/core/issues/24362

rjvelazco commented 1 year ago

Passed Internal QA

Docker Image: [dotcms/dotcms:master_4ea0b063]

Now we can create code files directly from dotCMS.

dsilvam commented 1 year ago

Reverting from 23.05: https://github.com/dotCMS/core/pull/24576

bryanboza commented 1 year ago

Reading the comments, I think we rollback this change, then we need to test something here or we can close this card? If we don't need to test anything please add the: "QA not needed" label

@wezell @fmontes

fmontes commented 1 year ago

I'm sorry this should not be in QA, the was rollbacked a while ago.

fmontes commented 1 year ago

@jdotcms Can you provide the endpoint to use for the binary or text?

jdotcms commented 1 year ago
curl --location --request PUT 'http://localhost:8080/api/v1/workflow/actions/default/fire/PUBLISH' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YWRtaW5AZG90Y21zLmNvbTphZG1pbg==' \
--header 'Cookie: access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI0NjE3NmUxMi02YzJkLTQwNmMtYjcyNC00ZGZhYzQ1NjI1MTciLCJ4bW9kIjoxNjg3OTAwOTU4NzMxLCJzdWIiOiJkb3RjbXMub3JnLjEiLCJpYXQiOjE2ODc5MDA5NTgsImlzcyI6IjU4N2ZhMTAwMWUiLCJleHAiOjE2ODc5ODczNTh9.WDE1o3harTOtNtBWdWNkFUPVwY4P9G2u9pd55nPJlW0' \
--data '{
    "contentlet": {
        "hostFolder":"default",
        "title": "greatings.txt",
        "fileName": "greatings.txt",
        "fileAsset": {
            "fileName": "greatings.txt",
           "content": "Hello dotCMS"
         },
        "contentType": "FileAsset"
    }
}'
fmontes commented 1 year ago

Closing in favor of

https://github.com/dotCMS/core/issues/26219 https://github.com/dotCMS/core/issues/26048