cylc-ui icon indicating copy to clipboard operation
cylc-ui copied to clipboard

Running mutation on 2 workflows displays error

Open MetRonnie opened this issue 7 months ago • 0 comments

In a mutation form, adding multiple workflows to run the mutation on results in an error snackbar.

image

This is because the response we get from the UIServer is in an odd format:

{
  "data": {
    "trigger": {
      "result": [
        {
          "trigger": {
            "result": [
              {
                "id": "~user/thing/run1",
                "response": [
                  true,
                  "d78b43de-7172-4135-afe6-346edbb02cec"
                ]
              }
            ],
            "__typename": "Trigger"
          }
        },
        {
          "trigger": {
            "result": [
              {
                "id": "~user/thing/run2",
                "response": [
                  true,
                  "dba6b04d-a618-4b40-89ca-21f96721f214"
                ]
              }
            ],
            "__typename": "Trigger"
          }
        }
      ],
      "__typename": "Trigger"
    }
  }
}

(I think https://github.com/cylc/cylc-uiserver/pull/290 deals with this, but will need to revisit it)

And this is not what the API-on-the-fly code expects

https://github.com/cylc/cylc-ui/blob/3d64d289457d0403258a9e0ae1dd84ffdf513b5b/src/utils/aotf.js#L954-L962

MetRonnie avatar Jul 03 '24 10:07 MetRonnie