Skip to content

Commit

Permalink
Conductor search v1 support conductor archive
Browse files Browse the repository at this point in the history
  • Loading branch information
Jozef Volak authored and marosmars committed Mar 8, 2023
1 parent f8ccba0 commit 312ad1e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/proxy/transformers/__tests__/workflow-rbac-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ describe('Workflow transformers', () => {
transformer(mockIdentity(), mockReq, null, callback);
}).then(() => {
expect(mockReq.url).toStrictEqual(
'/api/workflow/search-v2?' +
'/api/workflow/search?' +
escape('status IN (FAILED)') +
'=&query=' +
escape("correlationId='fb.com'"),
Expand Down
2 changes: 1 addition & 1 deletion src/proxy/transformers/workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const getSearchBefore: BeforeFun = (
newQueryString = updateQuery(newQueryString, limitToUser);
}

req.url = req._parsedUrl.pathname + '-v2?' + newQueryString;
req.url = `${req._parsedUrl.pathname}?${newQueryString}`;
proxyCallback();
};

Expand Down
11 changes: 6 additions & 5 deletions src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,26 @@ const findSchedule = (schedules, name) => {
searching executed workflows by freeText search query.
If input parameters are not valid, function return exception with an array object with status and error message. */
export function format_query(req) {
const UNDEFINED = 'undefined';
const query = [];

console.log(req.query);

if (
typeof req.query.workflowId !== 'undefined' &&
typeof req.query.workflowId !== UNDEFINED &&
req.query.workflowId !== ''
) {
if (req.query.workflowId.match(uuid_regex) !== null) {
query.push("workflowId='" + req.query.workflowId + "'");
query.push(`workflowId='${req.query.workflowId}'`);
} else if (
typeof req.query.workflowId !== 'undefined' &&
typeof req.query.workflowId !== UNDEFINED &&
req.query.workflowId.match(uuid_regex) === null
) {
query.push("workflowType='" + req.query.workflowId + "'");
query.push(`workflowType='${req.query.workflowId}'`);
}
}

if (typeof req.query.status !== 'undefined' && req.query.status !== '') {
if (typeof req.query.status !== UNDEFINED && req.query.status !== '') {
if (WORKFLOW_STATUS_TYPES.includes(req.query.status)) {
query.push("status='" + req.query.status + "'");
} else {
Expand Down

0 comments on commit 312ad1e

Please sign in to comment.