Skip to content

Commit a22387c

Browse files
committed
refactoring for start
1 parent f84d2ff commit a22387c

File tree

7 files changed

+11
-1
lines changed

7 files changed

+11
-1
lines changed

packages/lexicon/core.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ export type Workflow = {
161161

162162
// holds history information of a workflow
163163
history?: string[];
164+
165+
start?: string;
164166
};
165167

166168
export type StepId = string;

packages/project/src/Workflow.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class Workflow {
1313
index: any;
1414

1515
name?: string;
16+
start?: string;
1617
id: string;
1718
openfn?: l.WorkflowMeta;
1819
options: any; // TODO

packages/project/src/parse/from-app-state.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export const mapWorkflow = (workflow: Provisioner.Workflow) => {
9696
name: workflow.name,
9797
steps: [],
9898
history: workflow.version_history ?? [],
99+
start: 'trigger',
99100
openfn: renameKeys(remoteProps, { id: 'uuid' }),
100101
};
101102
if (workflow.name) {

packages/project/test/fixtures/sample-v2-project.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const json: SerializedProject = {
2929
],
3030
name: 'Workflow',
3131
id: 'workflow',
32+
start: 'trigger',
3233
openfn: { uuid: 1 },
3334
history: [],
3435
},
@@ -65,6 +66,7 @@ workflows:
6566
name: Workflow
6667
id: workflow
6768
openfn:
68-
uuid: 1
69+
uuid: 1
6970
history: []
71+
start: trigger
7072
`;

packages/project/test/parse/from-app-state.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ test('should create a Project from prov state with a workflow', (t) => {
8686
id: 'my-workflow',
8787
name: 'My Workflow',
8888
history: [],
89+
start: 'trigger',
8990
steps: [
9091
{
9192
id: 'trigger',

packages/project/test/parse/from-project.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ test('import from a v2 project as JSON', async (t) => {
8686
uuid: 1,
8787
},
8888
history: [],
89+
start: 'trigger',
8990
steps: [
9091
{
9192
name: 'b',
@@ -141,6 +142,7 @@ test('import from a v2 project as YAML', async (t) => {
141142
uuid: 1,
142143
},
143144
history: [],
145+
start: 'trigger',
144146
steps: [
145147
{
146148
name: 'b',

packages/project/test/serialize/to-project.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const createProject = () => {
3131
});
3232
// hack
3333
delete proj.workflows[0].steps[0].name;
34+
proj.workflows[0].workflow.start = 'trigger';
3435
return proj;
3536
};
3637

0 commit comments

Comments
 (0)