-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gh-633 Stream Deployment: UX improvements
- Loading branch information
Showing
22 changed files
with
1,852 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* Represents a Stream Deploy Config. | ||
* | ||
* @author Damien Vitrac | ||
*/ | ||
export class StreamDeployConfig { | ||
|
||
skipper = false; | ||
|
||
id: string; | ||
|
||
platform: any; | ||
|
||
deployers: any; | ||
|
||
apps: any; | ||
|
||
constructor() { | ||
|
||
} | ||
|
||
platformExist(key: string): boolean { | ||
if (!key) { | ||
return true; | ||
} | ||
if (this.platform) { | ||
return this.platform.values.filter((a) => a.key === key).length > 0; | ||
} | ||
return false; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
ui/src/app/streams/stream-deploy/app-properties/app-properties.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import {Component, EventEmitter, ViewEncapsulation} from '@angular/core'; | ||
import {PropertiesDialogComponent} from '../../../shared/flo/properties/properties-dialog.component'; | ||
import {BsModalRef} from 'ngx-bootstrap'; | ||
import {StreamsService} from '../../streams.service'; | ||
import {StreamAppPropertiesSource, StreamHead} from '../../flo/properties/stream-properties-source'; | ||
import {StreamPropertiesGroupModel} from '../../flo/properties/stream-properties-dialog.component'; | ||
import {Observable} from 'rxjs/Observable'; | ||
import {Properties} from 'spring-flo'; | ||
|
||
/** | ||
* Component for displaying application properties and capturing their values. | ||
* | ||
* @author Damien Vitrac | ||
*/ | ||
@Component({ | ||
selector: 'app-stream-deploy-app-properties', | ||
templateUrl: '../../../shared/flo/properties/properties-dialog.component.html', | ||
styleUrls: ['../../../shared/flo/properties/properties-dialog.component.scss'], | ||
encapsulation: ViewEncapsulation.None | ||
}) | ||
export class StreamDeployAppPropertiesComponent extends PropertiesDialogComponent { | ||
|
||
public title: string; | ||
|
||
constructor(bsModalRef: BsModalRef, | ||
private streamService: StreamsService) { | ||
|
||
super(bsModalRef); | ||
} | ||
|
||
setData(propertiesSource: StreamAppPropertiesSource) { | ||
this.propertiesGroupModel = new StreamPropertiesGroupModel( | ||
propertiesSource, | ||
this.streamService); | ||
this.propertiesGroupModel.load(); | ||
} | ||
|
||
} | ||
|
||
export class AppPropertiesSource implements StreamAppPropertiesSource { | ||
|
||
private options: Array<any>; | ||
public confirm = new EventEmitter(); | ||
|
||
constructor(options: Array<any>) { | ||
this.options = options; | ||
} | ||
|
||
getStreamHead(): StreamHead { | ||
return {presentStreamNames: []}; | ||
} | ||
|
||
getProperties(): Promise<Properties.Property[]> { | ||
return Observable.of(this.options).toPromise(); | ||
} | ||
|
||
applyChanges(properties: Properties.Property[]): void { | ||
this.confirm.emit(properties); | ||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
ui/src/app/streams/stream-deploy/properties-debug/properties-debug.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div *ngIf="raw && raw.length > 0" class="properties-box"> | ||
<div class="property" *ngFor="let val of raw" [class.invalid]="val.status == 'invalid'"> | ||
<span *ngIf="val.status == 'invalid'" class="fa fa-warning"> | ||
</span> | ||
<span class="key">{{ val.key }}</span> | ||
<span class="equal"> = </span> | ||
<span class="value">{{ val.value }}</span> | ||
</div> | ||
</div> | ||
<div class="alert alert-info" style="display: inline-block" *ngIf="raw && raw.length == 0"> | ||
No properties defined | ||
</div> |
45 changes: 45 additions & 0 deletions
45
ui/src/app/streams/stream-deploy/properties-debug/properties-debug.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import {ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges} from '@angular/core'; | ||
|
||
/** | ||
* Component used to display parameters of a stream deployment | ||
* | ||
* @author Damien Vitrac | ||
*/ | ||
@Component({ | ||
selector: 'app-stream-deploy-properties-debug', | ||
templateUrl: 'properties-debug.component.html', | ||
styleUrls: ['../styles.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class StreamDeployPropertiesDebugComponent implements OnChanges { | ||
|
||
/** | ||
* Array of properties | ||
*/ | ||
@Input() raw: Array<PropertiesDebug>; | ||
|
||
constructor() { | ||
} | ||
|
||
/** | ||
* On Change | ||
* @param {SimpleChanges} changes | ||
*/ | ||
ngOnChanges(changes: SimpleChanges): void { | ||
if (changes.raw.currentValue) { | ||
this.raw = changes.raw.currentValue; | ||
} else { | ||
this.raw = []; | ||
} | ||
} | ||
|
||
} | ||
|
||
/** | ||
* Dedicate Interface for {@Link StreamDeployPropertiesDebugComponent} | ||
*/ | ||
export interface PropertiesDebug { | ||
key: string; | ||
value: string; | ||
status: string; | ||
} |
28 changes: 0 additions & 28 deletions
28
ui/src/app/streams/stream-deploy/stream-deploy-validators.spec.ts
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
ui/src/app/streams/stream-deploy/stream-deploy-validators.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.