Skip to content

Commit

Permalink
Merge pull request #357 from muzikovam/MSTR-Fix-#347
Browse files Browse the repository at this point in the history
Add encodeURIComponent for wf name string (same as #356)
  • Loading branch information
zFernand0 committed May 2, 2019
2 parents 819a626 + c581f33 commit ddda8a8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Expand Up @@ -21,12 +21,12 @@ const category = "Provisioning";
const statusName = "complete";
const owner = "owner1";
const vendor = "IBM";
const workflowName = "workflow1";
const workflowName = "workflow one";
const badString = "Ba?d";
const badString1 = "Ba&d";

const START_RESOURCE_QUERY: string = `${WorkflowConstants.RESOURCE}/${WorkflowConstants.ZOSMF_VERSION}/${WorkflowConstants.ARCH_WORKFLOW_RESOURCE}`;
const PRETEND_URL = START_RESOURCE_QUERY + `?workflowName=${workflowName}&category=${category}`
const PRETEND_URL = START_RESOURCE_QUERY + `?workflowName=${encodeURIComponent(workflowName)}&category=${category}`
+ `&system=${system}&owner=${owner}&vendor=${vendor}&statusName=${statusName}`;

const PRETEND_ZOSMF_RESPONSE: IWorkflowsInfo = {
Expand Down
4 changes: 2 additions & 2 deletions packages/workflows/__tests__/api/ListWorkflows.unit.test.ts
Expand Up @@ -21,12 +21,12 @@ const category = "Provisioning";
const statusName = "complete";
const owner = "owner1";
const vendor = "IBM";
const workflowName = "workflow1";
const workflowName = "workflow one";
const badString = "Ba?d";
const badString1 = "Ba&d";

const START_RESOURCE_QUERY: string = `${WorkflowConstants.RESOURCE}/${WorkflowConstants.ZOSMF_VERSION}/${WorkflowConstants.WORKFLOW_RESOURCE}`;
const PRETEND_URL = START_RESOURCE_QUERY + `?workflowName=${workflowName}&category=${category}`
const PRETEND_URL = START_RESOURCE_QUERY + `?workflowName=${encodeURIComponent(workflowName)}&category=${category}`
+ `&system=${system}&owner=${owner}&vendor=${vendor}&statusName=${statusName}`;

const PRETEND_ZOSMF_RESPONSE: IWorkflowsInfo = {
Expand Down
2 changes: 1 addition & 1 deletion packages/workflows/src/api/ListArchivedWorkflows.ts
Expand Up @@ -42,7 +42,7 @@ export class ListArchivedWorkflows {
WorkflowValidator.validateNotEmptyString(zOSMFVersion, nozOSMFVersion.message);
const resourcesQuery: string = ListArchivedWorkflows.getResourcesQuery(zOSMFVersion,
[
{key: WorkflowConstants.workflowName, value : workflowName},
{key: WorkflowConstants.workflowName, value : workflowName ? encodeURIComponent(workflowName) : null},
{key: WorkflowConstants.category, value : category},
{key: WorkflowConstants.system, value : system},
{key: WorkflowConstants.owner, value : owner},
Expand Down
2 changes: 1 addition & 1 deletion packages/workflows/src/api/ListWorkflows.ts
Expand Up @@ -42,7 +42,7 @@ export class ListWorkflows {
WorkflowValidator.validateNotEmptyString(zOSMFVersion, nozOSMFVersion.message);
const resourcesQuery: string = ListWorkflows.getResourcesQuery(zOSMFVersion,
[
{key: WorkflowConstants.workflowName, value : workflowName},
{key: WorkflowConstants.workflowName, value : workflowName ? encodeURIComponent(workflowName) : null},
{key: WorkflowConstants.category, value : category},
{key: WorkflowConstants.system, value : system},
{key: WorkflowConstants.owner, value : owner},
Expand Down

0 comments on commit ddda8a8

Please sign in to comment.