@livechat/platform-workflows 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -542,6 +542,55 @@ var WORKFLOWS_TEST_SELECTORS = {
542
542
  panels: {
543
543
  element: {
544
544
  wrapper: "element-wrapper"
545
+ },
546
+ details: {
547
+ executions: {
548
+ list: {
549
+ row: "execution-row",
550
+ status: "execution-status"
551
+ }
552
+ },
553
+ panel: {
554
+ historyTab: "history-tab"
555
+ },
556
+ info: {
557
+ dateCreated: "date-created",
558
+ dateUpdated: "date-updated",
559
+ completedCycles: "completed-cycles",
560
+ failedCycles: "failed-cycles"
561
+ }
562
+ }
563
+ }
564
+ },
565
+ list: {
566
+ grid: {
567
+ table: {
568
+ wrapper: "workflows-table",
569
+ body: "workflows-table-body",
570
+ menuTrigger: "action-menu-trigger",
571
+ activateSwitch: "activate-switch",
572
+ infoButton: "info-btn",
573
+ workflowItem: (id) => `workflow-item-${id}`
574
+ }
575
+ },
576
+ view: {
577
+ createButton: "create-workflow-btn",
578
+ emptyInfo: "empty-info"
579
+ },
580
+ modals: {
581
+ create: {
582
+ wrapper: "create-workflow-modal"
583
+ },
584
+ previewTemplate: {
585
+ wrapper: "template-preview-modal",
586
+ useButton: "use-template-btn"
587
+ }
588
+ },
589
+ home: {
590
+ cards: {
591
+ template: {
592
+ wrapper: "template-card"
593
+ }
545
594
  }
546
595
  }
547
596
  }
@@ -9415,7 +9464,7 @@ var slackTaskTemplates = () => ({
9415
9464
  },
9416
9465
  headers: {
9417
9466
  Accept: "application/json",
9418
- // eslint-disable-next-line no-template-curly-in-string
9467
+ // eslint-disable-next-line no-template-curly-in-string -- on purpose
9419
9468
  "x-cred-access-token": "${workflow.credentials.slack.access_token}"
9420
9469
  }
9421
9470
  })
@@ -9436,7 +9485,7 @@ var slackTaskTemplates = () => ({
9436
9485
  },
9437
9486
  headers: {
9438
9487
  Accept: "application/json",
9439
- // eslint-disable-next-line no-template-curly-in-string
9488
+ // eslint-disable-next-line no-template-curly-in-string -- on purpose
9440
9489
  "x-cred-access-token": "${workflow.credentials.slack.access_token}"
9441
9490
  }
9442
9491
  })
@@ -9468,23 +9517,24 @@ var slackTriggerConfigs = () => {
9468
9517
  },
9469
9518
  output: {
9470
9519
  type: "object",
9471
- required: ["text", "sub_type", "channel_id"],
9472
9520
  properties: {
9473
- text: {
9474
- type: "string",
9475
- title: "Text Message"
9476
- },
9477
- sub_type: {
9478
- type: "string",
9479
- title: "Sub type of the event"
9480
- },
9481
- channel_id: {
9482
- type: "string",
9483
- title: "Channel ID"
9484
- },
9485
- username: {
9486
- type: "string",
9487
- title: "Name of the user"
9521
+ body: {
9522
+ type: "object",
9523
+ required: ["text", "channel"],
9524
+ properties: {
9525
+ text: {
9526
+ type: "string",
9527
+ title: "Text Message"
9528
+ },
9529
+ channel: {
9530
+ type: "string",
9531
+ title: "Channel ID"
9532
+ },
9533
+ user: {
9534
+ type: "string",
9535
+ title: "ID of the user"
9536
+ }
9537
+ }
9488
9538
  }
9489
9539
  }
9490
9540
  }
@@ -9513,23 +9563,24 @@ var slackTriggerConfigs = () => {
9513
9563
  },
9514
9564
  output: {
9515
9565
  type: "object",
9516
- required: ["text", "sub_type", "channel_id"],
9517
9566
  properties: {
9518
- text: {
9519
- type: "string",
9520
- title: "Text Message"
9521
- },
9522
- sub_type: {
9523
- type: "string",
9524
- title: "Sub type of the event"
9525
- },
9526
- channel_id: {
9527
- type: "string",
9528
- title: "Channel ID"
9529
- },
9530
- username: {
9531
- type: "string",
9532
- title: "Name of the user"
9567
+ body: {
9568
+ type: "object",
9569
+ required: ["text", "channel"],
9570
+ properties: {
9571
+ text: {
9572
+ type: "string",
9573
+ title: "Text Message"
9574
+ },
9575
+ channel: {
9576
+ type: "string",
9577
+ title: "Channel ID"
9578
+ },
9579
+ user: {
9580
+ type: "string",
9581
+ title: "ID of the user"
9582
+ }
9583
+ }
9533
9584
  }
9534
9585
  }
9535
9586
  }
@@ -9547,7 +9598,7 @@ var slackTriggerTemplates = () => ({
9547
9598
  channelId: null
9548
9599
  },
9549
9600
  headers: {
9550
- // eslint-disable-next-line no-template-curly-in-string
9601
+ // eslint-disable-next-line no-template-curly-in-string -- on purpose
9551
9602
  "x-adapter-slack-token": ["${workflow.credentials.slack.access_token}"]
9552
9603
  }
9553
9604
  }
@@ -9561,7 +9612,7 @@ var slackTriggerTemplates = () => ({
9561
9612
  userId: null
9562
9613
  },
9563
9614
  headers: {
9564
- // eslint-disable-next-line no-template-curly-in-string
9615
+ // eslint-disable-next-line no-template-curly-in-string -- on purpose
9565
9616
  "x-adapter-slack-token": ["${workflow.credentials.slack.access_token}"]
9566
9617
  }
9567
9618
  }
@@ -12984,6 +13035,9 @@ var logAmplitudeEvent = (name, payload, user) => {
12984
13035
  };
12985
13036
  var logSprigEvent = (name, email, payload) => {
12986
13037
  const sprig = window.Sprig;
13038
+ if (!sprig) {
13039
+ return;
13040
+ }
12987
13041
  sprig("identifyAndTrack", {
12988
13042
  eventName: name,
12989
13043
  userId: email,
@@ -15031,6 +15085,7 @@ function WorkflowCreatorProviderBase({
15031
15085
  }
15032
15086
  replaceWorkflowId(workflowId);
15033
15087
  }
15088
+ } catch (e) {
15034
15089
  } finally {
15035
15090
  setAction("isSaving", false);
15036
15091
  }
@@ -15065,6 +15120,7 @@ function WorkflowCreatorProviderBase({
15065
15120
  notifications.addSuccessToast(
15066
15121
  `Workflow has been ${state2.workflow.active ? "deactivated" : "activated"}`
15067
15122
  );
15123
+ } catch (e) {
15068
15124
  } finally {
15069
15125
  setAction("isActivating", false);
15070
15126
  }
@@ -15084,6 +15140,7 @@ function WorkflowCreatorProviderBase({
15084
15140
  }
15085
15141
  navigate("/list");
15086
15142
  notifications.addSuccessToast("Workflow has been removed successfully");
15143
+ } catch (e) {
15087
15144
  } finally {
15088
15145
  setAction("isRemoving", false);
15089
15146
  }
@@ -15114,6 +15171,7 @@ function WorkflowCreatorProviderBase({
15114
15171
  notifications.addSuccessToast(
15115
15172
  "Workflow draft has been created successfully"
15116
15173
  );
15174
+ } catch (e) {
15117
15175
  } finally {
15118
15176
  setAction("isCreating", false);
15119
15177
  }
@@ -15158,6 +15216,7 @@ function WorkflowCreatorProviderBase({
15158
15216
  notifications.addSuccessToast(
15159
15217
  "Workflow draft has been published successfully"
15160
15218
  );
15219
+ } catch (e) {
15161
15220
  } finally {
15162
15221
  setAction("isPublishing", false);
15163
15222
  }
@@ -15194,6 +15253,7 @@ function WorkflowCreatorProviderBase({
15194
15253
  notifications.addSuccessToast(
15195
15254
  "Workflow draft has been discarded successfully"
15196
15255
  );
15256
+ } catch (e) {
15197
15257
  } finally {
15198
15258
  setAction("isDiscarding", false);
15199
15259
  }
@@ -23162,25 +23222,38 @@ function WorkflowExecutionList({
23162
23222
  /* @__PURE__ */ jsx4("th", { children: "End date" }),
23163
23223
  /* @__PURE__ */ jsx4("th", { children: "Completion" })
23164
23224
  ] }) }),
23165
- /* @__PURE__ */ jsx4("tbody", { children: ((_a = workflowExecutions.data) == null ? void 0 : _a.length) ? workflowExecutions.data.map((execution) => /* @__PURE__ */ jsxs2("tr", { children: [
23166
- /* @__PURE__ */ jsx4("td", { children: (0, import_developer_studio_ui_react31.formatUSADate)(execution.started_at) }),
23167
- /* @__PURE__ */ jsx4("td", { children: (0, import_developer_studio_ui_react31.formatUSADate)(execution.ended_at) }),
23168
- /* @__PURE__ */ jsx4("td", { children: /* @__PURE__ */ jsx4(
23169
- import_design_system_react_components65.Tag,
23170
- {
23171
- kind: execution.status === import_developer_studio_api27.WorkflowExecutionStatus.Completed ? "success" : "error",
23172
- leftNode: /* @__PURE__ */ jsx4(
23173
- import_design_system_react_components65.Icon,
23225
+ /* @__PURE__ */ jsx4("tbody", { children: ((_a = workflowExecutions.data) == null ? void 0 : _a.length) ? workflowExecutions.data.map((execution) => /* @__PURE__ */ jsxs2(
23226
+ "tr",
23227
+ {
23228
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.panels.details.executions.list.row,
23229
+ children: [
23230
+ /* @__PURE__ */ jsx4("td", { children: (0, import_developer_studio_ui_react31.formatUSADate)(execution.started_at) }),
23231
+ /* @__PURE__ */ jsx4("td", { children: (0, import_developer_studio_ui_react31.formatUSADate)(execution.ended_at) }),
23232
+ /* @__PURE__ */ jsx4(
23233
+ "td",
23174
23234
  {
23175
- size: "small",
23176
- source: execution.status === import_developer_studio_api27.WorkflowExecutionStatus.Completed ? import_design_system_icons28.CheckCircle : import_design_system_icons28.CloseCircle
23235
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.panels.details.executions.list.status,
23236
+ children: /* @__PURE__ */ jsx4(
23237
+ import_design_system_react_components65.Tag,
23238
+ {
23239
+ kind: execution.status === import_developer_studio_api27.WorkflowExecutionStatus.Completed ? "success" : "error",
23240
+ leftNode: /* @__PURE__ */ jsx4(
23241
+ import_design_system_react_components65.Icon,
23242
+ {
23243
+ size: "small",
23244
+ source: execution.status === import_developer_studio_api27.WorkflowExecutionStatus.Completed ? import_design_system_icons28.CheckCircle : import_design_system_icons28.CloseCircle
23245
+ }
23246
+ ),
23247
+ size: "small",
23248
+ children: execution.status
23249
+ }
23250
+ )
23177
23251
  }
23178
- ),
23179
- size: "small",
23180
- children: execution.status
23181
- }
23182
- ) })
23183
- ] }, execution.id)) : /* @__PURE__ */ jsx4("tr", { children: /* @__PURE__ */ jsx4("td", { align: "center", colSpan: 4, children: "No executions" }) }) })
23252
+ )
23253
+ ]
23254
+ },
23255
+ execution.id
23256
+ )) : /* @__PURE__ */ jsx4("tr", { children: /* @__PURE__ */ jsx4("td", { align: "center", colSpan: 4, children: "No executions" }) }) })
23184
23257
  ] }) });
23185
23258
  }
23186
23259
  var List_default = WorkflowExecutionList;
@@ -23217,11 +23290,27 @@ function WorkflowDetailsInfo({
23217
23290
  return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react32.Column, { gap: 8, setColumnPadding: "0 2rem 0", children: [
23218
23291
  /* @__PURE__ */ jsxs2("div", { children: [
23219
23292
  /* @__PURE__ */ jsx4(Label, { children: "Date created" }),
23220
- /* @__PURE__ */ jsx4(import_design_system_react_components66.Text, { as: "div", bold: true, children: (0, import_developer_studio_ui_react32.formatUSADate)(workflow.data.created_at) })
23293
+ /* @__PURE__ */ jsx4(
23294
+ import_design_system_react_components66.Text,
23295
+ {
23296
+ as: "div",
23297
+ bold: true,
23298
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.panels.details.info.dateCreated,
23299
+ children: (0, import_developer_studio_ui_react32.formatUSADate)(workflow.data.created_at)
23300
+ }
23301
+ )
23221
23302
  ] }),
23222
23303
  /* @__PURE__ */ jsxs2("div", { children: [
23223
23304
  /* @__PURE__ */ jsx4(Label, { children: "Last modified" }),
23224
- /* @__PURE__ */ jsx4(import_design_system_react_components66.Text, { as: "div", bold: true, children: (0, import_developer_studio_ui_react32.formatUSADate)(workflow.data.updated_at || workflow.data.created_at) })
23305
+ /* @__PURE__ */ jsx4(
23306
+ import_design_system_react_components66.Text,
23307
+ {
23308
+ as: "div",
23309
+ bold: true,
23310
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.panels.details.info.dateUpdated,
23311
+ children: (0, import_developer_studio_ui_react32.formatUSADate)(workflow.data.updated_at || workflow.data.created_at)
23312
+ }
23313
+ )
23225
23314
  ] }),
23226
23315
  /* @__PURE__ */ jsxs2("div", { children: [
23227
23316
  /* @__PURE__ */ jsx4(Label, { children: "Created by" }),
@@ -23229,11 +23318,27 @@ function WorkflowDetailsInfo({
23229
23318
  ] }),
23230
23319
  /* @__PURE__ */ jsxs2("div", { children: [
23231
23320
  /* @__PURE__ */ jsx4(Label, { children: "Completed cycles" }),
23232
- /* @__PURE__ */ jsx4(import_design_system_react_components66.Text, { as: "div", bold: true, children: completedCycles })
23321
+ /* @__PURE__ */ jsx4(
23322
+ import_design_system_react_components66.Text,
23323
+ {
23324
+ as: "div",
23325
+ bold: true,
23326
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.panels.details.info.completedCycles,
23327
+ children: completedCycles
23328
+ }
23329
+ )
23233
23330
  ] }),
23234
23331
  /* @__PURE__ */ jsxs2("div", { children: [
23235
23332
  /* @__PURE__ */ jsx4(Label, { children: "Failed cycles" }),
23236
- /* @__PURE__ */ jsx4(import_design_system_react_components66.Text, { as: "div", bold: true, children: failedCycles })
23333
+ /* @__PURE__ */ jsx4(
23334
+ import_design_system_react_components66.Text,
23335
+ {
23336
+ as: "div",
23337
+ bold: true,
23338
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.panels.details.info.failedCycles,
23339
+ children: failedCycles
23340
+ }
23341
+ )
23237
23342
  ] }),
23238
23343
  /* @__PURE__ */ jsxs2("div", { children: [
23239
23344
  /* @__PURE__ */ jsx4(Label, { children: "Tasks" }),
@@ -23338,6 +23443,7 @@ function WorkflowDetailsPanel({
23338
23443
  /* @__PURE__ */ jsx4(
23339
23444
  import_design_system_react_components67.Tab,
23340
23445
  {
23446
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.panels.details.panel.historyTab,
23341
23447
  isSelected: tab === "executions",
23342
23448
  onClick: () => {
23343
23449
  navigate("../executions", { replace: true, relative: "route" });
@@ -24305,6 +24411,7 @@ function WorkflowTemplatePreviewModal({
24305
24411
  return /* @__PURE__ */ jsx4(
24306
24412
  import_design_system_react_components73.Modal,
24307
24413
  {
24414
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.list.modals.previewTemplate.wrapper,
24308
24415
  footer: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react39.Row, { flexEnd: true, gap: `var(${import_design_system_react_components73.SpacingToken.Spacing3})`, notPadded: true, children: [
24309
24416
  /* @__PURE__ */ jsx4(
24310
24417
  import_design_system_react_components73.Button,
@@ -24321,6 +24428,7 @@ function WorkflowTemplatePreviewModal({
24321
24428
  /* @__PURE__ */ jsx4(
24322
24429
  import_design_system_react_components73.Button,
24323
24430
  {
24431
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.list.modals.previewTemplate.useButton,
24324
24432
  disabled: isSaving,
24325
24433
  kind: "primary",
24326
24434
  loading: isSaving,
@@ -24636,6 +24744,7 @@ function WorkflowTemplateCard({
24636
24744
  import_developer_studio_ui_react43.Card,
24637
24745
  {
24638
24746
  border: true,
24747
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.list.home.cards.template.wrapper,
24639
24748
  height: "100%",
24640
24749
  marginLeft: false,
24641
24750
  noBackground: true,
@@ -24799,6 +24908,7 @@ function WorkflowCreateModal({ onClose }) {
24799
24908
  width: min(100% - 4rem, 60rem);
24800
24909
  overflow-y: auto;
24801
24910
  `,
24911
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.list.modals.create.wrapper,
24802
24912
  heading: /* @__PURE__ */ jsx4(import_design_system_react_components79.ModalHeader, { title: "Create a workflow" }),
24803
24913
  onClose: handleClose,
24804
24914
  children: /* @__PURE__ */ jsx4(Home_default, { basePath: "create/", isOnModal: true })
@@ -25006,20 +25116,30 @@ function WorkflowsTable({ workflowsQuery, state }) {
25006
25116
  },
25007
25117
  [navigate]
25008
25118
  );
25009
- return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react45.Table, { flowTable: true, loading: workflowsQuery.isLoading, children: [
25010
- /* @__PURE__ */ jsx4("thead", { children: /* @__PURE__ */ jsxs2("tr", { children: [
25011
- /* @__PURE__ */ jsx4("th", { children: "Name" }),
25012
- /* @__PURE__ */ jsx4("th", { children: "Tasks" }),
25013
- /* @__PURE__ */ jsx4("th", { children: "Status" }),
25014
- /* @__PURE__ */ jsx4("th", {}),
25015
- /* @__PURE__ */ jsx4("th", {})
25016
- ] }) }),
25017
- /* @__PURE__ */ jsx4("tbody", { children: workflowsQuery.isSuccess && filteredWorkflows.length > 0 ? filteredWorkflows.map((workflow) => {
25018
- var _a2, _b2, _c2, _d;
25019
- return /* @__PURE__ */ jsxs2(
25020
- "tr",
25021
- {
25022
- css: css`
25119
+ return /* @__PURE__ */ jsxs2(
25120
+ import_developer_studio_ui_react45.Table,
25121
+ {
25122
+ "data-testId": WORKFLOWS_TEST_SELECTORS.views.workflows.list.grid.table.wrapper,
25123
+ flowTable: true,
25124
+ loading: workflowsQuery.isLoading,
25125
+ children: [
25126
+ /* @__PURE__ */ jsx4("thead", { children: /* @__PURE__ */ jsxs2("tr", { children: [
25127
+ /* @__PURE__ */ jsx4("th", { children: "Name" }),
25128
+ /* @__PURE__ */ jsx4("th", { children: "Tasks" }),
25129
+ /* @__PURE__ */ jsx4("th", { children: "Status" }),
25130
+ /* @__PURE__ */ jsx4("th", {}),
25131
+ /* @__PURE__ */ jsx4("th", {})
25132
+ ] }) }),
25133
+ /* @__PURE__ */ jsx4(
25134
+ "tbody",
25135
+ {
25136
+ "data-testId": WORKFLOWS_TEST_SELECTORS.views.workflows.list.grid.table.body,
25137
+ children: workflowsQuery.isSuccess && filteredWorkflows.length > 0 ? filteredWorkflows.map((workflow) => {
25138
+ var _a2, _b2, _c2, _d;
25139
+ return /* @__PURE__ */ jsxs2(
25140
+ "tr",
25141
+ {
25142
+ css: css`
25023
25143
  transition: background 0.2s;
25024
25144
  cursor: pointer;
25025
25145
 
@@ -25027,131 +25147,141 @@ function WorkflowsTable({ workflowsQuery, state }) {
25027
25147
  background: var(${import_design_system_react_components82.DesignToken.SurfacePrimaryHover});
25028
25148
  }
25029
25149
  `,
25030
- onClick: () => {
25031
- handleSelect(workflow);
25032
- },
25033
- children: [
25034
- /* @__PURE__ */ jsx4("td", { width: "45%", children: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react45.Row, { gap: `var(${import_design_system_react_components82.SpacingToken.Spacing2})`, noWrap: true, notPadded: true, children: [
25035
- /* @__PURE__ */ jsx4(import_design_system_react_components82.Text, { noMargin: true, size: "sm", children: workflow.name }),
25036
- workflow.related_workflow_id ? /* @__PURE__ */ jsx4(
25037
- import_design_system_react_components82.Tag,
25038
- {
25039
- css: css`
25150
+ "data-testId": WORKFLOWS_TEST_SELECTORS.views.workflows.list.grid.table.workflowItem(
25151
+ workflow.id
25152
+ ),
25153
+ onClick: () => {
25154
+ handleSelect(workflow);
25155
+ },
25156
+ children: [
25157
+ /* @__PURE__ */ jsx4("td", { width: "45%", children: /* @__PURE__ */ jsxs2(import_developer_studio_ui_react45.Row, { gap: `var(${import_design_system_react_components82.SpacingToken.Spacing2})`, noWrap: true, notPadded: true, children: [
25158
+ /* @__PURE__ */ jsx4(import_design_system_react_components82.Text, { noMargin: true, size: "sm", children: workflow.name }),
25159
+ workflow.related_workflow_id ? /* @__PURE__ */ jsx4(
25160
+ import_design_system_react_components82.Tag,
25161
+ {
25162
+ css: css`
25040
25163
  color: #68afff;
25041
25164
  flex-shrink: 0;
25042
25165
  `,
25043
- kind: "info",
25044
- size: "small",
25045
- children: "Has Draft"
25046
- }
25047
- ) : null
25048
- ] }) }),
25049
- /* @__PURE__ */ jsx4("td", { width: "40%", children: /* @__PURE__ */ jsx4(import_developer_studio_ui_react45.Row, { gap: 12, notPadded: true, children: (_a2 = workflow.tags) == null ? void 0 : _a2.map((tag) => {
25050
- const revertIconColor = getWorkflowsEnv("isHeadless") && (tag.toLowerCase() === "openai" || tag.toLowerCase() === import_developer_studio_api32.IntegrationNames.BigCommerce.toLowerCase());
25051
- return /* @__PURE__ */ jsx4(
25052
- ProductIcon_default,
25053
- {
25054
- center: true,
25055
- height: 4,
25056
- product: tag.toLowerCase(),
25057
- revertColors: revertIconColor,
25058
- width: 4
25059
- },
25060
- tag
25061
- );
25062
- }) }) }),
25063
- /* @__PURE__ */ jsx4("td", { children: /* @__PURE__ */ jsx4(
25064
- import_design_system_react_components82.Tooltip,
25065
- {
25066
- triggerClassName: "tooltip-trigger",
25067
- triggerOnHover: true,
25068
- triggerRenderer: /* @__PURE__ */ jsx4(import_developer_studio_ui_react45.StopPropagation, { children: /* @__PURE__ */ jsx4(
25069
- import_design_system_react_components82.Switch,
25070
- {
25071
- css: css`
25166
+ kind: "info",
25167
+ size: "small",
25168
+ children: "Has Draft"
25169
+ }
25170
+ ) : null
25171
+ ] }) }),
25172
+ /* @__PURE__ */ jsx4("td", { width: "40%", children: /* @__PURE__ */ jsx4(import_developer_studio_ui_react45.Row, { gap: 12, notPadded: true, children: (_a2 = workflow.tags) == null ? void 0 : _a2.map((tag) => {
25173
+ const revertIconColor = getWorkflowsEnv("isHeadless") && (tag.toLowerCase() === "openai" || tag.toLowerCase() === import_developer_studio_api32.IntegrationNames.BigCommerce.toLowerCase());
25174
+ return /* @__PURE__ */ jsx4(
25175
+ ProductIcon_default,
25176
+ {
25177
+ center: true,
25178
+ height: 4,
25179
+ product: tag.toLowerCase(),
25180
+ revertColors: revertIconColor,
25181
+ width: 4
25182
+ },
25183
+ tag
25184
+ );
25185
+ }) }) }),
25186
+ /* @__PURE__ */ jsx4("td", { children: /* @__PURE__ */ jsx4(
25187
+ import_design_system_react_components82.Tooltip,
25188
+ {
25189
+ triggerClassName: "tooltip-trigger",
25190
+ triggerOnHover: true,
25191
+ triggerRenderer: /* @__PURE__ */ jsx4(import_developer_studio_ui_react45.StopPropagation, { children: /* @__PURE__ */ jsx4(
25192
+ import_design_system_react_components82.Switch,
25193
+ {
25194
+ css: css`
25072
25195
  vertical-align: bottom;
25073
25196
  `,
25074
- on: (_b2 = workflow.active) != null ? _b2 : false,
25075
- onChange: (e) => {
25076
- e.stopPropagation();
25077
- void handleActivate(workflow);
25078
- },
25079
- state: activateWorkflowAction.isLoading && ((_c2 = activateWorkflowAction.variables) == null ? void 0 : _c2.id) === workflow.id ? "loading" : workflow.draft ? "locked" : "regular"
25080
- }
25081
- ) }),
25082
- children: workflow.draft ? "Publish the draft to activate this workflow" : workflow.active ? "Deactivate flow" : "Activate flow"
25083
- }
25084
- ) }),
25085
- /* @__PURE__ */ jsx4("td", { children: !workflow.draft && /* @__PURE__ */ jsx4(
25086
- import_design_system_react_components82.Button,
25087
- {
25088
- icon: /* @__PURE__ */ jsx4(import_design_system_react_components82.Icon, { source: import_design_system_icons40.Info }),
25089
- kind: "plain",
25090
- onClick: (e) => {
25091
- e.stopPropagation();
25092
- handleShowDetails(workflow);
25093
- }
25094
- }
25095
- ) }),
25096
- /* @__PURE__ */ jsx4("td", { align: "right", children: /* @__PURE__ */ jsx4(import_developer_studio_ui_react45.StopPropagation, { children: /* @__PURE__ */ jsx4(
25097
- import_design_system_react_components82.ActionMenu,
25098
- {
25099
- options: [
25100
- {
25101
- key: "run",
25102
- element: /* @__PURE__ */ jsx4(
25103
- import_design_system_react_components82.ActionMenuItem,
25197
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.list.grid.table.activateSwitch,
25198
+ on: (_b2 = workflow.active) != null ? _b2 : false,
25199
+ onChange: (e) => {
25200
+ e.stopPropagation();
25201
+ void handleActivate(workflow);
25202
+ },
25203
+ state: activateWorkflowAction.isLoading && ((_c2 = activateWorkflowAction.variables) == null ? void 0 : _c2.id) === workflow.id ? "loading" : workflow.draft ? "locked" : "regular"
25204
+ }
25205
+ ) }),
25206
+ children: workflow.draft ? "Publish the draft to activate this workflow" : workflow.active ? "Deactivate flow" : "Activate flow"
25207
+ }
25208
+ ) }),
25209
+ /* @__PURE__ */ jsx4("td", { children: !workflow.draft && /* @__PURE__ */ jsx4(
25210
+ import_design_system_react_components82.Button,
25104
25211
  {
25105
- leftNode: /* @__PURE__ */ jsx4(import_design_system_react_components82.Icon, { source: import_design_system_icons40.PlayArrow }),
25106
- children: "Trigger manually"
25212
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.list.grid.table.infoButton,
25213
+ icon: /* @__PURE__ */ jsx4(import_design_system_react_components82.Icon, { source: import_design_system_icons40.Info }),
25214
+ kind: "plain",
25215
+ onClick: (e) => {
25216
+ e.stopPropagation();
25217
+ handleShowDetails(workflow);
25218
+ }
25107
25219
  }
25108
- ),
25109
- onClick: () => {
25110
- navigate(`/${workflow.id}/execute`);
25111
- }
25112
- },
25113
- {
25114
- key: "delete",
25115
- element: /* @__PURE__ */ jsx4(import_design_system_react_components82.ActionMenuItem, { leftNode: /* @__PURE__ */ jsx4(import_design_system_react_components82.Icon, { source: import_design_system_icons40.Delete }), children: "Delete" }),
25116
- onClick: () => {
25117
- void handleDelete(workflow);
25118
- }
25119
- }
25120
- ],
25121
- triggerRenderer: /* @__PURE__ */ jsx4(
25122
- import_design_system_react_components82.Button,
25123
- {
25124
- icon: /* @__PURE__ */ jsx4(import_design_system_react_components82.Icon, { source: import_design_system_icons40.MoreHoriz }),
25125
- kind: "text",
25126
- loading: deleteAction.isLoading ? ((_d = deleteAction.variables) == null ? void 0 : _d.id) === workflow.id : void 0,
25127
- size: "compact"
25128
- }
25129
- )
25130
- }
25131
- ) }) })
25132
- ]
25133
- },
25134
- workflow.id
25135
- );
25136
- }) : workflowsQuery.isLoading ? /* @__PURE__ */ jsx4("tr", { children: /* @__PURE__ */ jsx4("td", { align: "center", colSpan: 6, children: /* @__PURE__ */ jsx4(import_developer_studio_ui_react45.Loader, { size: "medium" }) }) }) : /* @__PURE__ */ jsx4(
25137
- "tr",
25138
- {
25139
- css: css`
25220
+ ) }),
25221
+ /* @__PURE__ */ jsx4("td", { align: "right", children: /* @__PURE__ */ jsx4(import_developer_studio_ui_react45.StopPropagation, { children: /* @__PURE__ */ jsx4(
25222
+ import_design_system_react_components82.ActionMenu,
25223
+ {
25224
+ options: [
25225
+ {
25226
+ key: "run",
25227
+ element: /* @__PURE__ */ jsx4(
25228
+ import_design_system_react_components82.ActionMenuItem,
25229
+ {
25230
+ leftNode: /* @__PURE__ */ jsx4(import_design_system_react_components82.Icon, { source: import_design_system_icons40.PlayArrow }),
25231
+ children: "Trigger manually"
25232
+ }
25233
+ ),
25234
+ onClick: () => {
25235
+ navigate(`/${workflow.id}/execute`);
25236
+ }
25237
+ },
25238
+ {
25239
+ key: "delete",
25240
+ element: /* @__PURE__ */ jsx4(import_design_system_react_components82.ActionMenuItem, { leftNode: /* @__PURE__ */ jsx4(import_design_system_react_components82.Icon, { source: import_design_system_icons40.Delete }), children: "Delete" }),
25241
+ onClick: () => {
25242
+ void handleDelete(workflow);
25243
+ }
25244
+ }
25245
+ ],
25246
+ triggerRenderer: /* @__PURE__ */ jsx4(
25247
+ import_design_system_react_components82.Button,
25248
+ {
25249
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.list.grid.table.menuTrigger,
25250
+ icon: /* @__PURE__ */ jsx4(import_design_system_react_components82.Icon, { source: import_design_system_icons40.MoreHoriz }),
25251
+ kind: "text",
25252
+ loading: deleteAction.isLoading ? ((_d = deleteAction.variables) == null ? void 0 : _d.id) === workflow.id : void 0,
25253
+ size: "compact"
25254
+ }
25255
+ )
25256
+ }
25257
+ ) }) })
25258
+ ]
25259
+ },
25260
+ workflow.id
25261
+ );
25262
+ }) : workflowsQuery.isLoading ? /* @__PURE__ */ jsx4("tr", { children: /* @__PURE__ */ jsx4("td", { align: "center", colSpan: 6, children: /* @__PURE__ */ jsx4(import_developer_studio_ui_react45.Loader, { size: "medium" }) }) }) : /* @__PURE__ */ jsx4(
25263
+ "tr",
25264
+ {
25265
+ css: css`
25140
25266
  background: transparent !important;
25141
25267
  color: var(${import_design_system_react_components82.DesignToken.ContentBasicSecondary});
25142
25268
  `,
25143
- children: /* @__PURE__ */ jsx4("td", { align: "left", colSpan: 6, children: /* @__PURE__ */ jsxs2(import_design_system_react_components82.Text, { as: "div", size: "md", children: [
25144
- "There are no",
25145
- " ",
25146
- state.filters.status !== "All" && state.filters.status.toLowerCase(),
25147
- " ",
25148
- "workflows",
25149
- " ",
25150
- ((_c = (_b = state.params) == null ? void 0 : _b.name) == null ? void 0 : _c.value) ? `with "${state.params.name.value}" in the name` : null
25151
- ] }) })
25152
- }
25153
- ) })
25154
- ] });
25269
+ children: /* @__PURE__ */ jsx4("td", { align: "left", colSpan: 6, children: /* @__PURE__ */ jsxs2(import_design_system_react_components82.Text, { as: "div", size: "md", children: [
25270
+ "There are no",
25271
+ " ",
25272
+ state.filters.status !== "All" && state.filters.status.toLowerCase(),
25273
+ " ",
25274
+ "workflows",
25275
+ " ",
25276
+ ((_c = (_b = state.params) == null ? void 0 : _b.name) == null ? void 0 : _c.value) ? `with "${state.params.name.value}" in the name` : null
25277
+ ] }) })
25278
+ }
25279
+ )
25280
+ }
25281
+ )
25282
+ ]
25283
+ }
25284
+ );
25155
25285
  }
25156
25286
  var Table_default = WorkflowsTable;
25157
25287
 
@@ -25235,28 +25365,35 @@ function WorkflowListView() {
25235
25365
  return /* @__PURE__ */ jsxs2(import_developer_studio_ui_react47.View, { center: hasNoData, noWrap: true, stretch: isLoading, children: [
25236
25366
  getWorkflowsEnv("isLiveChatMode") ? /* @__PURE__ */ jsx4(import_developer_studio_ui_react47.Row, { noMaxWidth: true, notPadded: true, children: /* @__PURE__ */ jsx4(LiveChatNavbar_default, {}) }) : null,
25237
25367
  /* @__PURE__ */ jsxs2(import_developer_studio_ui_react47.Row, { topMargin: true, verticalCenter: hasNoData, children: [
25238
- /* @__PURE__ */ jsx4(import_developer_studio_ui_react47.Column, { width: hasNoData ? 10 : 8, children: hasNoData ? /* @__PURE__ */ jsx4(import_developer_studio_ui_react47.Row, { notPadded: true, children: /* @__PURE__ */ jsx4(
25239
- import_developer_studio_ui_react47.Intro,
25368
+ /* @__PURE__ */ jsx4(import_developer_studio_ui_react47.Column, { width: hasNoData ? 10 : 8, children: hasNoData ? /* @__PURE__ */ jsx4(
25369
+ import_developer_studio_ui_react47.Row,
25240
25370
  {
25241
- body: "Automate your work with an app integration platform. Use AI to quicken the process. Enjoy a simple, no-code setup to streamline tasks you would otherwise do manually.",
25242
- center: true,
25243
- header: /* @__PURE__ */ jsx4(import_developer_studio_ui_react47.Column, { notPadded: true, stretch: true, children: /* @__PURE__ */ jsxs2(
25244
- import_developer_studio_ui_react47.Row,
25371
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.list.view.emptyInfo,
25372
+ notPadded: true,
25373
+ children: /* @__PURE__ */ jsx4(
25374
+ import_developer_studio_ui_react47.Intro,
25245
25375
  {
25376
+ body: "Automate your work with an app integration platform. Use AI to quicken the process. Enjoy a simple, no-code setup to streamline tasks you would otherwise do manually.",
25246
25377
  center: true,
25247
- gap: `var(${import_design_system_react_components84.SpacingToken.Spacing2})`,
25248
- notPadded: true,
25249
- verticalCenter: true,
25250
- children: [
25251
- "Welcome to ",
25252
- /* @__PURE__ */ jsx4("span", { css: markedStyles, children: "Workflows" })
25253
- ]
25378
+ header: /* @__PURE__ */ jsx4(import_developer_studio_ui_react47.Column, { notPadded: true, stretch: true, children: /* @__PURE__ */ jsxs2(
25379
+ import_developer_studio_ui_react47.Row,
25380
+ {
25381
+ center: true,
25382
+ gap: `var(${import_design_system_react_components84.SpacingToken.Spacing2})`,
25383
+ notPadded: true,
25384
+ verticalCenter: true,
25385
+ children: [
25386
+ "Welcome to ",
25387
+ /* @__PURE__ */ jsx4("span", { css: markedStyles, children: "Workflows" })
25388
+ ]
25389
+ }
25390
+ ) }),
25391
+ noMaxWidth: true,
25392
+ style: { maxWidth: "38rem" }
25254
25393
  }
25255
- ) }),
25256
- noMaxWidth: true,
25257
- style: { maxWidth: "38rem" }
25394
+ )
25258
25395
  }
25259
- ) }) : /* @__PURE__ */ jsx4(
25396
+ ) : /* @__PURE__ */ jsx4(
25260
25397
  import_developer_studio_ui_react47.Intro,
25261
25398
  {
25262
25399
  body: "Create custom workflows to automate your work.",
@@ -25267,6 +25404,7 @@ function WorkflowListView() {
25267
25404
  hasData && !getWorkflowsEnv("isHeadless") ? /* @__PURE__ */ jsx4(import_developer_studio_ui_react47.Column, { pullRight: true, children: /* @__PURE__ */ jsx4(
25268
25405
  import_design_system_react_components84.Button,
25269
25406
  {
25407
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.list.view.createButton,
25270
25408
  kind: "primary",
25271
25409
  onClick: () => {
25272
25410
  navigate("create");