fix: expose missing createdAt and updatedAt fields from flow
This commit is contained in:
@@ -6,6 +6,8 @@ const flowSerializer = (flow) => {
|
|||||||
name: flow.name,
|
name: flow.name,
|
||||||
active: flow.active,
|
active: flow.active,
|
||||||
status: flow.status,
|
status: flow.status,
|
||||||
|
createdAt: flow.createdAt.getTime(),
|
||||||
|
updatedAt: flow.updatedAt.getTime(),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (flow.steps?.length > 0) {
|
if (flow.steps?.length > 0) {
|
||||||
|
@@ -27,6 +27,8 @@ describe('flowSerializer', () => {
|
|||||||
name: flow.name,
|
name: flow.name,
|
||||||
active: flow.active,
|
active: flow.active,
|
||||||
status: flow.status,
|
status: flow.status,
|
||||||
|
createdAt: flow.createdAt.getTime(),
|
||||||
|
updatedAt: flow.updatedAt.getTime(),
|
||||||
};
|
};
|
||||||
|
|
||||||
expect(flowSerializer(flow)).toEqual(expectedPayload);
|
expect(flowSerializer(flow)).toEqual(expectedPayload);
|
||||||
|
@@ -9,6 +9,8 @@ const getExecutionMock = async (execution, flow, steps) => {
|
|||||||
name: flow.name,
|
name: flow.name,
|
||||||
active: flow.active,
|
active: flow.active,
|
||||||
status: flow.active ? 'published' : 'draft',
|
status: flow.active ? 'published' : 'draft',
|
||||||
|
createdAt: flow.createdAt.getTime(),
|
||||||
|
updatedAt: flow.updatedAt.getTime(),
|
||||||
steps: steps.map((step) => ({
|
steps: steps.map((step) => ({
|
||||||
id: step.id,
|
id: step.id,
|
||||||
type: step.type,
|
type: step.type,
|
||||||
|
@@ -10,6 +10,8 @@ const getExecutionsMock = async (executions, flow, steps) => {
|
|||||||
name: flow.name,
|
name: flow.name,
|
||||||
active: flow.active,
|
active: flow.active,
|
||||||
status: flow.active ? 'published' : 'draft',
|
status: flow.active ? 'published' : 'draft',
|
||||||
|
createdAt: flow.createdAt.getTime(),
|
||||||
|
updatedAt: flow.updatedAt.getTime(),
|
||||||
steps: steps.map((step) => ({
|
steps: steps.map((step) => ({
|
||||||
id: step.id,
|
id: step.id,
|
||||||
type: step.type,
|
type: step.type,
|
||||||
|
@@ -4,6 +4,8 @@ const getFlowMock = async (flow, steps) => {
|
|||||||
id: flow.id,
|
id: flow.id,
|
||||||
name: flow.name,
|
name: flow.name,
|
||||||
status: flow.active ? 'published' : 'draft',
|
status: flow.active ? 'published' : 'draft',
|
||||||
|
createdAt: flow.createdAt.getTime(),
|
||||||
|
updatedAt: flow.updatedAt.getTime(),
|
||||||
steps: steps.map((step) => ({
|
steps: steps.map((step) => ({
|
||||||
appKey: step.appKey,
|
appKey: step.appKey,
|
||||||
iconUrl: step.iconUrl,
|
iconUrl: step.iconUrl,
|
||||||
|
@@ -7,6 +7,8 @@ const getFlowsMock = async (flows, steps) => {
|
|||||||
id: flow.id,
|
id: flow.id,
|
||||||
name: flow.name,
|
name: flow.name,
|
||||||
status: flow.active ? 'published' : 'draft',
|
status: flow.active ? 'published' : 'draft',
|
||||||
|
createdAt: flow.createdAt.getTime(),
|
||||||
|
updatedAt: flow.updatedAt.getTime(),
|
||||||
steps: flowSteps.map((step) => ({
|
steps: flowSteps.map((step) => ({
|
||||||
appKey: step.appKey,
|
appKey: step.appKey,
|
||||||
iconUrl: step.iconUrl,
|
iconUrl: step.iconUrl,
|
||||||
|
@@ -241,6 +241,7 @@ export const FlowPropType = PropTypes.shape({
|
|||||||
PropTypes.instanceOf(Date),
|
PropTypes.instanceOf(Date),
|
||||||
]),
|
]),
|
||||||
updatedAt: PropTypes.oneOfType([
|
updatedAt: PropTypes.oneOfType([
|
||||||
|
PropTypes.number,
|
||||||
PropTypes.string,
|
PropTypes.string,
|
||||||
PropTypes.instanceOf(Date),
|
PropTypes.instanceOf(Date),
|
||||||
]),
|
]),
|
||||||
|
Reference in New Issue
Block a user