Skip to content

Commit

Permalink
fix: linked variable already being a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfiszel committed Dec 6, 2023
1 parent 4cb7a12 commit 9c4f1e0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
31 changes: 17 additions & 14 deletions frontend/src/lib/components/AppConnect.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -264,20 +264,23 @@
const resourceValue = args
if (!manual || linkedSecret != undefined) {
await VariableService.createVariable({
workspace: $workspaceStore!,
requestBody: {
path,
value: manual ? args[linkedSecret ?? ''] : value,
is_secret: true,
description: emptyString(description)
? `${manual ? 'Token' : 'OAuth token'} for ${resource_type}`
: description,
is_oauth: !manual,
account: account
}
})
resourceValue[linkedSecret ?? 'token'] = `$var:${path}`
let v = manual ? args[linkedSecret ?? ''] : value
if (!v.startsWith('$var:')) {
await VariableService.createVariable({
workspace: $workspaceStore!,
requestBody: {
path,
value: v,
is_secret: true,
description: emptyString(description)
? `${manual ? 'Token' : 'OAuth token'} for ${resource_type}`
: description,
is_oauth: !manual,
account: account
}
})
resourceValue[linkedSecret ?? 'token'] = `$var:${path}`
}
}
await ResourceService.createResource({
Expand Down
12 changes: 0 additions & 12 deletions frontend/src/lib/components/FlowStatusViewerInner.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,6 @@
}
}
function setDurationStatus(key: string, value: DurationStatus) {
if (!deepEqual($localDurationStatuses[key], value)) {
$localDurationStatuses[key] = value
globalDurationStatuses.forEach((s) => {
s.update((x) => {
x[key] = JSON.parse(JSON.stringify(value))
return x
})
})
}
}
function setDurationStatusByJob(key: string, id: string, value: any) {
if (!deepEqual($localDurationStatuses[key]?.byJob[id], value)) {
$localDurationStatuses[key].byJob[id] = value
Expand Down

0 comments on commit 9c4f1e0

Please sign in to comment.