Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit 55a202c

Browse files
committed
Register Applications: update validation rule name
Resolves #770
1 parent 7a58b86 commit 55a202c

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

ui/src/app/apps/apps-register/apps-register.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ describe('AppsRegisterComponent', () => {
9292
it('should display an error if no the name is invalid', () => {
9393
const tests = [
9494
{name: '', type: 'source', uri: 'http://foo.bar', metaDataUri: '', force: false},
95-
{name: 'foo bar', type: 'sink', uri: 'http://foo.bar', metaDataUri: '', force: false}
95+
{name: 'd', type: 'sink', uri: 'http://foo.bar', metaDataUri: '', force: false}
9696
];
9797
const form = component.forms[0];
9898
tests.forEach((test) => {

ui/src/app/apps/apps-register/apps-register.validator.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@ describe('AppsRegisterValidator', () => {
1111
describe('appName', () => {
1212

1313
it('invalid', () => {
14-
[' ', 'f', 'fo ', 'foo>', 'foo.', 'foo/', 'foo?', 'foo{', 'foo}', 'foo^', 'foo$', 'foo#', 'foo@', 'foo*',
15-
'foo(', 'foo)', 'foo[', 'foo]', 'foo<', 'foo>', 'foo,', 'foo!', 'foo|', 'foo bar'].forEach((mock) => {
14+
[' ', 'f'].forEach((mock) => {
1615
const appName: FormControl = new FormControl(mock);
1716
const result = AppsRegisterValidator.appName(appName);
1817
expect(result.invalid).toBeTruthy();
1918
});
2019
});
2120

2221
it('valid', () => {
23-
[null, 'fo', 'foo', 'f12', 'foo12', 'foooooooooooooooooooooooooo'].forEach((mock) => {
22+
[null, 'fo', 'foo', 'f12', 'foo12', 'foooooooooooooooooooooooooo', 'fo ', 'foo>', 'foo.', 'foo/', 'foo?', 'foo-',
23+
'foo{', 'foo}', 'foo^', 'foo$', 'foo#', 'foo@', 'foo*', 'foo(', 'foo)', 'foo[', 'foo]', 'foo<', 'foo>',
24+
'foo,', 'foo!', 'foo|', 'foo bar'].forEach((mock) => {
2425
const appName: FormControl = new FormControl(mock);
2526
const result = AppsRegisterValidator.appName(appName);
2627
expect(result).toBeNull();

ui/src/app/apps/apps-register/apps-register.validator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class AppsRegisterValidator {
1111
/**
1212
* Name regex
1313
*/
14-
static nameRegex = /^[a-zA-Z0-9]{2,50}$/;
14+
static nameRegex = /^.{2,250}$/;
1515

1616
/**
1717
* Uri regex

0 commit comments

Comments
 (0)