Skip to content

Commit

Permalink
Fix: Introduce new function to remove leading zero fron version for c…
Browse files Browse the repository at this point in the history
…orrect links to GSM-Manual
  • Loading branch information
y0urself committed Jun 8, 2022
1 parent d3cf6ff commit ca25599
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gmp/gmpsettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import {RELEASE_VERSION} from '../version';
import {RELEASE_VERSION, REMOVED_ZERO_RELEASE_VERSION} from '../version';

import {isDefined} from './utils/identity';

export const DEFAULT_RELOAD_INTERVAL = 15 * 1000; // fifteen seconds
export const DEFAULT_RELOAD_INTERVAL_ACTIVE = 3 * 1000; // three seconds
export const DEFAULT_RELOAD_INTERVAL_INACTIVE = 60 * 1000; // one minute
export const DEFAULT_MANUAL_URL = `http://docs.greenbone.net/GSM-Manual/gos-${RELEASE_VERSION}/`;
export const DEFAULT_MANUAL_URL = `http://docs.greenbone.net/GSM-Manual/gos-${REMOVED_ZERO_RELEASE_VERSION}/`;
export const DEFAULT_PROTOCOLDOC_URL = `https://docs.greenbone.net/API/GMP/gmp-${RELEASE_VERSION}.html`;
export const DEFAULT_REPORT_RESULTS_THRESHOLD = 25000;
export const DEFAULT_LOG_LEVEL = 'warn';
Expand Down
7 changes: 7 additions & 0 deletions src/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,15 @@ const getMajorMinorVersion = () => {
return `${major}.${minor}`;
};

const getCleanedMajorMinorVersion = () => {
// eslint-disable-next-line no-unused-vars
const [major, minor, ...rest] = VERSION.split('.');
return `${major}.${parseInt(minor)}`;
};

export const VERSION = '22.04.0.dev1';

export const RELEASE_VERSION = getMajorMinorVersion();
export const REMOVED_ZERO_RELEASE_VERSION = getCleanedMajorMinorVersion();

export default VERSION;

0 comments on commit ca25599

Please sign in to comment.