Skip to content

Commit

Permalink
Update template to generate route to use path parameters in URI
Browse files Browse the repository at this point in the history
fixes #976

Signed-off-by: Aurélien Pupier <[email protected]>
  • Loading branch information
apupier committed Mar 28, 2024
1 parent b90d7e7 commit d27f684
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
id: from-4257
uri: timer:template
parameters:
timerName: timer-name
repeatCount: "5"
steps:
- setBody:
Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/hooks/entities.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,9 @@ describe('useEntities', () => {
id: route-1234
from:
id: from-1234
uri: timer
uri: timer:template
parameters:
period: "1000"
timerName: template
steps:
- log:
id: log-1234
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ exports[`createCamelResource should create an empty KameletResource if no args i
"id": "from-1234",
"parameters": {
"period": "{{period}}",
"timerName": "user",
},
"steps": [
{
Expand All @@ -18,7 +17,7 @@ exports[`createCamelResource should create an empty KameletResource if no args i
"to": "kamelet:sink",
},
],
"uri": "timer",
"uri": "timer:user",
},
"id": "kamelet-1234",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ exports[`KameletResource should convert to JSON 1`] = `
"id": "from-1234",
"parameters": {
"period": "{{period}}",
"timerName": "user",
},
"steps": [
{
Expand All @@ -52,7 +51,7 @@ exports[`KameletResource should convert to JSON 1`] = `
"to": "kamelet:sink",
},
],
"uri": "timer",
"uri": "timer:user",
},
},
"types": {
Expand Down Expand Up @@ -106,7 +105,6 @@ exports[`KameletResource should create a new KameletResource 1`] = `
"id": "from-1234",
"parameters": {
"period": "{{period}}",
"timerName": "user",
},
"steps": [
{
Expand All @@ -116,7 +114,7 @@ exports[`KameletResource should create a new KameletResource 1`] = `
"to": "kamelet:sink",
},
],
"uri": "timer",
"uri": "timer:user",
},
},
"types": {
Expand Down Expand Up @@ -171,7 +169,6 @@ exports[`KameletResource should get the visual entities (Camel Route Visual Enti
"id": "from-1234",
"parameters": {
"period": "{{period}}",
"timerName": "user",
},
"steps": [
{
Expand All @@ -181,7 +178,7 @@ exports[`KameletResource should get the visual entities (Camel Route Visual Enti
"to": "kamelet:sink",
},
],
"uri": "timer",
"uri": "timer:user",
},
"id": "kamelet-1234",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ spec:
template:
from:
id: ${getCamelRandomId('from')}
uri: "timer"
uri: "timer:user"
parameters:
timerName: user
period: "{{period}}"
steps:
- to: https://random-data-api.com/api/v2/users
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ export const routeTemplate = () => {
id: ${getCamelRandomId('route')}
from:
id: ${getCamelRandomId('from')}
uri: timer
uri: timer:template
parameters:
timerName: template
period: "1000"
steps:
- log:
Expand Down
6 changes: 2 additions & 4 deletions packages/ui/src/utils/get-custom-schema-from-kamelet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ describe('getCustomSchemaFromKamelet', () => {
id: 'from-3836',
parameters: {
period: '{{period}}',
timerName: 'user',
},
uri: 'timer',
uri: 'timer:user',
},
},
types: {
Expand Down Expand Up @@ -195,9 +194,8 @@ describe('getCustomSchemaFromKamelet', () => {
id: 'from-3836',
parameters: {
period: '{{period}}',
timerName: 'user',
},
uri: 'timer',
uri: 'timer:user',
},
},
types: {
Expand Down
15 changes: 5 additions & 10 deletions packages/ui/src/utils/update-kamelet-from-custom-schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ describe('updateKameletFromCustomSchema', () => {
id: 'from-3836',
parameters: {
period: '{{period}}',
timerName: 'user',
},
uri: 'timer',
uri: 'timer:user',
},
},
types: {
Expand Down Expand Up @@ -150,9 +149,8 @@ describe('updateKameletFromCustomSchema', () => {
id: 'from-3836',
parameters: {
period: '{{period}}',
timerName: 'user',
},
uri: 'timer',
uri: 'timer:user',
},
},
types: {
Expand Down Expand Up @@ -230,9 +228,8 @@ describe('updateKameletFromCustomSchema', () => {
id: 'from-3836',
parameters: {
period: '{{period}}',
timerName: 'user',
},
uri: 'timer',
uri: 'timer:user',
},
},
types: {
Expand Down Expand Up @@ -350,9 +347,8 @@ describe('updateKameletFromCustomSchema', () => {
id: 'from-3836',
parameters: {
period: '{{period}}',
timerName: 'user',
},
uri: 'timer',
uri: 'timer:user',
},
},
types: {
Expand Down Expand Up @@ -428,9 +424,8 @@ describe('updateKameletFromCustomSchema', () => {
id: 'from-3836',
parameters: {
period: '{{period}}',
timerName: 'user',
},
uri: 'timer',
uri: 'timer:user',
},
},
types: {
Expand Down

0 comments on commit d27f684

Please sign in to comment.