mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-10 17:30:51 +00:00
Fixes for tracex sandbox (#8804)
* Make possible to create with specific _id Signed-off-by: Anna Khismatullina <anna.khismatullina@gmail.com> * Add undefined check Signed-off-by: Anna Khismatullina <anna.khismatullina@gmail.com> --------- Signed-off-by: Anna Khismatullina <anna.khismatullina@gmail.com>
This commit is contained in:
parent
cd0a687e47
commit
030d515ea6
@ -233,7 +233,7 @@ export class CardsProcessor {
|
||||
const cardPath = path.join(currentDir, entry.name)
|
||||
const { class: cardType, ...cardProps } = await readYamlHeader(cardPath)
|
||||
|
||||
if (cardType.startsWith('card:types:') === false) {
|
||||
if (cardType !== undefined && cardType.startsWith('card:types:') === false) {
|
||||
throw new Error('Unsupported card type: ' + cardType + ' in ' + cardPath)
|
||||
}
|
||||
|
||||
|
@ -230,7 +230,7 @@ export class WorkspaceInitializer {
|
||||
vars: Record<string, any>,
|
||||
defaults: Map<Ref<Class<T>>, Props<T>>
|
||||
): Promise<void> {
|
||||
const _id = generateId<T>()
|
||||
const _id = step.data._id ?? generateId<T>()
|
||||
if (step.resultVariable !== undefined) {
|
||||
vars[`\${${step.resultVariable}}`] = _id
|
||||
}
|
||||
@ -249,7 +249,7 @@ export class WorkspaceInitializer {
|
||||
}
|
||||
}
|
||||
|
||||
await this.create(step._class, data, _id)
|
||||
await this.create(step._class, data, _id as Ref<T>)
|
||||
}
|
||||
|
||||
private parseMarkdown (text: string): string {
|
||||
|
Loading…
Reference in New Issue
Block a user