function generateUrl()

in src/models/workflow-listing/index.js [6:23]


function generateUrl(path, isDirectory = true) {
  if (routes.loaded && routes.workflowsConfigured) {
    let url = `${routes.workflows}`;
    if (!url.endsWith('/')) {
      url = `${url}/`;
    }
    if (path) {
      url = `${url}${path}`;
    }
    if (!url.endsWith('/') && isDirectory) {
      url = `${url}/`;
    } else if (url.endsWith('/') && !isDirectory) {
      url = url.substr(0, url.length - 1);
    }
    return url;
  }
  return null;
}