Merge branch 'feat/preferred-port-design' of github.com:Start9Labs/start-os into sdk-comments

This commit is contained in:
Matt Hill
2026-02-23 17:00:23 -07:00
2 changed files with 21 additions and 18 deletions

View File

@@ -66,7 +66,7 @@ export type PackageActionData = {
@if (requestInfo) { @if (requestInfo) {
<task-info <task-info
[originalValue]="res.originalValue || {}" [originalValue]="res.originalValue || {}"
[operations]="res.operations || []" [operations]="res.visibleOperations || []"
/> />
} }
@@ -156,18 +156,25 @@ export class ActionInputModal {
const originalValue = res.value || {} const originalValue = res.value || {}
this.eventId = res.eventId 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 { return {
spec: res.spec, spec: res.spec,
originalValue, originalValue,
operations: this.requestInfo?.input operations,
? compare( visibleOperations:
JSON.parse(JSON.stringify(originalValue)), operations?.filter(op => {
utils.deepMerge( const key = op.path.split('/')[1]
JSON.parse(JSON.stringify(originalValue)), return (res.spec[key!] as any)?.type !== 'hidden'
this.requestInfo.input.value, }) ?? null,
) as object,
)
: null,
} }
}), }),
catchError(e => { catchError(e => {
@@ -180,14 +187,11 @@ export class ActionInputModal {
async execute(input: object) { async execute(input: object) {
if (await this.checkConflicts(input)) { if (await this.checkConflicts(input)) {
const merged = this.context.data.prefill
? { ...input, ...this.context.data.prefill }
: input
await this.actionService.execute( await this.actionService.execute(
this.pkgInfo.id, this.pkgInfo.id,
this.eventId, this.eventId,
this.actionId, this.actionId,
merged, input,
) )
this.context.$implicit.complete() this.context.$implicit.complete()
} }

View File

@@ -27,6 +27,7 @@ export class ActionService {
private readonly formDialog = inject(FormDialogService) private readonly formDialog = inject(FormDialogService)
async present(data: PackageActionData) { async present(data: PackageActionData) {
data.prefill = data.prefill ?? data.requestInfo?.input?.value
const { pkgInfo, actionInfo } = data const { pkgInfo, actionInfo } = data
if (actionInfo.metadata.hasInput) { if (actionInfo.metadata.hasInput) {
@@ -43,11 +44,9 @@ export class ActionService {
data, data,
}) })
.pipe(filter(Boolean)) .pipe(filter(Boolean))
.subscribe(() => .subscribe(() => this.execute(pkgInfo.id, null, actionInfo.id))
this.execute(pkgInfo.id, null, actionInfo.id, data.prefill),
)
} else { } else {
this.execute(pkgInfo.id, null, actionInfo.id, data.prefill) this.execute(pkgInfo.id, null, actionInfo.id)
} }
} }
} }