@quazardous/qdadm 2.44.0 → 2.45.0

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.
@@ -8,6 +8,7 @@
8
8
  * configureTasks({ dialog: { width: '56rem', modal: false }, slots: { 'after-log': DeliverySummary } })
9
9
  * registerTaskKind('deploy', { task, log, dialog: { maximizable: false }, component: DeployDialog })
10
10
  * registerTaskKind('deliver', { task, log, logPatterns: { errorPattern: /\[error\]|^→ failed/ } })
11
+ * configureTasks({ phaseIcons: { deploy: 'pi pi-upload', 'backup-after': 'pi pi-database' } })
11
12
  */
12
13
  import { shallowReactive, type Component } from 'vue'
13
14
 
@@ -43,6 +44,8 @@ export interface TaskUiOptions {
43
44
  dialog?: TaskDialogOptions
44
45
  logPatterns?: TaskLogPatterns
45
46
  slots?: Partial<Record<TaskDialogSlotName, Component>>
47
+ /** An icon class per phase name, in the phases frieze (#4655); a phase without one shows its state's. */
48
+ phaseIcons?: Record<string, string>
46
49
  /**
47
50
  * Renders instead of TaskDialog, with props `{ runId, options }` and a
48
51
  * `close` event; it reads the run through getTaskStore().
@@ -78,6 +81,7 @@ export function configureTasks(options: TaskUiOptions): void {
78
81
  if (options.dialog) app.dialog = { ...app.dialog, ...options.dialog }
79
82
  if (options.slots) app.slots = { ...app.slots, ...options.slots }
80
83
  if (options.logPatterns) app.logPatterns = { ...app.logPatterns, ...options.logPatterns }
84
+ if (options.phaseIcons) app.phaseIcons = { ...app.phaseIcons, ...options.phaseIcons }
81
85
  if (options.component !== undefined) app.component = options.component
82
86
  if (options.tray) app.tray = { ...app.tray, ...options.tray }
83
87
  }
@@ -87,6 +91,7 @@ export function resetTaskUi(): void {
87
91
  delete app.dialog
88
92
  delete app.slots
89
93
  delete app.logPatterns
94
+ delete app.phaseIcons
90
95
  delete app.component
91
96
  delete app.tray
92
97
  }
@@ -104,6 +109,7 @@ export function resolveTaskUi(kind?: TaskUiOptions | null, page?: TaskDialogOpti
104
109
  // null is kept: it turns a pattern off
105
110
  logPatterns: { ...TASK_LOG_DEFAULTS, ...strip(app.logPatterns), ...strip(kind?.logPatterns) } as Required<TaskLogPatterns>,
106
111
  slots: { ...app.slots, ...kind?.slots } as Partial<Record<TaskDialogSlotName, Component>>,
112
+ phaseIcons: { ...app.phaseIcons, ...kind?.phaseIcons } as Record<string, string>,
107
113
  component: kind?.component ?? app.component ?? null,
108
114
  }
109
115
  }