Skip to content

Commit

Permalink
fix variables in process-details page (#1848)
Browse files Browse the repository at this point in the history
* fix variables in process-details page

* fix tests
  • Loading branch information
AjayJagan authored Sep 1, 2023
1 parent 9abfcbd commit f8ba2a7
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const ProcessDetails: React.FC<ProcessDetailsProps> = ({
};
const getVariableJSON = (): void => {
if (data && data.id === processDetails.id) {
setUpdateJson(JSON.parse(data.variables));
setUpdateJson(data.variables);
}
};
/* istanbul ignore else*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,38 @@ describe('ProcessDetails tests', () => {
parentProcessInstanceId: 'e4448857-fa0c-403b-ad69-f0a353458b9d',
parentProcessInstance: null,
roles: [],
variables:
'{"trip":{"begin":"2019-10-22T22:00:00Z[UTC]","city":"Bangalore","country":"India","end":"2019-10-30T22:00:00Z[UTC]","visaRequired":false},"hotel":{"address":{"city":"Bangalore","country":"India","street":"street","zipCode":"12345"},"bookingNumber":"XX-012345","name":"Perfect hotel","phone":"09876543"},"traveller":{"address":{"city":"Bangalore","country":"US","street":"Bangalore","zipCode":"560093"},"email":"[email protected]","firstName":"Ajay","lastName":"Jaganathan","nationality":"US"}}',
variables: {
trip: {
begin: '2019-10-22T22:00:00Z[UTC]',
city: 'Bangalore',
country: 'India',
end: '2019-10-30T22:00:00Z[UTC]',
visaRequired: false
},
hotel: {
address: {
city: 'Bangalore',
country: 'India',
street: 'street',
zipCode: '12345'
},
bookingNumber: 'XX-012345',
name: 'Perfect hotel',
phone: '09876543'
},
traveller: {
address: {
city: 'Bangalore',
country: 'US',
street: 'Bangalore',
zipCode: '560093'
},
email: '[email protected]',
firstName: 'Ajay',
lastName: 'Jaganathan',
nationality: 'US'
}
} as any,
state: ProcessInstanceState.Active,
start: new Date('2019-10-22T03:40:44.089Z'),
lastUpdate: new Date('Thu, 22 Apr 2021 14:53:04 GMT'),
Expand Down Expand Up @@ -232,8 +262,38 @@ describe('ProcessDetails tests', () => {
parentProcessInstanceId: 'e4448857-fa0c-403b-ad69-f0a353458b9d',
parentProcessInstance: null,
roles: [],
variables:
'{"trip":{"begin":"2019-10-22T22:00:00Z[UTC]","city":"Bangalore","country":"India","end":"2019-10-30T22:00:00Z[UTC]","visaRequired":false},"hotel":{"address":{"city":"Bangalore","country":"India","street":"street","zipCode":"12345"},"bookingNumber":"XX-012345","name":"Perfect hotel","phone":"09876543"},"traveller":{"address":{"city":"Bangalore","country":"US","street":"Bangalore","zipCode":"560093"},"email":"[email protected]","firstName":"Ajay","lastName":"Jaganathan","nationality":"US"}}',
variables: {
trip: {
begin: '2019-10-22T22:00:00Z[UTC]',
city: 'Bangalore',
country: 'India',
end: '2019-10-30T22:00:00Z[UTC]',
visaRequired: false
},
hotel: {
address: {
city: 'Bangalore',
country: 'India',
street: 'street',
zipCode: '12345'
},
bookingNumber: 'XX-012345',
name: 'Perfect hotel',
phone: '09876543'
},
traveller: {
address: {
city: 'Bangalore',
country: 'US',
street: 'Bangalore',
zipCode: '560093'
},
email: '[email protected]',
firstName: 'Ajay',
lastName: 'Jaganathan',
nationality: 'US'
}
} as any,
state: ProcessInstanceState.Completed,
start: new Date('2019-10-22T03:40:44.089Z'),
lastUpdate: new Date('Thu, 22 Apr 2021 14:53:04 GMT'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,9 @@ const processInstance = {
id: 'tEE12-fo54-l665-mp112-akou112345566',
processId: 'travels',
businessKey: 'TEE12',
parentProcessInstanceId: null,
parentProcessInstance: null,
processName: 'travels',
roles: [],
state: ProcessInstanceState.Completed,
rootProcessInstanceId: null,
addons: ['jobs-management', 'prometheus-monitoring', 'process-management'],
start: new Date('2019-10-22T03:40:44.089Z'),
lastUpdate: new Date('2019-10-22T03:40:44.089Z'),
Expand All @@ -56,8 +53,43 @@ const processInstance = {
},
serviceUrl: 'http://localhost:4000',
endpoint: 'http://localhost:4000',
variables:
'{"flight":{"arrival":"2019-10-30T22:00:00Z[UTC]","departure":"2019-10-22T22:00:00Z[UTC]","flightNumber":"MX555"},"trip":{"begin":"2019-10-22T22:00:00Z[UTC]","city":"Bangalore","country":"India","end":"2019-10-30T22:00:00Z[UTC]","visaRequired":false},"hotel":{"address":{"city":"Bangalore","country":"India","street":"street","zipCode":"12345"},"bookingNumber":"XX-012345","name":"Perfect hotel","phone":"09876543"},"traveller":{"address":{"city":"Bangalore","country":"US","street":"Bangalore","zipCode":"560093"},"email":"[email protected]","firstName":"Ajay","lastName":"Jaganathan","nationality":"US"}}',
variables: {
flight: {
arrival: '2019-10-30T22:00:00Z[UTC]',
departure: '2019-10-22T22:00:00Z[UTC]',
flightNumber: 'MX555'
},
trip: {
begin: '2019-10-22T22:00:00Z[UTC]',
city: 'Bangalore',
country: 'India',
end: '2019-10-30T22:00:00Z[UTC]',
visaRequired: false
},
hotel: {
address: {
city: 'Bangalore',
country: 'India',
street: 'street',
zipCode: '12345'
},
bookingNumber: 'XX-012345',
name: 'Perfect hotel',
phone: '09876543'
},
traveller: {
address: {
city: 'Bangalore',
country: 'US',
street: 'Bangalore',
zipCode: '560093'
},
email: '[email protected]',
firstName: 'Ajay',
lastName: 'Jaganathan',
nationality: 'US'
}
} as any,
nodes: [
{
nodeId: '1',
Expand Down

0 comments on commit f8ba2a7

Please sign in to comment.