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

Commit e358e0e

Browse files
oodamienilayaperumalg
authored andcommitted
Stream deploy: fix error toggle builder
Fix regex Remove disabled state when errors messages are presents
1 parent 9bf06ac commit e358e0e

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

ui/src/app/streams/stream-deploy/builder/builder.component.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,9 +445,6 @@ export class StreamDeployBuilderComponent implements OnInit, OnDestroy {
445445
* @returns {boolean}
446446
*/
447447
isSubmittable(builder): boolean {
448-
if ((builder.errors.app.length + builder.errors.global.length) > 0) {
449-
return false;
450-
}
451448
return builder.formGroup.valid;
452449
}
453450

ui/src/app/streams/stream-deploy/stream-deploy.service.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Injectable } from '@angular/core';
22
import { Observable } from 'rxjs/Observable';
33
import { Platform } from '../model/platform';
4-
import { SharedAboutService } from '../../shared/services/shared-about.service';
54
import { StreamsService } from '../streams.service';
65
import { mergeMap } from 'rxjs/operators';
76
import { Parser } from '../../shared/services/parser';
@@ -16,7 +15,6 @@ import {
1615
import { StreamDeployConfig } from '../model/stream-deploy-config';
1716
import { Utils } from '../../shared/flo/support/utils';
1817

19-
2018
/**
2119
* Provides {@link StreamDeployConfig} related services.
2220
*
@@ -39,11 +37,11 @@ export class StreamDeployService {
3937
*/
4038
public static deployer = {
4139
is: (key: string): boolean => {
42-
return /^(deployer)((\.\*)|([.][a-zA-Z0-9]{1,50})?)+([.][a-zA-Z0-9]{1,50})$/.test(key);
40+
return /^(deployer.)/.test(key);
4341
},
4442
extract: (key: string): string => {
45-
const result = key.match(/^deployer\.[\w\*]+.(.*)$/);
46-
return result.length > 1 ? result[1] : '';
43+
const result = key.split('.');
44+
return result.length > 2 ? result[2] : '';
4745
},
4846
};
4947

@@ -52,7 +50,7 @@ export class StreamDeployService {
5250
*/
5351
public static version = {
5452
is: (key: string): boolean => {
55-
return /^(version)+([.][a-zA-Z0-9]{2,50})$/.test(key);
53+
return /^(version.)/.test(key);
5654
}
5755
};
5856

@@ -61,11 +59,11 @@ export class StreamDeployService {
6159
*/
6260
public static app = {
6361
is: (key: string): boolean => {
64-
return /^(app)((\.\*)|([.][a-zA-Z0-9-\-]{1,50})?)+([.][a-zA-Z0-9-\-]{1,50})$/.test(key);
62+
return /^(app.)/.test(key);
6563
},
6664
extract: (key: string): string => {
67-
const result = key.match(/^app\.[\w\*]+.(.*)$/);
68-
return result.length > 1 ? result[1] : '';
65+
const result = key.split('.');
66+
return result.length > 2 ? result[2] : '';
6967
}
7068
};
7169

@@ -275,5 +273,4 @@ export class StreamDeployService {
275273
});
276274
}
277275

278-
279276
}

0 commit comments

Comments
 (0)