Azure / LogicAppsUX

https://learn.microsoft.com/azure/logic-apps
MIT License
77 stars 84 forks source link

Styling Does Not Apply to Dynamic Contents in HTLM Editor in V3 #5194

Open tbabatund opened 4 months ago

tbabatund commented 4 months ago

Describe the Bug with repro steps

  1. Set up flow as below

image

  1. In the Send an Email action, add some text to body of email and make sure to include some arbitrary dynamic content

image

  1. Highlight the al the text in the email body, including dynamic content, and apply some formatting -- color, bold or font.

  2. Save and run flow, what you will get is styling only applied to static content and not the dynamic part of the text like below where color only applied to static text.

image

What type of Logic App Is this happening in?

Consumption (Portal)

Are you using new designer or old designer

New Designer

Did you refer to the TSG before filing this issue? https://aka.ms/lauxtsg

Yes

Workflow JSON

{
  "definition": {
    "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
    "contentVersion": "1.0.0.0",
    "staticResults": {
      "Send_an_email_(V2)0": {
        "status": "Succeeded"
      }
    },
    "triggers": {
      "When_an_email_is_flagged_(V3)": {
        "type": "ApiConnectionNotification",
        "inputs": {
          "host": {
            "connection": {
              "name": "@parameters('$connections')['office365-1']['connectionId']"
            }
          },
          "fetch": {
            "pathTemplate": {
              "template": "/v3/Mail/OnFlaggedEmail"
            },
            "method": "get",
            "queries": {
              "to": "tbabatunde@microsoft.com",
              "importance": "Any",
              "fetchOnlyWithAttachment": false,
              "includeAttachments": false,
              "folderPath": "Inbox"
            }
          },
          "subscribe": {
            "body": {
              "NotificationUrl": "@listCallbackUrl()"
            },
            "pathTemplate": {
              "template": "/GraphFlaggedMailSubscriptionPoke/$subscriptions"
            },
            "method": "post",
            "queries": {
              "importance": "Any",
              "fetchOnlyWithAttachment": false,
              "folderPath": "Inbox"
            }
          }
        },
        "splitOn": "@triggerBody()?['value']"
      }
    },
    "actions": {
      "Send_an_email_(V2)": {
        "type": "ApiConnection",
        "inputs": {
          "host": {
            "connection": {
              "name": "@parameters('$connections')['office365-1']['connectionId']"
            }
          },
          "method": "post",
          "body": {
            "To": "tbabatunde@microsoft.com",
            "Subject": "Hello",
            "Body": "<p>Apply styling to @{triggerBody()?['from']}</p>",
            "Importance": "Normal"
          },
          "path": "/v2/Mail"
        },
        "runAfter": {}
      }
    },
    "outputs": {},
    "parameters": {
      "$connections": {
        "type": "Object",
        "defaultValue": {}
      }
    }
  },
  "parameters": {
    "$connections": {
      "value": {
        "office365-1": {
          "id": "/subscriptions/e1f4ebc5-f80b-40c0-9027-93c34668bf5d/providers/Microsoft.Web/locations/centralus/managedApis/office365",
          "connectionId": "/subscriptions/e1f4ebc5-f80b-40c0-9027-93c34668bf5d/resourceGroups/designer/providers/Microsoft.Web/connections/office365-4",
          "connectionName": "office365-4"
        }
      }
    }
  }
}

Screenshots or Videos

No response

Browser

Chrome

Additional context

On debugging, it is clear that selection is correct but styling is not implemented for dynamic content.

image

kisubedi commented 2 months ago

@Eric-B-Wu when is this expected to happen given Legacy cut label?

Eric-B-Wu commented 2 months ago

I'll take a look today and see the complexity of the item. If its a simple fix I'll go ahead and implement, if not this may be part of our html editor rewrite

kisubedi commented 2 months ago

@Eric-B-Wu - this might not be a simple fix. when is the html editor rewrite supposed to deadlined ?

Eric-B-Wu commented 2 months ago

yeah I took a deep look of trying to implement it; the main issue is that currently there's too much custom logic involving decoding, encoding, span removal, etc. which requires to add more custom logic to each of those sections specifically for styling. The whole serializing section of HTML editor is too messy and instead of spending extra time on more logic that will be removed, I'm deciding to push this to html rewrite. We're likely schedule to be mid/end of semester for this