-
Notifications
You must be signed in to change notification settings - Fork 612
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improved ui for rules tabs, refactored validation for rules
- Loading branch information
1 parent
b7e4ba4
commit fc7c162
Showing
671 changed files
with
19,244 additions
and
6,683 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,3 +48,5 @@ lerna.json | |
|
||
# TODO remove after moving traffic splitting config to WPC | ||
gateway.*.json | ||
|
||
packages/tasks/tpl/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
.webiny/** | ||
packages/ui/src/RichTextEditor/editorjs/** | ||
lerna.json | ||
coverage/** |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { createTaskDefinition } from "@webiny/tasks"; | ||
import { Context } from "../types"; | ||
import { ITaskResponseContinueOptions } from "@webiny/tasks/response/abstractions"; | ||
|
||
const MAX_RUNS = 5; | ||
|
||
const getMaxRuns = (input?: string | number) => { | ||
const value = Number(input); | ||
if (isNaN(value)) { | ||
return MAX_RUNS; | ||
} | ||
return value > 0 && value < 50 ? value : MAX_RUNS; | ||
}; | ||
|
||
interface TaskValues { | ||
run?: number; | ||
maxRuns?: string | number; | ||
seconds?: number | string; | ||
} | ||
|
||
const getOptions = (values: TaskValues): ITaskResponseContinueOptions | undefined => { | ||
if (!values.seconds || typeof values.seconds !== "number" || values.seconds < 1) { | ||
return undefined; | ||
} | ||
return { | ||
seconds: values.seconds | ||
}; | ||
}; | ||
|
||
export const createContinuingTask = () => { | ||
return createTaskDefinition<Context, TaskValues>({ | ||
id: "continuingTask", | ||
title: "Mock Continuing Task", | ||
description: | ||
"This is a mock task which will continue to run until it reaches the defined run limit.", | ||
async run(params) { | ||
const { response, isAborted, input } = params; | ||
const run = input.run || 0; | ||
const maxRuns = getMaxRuns(input.maxRuns); | ||
if (run >= maxRuns) { | ||
return response.done("Got to the run limit."); | ||
} | ||
if (isAborted()) { | ||
return response.aborted(); | ||
} | ||
|
||
await new Promise(resolve => setTimeout(resolve, 10000)); | ||
|
||
return response.continue( | ||
{ | ||
...(input || {}), | ||
run: run + 1 | ||
}, | ||
getOptions(input) | ||
); | ||
} | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { createTaskDefinition } from "@webiny/tasks"; | ||
import { getDocumentClient } from "@webiny/aws-sdk/client-dynamodb"; | ||
|
||
export const createCountDynamoDbTask = () => { | ||
return createTaskDefinition({ | ||
id: "countDdb", | ||
title: "Count DynamoDB", | ||
description: "Counts DynamoDB items.", | ||
run: async params => { | ||
const { response, isAborted, isCloseToTimeout } = params; | ||
if (isAborted()) { | ||
return response.aborted(); | ||
} else if (isCloseToTimeout()) { | ||
return response.continue({}); | ||
} | ||
const documentClient = getDocumentClient(); | ||
|
||
const results = await documentClient.scan({ | ||
TableName: process.env.DB_TABLE | ||
}); | ||
|
||
return response.done(`Count: ${results.Count}`); | ||
} | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.