Sha256: e84815fe662b284376361deb67080d2cefd458f513631234000742421d4a3c4b

Contents?: true

Size: 1.18 KB

Versions: 10

Compression:

Stored size: 1.18 KB

Contents

import { decodeModelId } from './globalIdHelper';

const experimental = path => `/experimental${path}`;

const showPath = path => `${path}/:id`;
const newPath = path => `${path}/new`;

export const modelPath = (basePath, model) =>
  `${basePath}/${decodeModelId(model)}`;

// react-router uses path-to-regexp, should we use it as well in a future?
// https://github.com/pillarjs/path-to-regexp/tree/v1.7.0#compile-reverse-path-to-regexp
export const resolvePath = (path, params) =>
  Object.entries(params).reduce(
    (memo, [key, value]) => memo.replace(key, value),
    path
  );

export const ovalContentsApiPath = '/api/v2/compliance/oval_contents';

export const ovalContentsPath = experimental('/compliance/oval_contents');
export const ovalContentsShowPath = showPath(ovalContentsPath);
export const ovalContentsNewPath = newPath(ovalContentsPath);
export const ovalPoliciesPath = experimental('/compliance/oval_policies');
export const ovalPoliciesShowPath = `${showPath(ovalPoliciesPath)}/:tab?`;
export const ovalPoliciesNewPath = newPath(ovalPoliciesPath);
export const hostsPath = '/hosts';
export const newJobPath = newPath('/job_invocations');
export const hostsShowPath = showPath(hostsPath);

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
foreman_openscap-8.0.0 webpack/helpers/pathsHelper.js
foreman_openscap-7.1.1 webpack/helpers/pathsHelper.js
foreman_openscap-7.1.0 webpack/helpers/pathsHelper.js
foreman_openscap-7.0.0 webpack/helpers/pathsHelper.js
foreman_openscap-6.0.0 webpack/helpers/pathsHelper.js
foreman_openscap-5.2.3 webpack/helpers/pathsHelper.js
foreman_openscap-5.2.2 webpack/helpers/pathsHelper.js
foreman_openscap-5.1.1 webpack/helpers/pathsHelper.js
foreman_openscap-5.2.1 webpack/helpers/pathsHelper.js
foreman_openscap-5.2.0 webpack/helpers/pathsHelper.js