Merge pull request #1812 from automatisch/AUT-917

fix: expose missing createdAt and updatedAt fields from flow
This commit is contained in:
Ömer Faruk Aydın
2024-04-16 14:10:26 +02:00
committed by GitHub
7 changed files with 13 additions and 0 deletions

View File

@@ -6,6 +6,8 @@ const flowSerializer = (flow) => {
name: flow.name,
active: flow.active,
status: flow.status,
createdAt: flow.createdAt.getTime(),
updatedAt: flow.updatedAt.getTime(),
};
if (flow.steps?.length > 0) {

View File

@@ -27,6 +27,8 @@ describe('flowSerializer', () => {
name: flow.name,
active: flow.active,
status: flow.status,
createdAt: flow.createdAt.getTime(),
updatedAt: flow.updatedAt.getTime(),
};
expect(flowSerializer(flow)).toEqual(expectedPayload);

View File

@@ -9,6 +9,8 @@ const getExecutionMock = async (execution, flow, steps) => {
name: flow.name,
active: flow.active,
status: flow.active ? 'published' : 'draft',
createdAt: flow.createdAt.getTime(),
updatedAt: flow.updatedAt.getTime(),
steps: steps.map((step) => ({
id: step.id,
type: step.type,

View File

@@ -10,6 +10,8 @@ const getExecutionsMock = async (executions, flow, steps) => {
name: flow.name,
active: flow.active,
status: flow.active ? 'published' : 'draft',
createdAt: flow.createdAt.getTime(),
updatedAt: flow.updatedAt.getTime(),
steps: steps.map((step) => ({
id: step.id,
type: step.type,

View File

@@ -4,6 +4,8 @@ const getFlowMock = async (flow, steps) => {
id: flow.id,
name: flow.name,
status: flow.active ? 'published' : 'draft',
createdAt: flow.createdAt.getTime(),
updatedAt: flow.updatedAt.getTime(),
steps: steps.map((step) => ({
appKey: step.appKey,
iconUrl: step.iconUrl,

View File

@@ -7,6 +7,8 @@ const getFlowsMock = async (flows, steps) => {
id: flow.id,
name: flow.name,
status: flow.active ? 'published' : 'draft',
createdAt: flow.createdAt.getTime(),
updatedAt: flow.updatedAt.getTime(),
steps: flowSteps.map((step) => ({
appKey: step.appKey,
iconUrl: step.iconUrl,

View File

@@ -241,6 +241,7 @@ export const FlowPropType = PropTypes.shape({
PropTypes.instanceOf(Date),
]),
updatedAt: PropTypes.oneOfType([
PropTypes.number,
PropTypes.string,
PropTypes.instanceOf(Date),
]),