From 3e57c2133e896975391c1a0b39275f73b7f650ea Mon Sep 17 00:00:00 2001 From: Rob Szkutak Date: Thu, 11 Jan 2018 18:27:25 -0600 Subject: [PATCH] Issue 503 --- .../main/ui/app/mlcp-ui/mlcp-ui.component.ts | 57 ++++++++++++++++++- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/quick-start/src/main/ui/app/mlcp-ui/mlcp-ui.component.ts b/quick-start/src/main/ui/app/mlcp-ui/mlcp-ui.component.ts index 33a3a4d7cd..880282d552 100644 --- a/quick-start/src/main/ui/app/mlcp-ui/mlcp-ui.component.ts +++ b/quick-start/src/main/ui/app/mlcp-ui/mlcp-ui.component.ts @@ -62,6 +62,9 @@ export class MlcpUiComponent implements OnChanges { }, 'Transform Options': { collapsed: true + }, + 'Flow Options': { + collapsed: true } }; @@ -384,9 +387,38 @@ export class MlcpUiComponent implements OnChanges { field: 'transform_param', type: 'string', description: 'Optional extra data to pass through to a custom transformation function. Ignored if -transform_module is not specified.\nDefault: no namespace. For details, see Transforming Content During Ingestion.', - value: `entity-name=${encodeURIComponent(entityName)},flow-name=${encodeURIComponent(flowName)}`, + value: ' ', + readOnly: false, + }, + ], + collapsed: true, + }, + { + category: 'Flow Options', + settings: [ + { + label: 'Entity Name', + field: 'entity-name', + type: 'string', + description: 'The name of your entity being built.', + value: `${encodeURIComponent(entityName)}`, readOnly: true, }, + { + label: 'Flow Name', + field: 'entity-name', + type: 'string', + description: 'The name of your flow being built.', + value: `${encodeURIComponent(flowName)}`, + readOnly: true, + }, + { + label: 'Job Id', + field: 'jobId', + type: 'string', + description: 'The unique ID of your Input Flow job. If not specified, one will be auto-generated for you.', + readOnly: false, + }, ], collapsed: true, }, @@ -487,9 +519,15 @@ export class MlcpUiComponent implements OnChanges { const key = setting.field; let value = setting.value; if (setting.type !== 'boolean' && setting.type !== 'number') { - value = '"' + setting.value + '"'; + if(group.category !== 'Flow Options') + value = '"' + setting.value + '"'; + else + value = setting.value; } - this.addMlcpOption(options, key, value, true, true); + if(group.category !== 'Flow Options') + this.addMlcpOption(options, key, value, true, true); + else + this.appendFlowOption(options, key, value) } }); } @@ -512,6 +550,19 @@ export class MlcpUiComponent implements OnChanges { } } + appendFlowOption(options: any, key: string, value: string): + void { + let tp = options[options.length-1]; + let n = tp.substring(0, tp.length-1); + if(n.length > 2) + n = n + ","; + else + n = '"'; + n = n + key + "=" + value + '"'; + options.pop(); + options.push(n); + } + updateSetting(setting: any, value: any): void { setting.value = value; this.updateMlcpCommand();