mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
Merge branch 'feat/preferred-port-design' of github.com:Start9Labs/start-os into sdk-comments
This commit is contained in:
@@ -66,7 +66,7 @@ export type PackageActionData = {
|
||||
@if (requestInfo) {
|
||||
<task-info
|
||||
[originalValue]="res.originalValue || {}"
|
||||
[operations]="res.operations || []"
|
||||
[operations]="res.visibleOperations || []"
|
||||
/>
|
||||
}
|
||||
|
||||
@@ -156,18 +156,25 @@ export class ActionInputModal {
|
||||
const originalValue = res.value || {}
|
||||
this.eventId = res.eventId
|
||||
|
||||
const operations = this.requestInfo?.input
|
||||
? compare(
|
||||
JSON.parse(JSON.stringify(originalValue)),
|
||||
utils.deepMerge(
|
||||
JSON.parse(JSON.stringify(originalValue)),
|
||||
this.requestInfo.input.value,
|
||||
) as object,
|
||||
)
|
||||
: null
|
||||
|
||||
return {
|
||||
spec: res.spec,
|
||||
originalValue,
|
||||
operations: this.requestInfo?.input
|
||||
? compare(
|
||||
JSON.parse(JSON.stringify(originalValue)),
|
||||
utils.deepMerge(
|
||||
JSON.parse(JSON.stringify(originalValue)),
|
||||
this.requestInfo.input.value,
|
||||
) as object,
|
||||
)
|
||||
: null,
|
||||
operations,
|
||||
visibleOperations:
|
||||
operations?.filter(op => {
|
||||
const key = op.path.split('/')[1]
|
||||
return (res.spec[key!] as any)?.type !== 'hidden'
|
||||
}) ?? null,
|
||||
}
|
||||
}),
|
||||
catchError(e => {
|
||||
@@ -180,14 +187,11 @@ export class ActionInputModal {
|
||||
|
||||
async execute(input: object) {
|
||||
if (await this.checkConflicts(input)) {
|
||||
const merged = this.context.data.prefill
|
||||
? { ...input, ...this.context.data.prefill }
|
||||
: input
|
||||
await this.actionService.execute(
|
||||
this.pkgInfo.id,
|
||||
this.eventId,
|
||||
this.actionId,
|
||||
merged,
|
||||
input,
|
||||
)
|
||||
this.context.$implicit.complete()
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ export class ActionService {
|
||||
private readonly formDialog = inject(FormDialogService)
|
||||
|
||||
async present(data: PackageActionData) {
|
||||
data.prefill = data.prefill ?? data.requestInfo?.input?.value
|
||||
const { pkgInfo, actionInfo } = data
|
||||
|
||||
if (actionInfo.metadata.hasInput) {
|
||||
@@ -43,11 +44,9 @@ export class ActionService {
|
||||
data,
|
||||
})
|
||||
.pipe(filter(Boolean))
|
||||
.subscribe(() =>
|
||||
this.execute(pkgInfo.id, null, actionInfo.id, data.prefill),
|
||||
)
|
||||
.subscribe(() => this.execute(pkgInfo.id, null, actionInfo.id))
|
||||
} else {
|
||||
this.execute(pkgInfo.id, null, actionInfo.id, data.prefill)
|
||||
this.execute(pkgInfo.id, null, actionInfo.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user