codenvy / redhat

1 stars 2 forks source link

REDHAT-39: Change guide model to add ability handle few paragraphs with text and action. #41

Closed AndrienkoAleksandr closed 7 years ago

AndrienkoAleksandr commented 7 years ago

What issues does this PR fix or reference? https://github.com/codenvy/redhat/issues/39

Changed model:

{
  "title": "Guide title",
  "sections": [
    {
      "title": "Section #1 :: Simple",
      "paragraphs": [
        {
          "text": "This paragraph contains no action but some text"
        },
        {
          "text": "This paragraph contains no action but some text too"
        }
      ]
    },
    {
      "title": "Section #2 :: Describes how to expand a path in the project explorer",
      "paragraphs": [
        {
          "text": "To open a path the `expand-path` action is used. It requires the mandator `path` parameter containing relative to the project the path to open",
          "action": {
            "label": "Expand path",
            "actionId": "expand-path",
            "parameters": {
              "path": "src/main/java/org/jboss/as/quickstarts/kitchensink/service/MemberRegistration.java"
            }
          }
        }
      ]
    },
    {
      "title": "Section #3 :: Describes how to open a file and run command",
      "paragraphs": [
        {
            "text": "<h4>Open File</h4>"
        },
        {
          "text": "To open a file the `open-file` action is used. It requires the mandatory `file` parameter containing relative to the project the file path to open . Also the auxiliary `line` parameter contains the line number to scroll when file is opened.",
          "action": {
            "label": "Open file",
            "actionId": "open-file",
            "parameters": {
              "file": "src/main/java/org/jboss/as/quickstarts/kitchensink/service/MemberRegistration.java",
              "line": 40
            }
          }
        },
        {
          "text": "<h4>Run command</h4>"  
        },
        {
          "text": "To run a command the `run-command` action is used. It requires the mandatory `name` parameter containing the name of the existed command to run.",
          "action": {
              "label": "Run command",
              "actionId": "run-command",
              "parameters": {
                "name": "KitchenSink2: Build"
              }
          }
          },
          {
          "action": {
              "label": "Run command",
              "actionId": "run-command",
              "parameters": {
                "name": "KitchenSink2: Build"
              }
          }
          }
      ]
    }
  ]
}

ScreenShot: guide

Signed-off-by: Aleksandr Andriienko oandriie@redhat.com

AndrienkoAleksandr commented 7 years ago

One more example https://gist.github.com/AndrienkoAleksandr/f04cf9a9a17ac90a512b582697cdce82

tolusha commented 7 years ago

@AndrienkoAleksandr Attach a new screenshot pls

AndrienkoAleksandr commented 7 years ago

@tolusha done.