Skip to content

Commit ee25df9

Browse files
authored
fix(about): allow alternate build suffix separator characters (#1582)
1 parent f7f4d3f commit ee25df9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/app/About/AboutDescription.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { useCryostatTranslation } from '@i18n/i18nextUtil';
2323
import { Text, TextContent, TextList, TextListItem, TextVariants } from '@patternfly/react-core';
2424
import * as React from 'react';
2525

26-
export const VERSION_REGEX = /^(v?[0-9]+\.[0-9]+\.[0-9]+)(?:-(.+))?$/;
26+
export const VERSION_REGEX = /^(v?[0-9]+\.[0-9]+\.[0-9]+)(?:[-_\.](.+))?$/;
2727

2828
export const AboutDescription: React.FC = () => {
2929
const serviceContext = React.useContext(ServiceContext);

src/test/About/AboutDescription.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ describe('<AboutDescription />', () => {
6767
{ str: '3.0.0-vendor123', version: '3.0.0', build: 'vendor123' },
6868
{ str: 'v3.0.0-vendor123', version: 'v3.0.0', build: 'vendor123' },
6969
{ str: 'v1.2.3-branch-vendor123', version: 'v1.2.3', build: 'branch-vendor123' },
70+
{ str: 'v1.2.3.branch-vendor123', version: 'v1.2.3', build: 'branch-vendor123' },
71+
{ str: 'v1.2.3_branch-vendor123', version: 'v1.2.3', build: 'branch-vendor123' },
7072
{ str: 'v1.2.3-branch-vendor.tag123_a', version: 'v1.2.3', build: 'branch-vendor.tag123_a' },
7173
{ str: 'v1.2.3-abcd1234', version: 'v1.2.3', build: 'abcd1234' },
7274
];

0 commit comments

Comments
 (0)