@lowcodeunit/applications-flow-common 1.33.216-lets-get-social-ish → 1.33.217-lets-get-social-ish

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3809,147 +3809,607 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImpor
3809
3809
  args: [{ selector: 'lcu-gh-control', template: "<mat-card class=\"social-card\">\n <div class=\"gh-card-container\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n <mat-icon fxFlex=\"15%\" class=\"gh-icon\">error_outline</mat-icon>\n <div fxFlex=\"70%\"class=\"gh-card-main-content\">\n <mat-form-field appearance=\"fill\" class=\"gh-input\">\n <mat-label>{{InputLabel}}</mat-label>\n <input matInput type=\"text\" [(ngModel)]=\"value\">\n <!-- <button *ngIf=\"value\" matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"value=''\">\n <mat-icon>close</mat-icon>\n </button> -->\n </mat-form-field>\n </div>\n <button fxFlex=\"15%\" mat-button (click)=\"Submit()\" id=\"submit-btn\">Submit</button>\n </div>\n\n <mat-card-actions fxLayout=\"row\" fxLayoutAlign=\"space-around center\">\n <button mat-button (click)=\"CreatePullRequest()\" id=\"pr-btn\">Pull Request</button>\n <button mat-button (click)=\"OpenIssue()\" id=\"oi-btn\">Open Issue</button>\n <button mat-button (click)=\"CreateFeatureBranch()\" id=\"fb-btn\">Feature Branch</button>\n <button mat-icon-button (click)=\"OpenMoreInfo()\">\n <mat-icon>more_horiz</mat-icon>\n </button>\n </mat-card-actions>\n </mat-card>", styles: [":host ::ng-deep .social-card{margin:20px;padding:15px 5px}:host ::ng-deep mat-card-actions{margin-bottom:-1px!important;margin-left:0!important;margin-right:-.5px!important}:host ::ng-deep .main-slot-container{padding:10px}:host ::ng-deep .slot-header{align-items:center}:host ::ng-deep .slot-content{width:100%}:host ::ng-deep .slot-name{font-size:13px;font-weight:600}:host ::ng-deep .slot-description{font-size:12px;margin-right:10px}:host ::ng-deep .slot-action-anchor{font-size:10px;text-decoration:none;color:#000}:host ::ng-deep .action-icon{height:25px;width:25px;font-size:25px;cursor:pointer}.gh-icon{width:60px;height:60px;font-size:60px;text-align:center}.gh-input{width:90%}.selected{border:1px solid green}::ng-deep .mat-form-field-flex{border:1px solid;border-radius:30px!important}::ng-deep .mat-form-field-wrapper{padding-bottom:0!important}\n"] }]
3810
3810
  }], ctorParameters: function () { return []; } });
3811
3811
 
3812
- class MainFeedCardComponent {
3813
- constructor(eacSvc) {
3812
+ class DevopsSourceControlFormComponent {
3813
+ // Constructors
3814
+ constructor(appsFlowSvc, eacSvc, formBuilder) {
3815
+ this.appsFlowSvc = appsFlowSvc;
3814
3816
  this.eacSvc = eacSvc;
3817
+ this.formBuilder = formBuilder;
3818
+ this.SeparatorKeysCodes = [ENTER, COMMA];
3819
+ this.SaveStatusEvent = new EventEmitter;
3820
+ this.BuildPath = null;
3821
+ this.HostingDetails = new ProjectHostingDetails();
3822
+ this.SelectedBranches = [];
3823
+ this.SourceControlRoot = '';
3824
+ this.UseBranches = true;
3825
+ this.UseBuildPath = false;
3815
3826
  }
3816
- get Icon() {
3817
- if (this.FeedItem.Status.Code === 0) {
3818
- return 'check_circle';
3819
- }
3820
- else if (this.FeedItem.Status.Code === 1) {
3821
- return 'cancel';
3827
+ // Properties
3828
+ get ArtifactLookups() {
3829
+ return this.DevOpsAction?.ArtifactLookups;
3830
+ }
3831
+ get ArtifactLookup() {
3832
+ const artLookup = this.DevOpsAction?.ArtifactLookups
3833
+ ? this.DevOpsAction?.ArtifactLookups[0]
3834
+ : null;
3835
+ return artLookup;
3836
+ }
3837
+ get Artifact() {
3838
+ return this.Environment?.Artifacts && this.ArtifactLookup
3839
+ ? this.Environment?.Artifacts[this.ArtifactLookup] || {}
3840
+ : {};
3841
+ }
3842
+ get BranchesFormControl() {
3843
+ return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'branches');
3844
+ }
3845
+ get BuildPathFormControl() {
3846
+ return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'buildPath');
3847
+ }
3848
+ get DevOpsActionLookups() {
3849
+ // console.log(this.DevOpsActions);
3850
+ return Object.keys(this.DevOpsActions || {});
3851
+ }
3852
+ get DevOpsAction() {
3853
+ return this.Environment.DevOpsActions && this.DevOpsActionLookup
3854
+ ? this.Environment.DevOpsActions[this.DevOpsActionLookup] || {}
3855
+ : {};
3856
+ }
3857
+ get DevOpsActionLookup() {
3858
+ if (!!this.DevOpsActionLookupFormControl?.value) {
3859
+ return this.DevOpsActionLookupFormControl.value;
3822
3860
  }
3823
- else if (this.FeedItem.Status.Code === 2) {
3824
- return 'sync';
3861
+ if (!!this.EditingSourceControl?.DevOpsActionTriggerLookups) {
3862
+ return this.EditingSourceControl?.DevOpsActionTriggerLookups[0];
3825
3863
  }
3826
3864
  else {
3827
- return 'help_outline';
3865
+ return null;
3828
3866
  }
3829
3867
  }
3830
- get IconColor() {
3831
- if (this.FeedItem.Status.Code === 0) {
3832
- return 'green';
3833
- }
3834
- else if (this.FeedItem.Status.Code === 1) {
3835
- return 'red';
3836
- }
3837
- else if (this.FeedItem.Status.Code === 2) {
3838
- return 'blue';
3839
- }
3840
- else {
3841
- return 'gray';
3868
+ get DevOpsActionLookupFormControl() {
3869
+ return this.DevOpsSourceControlFormGroup.get('devOpsActionLookup');
3870
+ }
3871
+ get DevOpsActions() {
3872
+ return this.Environment.DevOpsActions || {};
3873
+ }
3874
+ get EditingSourceControl() {
3875
+ let sc = this.Environment?.Sources
3876
+ ? this.Environment?.Sources[this.EditingSourceControlLookup]
3877
+ : null;
3878
+ if (sc == null && this.EditingSourceControlLookup) {
3879
+ sc = {};
3842
3880
  }
3881
+ return sc;
3882
+ }
3883
+ get MainBranchFormControl() {
3884
+ return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'mainBranch');
3885
+ }
3886
+ get OrganizationFormControl() {
3887
+ return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'organization');
3888
+ }
3889
+ get RepositoryFormControl() {
3890
+ return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'repository');
3891
+ }
3892
+ get State() {
3893
+ return this.eacSvc.State;
3843
3894
  }
3844
3895
  // Life Cycle
3896
+ ngAfterViewInit() { }
3897
+ ngOnDestroy() {
3898
+ this.destroyFormControls();
3899
+ }
3845
3900
  ngOnInit() {
3846
- this.handleRefresh();
3901
+ if (this.EditingSourceControlLookup === null) {
3902
+ this.CreateNewSourceControl();
3903
+ }
3904
+ if (this.EditingSourceControl != null) {
3905
+ this.DevOpsSourceControlFormGroup = this.formBuilder.group({});
3906
+ this.setupFormControls();
3907
+ }
3908
+ this.RefreshOrganizations();
3847
3909
  }
3848
3910
  // API Methods
3849
- CalculateTimelapse(timestamp) {
3850
- return moment(timestamp).fromNow();
3911
+ AddBranchOption(event) {
3912
+ this.addBranchOption(event.value);
3913
+ event.input.value = '';
3851
3914
  }
3852
- HandleAction(action) {
3853
- if (action.ActionType == 'Link') {
3854
- if (action.Action.startsWith('http')) {
3855
- window.open(action.Action, '_blank');
3856
- }
3857
- else {
3858
- window.location.href = action.Action;
3859
- }
3860
- }
3861
- else if (action.ActionType == 'Modal') {
3862
- if (action.Action == 'AddSourceControl') {
3863
- // TODO: George launch source control modal
3864
- alert('AddSourceControl modaled');
3865
- }
3866
- else {
3867
- alert('other modaled ' + action.Action);
3868
- }
3869
- }
3915
+ BranchOptionSelected(event) {
3916
+ this.addBranchOption(event.option.value);
3870
3917
  }
3871
- handleRefresh() {
3872
- if (this.FeedItem?.RefreshLink) {
3873
- setTimeout(() => {
3874
- this.eacSvc.CheckUserFeedItem(this.FeedItem).subscribe(async (response) => {
3875
- if (response.Status.Code === 0) {
3876
- this.FeedItem = response.Model;
3877
- this.handleRefresh();
3878
- }
3879
- else {
3880
- console.log(response);
3881
- }
3882
- }, (err) => {
3883
- console.log(err);
3884
- });
3885
- }, 5000);
3886
- }
3918
+ BranchesChanged(branches) {
3919
+ this.loadProjectHostingDetails();
3887
3920
  }
3888
- }
3889
- MainFeedCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: MainFeedCardComponent, deps: [{ token: EaCService }], target: i0.ɵɵFactoryTarget.Component });
3890
- MainFeedCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: MainFeedCardComponent, selector: "lcu-main-feed-card", inputs: { FeedItem: ["feed-item", "FeedItem"] }, ngImport: i0, template: "<mat-card class=\"social-card\">\n <mat-card-header>\n <img\n mat-card-avatar\n class=\"example-header-image\"\n [src]=\"FeedItem.Avatar\"\n *ngIf=\"FeedItem.Avatar\"\n />\n\n <mat-card-title *ngIf=\"FeedItem.Title\">{{ FeedItem.Title }}</mat-card-title>\n\n <mat-card-subtitle>\n <div *ngIf=\"FeedItem.Subtitle\">{{ FeedItem.Subtitle }}</div>\n <div *ngIf=\"FeedItem.Status\">\n <mat-icon\n *ngIf=\"Icon\"\n [style.color]=\"IconColor\"\n [class.spin]=\"FeedItem.Status?.Code == 2\"\n >\n {{ Icon }}\n </mat-icon>\n\n <span *ngIf=\"FeedItem.Timestamp\">\n {{ CalculateTimelapse(FeedItem.Timestamp) }}\n </span>\n </div>\n </mat-card-subtitle>\n </mat-card-header>\n\n <div *ngIf=\"!FeedItem.IsShortForm\">\n <!-- <div class=\"feed-card-container\">\n <div class=\"feed-card-main-content\">\n The tab content (only 1 'tab' for now)... So really we don't need to worry about tabs until a future iteration\n\n The tabs property will contain a data structure that will vary by the FeedItem.Type... That structure can be used to render the content\n </div>\n </div> -->\n </div>\n\n <mat-card-actions fxLayout=\"row\" fxLayoutAlign=\"space-around center\">\n <div fxFlex></div>\n\n <ng-container *ngFor=\"let action of FeedItem.Actions\">\n <button mat-button [color]=\"action.Color\" (click)=\"HandleAction(action)\">\n <mat-icon *ngIf=\"action.Icon\">{{ action.Icon }}</mat-icon>\n\n {{ action.Text }}\n </button>\n </ng-container>\n </mat-card-actions>\n</mat-card>\n", styles: [":host :host ::ng-deep .social-card{margin:20px;padding:15px 5px}:host :host ::ng-deep mat-card-actions{margin-bottom:-1px!important;margin-left:0!important;margin-right:-.5px!important}:host :host ::ng-deep .main-slot-container{padding:10px}:host :host ::ng-deep .slot-header{align-items:center}:host :host ::ng-deep .slot-content{width:100%}:host :host ::ng-deep .slot-name{font-size:13px;font-weight:600}:host :host ::ng-deep .slot-description{font-size:12px;margin-right:10px}:host :host ::ng-deep .slot-action-anchor{font-size:10px;text-decoration:none;color:#000}:host :host ::ng-deep .action-icon{height:25px;width:25px;font-size:25px;cursor:pointer}:host .example-header-image{background-size:cover}:host .mat-icon{display:inline-flex;vertical-align:middle}:host .mat-icon.spin{animation:rotate 1s ease-in-out infinite}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], components: [{ type: i4.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i4.MatCardHeader, selector: "mat-card-header" }, { type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i2$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.MatCardAvatar, selector: "[mat-card-avatar], [matCardAvatar]" }, { type: i4.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { type: i4.MatCardSubtitle, selector: "mat-card-subtitle, [mat-card-subtitle], [matCardSubtitle]" }, { type: i4.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { type: i5$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i5$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i5$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
3891
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: MainFeedCardComponent, decorators: [{
3892
- type: Component,
3893
- args: [{ selector: 'lcu-main-feed-card', template: "<mat-card class=\"social-card\">\n <mat-card-header>\n <img\n mat-card-avatar\n class=\"example-header-image\"\n [src]=\"FeedItem.Avatar\"\n *ngIf=\"FeedItem.Avatar\"\n />\n\n <mat-card-title *ngIf=\"FeedItem.Title\">{{ FeedItem.Title }}</mat-card-title>\n\n <mat-card-subtitle>\n <div *ngIf=\"FeedItem.Subtitle\">{{ FeedItem.Subtitle }}</div>\n <div *ngIf=\"FeedItem.Status\">\n <mat-icon\n *ngIf=\"Icon\"\n [style.color]=\"IconColor\"\n [class.spin]=\"FeedItem.Status?.Code == 2\"\n >\n {{ Icon }}\n </mat-icon>\n\n <span *ngIf=\"FeedItem.Timestamp\">\n {{ CalculateTimelapse(FeedItem.Timestamp) }}\n </span>\n </div>\n </mat-card-subtitle>\n </mat-card-header>\n\n <div *ngIf=\"!FeedItem.IsShortForm\">\n <!-- <div class=\"feed-card-container\">\n <div class=\"feed-card-main-content\">\n The tab content (only 1 'tab' for now)... So really we don't need to worry about tabs until a future iteration\n\n The tabs property will contain a data structure that will vary by the FeedItem.Type... That structure can be used to render the content\n </div>\n </div> -->\n </div>\n\n <mat-card-actions fxLayout=\"row\" fxLayoutAlign=\"space-around center\">\n <div fxFlex></div>\n\n <ng-container *ngFor=\"let action of FeedItem.Actions\">\n <button mat-button [color]=\"action.Color\" (click)=\"HandleAction(action)\">\n <mat-icon *ngIf=\"action.Icon\">{{ action.Icon }}</mat-icon>\n\n {{ action.Text }}\n </button>\n </ng-container>\n </mat-card-actions>\n</mat-card>\n", styles: [":host :host ::ng-deep .social-card{margin:20px;padding:15px 5px}:host :host ::ng-deep mat-card-actions{margin-bottom:-1px!important;margin-left:0!important;margin-right:-.5px!important}:host :host ::ng-deep .main-slot-container{padding:10px}:host :host ::ng-deep .slot-header{align-items:center}:host :host ::ng-deep .slot-content{width:100%}:host :host ::ng-deep .slot-name{font-size:13px;font-weight:600}:host :host ::ng-deep .slot-description{font-size:12px;margin-right:10px}:host :host ::ng-deep .slot-action-anchor{font-size:10px;text-decoration:none;color:#000}:host :host ::ng-deep .action-icon{height:25px;width:25px;font-size:25px;cursor:pointer}:host .example-header-image{background-size:cover}:host .mat-icon{display:inline-flex;vertical-align:middle}:host .mat-icon.spin{animation:rotate 1s ease-in-out infinite}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
3894
- }], ctorParameters: function () { return [{ type: EaCService }]; }, propDecorators: { FeedItem: [{
3895
- type: Input,
3896
- args: ['feed-item']
3897
- }] } });
3898
-
3899
- class TwoColumnHeaderComponent {
3900
- constructor() { }
3901
- ngOnInit() {
3921
+ BuildPathChanged(event) {
3922
+ //do something??
3902
3923
  }
3903
- }
3904
- TwoColumnHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TwoColumnHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3905
- TwoColumnHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: TwoColumnHeaderComponent, selector: "lcu-two-column-header", ngImport: i0, template: "<div class=\"col-container\" fxLayout=\"row\">\n\n <div class=\"col-left\" fxFlex=\"15%\" >\n <ng-content select=\"[left]\"></ng-content>\n </div>\n\n <div class=\"col-center\" fxFlex=\"85%\">\n <ng-content></ng-content>\n </div>\n\n</div>\n", styles: [".col-container{background-color:#ebecf0}.col-left{min-width:210px}\n"], directives: [{ type: i5$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i5$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }] });
3906
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TwoColumnHeaderComponent, decorators: [{
3907
- type: Component,
3908
- args: [{ selector: 'lcu-two-column-header', template: "<div class=\"col-container\" fxLayout=\"row\">\n\n <div class=\"col-left\" fxFlex=\"15%\" >\n <ng-content select=\"[left]\"></ng-content>\n </div>\n\n <div class=\"col-center\" fxFlex=\"85%\">\n <ng-content></ng-content>\n </div>\n\n</div>\n", styles: [".col-container{background-color:#ebecf0}.col-left{min-width:210px}\n"] }]
3909
- }], ctorParameters: function () { return []; } });
3910
-
3911
- class CardCarouselComponent {
3912
- constructor() {
3913
- this.carouselIndex = 0;
3924
+ CreateNewSourceControl() {
3925
+ this.SetEditingSourceControl(Guid.CreateRaw());
3914
3926
  }
3915
- ngOnInit() {
3927
+ CreateRepository() {
3928
+ this.CreatingRepository = true;
3929
+ this.RepositoryFormControl.reset();
3916
3930
  }
3917
- ngAfterViewInit() {
3918
- this.assignCarouselClass();
3931
+ CancelCreateRepository() {
3932
+ this.CreatingRepository = false;
3919
3933
  }
3920
- LeftChevronClicked() {
3921
- this.removeCarouselClasses();
3922
- if (this.carouselIndex === 0) {
3923
- this.carouselIndex = this.Stats.length - 1;
3934
+ DevOpsActionLookupChanged(event) {
3935
+ this.configureDevOpsAction();
3936
+ }
3937
+ MainBranchChanged(event) {
3938
+ this.emitBranchesChanged();
3939
+ }
3940
+ OrganizationChanged(event) {
3941
+ const org = this.OrganizationFormControl;
3942
+ this.RepositoryFormControl.reset();
3943
+ if (this.UseBranches) {
3944
+ this.BranchesFormControl.reset();
3945
+ this.SelectedBranches = [];
3924
3946
  }
3925
- else {
3926
- this.carouselIndex--;
3947
+ this.listRepositories();
3948
+ }
3949
+ RefreshOrganizations() {
3950
+ // this.Loading = true;
3951
+ this.listOrganizations();
3952
+ this.OrganizationFormControl?.reset();
3953
+ this.RepositoryFormControl?.reset();
3954
+ if (this.UseBranches) {
3955
+ this.BranchesFormControl?.reset();
3927
3956
  }
3928
- this.assignCarouselClass();
3929
3957
  }
3930
- MoreDetailsClicked() {
3931
- console.log("More details clicked on carousel item", this.Stats[this.carouselIndex]);
3958
+ RemoveBranchOption(option) {
3959
+ const index = this.SelectedBranches.indexOf(option);
3960
+ if (index >= 0) {
3961
+ this.SelectedBranches.splice(index, 1);
3962
+ }
3963
+ this.emitBranchesChanged();
3932
3964
  }
3933
- RightChevronClicked() {
3934
- this.removeCarouselClasses();
3935
- if (this.carouselIndex === this.Stats.length - 1) {
3936
- this.carouselIndex = 0;
3965
+ RepositoryChanged(event) {
3966
+ const repo = this.RepositoryFormControl;
3967
+ if (this.UseBranches) {
3968
+ this.BranchesFormControl.reset();
3969
+ this.SelectedBranches = [];
3970
+ this.listBranches();
3937
3971
  }
3938
- else {
3939
- this.carouselIndex++;
3972
+ if (!this.UseBranches) {
3973
+ this.listBuildPaths();
3940
3974
  }
3941
- this.assignCarouselClass();
3942
3975
  }
3943
- //HELPERS
3944
- removeCarouselClasses() {
3945
- for (let i = 0; i < this.Stats.length; i++) {
3946
- if (i === this.carouselIndex) {
3947
- document.getElementById("carousel-" + this.carouselIndex).classList.remove('active');
3976
+ SaveRepository() {
3977
+ this.Loading = true;
3978
+ const org = this.OrganizationFormControl.value;
3979
+ const repoName = this.RepositoryFormControl.value;
3980
+ this.appsFlowSvc
3981
+ .CreateRepository(org, repoName)
3982
+ .subscribe((response) => {
3983
+ if (response.Status.Code === 0) {
3984
+ this.listRepositories(repoName);
3985
+ this.CreatingRepository = false;
3948
3986
  }
3949
3987
  else {
3950
- document.getElementById("carousel-" + i).classList.remove('hidden');
3988
+ // TODO: Need to surface an error to the user...
3989
+ this.Loading = false;
3951
3990
  }
3952
- }
3991
+ });
3992
+ }
3993
+ SetEditingSourceControl(scLookup) {
3994
+ this.EditingSourceControlLookup = scLookup;
3995
+ }
3996
+ SubmitSourceControl() {
3997
+ console.log("source control submitted: ", this.DevOpsSourceControlFormGroup.value);
3998
+ this.SaveSourceControl();
3999
+ }
4000
+ SaveSourceControl() {
4001
+ const saveEnvReq = {
4002
+ Environment: {
4003
+ ...this.Environment,
4004
+ Artifacts: this.Environment.Artifacts || {},
4005
+ DevOpsActions: this.Environment.DevOpsActions || {},
4006
+ Secrets: this.Environment.Secrets || {},
4007
+ Sources: this.Environment.Sources || {},
4008
+ },
4009
+ EnvironmentLookup: this.EnvironmentLookup,
4010
+ EnterpriseDataTokens: {},
4011
+ };
4012
+ let artifactLookup;
4013
+ let artifact = this.Artifact;
4014
+ if (!this.ArtifactLookup) {
4015
+ artifactLookup = Guid.CreateRaw();
4016
+ artifact = {
4017
+ ...artifact,
4018
+ // Type: this.HostingDetailsFormControls.SelectedHostingOption
4019
+ // .ArtifactType,
4020
+ // Name: this.HostingDetailsFormControls.SelectedHostingOption.Name,
4021
+ NPMRegistry: 'https://registry.npmjs.org/',
4022
+ };
4023
+ }
4024
+ else {
4025
+ artifactLookup = this.ArtifactLookup;
4026
+ }
4027
+ saveEnvReq.Environment.Artifacts[artifactLookup] = artifact;
4028
+ let devOpsActionLookup;
4029
+ if (!this.DevOpsActionLookup) {
4030
+ devOpsActionLookup = Guid.CreateRaw();
4031
+ const doa = {
4032
+ ...this.DevOpsAction,
4033
+ ArtifactLookups: [artifactLookup],
4034
+ };
4035
+ saveEnvReq.Environment.DevOpsActions[devOpsActionLookup] = this.DevOpsAction;
4036
+ }
4037
+ else {
4038
+ devOpsActionLookup = this.DevOpsActionLookupFormControl.value;
4039
+ const doa = {
4040
+ ...this.DevOpsAction,
4041
+ // Name: this.HostingDetailsFormControls.DevOpsActionNameFormControl.value,
4042
+ };
4043
+ // saveEnvReq.Environment.DevOpsActions[devOpsActionLookup] = doa;
4044
+ saveEnvReq.Environment.DevOpsActions[devOpsActionLookup] = this.DevOpsAction;
4045
+ }
4046
+ let source = {
4047
+ ...this.EditingSourceControl,
4048
+ Branches: this.SelectedBranches,
4049
+ MainBranch: this.MainBranchFormControl.value,
4050
+ };
4051
+ source = {
4052
+ ...source,
4053
+ Type: 'GitHub',
4054
+ Name: this.EditingSourceControlLookup,
4055
+ DevOpsActionTriggerLookups: [devOpsActionLookup],
4056
+ Organization: this.OrganizationFormControl.value,
4057
+ Repository: this.RepositoryFormControl.value,
4058
+ };
4059
+ const scLookup = `github://${source.Organization}/${source.Repository}`;
4060
+ saveEnvReq.Environment.Sources[scLookup] = source;
4061
+ let resp = this.eacSvc.SaveEnvironmentAsCode(saveEnvReq);
4062
+ resp.then(res => {
4063
+ this.SaveStatusEvent.emit(res);
4064
+ });
4065
+ }
4066
+ // Helpers
4067
+ addBranchOption(value) {
4068
+ value = (value || '').trim();
4069
+ if (value && this.SelectedBranches.indexOf(value) < 0) {
4070
+ this.SelectedBranches.push(value);
4071
+ }
4072
+ this.BranchesInput.nativeElement.blur();
4073
+ this.emitBranchesChanged();
4074
+ }
4075
+ configureDevOpsAction() {
4076
+ setTimeout(() => {
4077
+ this.DevOpsActionLookupFormControl.setValue(this.DevOpsActionLookup);
4078
+ }, 0);
4079
+ }
4080
+ destroyFormControls() {
4081
+ this.DevOpsSourceControlFormGroup.removeControl([this.SourceControlRoot, 'mainBranch'].join(''));
4082
+ this.DevOpsSourceControlFormGroup?.removeControl([this.SourceControlRoot, 'branches'].join(''));
4083
+ this.DevOpsSourceControlFormGroup?.removeControl([this.SourceControlRoot, 'buildPath'].join(''));
4084
+ this.SelectedBranches = [];
4085
+ this.DevOpsSourceControlFormGroup?.removeControl([this.SourceControlRoot, 'organization'].join(''));
4086
+ this.DevOpsSourceControlFormGroup?.removeControl([this.SourceControlRoot, 'repository'].join(''));
4087
+ }
4088
+ emitBranchesChanged() {
4089
+ if (this.SelectedBranches?.length > 0 &&
4090
+ (!this.MainBranchFormControl.value ||
4091
+ this.SelectedBranches.indexOf(this.MainBranchFormControl.value) < 0)) {
4092
+ this.MainBranchFormControl.setValue(this.SelectedBranches.find((branch) => branch === 'main' || branch === 'master') || this.SelectedBranches[0]);
4093
+ }
4094
+ else if (this.SelectedBranches?.length <= 0) {
4095
+ this.MainBranchFormControl.reset();
4096
+ }
4097
+ this.BranchesFormControl.setValue(this.SelectedBranches.join(','));
4098
+ this.BranchesChanged(this.SelectedBranches || []);
4099
+ }
4100
+ listBranches() {
4101
+ if (this.UseBranches) {
4102
+ this.Loading = true;
4103
+ this.appsFlowSvc
4104
+ .ListBranches(this.OrganizationFormControl.value, this.RepositoryFormControl.value)
4105
+ .subscribe((response) => {
4106
+ this.BranchOptions = response.Model;
4107
+ this.Loading = false;
4108
+ if (this.EditingSourceControl?.Branches?.length > 0) {
4109
+ this.SelectedBranches = this.EditingSourceControl.Branches;
4110
+ }
4111
+ else if (this.BranchOptions?.length === 1) {
4112
+ this.BranchesFormControl.setValue(this.BranchOptions[0].Name);
4113
+ this.SelectedBranches = [this.BranchOptions[0].Name];
4114
+ }
4115
+ this.emitBranchesChanged();
4116
+ this.listBuildPaths();
4117
+ });
4118
+ }
4119
+ }
4120
+ listBuildPaths() {
4121
+ if (this.UseBuildPath) {
4122
+ this.Loading = true;
4123
+ this.appsFlowSvc
4124
+ .ListBuildPaths(this.OrganizationFormControl.value, this.RepositoryFormControl.value)
4125
+ .subscribe((response) => {
4126
+ this.BuildPathOptions = response.Model;
4127
+ this.Loading = false;
4128
+ if (this.BuildPathOptions?.length === 1) {
4129
+ this.BuildPathFormControl.setValue(this.BuildPathOptions[0]);
4130
+ }
4131
+ });
4132
+ }
4133
+ }
4134
+ listOrganizations() {
4135
+ this.Loading = true;
4136
+ this.appsFlowSvc
4137
+ .ListOrganizations()
4138
+ .subscribe((response) => {
4139
+ this.OrganizationOptions = response.Model;
4140
+ this.Loading = false;
4141
+ if (this.EditingSourceControl?.Organization) {
4142
+ setTimeout(() => {
4143
+ this.OrganizationFormControl.setValue(this.EditingSourceControl.Organization);
4144
+ this.listRepositories(this.EditingSourceControl?.Repository);
4145
+ }, 0);
4146
+ }
4147
+ });
4148
+ }
4149
+ listRepositories(activeRepo = null) {
4150
+ this.Loading = true;
4151
+ this.appsFlowSvc
4152
+ .ListRepositories(this.OrganizationFormControl.value)
4153
+ .subscribe((response) => {
4154
+ this.RepositoryOptions = response.Model;
4155
+ this.Loading = false;
4156
+ if (activeRepo) {
4157
+ setTimeout(() => {
4158
+ this.RepositoryFormControl.setValue(activeRepo);
4159
+ this.listBranches();
4160
+ if (!this.UseBranches) {
4161
+ this.listBuildPaths();
4162
+ }
4163
+ }, 0);
4164
+ }
4165
+ else if (this.RepositoryOptions?.length <= 0) {
4166
+ this.CreatingRepository = true;
4167
+ }
4168
+ });
4169
+ }
4170
+ loadProjectHostingDetails() {
4171
+ if (this.SelectedBranches?.length > 0) {
4172
+ this.HostingDetails.Loading = true;
4173
+ this.appsFlowSvc
4174
+ .LoadProjectHostingDetails(this.OrganizationFormControl?.value, this.RepositoryFormControl?.value, this.MainBranchFormControl?.value)
4175
+ .subscribe((response) => {
4176
+ this.HostingDetails = response.Model;
4177
+ this.HostingDetails.Loading = false;
4178
+ this.configureDevOpsAction();
4179
+ }, (err) => {
4180
+ this.HostingDetails.Loading = false;
4181
+ });
4182
+ }
4183
+ }
4184
+ setupFormControls() {
4185
+ // this.destroyFormControls();
4186
+ this.DevOpsSourceControlFormGroup.addControl('devOpsActionLookup', new FormControl(this.DevOpsActionLookup || '', []));
4187
+ this.DevOpsSourceControlFormGroup.addControl([this.SourceControlRoot, 'organization'].join(''), new FormControl(this.EditingSourceControl.Organization ?? '', Validators.required));
4188
+ this.DevOpsSourceControlFormGroup.addControl([this.SourceControlRoot, 'repository'].join(''), new FormControl(this.EditingSourceControl.Repository ?? '', Validators.required));
4189
+ if (this.UseBranches) {
4190
+ this.DevOpsSourceControlFormGroup.addControl([this.SourceControlRoot, 'branches'].join(''), new FormControl(this.EditingSourceControl?.Branches ?? '', Validators.required));
4191
+ this.SelectedBranches = this.EditingSourceControl?.Branches;
4192
+ this.DevOpsSourceControlFormGroup.addControl([this.SourceControlRoot, 'mainBranch'].join(''), new FormControl(this.EditingSourceControl.MainBranch ?? '', Validators.required));
4193
+ }
4194
+ if (this.UseBuildPath) {
4195
+ this.DevOpsSourceControlFormGroup.addControl([this.SourceControlRoot, 'buildPath'].join(''), new FormControl(this.BuildPath ?? '', Validators.required));
4196
+ }
4197
+ }
4198
+ }
4199
+ DevopsSourceControlFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: DevopsSourceControlFormComponent, deps: [{ token: ApplicationsFlowService }, { token: EaCService }, { token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
4200
+ DevopsSourceControlFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: DevopsSourceControlFormComponent, selector: "lcu-devops-source-control-form", inputs: { EditingSourceControlLookup: ["editing-source-control-lookup", "EditingSourceControlLookup"], Environment: ["environment", "Environment"], EnvironmentLookup: ["environment-lookup", "EnvironmentLookup"] }, outputs: { SaveStatusEvent: "save-status-event" }, viewQueries: [{ propertyName: "BranchesInput", first: true, predicate: ["branches"], descendants: true }], ngImport: i0, template: "<form class=\"form-card\" [formGroup]=\"DevOpsSourceControlFormGroup\" (ngSubmit)=\"SubmitSourceControl()\">\n\n <mat-card class=\"spread\" class=\"sc-card\">\n <mat-card-header>\n <mat-card-title> Source Control </mat-card-title>\n\n <div fxFlex></div>\n\n <mat-icon matSuffix matTooltip=\"Configure source control, DevOps CI/CD, and artifacts.\">\n info_outline\n </mat-icon>\n </mat-card-header>\n\n <mat-card-content>\n <div class=\"card\">\n <mat-form-field class=\"mat-full-width\">\n <mat-select formControlName=\"devOpsActionLookup\" placeholder=\"DevOps Action\"\n [disabled]=\"HostingDetails?.Loading\" (selectionChange)=\"DevOpsActionLookupChanged($event)\">\n <ng-container *ngFor=\"let devOpsActionLookup of DevOpsActionLookups\">\n <mat-option [value]=\"devOpsActionLookup\" *ngIf=\"DevOpsActions[devOpsActionLookup]; let devOpsAction\">\n {{ devOpsAction.Name }}\n </mat-option>\n </ng-container>\n\n <mat-option value=\"\">-- Create New --</mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"card\" *ngIf=\"OrganizationFormControl?.valid || !Loading\">\n <mat-form-field class=\"mat-full-width with-hint margin-bottom\" *ngIf=\"OrganizationOptions?.length > 0\">\n <mat-icon class=\"org-icon\" matPrefix>corporate_fare</mat-icon>\n\n <mat-select [formControlName]=\"SourceControlRoot + 'organization'\" placeholder=\"Organization\"\n (selectionChange)=\"OrganizationChanged($event)\" [disabled]=\"Loading || HostingDetails?.Loading\" required>\n <ng-container *ngFor=\"let orgOpt of OrganizationOptions\">\n <mat-option [value]=\"orgOpt.Name\">\n {{ orgOpt.Name }}\n </mat-option>\n </ng-container>\n </mat-select>\n\n <mat-icon matSuffix (click)=\"RefreshOrganizations()\" matTooltip=\"Refresh Organization\"> refresh </mat-icon>\n\n <a matSuffix href=\"/.oauth/github?oauth-force-edit=true\" target=\"_blank\" color=\"accent\">\n <mat-icon color=\"accent\" matTooltip=\"Re-authorize Organizations\"> launch </mat-icon>\n </a>\n\n <mat-hint>\n If you don't have an organization or would like to create a new one,\n <a href=\"https://github.com/account/organizations/new\" target=\"_blank\">\n start here\n </a>\n </mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"card\" *ngIf=\"\n RepositoryFormControl?.valid ||\n (OrganizationFormControl?.valid && !Loading)\n \">\n <mat-form-field class=\"mat-full-width\">\n <mat-icon class=\"org-icon\" matPrefix>description</mat-icon>\n\n <mat-select [formControlName]=\"SourceControlRoot + 'repository'\" [placeholder]=\"\n OrganizationFormControl?.valid\n ? 'Repository'\n : 'Repository (select organization first)'\n \" [disabled]=\"\n !OrganizationFormControl?.valid || Loading || HostingDetails?.Loading\n \" (selectionChange)=\"RepositoryChanged($event)\" *ngIf=\"!CreatingRepository\" required>\n <ng-container *ngFor=\"let repoOpt of RepositoryOptions\">\n <mat-option [value]=\"repoOpt.Name\">\n {{ repoOpt.Name }}\n </mat-option>\n </ng-container>\n </mat-select>\n\n <input matInput placeholder=\"Repository (creates new if does not exist)\"\n [formControlName]=\"SourceControlRoot + 'repository'\" *ngIf=\"CreatingRepository\"\n [fxHide]=\"Loading || HostingDetails?.Loading\" required />\n\n <mat-icon matSuffix (click)=\"CreateRepository()\" [fxHide]=\"Loading || HostingDetails?.Loading\"\n *ngIf=\"!CreatingRepository && OrganizationFormControl?.valid\">\n add_circle\n </mat-icon>\n\n <button mat-button type=\"button\" (click)=\"SaveRepository()\"\n *ngIf=\"CreatingRepository && RepositoryFormControl?.valid\">\n\n <mat-icon matSuffix color=\"primary\">\n save\n </mat-icon>\n </button>\n\n <button mat-button type=\"button\" (click)=\"CancelCreateRepository()\" *ngIf=\"CreatingRepository\">\n\n <mat-icon matSuffix>\n cancel\n </mat-icon>\n </button>\n </mat-form-field>\n </div>\n\n <div class=\"card\" *ngIf=\"\n (BranchesFormControl?.valid ||\n (OrganizationFormControl?.valid &&\n RepositoryFormControl?.valid &&\n !Loading)) &&\n !CreatingRepository &&\n UseBranches\n \">\n <mat-form-field class=\"mat-full-width\">\n <mat-icon class=\"org-icon\" matPrefix>account_tree</mat-icon>\n\n <mat-label>Selected Branches</mat-label>\n\n <mat-autocomplete (optionSelected)=\"BranchOptionSelected($event)\" #branchOptions=\"matAutocomplete\">\n <ng-container *ngFor=\"let branchOpt of BranchOptions\">\n <mat-option [value]=\"branchOpt.Name\">\n {{ branchOpt.Name }}\n </mat-option>\n </ng-container>\n </mat-autocomplete>\n\n <mat-chip-list #selectedBranches>\n <mat-chip [removable]=\"true\" (removed)=\"RemoveBranchOption(selBranch)\"\n *ngFor=\"let selBranch of SelectedBranches\">\n {{ selBranch }}\n <mat-icon matChipRemove>cancel</mat-icon>\n </mat-chip>\n\n <input matInput placeholder=\"New Branch...\" [formControlName]=\"SourceControlRoot + 'branches'\" #branches\n [matAutocomplete]=\"branchOptions\" [matChipInputFor]=\"selectedBranches\"\n [matChipInputSeparatorKeyCodes]=\"SeparatorKeysCodes\" [matChipInputAddOnBlur]=\"true\"\n (matChipInputTokenEnd)=\"AddBranchOption($event)\" [disabled]=\"Loading || HostingDetails?.Loading\"\n required />\n </mat-chip-list>\n </mat-form-field>\n\n <mat-form-field class=\"mat-full-width with-hint\" [fxShow]=\"SelectedBranches?.length > 1\">\n <mat-icon class=\"org-icon\" matPrefix>account_tree</mat-icon>\n\n <mat-select [formControlName]=\"SourceControlRoot + 'mainBranch'\" placeholder=\"Main Branch\"\n [disabled]=\"Loading || HostingDetails?.Loading\" (selectionChange)=\"MainBranchChanged($event)\" required>\n <ng-container *ngFor=\"let branch of SelectedBranches\">\n <mat-option [value]=\"branch\">\n {{ branch }}\n </mat-option>\n </ng-container>\n </mat-select>\n\n <mat-icon matSuffix (click)=\"RefreshOrganizations()\"> refresh </mat-icon>\n\n <a matSuffix mat-icon-button href=\"/.oauth/github?oauth-force-edit=true\" target=\"_blank\" color=\"accent\">\n <mat-icon matTooltip=\"Re-authorize Organizations\" color=\"accent\"> launch </mat-icon>\n </a>\n\n <mat-hint>\n If you don't have an organization or would like to create a new one,\n <a href=\"https://github.com/account/organizations/new\" target=\"_blank\">\n start here\n </a>\n </mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"card\" *ngIf=\"\n (BuildPathFormControl?.valid ||\n (OrganizationFormControl?.valid &&\n RepositoryFormControl?.valid &&\n !Loading)) &&\n !CreatingRepository &&\n UseBuildPath\n \">\n <mat-form-field class=\"mat-full-width with-hint\">\n <mat-icon class=\"org-icon\" matPrefix>build</mat-icon>\n\n <mat-select [formControlName]=\"SourceControlRoot + 'buildPath'\" placeholder=\"Build Path\"\n [disabled]=\"Loading || BuildPathDisabled\" (selectionChange)=\"BuildPathChanged($event)\" required>\n <ng-container *ngFor=\"let buildPath of BuildPathOptions\">\n <mat-option [value]=\"buildPath\">\n {{ buildPath }}\n </mat-option>\n </ng-container>\n </mat-select>\n\n <mat-hint>\n The build path identifies which build action to use for your\n configuration.\n </mat-hint>\n </mat-form-field>\n </div>\n\n <div *ngIf=\"Loading\">\n <div class=\"spread\">\n <lcu-loader style=\"margin: auto\" [loading]=\"true\"></lcu-loader>\n\n <div class=\"margin-3\">\n <h4 class=\"mat-title\" *ngIf=\"!OrganizationFormControl?.valid\">\n Loading organizations\n </h4>\n\n <h4 class=\"mat-title\" *ngIf=\"\n OrganizationFormControl?.valid && !RepositoryFormControl?.valid\n \">\n Loading repositories\n </h4>\n\n <h4 class=\"mat-title\" *ngIf=\"RepositoryFormControl?.valid && !BranchesFormControl?.valid\">\n Loading branches\n </h4>\n\n <h4 class=\"mat-title\" *ngIf=\"\n (RepositoryFormControl?.valid || BranchesFormControl?.valid) &&\n !BuildPathFormControl?.valid\n \">\n Loading build paths\n </h4>\n </div>\n </div>\n </div>\n <!-- </div> -->\n\n </mat-card-content>\n <mat-card-actions fxLayoutAlign=\"center center\">\n\n <button \n mat-raised-button \n *ngIf=\"!State?.Loading\"\n type=\"submit\" \n fxFlex=\"100%\" \n color=\"primary\" \n [disabled]=\"!DevOpsSourceControlFormGroup.valid || !DevOpsSourceControlFormGroup.dirty\">\n <mat-icon>save</mat-icon>\n Save Source Control\n </button>\n <lcu-loader [loading]=\"State?.Loading\"></lcu-loader>\n \n </mat-card-actions>\n </mat-card>\n</form>", styles: [".form-card,.sc-card{width:100%}.margin-bottom{margin-bottom:15px}\n"], components: [{ type: i4.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i4.MatCardHeader, selector: "mat-card-header" }, { type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i8.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i2$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i8$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { type: i9$1.MatChipList, selector: "mat-chip-list", inputs: ["errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { type: i2$1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { type: i3.LoaderComponent, selector: "lcu-loader", inputs: ["diameter", "hide-inner", "loading"] }], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i4.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { type: i5$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i4$2.MatSuffix, selector: "[matSuffix]" }, { type: i12.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i4.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$2.MatPrefix, selector: "[matPrefix]" }, { type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i4$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i11.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9.DefaultShowHideDirective, selector: " [fxShow], [fxShow.print], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide], [fxHide.print], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]", inputs: ["fxShow", "fxShow.print", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.print", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { type: i4$2.MatLabel, selector: "mat-label" }, { type: i9$1.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { type: i9$1.MatChipRemove, selector: "[matChipRemove]" }, { type: i8$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { type: i9$1.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { type: i4.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { type: i5$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }] });
4201
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: DevopsSourceControlFormComponent, decorators: [{
4202
+ type: Component,
4203
+ args: [{ selector: 'lcu-devops-source-control-form', template: "<form class=\"form-card\" [formGroup]=\"DevOpsSourceControlFormGroup\" (ngSubmit)=\"SubmitSourceControl()\">\n\n <mat-card class=\"spread\" class=\"sc-card\">\n <mat-card-header>\n <mat-card-title> Source Control </mat-card-title>\n\n <div fxFlex></div>\n\n <mat-icon matSuffix matTooltip=\"Configure source control, DevOps CI/CD, and artifacts.\">\n info_outline\n </mat-icon>\n </mat-card-header>\n\n <mat-card-content>\n <div class=\"card\">\n <mat-form-field class=\"mat-full-width\">\n <mat-select formControlName=\"devOpsActionLookup\" placeholder=\"DevOps Action\"\n [disabled]=\"HostingDetails?.Loading\" (selectionChange)=\"DevOpsActionLookupChanged($event)\">\n <ng-container *ngFor=\"let devOpsActionLookup of DevOpsActionLookups\">\n <mat-option [value]=\"devOpsActionLookup\" *ngIf=\"DevOpsActions[devOpsActionLookup]; let devOpsAction\">\n {{ devOpsAction.Name }}\n </mat-option>\n </ng-container>\n\n <mat-option value=\"\">-- Create New --</mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"card\" *ngIf=\"OrganizationFormControl?.valid || !Loading\">\n <mat-form-field class=\"mat-full-width with-hint margin-bottom\" *ngIf=\"OrganizationOptions?.length > 0\">\n <mat-icon class=\"org-icon\" matPrefix>corporate_fare</mat-icon>\n\n <mat-select [formControlName]=\"SourceControlRoot + 'organization'\" placeholder=\"Organization\"\n (selectionChange)=\"OrganizationChanged($event)\" [disabled]=\"Loading || HostingDetails?.Loading\" required>\n <ng-container *ngFor=\"let orgOpt of OrganizationOptions\">\n <mat-option [value]=\"orgOpt.Name\">\n {{ orgOpt.Name }}\n </mat-option>\n </ng-container>\n </mat-select>\n\n <mat-icon matSuffix (click)=\"RefreshOrganizations()\" matTooltip=\"Refresh Organization\"> refresh </mat-icon>\n\n <a matSuffix href=\"/.oauth/github?oauth-force-edit=true\" target=\"_blank\" color=\"accent\">\n <mat-icon color=\"accent\" matTooltip=\"Re-authorize Organizations\"> launch </mat-icon>\n </a>\n\n <mat-hint>\n If you don't have an organization or would like to create a new one,\n <a href=\"https://github.com/account/organizations/new\" target=\"_blank\">\n start here\n </a>\n </mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"card\" *ngIf=\"\n RepositoryFormControl?.valid ||\n (OrganizationFormControl?.valid && !Loading)\n \">\n <mat-form-field class=\"mat-full-width\">\n <mat-icon class=\"org-icon\" matPrefix>description</mat-icon>\n\n <mat-select [formControlName]=\"SourceControlRoot + 'repository'\" [placeholder]=\"\n OrganizationFormControl?.valid\n ? 'Repository'\n : 'Repository (select organization first)'\n \" [disabled]=\"\n !OrganizationFormControl?.valid || Loading || HostingDetails?.Loading\n \" (selectionChange)=\"RepositoryChanged($event)\" *ngIf=\"!CreatingRepository\" required>\n <ng-container *ngFor=\"let repoOpt of RepositoryOptions\">\n <mat-option [value]=\"repoOpt.Name\">\n {{ repoOpt.Name }}\n </mat-option>\n </ng-container>\n </mat-select>\n\n <input matInput placeholder=\"Repository (creates new if does not exist)\"\n [formControlName]=\"SourceControlRoot + 'repository'\" *ngIf=\"CreatingRepository\"\n [fxHide]=\"Loading || HostingDetails?.Loading\" required />\n\n <mat-icon matSuffix (click)=\"CreateRepository()\" [fxHide]=\"Loading || HostingDetails?.Loading\"\n *ngIf=\"!CreatingRepository && OrganizationFormControl?.valid\">\n add_circle\n </mat-icon>\n\n <button mat-button type=\"button\" (click)=\"SaveRepository()\"\n *ngIf=\"CreatingRepository && RepositoryFormControl?.valid\">\n\n <mat-icon matSuffix color=\"primary\">\n save\n </mat-icon>\n </button>\n\n <button mat-button type=\"button\" (click)=\"CancelCreateRepository()\" *ngIf=\"CreatingRepository\">\n\n <mat-icon matSuffix>\n cancel\n </mat-icon>\n </button>\n </mat-form-field>\n </div>\n\n <div class=\"card\" *ngIf=\"\n (BranchesFormControl?.valid ||\n (OrganizationFormControl?.valid &&\n RepositoryFormControl?.valid &&\n !Loading)) &&\n !CreatingRepository &&\n UseBranches\n \">\n <mat-form-field class=\"mat-full-width\">\n <mat-icon class=\"org-icon\" matPrefix>account_tree</mat-icon>\n\n <mat-label>Selected Branches</mat-label>\n\n <mat-autocomplete (optionSelected)=\"BranchOptionSelected($event)\" #branchOptions=\"matAutocomplete\">\n <ng-container *ngFor=\"let branchOpt of BranchOptions\">\n <mat-option [value]=\"branchOpt.Name\">\n {{ branchOpt.Name }}\n </mat-option>\n </ng-container>\n </mat-autocomplete>\n\n <mat-chip-list #selectedBranches>\n <mat-chip [removable]=\"true\" (removed)=\"RemoveBranchOption(selBranch)\"\n *ngFor=\"let selBranch of SelectedBranches\">\n {{ selBranch }}\n <mat-icon matChipRemove>cancel</mat-icon>\n </mat-chip>\n\n <input matInput placeholder=\"New Branch...\" [formControlName]=\"SourceControlRoot + 'branches'\" #branches\n [matAutocomplete]=\"branchOptions\" [matChipInputFor]=\"selectedBranches\"\n [matChipInputSeparatorKeyCodes]=\"SeparatorKeysCodes\" [matChipInputAddOnBlur]=\"true\"\n (matChipInputTokenEnd)=\"AddBranchOption($event)\" [disabled]=\"Loading || HostingDetails?.Loading\"\n required />\n </mat-chip-list>\n </mat-form-field>\n\n <mat-form-field class=\"mat-full-width with-hint\" [fxShow]=\"SelectedBranches?.length > 1\">\n <mat-icon class=\"org-icon\" matPrefix>account_tree</mat-icon>\n\n <mat-select [formControlName]=\"SourceControlRoot + 'mainBranch'\" placeholder=\"Main Branch\"\n [disabled]=\"Loading || HostingDetails?.Loading\" (selectionChange)=\"MainBranchChanged($event)\" required>\n <ng-container *ngFor=\"let branch of SelectedBranches\">\n <mat-option [value]=\"branch\">\n {{ branch }}\n </mat-option>\n </ng-container>\n </mat-select>\n\n <mat-icon matSuffix (click)=\"RefreshOrganizations()\"> refresh </mat-icon>\n\n <a matSuffix mat-icon-button href=\"/.oauth/github?oauth-force-edit=true\" target=\"_blank\" color=\"accent\">\n <mat-icon matTooltip=\"Re-authorize Organizations\" color=\"accent\"> launch </mat-icon>\n </a>\n\n <mat-hint>\n If you don't have an organization or would like to create a new one,\n <a href=\"https://github.com/account/organizations/new\" target=\"_blank\">\n start here\n </a>\n </mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"card\" *ngIf=\"\n (BuildPathFormControl?.valid ||\n (OrganizationFormControl?.valid &&\n RepositoryFormControl?.valid &&\n !Loading)) &&\n !CreatingRepository &&\n UseBuildPath\n \">\n <mat-form-field class=\"mat-full-width with-hint\">\n <mat-icon class=\"org-icon\" matPrefix>build</mat-icon>\n\n <mat-select [formControlName]=\"SourceControlRoot + 'buildPath'\" placeholder=\"Build Path\"\n [disabled]=\"Loading || BuildPathDisabled\" (selectionChange)=\"BuildPathChanged($event)\" required>\n <ng-container *ngFor=\"let buildPath of BuildPathOptions\">\n <mat-option [value]=\"buildPath\">\n {{ buildPath }}\n </mat-option>\n </ng-container>\n </mat-select>\n\n <mat-hint>\n The build path identifies which build action to use for your\n configuration.\n </mat-hint>\n </mat-form-field>\n </div>\n\n <div *ngIf=\"Loading\">\n <div class=\"spread\">\n <lcu-loader style=\"margin: auto\" [loading]=\"true\"></lcu-loader>\n\n <div class=\"margin-3\">\n <h4 class=\"mat-title\" *ngIf=\"!OrganizationFormControl?.valid\">\n Loading organizations\n </h4>\n\n <h4 class=\"mat-title\" *ngIf=\"\n OrganizationFormControl?.valid && !RepositoryFormControl?.valid\n \">\n Loading repositories\n </h4>\n\n <h4 class=\"mat-title\" *ngIf=\"RepositoryFormControl?.valid && !BranchesFormControl?.valid\">\n Loading branches\n </h4>\n\n <h4 class=\"mat-title\" *ngIf=\"\n (RepositoryFormControl?.valid || BranchesFormControl?.valid) &&\n !BuildPathFormControl?.valid\n \">\n Loading build paths\n </h4>\n </div>\n </div>\n </div>\n <!-- </div> -->\n\n </mat-card-content>\n <mat-card-actions fxLayoutAlign=\"center center\">\n\n <button \n mat-raised-button \n *ngIf=\"!State?.Loading\"\n type=\"submit\" \n fxFlex=\"100%\" \n color=\"primary\" \n [disabled]=\"!DevOpsSourceControlFormGroup.valid || !DevOpsSourceControlFormGroup.dirty\">\n <mat-icon>save</mat-icon>\n Save Source Control\n </button>\n <lcu-loader [loading]=\"State?.Loading\"></lcu-loader>\n \n </mat-card-actions>\n </mat-card>\n</form>", styles: [".form-card,.sc-card{width:100%}.margin-bottom{margin-bottom:15px}\n"] }]
4204
+ }], ctorParameters: function () { return [{ type: ApplicationsFlowService }, { type: EaCService }, { type: i1$1.FormBuilder }]; }, propDecorators: { EditingSourceControlLookup: [{
4205
+ type: Input,
4206
+ args: ['editing-source-control-lookup']
4207
+ }], Environment: [{
4208
+ type: Input,
4209
+ args: ['environment']
4210
+ }], EnvironmentLookup: [{
4211
+ type: Input,
4212
+ args: ['environment-lookup']
4213
+ }], SaveStatusEvent: [{
4214
+ type: Output,
4215
+ args: ['save-status-event']
4216
+ }], BranchesInput: [{
4217
+ type: ViewChild,
4218
+ args: ['branches']
4219
+ }] } });
4220
+
4221
+ class SourceControlDialogComponent {
4222
+ constructor(dialogRef, data) {
4223
+ this.dialogRef = dialogRef;
4224
+ this.data = data;
4225
+ }
4226
+ ngOnInit() {
4227
+ }
4228
+ CloseDialog() {
4229
+ this.dialogRef.close();
4230
+ }
4231
+ }
4232
+ SourceControlDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: SourceControlDialogComponent, deps: [{ token: i1$4.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
4233
+ SourceControlDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: SourceControlDialogComponent, selector: "lcu-source-control-dialog", ngImport: i0, template: "\n<div class=\"dialog-header\" fxLayoutAlign=\"end center\">\n <button mat-icon-button (click)=\"CloseDialog()\">\n <mat-icon>cancel</mat-icon>\n </button>\n</div>\n\n<div fxLayoutAlign=\"center center\">\n <lcu-devops-source-control-form\n [environment]=\"data.environment\"\n [environment-lookup]=\"data.environmentLookup\"\n [editing-source-control-lookup]=\"data.scLookup\">\n </lcu-devops-source-control-form>\n</div>", styles: [".dialog-header{width:100%}\n"], components: [{ type: i2$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: DevopsSourceControlFormComponent, selector: "lcu-devops-source-control-form", inputs: ["editing-source-control-lookup", "environment", "environment-lookup"], outputs: ["save-status-event"] }], directives: [{ type: i5$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }] });
4234
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: SourceControlDialogComponent, decorators: [{
4235
+ type: Component,
4236
+ args: [{ selector: 'lcu-source-control-dialog', template: "\n<div class=\"dialog-header\" fxLayoutAlign=\"end center\">\n <button mat-icon-button (click)=\"CloseDialog()\">\n <mat-icon>cancel</mat-icon>\n </button>\n</div>\n\n<div fxLayoutAlign=\"center center\">\n <lcu-devops-source-control-form\n [environment]=\"data.environment\"\n [environment-lookup]=\"data.environmentLookup\"\n [editing-source-control-lookup]=\"data.scLookup\">\n </lcu-devops-source-control-form>\n</div>", styles: [".dialog-header{width:100%}\n"] }]
4237
+ }], ctorParameters: function () { return [{ type: i1$4.MatDialogRef }, { type: undefined, decorators: [{
4238
+ type: Inject,
4239
+ args: [MAT_DIALOG_DATA]
4240
+ }] }]; } });
4241
+
4242
+ class MainFeedCardComponent {
4243
+ constructor(eacSvc, dialog) {
4244
+ this.eacSvc = eacSvc;
4245
+ this.dialog = dialog;
4246
+ }
4247
+ get ActiveEnvironment() {
4248
+ return this.State?.EaC?.Environments[this.ActiveEnvironmentLookup];
4249
+ }
4250
+ get ActiveEnvironmentLookup() {
4251
+ // TODO: Eventually support multiple environments
4252
+ const envLookups = Object.keys(this.State?.EaC?.Environments || {});
4253
+ return envLookups[0];
4254
+ }
4255
+ get Environment() {
4256
+ // console.log("Ent Environment var: ", this.State?.EaC?.Environments[this.State?.EaC?.Enterprise?.PrimaryEnvironment]);
4257
+ return this.State?.EaC?.Environments[this.State?.EaC?.Enterprise?.PrimaryEnvironment];
4258
+ }
4259
+ get Icon() {
4260
+ if (this.FeedItem.Status.Code === 0) {
4261
+ return 'check_circle';
4262
+ }
4263
+ else if (this.FeedItem.Status.Code === 1) {
4264
+ return 'cancel';
4265
+ }
4266
+ else if (this.FeedItem.Status.Code === 2) {
4267
+ return 'sync';
4268
+ }
4269
+ else {
4270
+ return 'help_outline';
4271
+ }
4272
+ }
4273
+ get IconColor() {
4274
+ if (this.FeedItem.Status.Code === 0) {
4275
+ return 'green';
4276
+ }
4277
+ else if (this.FeedItem.Status.Code === 1) {
4278
+ return 'red';
4279
+ }
4280
+ else if (this.FeedItem.Status.Code === 2) {
4281
+ return 'blue';
4282
+ }
4283
+ else {
4284
+ return 'gray';
4285
+ }
4286
+ }
4287
+ get State() {
4288
+ return this.eacSvc.State;
4289
+ }
4290
+ // Life Cycle
4291
+ ngOnInit() {
4292
+ this.handleRefresh();
4293
+ }
4294
+ // API Methods
4295
+ CalculateTimelapse(timestamp) {
4296
+ return moment(timestamp).fromNow();
4297
+ }
4298
+ HandleAction(action) {
4299
+ if (action.ActionType == 'Link') {
4300
+ if (action.Action.startsWith('http')) {
4301
+ window.open(action.Action, '_blank');
4302
+ }
4303
+ else {
4304
+ window.location.href = action.Action;
4305
+ }
4306
+ }
4307
+ else if (action.ActionType == 'Modal') {
4308
+ if (action.Action == 'AddSourceControl') {
4309
+ this.OpenSourceControlDialog('');
4310
+ }
4311
+ else {
4312
+ alert('other modaled ' + action.Action);
4313
+ }
4314
+ }
4315
+ }
4316
+ OpenSourceControlDialog(scLookup) {
4317
+ const dialogRef = this.dialog.open(SourceControlDialogComponent, {
4318
+ width: '550px',
4319
+ data: {
4320
+ environment: this.Environment,
4321
+ environmentLookup: this.ActiveEnvironmentLookup,
4322
+ scLookup: scLookup,
4323
+ },
4324
+ });
4325
+ dialogRef.afterClosed().subscribe((result) => {
4326
+ // console.log('The dialog was closed');
4327
+ // console.log("result:", result)
4328
+ });
4329
+ }
4330
+ // Helpers
4331
+ handleRefresh() {
4332
+ if (this.FeedItem?.RefreshLink) {
4333
+ setTimeout(() => {
4334
+ this.eacSvc.CheckUserFeedItem(this.FeedItem).subscribe(async (response) => {
4335
+ if (response.Status.Code === 0) {
4336
+ this.FeedItem = response.Model;
4337
+ this.handleRefresh();
4338
+ }
4339
+ else {
4340
+ console.log(response);
4341
+ }
4342
+ }, (err) => {
4343
+ console.log(err);
4344
+ });
4345
+ }, 5000);
4346
+ }
4347
+ }
4348
+ }
4349
+ MainFeedCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: MainFeedCardComponent, deps: [{ token: EaCService }, { token: i1$4.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
4350
+ MainFeedCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: MainFeedCardComponent, selector: "lcu-main-feed-card", inputs: { FeedItem: ["feed-item", "FeedItem"] }, ngImport: i0, template: "<mat-card class=\"social-card\">\n <mat-card-header>\n <img\n mat-card-avatar\n class=\"example-header-image\"\n [src]=\"FeedItem.Avatar\"\n *ngIf=\"FeedItem.Avatar\"\n />\n\n <mat-card-title *ngIf=\"FeedItem.Title\">{{ FeedItem.Title }}</mat-card-title>\n\n <mat-card-subtitle>\n <div *ngIf=\"FeedItem.Subtitle\">{{ FeedItem.Subtitle }}</div>\n <div *ngIf=\"FeedItem.Status\">\n <mat-icon\n *ngIf=\"Icon\"\n [style.color]=\"IconColor\"\n [class.spin]=\"FeedItem.Status?.Code == 2\"\n >\n {{ Icon }}\n </mat-icon>\n\n <span *ngIf=\"FeedItem.Timestamp\">\n {{ CalculateTimelapse(FeedItem.Timestamp) }}\n </span>\n </div>\n </mat-card-subtitle>\n </mat-card-header>\n\n <div *ngIf=\"!FeedItem.IsShortForm\">\n <!-- <div class=\"feed-card-container\">\n <div class=\"feed-card-main-content\">\n The tab content (only 1 'tab' for now)... So really we don't need to worry about tabs until a future iteration\n\n The tabs property will contain a data structure that will vary by the FeedItem.Type... That structure can be used to render the content\n </div>\n </div> -->\n </div>\n\n <mat-card-actions fxLayout=\"row\" fxLayoutAlign=\"space-around center\">\n <div fxFlex></div>\n\n <ng-container *ngFor=\"let action of FeedItem.Actions\">\n <button mat-button [color]=\"action.Color\" (click)=\"HandleAction(action)\">\n <mat-icon *ngIf=\"action.Icon\">{{ action.Icon }}</mat-icon>\n\n {{ action.Text }}\n </button>\n </ng-container>\n </mat-card-actions>\n</mat-card>\n", styles: [":host :host ::ng-deep .social-card{margin:20px;padding:15px 5px}:host :host ::ng-deep mat-card-actions{margin-bottom:-1px!important;margin-left:0!important;margin-right:-.5px!important}:host :host ::ng-deep .main-slot-container{padding:10px}:host :host ::ng-deep .slot-header{align-items:center}:host :host ::ng-deep .slot-content{width:100%}:host :host ::ng-deep .slot-name{font-size:13px;font-weight:600}:host :host ::ng-deep .slot-description{font-size:12px;margin-right:10px}:host :host ::ng-deep .slot-action-anchor{font-size:10px;text-decoration:none;color:#000}:host :host ::ng-deep .action-icon{height:25px;width:25px;font-size:25px;cursor:pointer}:host .example-header-image{background-size:cover}:host .mat-icon{display:inline-flex;vertical-align:middle}:host .mat-icon.spin{animation:rotate 1s ease-in-out infinite}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], components: [{ type: i4.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i4.MatCardHeader, selector: "mat-card-header" }, { type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i2$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.MatCardAvatar, selector: "[mat-card-avatar], [matCardAvatar]" }, { type: i4.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { type: i4.MatCardSubtitle, selector: "mat-card-subtitle, [mat-card-subtitle], [matCardSubtitle]" }, { type: i4.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { type: i5$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i5$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i5$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
4351
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: MainFeedCardComponent, decorators: [{
4352
+ type: Component,
4353
+ args: [{ selector: 'lcu-main-feed-card', template: "<mat-card class=\"social-card\">\n <mat-card-header>\n <img\n mat-card-avatar\n class=\"example-header-image\"\n [src]=\"FeedItem.Avatar\"\n *ngIf=\"FeedItem.Avatar\"\n />\n\n <mat-card-title *ngIf=\"FeedItem.Title\">{{ FeedItem.Title }}</mat-card-title>\n\n <mat-card-subtitle>\n <div *ngIf=\"FeedItem.Subtitle\">{{ FeedItem.Subtitle }}</div>\n <div *ngIf=\"FeedItem.Status\">\n <mat-icon\n *ngIf=\"Icon\"\n [style.color]=\"IconColor\"\n [class.spin]=\"FeedItem.Status?.Code == 2\"\n >\n {{ Icon }}\n </mat-icon>\n\n <span *ngIf=\"FeedItem.Timestamp\">\n {{ CalculateTimelapse(FeedItem.Timestamp) }}\n </span>\n </div>\n </mat-card-subtitle>\n </mat-card-header>\n\n <div *ngIf=\"!FeedItem.IsShortForm\">\n <!-- <div class=\"feed-card-container\">\n <div class=\"feed-card-main-content\">\n The tab content (only 1 'tab' for now)... So really we don't need to worry about tabs until a future iteration\n\n The tabs property will contain a data structure that will vary by the FeedItem.Type... That structure can be used to render the content\n </div>\n </div> -->\n </div>\n\n <mat-card-actions fxLayout=\"row\" fxLayoutAlign=\"space-around center\">\n <div fxFlex></div>\n\n <ng-container *ngFor=\"let action of FeedItem.Actions\">\n <button mat-button [color]=\"action.Color\" (click)=\"HandleAction(action)\">\n <mat-icon *ngIf=\"action.Icon\">{{ action.Icon }}</mat-icon>\n\n {{ action.Text }}\n </button>\n </ng-container>\n </mat-card-actions>\n</mat-card>\n", styles: [":host :host ::ng-deep .social-card{margin:20px;padding:15px 5px}:host :host ::ng-deep mat-card-actions{margin-bottom:-1px!important;margin-left:0!important;margin-right:-.5px!important}:host :host ::ng-deep .main-slot-container{padding:10px}:host :host ::ng-deep .slot-header{align-items:center}:host :host ::ng-deep .slot-content{width:100%}:host :host ::ng-deep .slot-name{font-size:13px;font-weight:600}:host :host ::ng-deep .slot-description{font-size:12px;margin-right:10px}:host :host ::ng-deep .slot-action-anchor{font-size:10px;text-decoration:none;color:#000}:host :host ::ng-deep .action-icon{height:25px;width:25px;font-size:25px;cursor:pointer}:host .example-header-image{background-size:cover}:host .mat-icon{display:inline-flex;vertical-align:middle}:host .mat-icon.spin{animation:rotate 1s ease-in-out infinite}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
4354
+ }], ctorParameters: function () { return [{ type: EaCService }, { type: i1$4.MatDialog }]; }, propDecorators: { FeedItem: [{
4355
+ type: Input,
4356
+ args: ['feed-item']
4357
+ }] } });
4358
+
4359
+ class TwoColumnHeaderComponent {
4360
+ constructor() { }
4361
+ ngOnInit() {
4362
+ }
4363
+ }
4364
+ TwoColumnHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TwoColumnHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
4365
+ TwoColumnHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: TwoColumnHeaderComponent, selector: "lcu-two-column-header", ngImport: i0, template: "<div class=\"col-container\" fxLayout=\"row\">\n\n <div class=\"col-left\" fxFlex=\"15%\" >\n <ng-content select=\"[left]\"></ng-content>\n </div>\n\n <div class=\"col-center\" fxFlex=\"85%\">\n <ng-content></ng-content>\n </div>\n\n</div>\n", styles: [".col-container{background-color:#ebecf0}.col-left{min-width:210px}\n"], directives: [{ type: i5$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i5$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }] });
4366
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TwoColumnHeaderComponent, decorators: [{
4367
+ type: Component,
4368
+ args: [{ selector: 'lcu-two-column-header', template: "<div class=\"col-container\" fxLayout=\"row\">\n\n <div class=\"col-left\" fxFlex=\"15%\" >\n <ng-content select=\"[left]\"></ng-content>\n </div>\n\n <div class=\"col-center\" fxFlex=\"85%\">\n <ng-content></ng-content>\n </div>\n\n</div>\n", styles: [".col-container{background-color:#ebecf0}.col-left{min-width:210px}\n"] }]
4369
+ }], ctorParameters: function () { return []; } });
4370
+
4371
+ class CardCarouselComponent {
4372
+ constructor() {
4373
+ this.carouselIndex = 0;
4374
+ }
4375
+ ngOnInit() {
4376
+ }
4377
+ ngAfterViewInit() {
4378
+ this.assignCarouselClass();
4379
+ }
4380
+ LeftChevronClicked() {
4381
+ this.removeCarouselClasses();
4382
+ if (this.carouselIndex === 0) {
4383
+ this.carouselIndex = this.Stats.length - 1;
4384
+ }
4385
+ else {
4386
+ this.carouselIndex--;
4387
+ }
4388
+ this.assignCarouselClass();
4389
+ }
4390
+ MoreDetailsClicked() {
4391
+ console.log("More details clicked on carousel item", this.Stats[this.carouselIndex]);
4392
+ }
4393
+ RightChevronClicked() {
4394
+ this.removeCarouselClasses();
4395
+ if (this.carouselIndex === this.Stats.length - 1) {
4396
+ this.carouselIndex = 0;
4397
+ }
4398
+ else {
4399
+ this.carouselIndex++;
4400
+ }
4401
+ this.assignCarouselClass();
4402
+ }
4403
+ //HELPERS
4404
+ removeCarouselClasses() {
4405
+ for (let i = 0; i < this.Stats.length; i++) {
4406
+ if (i === this.carouselIndex) {
4407
+ document.getElementById("carousel-" + this.carouselIndex).classList.remove('active');
4408
+ }
4409
+ else {
4410
+ document.getElementById("carousel-" + i).classList.remove('hidden');
4411
+ }
4412
+ }
3953
4413
  }
3954
4414
  assignCarouselClass() {
3955
4415
  for (let i = 0; i < this.Stats.length; i++) {
@@ -4464,278 +4924,40 @@ class SourceControlFormComponent {
4464
4924
  this.SourceControlFormGroup = this.formBldr.group({});
4465
4925
  this.setupBuildForm();
4466
4926
  }
4467
- setupBuildForm() {
4468
- this.SourceControlFormGroup.addControl('hasBuild', this.formBldr.control(!!this.EditingApplication.LowCodeUnit?.SourceControlLookup || false, [Validators.required]));
4469
- this.SourceControlFormGroup.addControl('sourceControlLookup', this.formBldr.control(this.EditingApplication.LowCodeUnit?.SourceControlLookup || '', []));
4470
- }
4471
- }
4472
- SourceControlFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: SourceControlFormComponent, deps: [{ token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
4473
- SourceControlFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: SourceControlFormComponent, selector: "lcu-source-control-form", inputs: { EditingApplication: ["editing-application", "EditingApplication"], Environment: ["environment", "Environment"] }, outputs: { SaveFormEvent: "save-form-event" }, ngImport: i0, template: "<form class=\"source-control-form\" [formGroup]=\"SourceControlFormGroup\" (ngSubmit)=\"SubmitSourceControl()\">\n\n<mat-card class=\"spread flow-card\" *ngIf=\"ProcessorType != 'Redirect'\">\n <mat-card-header>\n <mat-card-title *ngIf=\"!HasBuildFormControl.value\">\n Build & Source\n </mat-card-title>\n\n <mat-card-title *ngIf=\"HasBuildFormControl.value\">\n Source Control\n </mat-card-title>\n\n <div fxFlex></div>\n\n <mat-slide-toggle\n formControlName=\"hasBuild\"\n matTooltip=\"Has Build?\"\n >\n </mat-slide-toggle>\n\n <mat-icon\n matSuffix\n matTooltip=\"Configure source control, DevOps CI/CD, and artifacts.\"\n >\n info_outline\n </mat-icon>\n </mat-card-header>\n\n <mat-card-content>\n <mat-form-field\n class=\"mat-full-width\"\n *ngIf=\"\n HasBuildFormControl.value && SourceControlLookups?.length > 0\n \"\n >\n <mat-select\n formControlName=\"sourceControlLookup\"\n placeholder=\"Source Control\"\n (selectionChange)=\"SourceControlLookupChanged($event)\"\n [disabled]=\"\n SourceControlFormControls?.Loading || HostingDetails?.Loading\n \"\n >\n <ng-container\n *ngFor=\"let srcCtrlLookup of SourceControlLookups\"\n >\n <mat-option\n [value]=\"srcCtrlLookup\"\n *ngIf=\"SourceControls[srcCtrlLookup]; let srcCtrl\"\n >\n {{ srcCtrl.Name }}\n </mat-option>\n </ng-container>\n </mat-select>\n\n <div *ngIf=\"HasBuildFormControl?.value\">\n <h3>\n @{{\n SourceControlFormControls?.OrganizationFormControl?.value ||\n SourceControl?.Organization\n }}/{{\n SourceControlFormControls?.RepositoryFormControl?.value ||\n SourceControl?.Repository\n }}\n </h3>\n\n <p>Organization and Repository pulled from build settings</p>\n\n <mat-hint>\n CurrentBuild:\n {{ EditingApplication?.LowCodeUnit?.CurrentBuild }}\n </mat-hint>\n </div>\n </mat-form-field>\n\n <div *ngIf=\"SourceControlLookups?.length < 0\">\n <h3>\n Create source control locations under the DevOps tab above.\n </h3>\n </div>\n </mat-card-content>\n <mat-card-actions fxLayoutAlign=\"center center\">\n\n <button \n mat-raised-button \n type=\"submit\" \n fxFlex=\"100%\" \n color=\"primary\" \n [disabled]=\"!SourceControlFormGroup.valid || !SourceControlFormGroup.dirty\">\n <mat-icon>save</mat-icon>\n Save\n </button>\n \n </mat-card-actions>\n </mat-card>\n</form>\n", styles: [""], components: [{ type: i4.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i4.MatCardHeader, selector: "mat-card-header" }, { type: i12$1.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex", "name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "checked"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i8.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i2$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { type: i5$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i12.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i4$2.MatSuffix, selector: "[matSuffix]" }, { type: i4.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i4.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { type: i5$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }] });
4474
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: SourceControlFormComponent, decorators: [{
4475
- type: Component,
4476
- args: [{ selector: 'lcu-source-control-form', template: "<form class=\"source-control-form\" [formGroup]=\"SourceControlFormGroup\" (ngSubmit)=\"SubmitSourceControl()\">\n\n<mat-card class=\"spread flow-card\" *ngIf=\"ProcessorType != 'Redirect'\">\n <mat-card-header>\n <mat-card-title *ngIf=\"!HasBuildFormControl.value\">\n Build & Source\n </mat-card-title>\n\n <mat-card-title *ngIf=\"HasBuildFormControl.value\">\n Source Control\n </mat-card-title>\n\n <div fxFlex></div>\n\n <mat-slide-toggle\n formControlName=\"hasBuild\"\n matTooltip=\"Has Build?\"\n >\n </mat-slide-toggle>\n\n <mat-icon\n matSuffix\n matTooltip=\"Configure source control, DevOps CI/CD, and artifacts.\"\n >\n info_outline\n </mat-icon>\n </mat-card-header>\n\n <mat-card-content>\n <mat-form-field\n class=\"mat-full-width\"\n *ngIf=\"\n HasBuildFormControl.value && SourceControlLookups?.length > 0\n \"\n >\n <mat-select\n formControlName=\"sourceControlLookup\"\n placeholder=\"Source Control\"\n (selectionChange)=\"SourceControlLookupChanged($event)\"\n [disabled]=\"\n SourceControlFormControls?.Loading || HostingDetails?.Loading\n \"\n >\n <ng-container\n *ngFor=\"let srcCtrlLookup of SourceControlLookups\"\n >\n <mat-option\n [value]=\"srcCtrlLookup\"\n *ngIf=\"SourceControls[srcCtrlLookup]; let srcCtrl\"\n >\n {{ srcCtrl.Name }}\n </mat-option>\n </ng-container>\n </mat-select>\n\n <div *ngIf=\"HasBuildFormControl?.value\">\n <h3>\n @{{\n SourceControlFormControls?.OrganizationFormControl?.value ||\n SourceControl?.Organization\n }}/{{\n SourceControlFormControls?.RepositoryFormControl?.value ||\n SourceControl?.Repository\n }}\n </h3>\n\n <p>Organization and Repository pulled from build settings</p>\n\n <mat-hint>\n CurrentBuild:\n {{ EditingApplication?.LowCodeUnit?.CurrentBuild }}\n </mat-hint>\n </div>\n </mat-form-field>\n\n <div *ngIf=\"SourceControlLookups?.length < 0\">\n <h3>\n Create source control locations under the DevOps tab above.\n </h3>\n </div>\n </mat-card-content>\n <mat-card-actions fxLayoutAlign=\"center center\">\n\n <button \n mat-raised-button \n type=\"submit\" \n fxFlex=\"100%\" \n color=\"primary\" \n [disabled]=\"!SourceControlFormGroup.valid || !SourceControlFormGroup.dirty\">\n <mat-icon>save</mat-icon>\n Save\n </button>\n \n </mat-card-actions>\n </mat-card>\n</form>\n", styles: [""] }]
4477
- }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }]; }, propDecorators: { EditingApplication: [{
4478
- type: Input,
4479
- args: ['editing-application']
4480
- }], Environment: [{
4481
- type: Input,
4482
- args: ['environment']
4483
- }], SaveFormEvent: [{
4484
- type: Output,
4485
- args: ['save-form-event']
4486
- }] } });
4487
-
4488
- class BuildPipelineFormComponent {
4489
- constructor(eacSvc, formBuilder, appsFlowSvc) {
4490
- this.eacSvc = eacSvc;
4491
- this.formBuilder = formBuilder;
4492
- this.appsFlowSvc = appsFlowSvc;
4493
- this.HostingDetails = new ProjectHostingDetails();
4494
- this.ResponseEvent = new EventEmitter;
4495
- }
4496
- get Artifact() {
4497
- // console.log("ARTIFACT: ", this.Environment?.Artifacts[this.ArtifactLookup]);
4498
- return this.Environment?.Artifacts && this.ArtifactLookup
4499
- ? this.Environment?.Artifacts[this.ArtifactLookup] || {}
4500
- : {};
4501
- }
4502
- get ArtifactLookup() {
4503
- const artLookup = this.DevOpsAction?.ArtifactLookups
4504
- ? this.DevOpsAction?.ArtifactLookups[0]
4505
- : null;
4506
- return artLookup;
4507
- }
4508
- get BuildPipelineFormControl() {
4509
- return this.BuildPipelineFormGroup?.get('buildPipeline');
4510
- }
4511
- get DevOpsAction() {
4512
- return this.Environment.DevOpsActions && this.DevOpsActionLookup
4513
- ? this.Environment.DevOpsActions[this.DevOpsActionLookup] || {}
4514
- : {};
4515
- }
4516
- get DevOpsActions() {
4517
- return this.Environment.DevOpsActions || {};
4518
- }
4519
- get DevOpsActionNameFormControl() {
4520
- return this.BuildPipelineFormGroup.get('devOpsActionName');
4521
- }
4522
- get NPMTokenFormControl() {
4523
- return this.BuildPipelineFormGroup.get('npmToken');
4524
- }
4525
- // (ho) => ho.Lookup === this.BuildPipeline
4526
- get SelectedHostingOption() {
4527
- return this.HostingDetails?.HostingOptions?.find((ho) => ho.Lookup === this.BuildPipeline);
4528
- }
4529
- get SelectedHostingOptionInputControlValues() {
4530
- return this.SelectedHostingOption?.Inputs?.reduce((prev, cur) => {
4531
- const res = {
4532
- ...prev,
4533
- };
4534
- res[cur.Lookup] = this.BuildPipelineFormGroup.controls[cur.Lookup].value;
4535
- return res;
4536
- }, {});
4537
- }
4538
- get SourceControlLookups() {
4539
- return Object.keys(this.SourceControls || {});
4540
- }
4541
- get SourceControls() {
4542
- return this.Environment.Sources || {};
4543
- }
4544
- get State() {
4545
- return this.eacSvc.State;
4546
- }
4547
- ngOnInit() {
4548
- // console.log('BuildPipeline = ', this.BuildPipeline)
4549
- // this.BuildPipelineFormGroup = this.formBuilder.group({});
4550
- // if (this.BuildPipelineFormGroup != null) {
4551
- // this.BuildPipelineFormGroup.removeControl('hostingDetails');
4552
- // }
4553
- // this.BuildPipelineFormGroup.addControl(
4554
- // 'hostingDetails',
4555
- this.BuildPipelineFormGroup = this.formBuilder.group({
4556
- buildPipeline: [this.BuildPipeline, [Validators.required]],
4557
- });
4558
- // );
4559
- this.loadProjectHostingDetails();
4560
- // this.setupControlsForForm();
4561
- }
4562
- //API METHODS
4563
- BuildPipelineChanged() {
4564
- //for some reason this value is coming back undefined
4565
- // console.log("build pipeline value: ", this.BuildPipelineFormControl?.value)
4566
- this.BuildPipeline = this.BuildPipelineFormControl?.value;
4567
- this.setupControlsForForm();
4568
- }
4569
- SubmitBuildPipeline() {
4570
- // console.log("submitting build pipeline: ", this.BuildPipelineFormGroup.value);
4571
- this.SaveEnvironment();
4572
- }
4573
- SaveEnvironment() {
4574
- const saveEnvReq = {
4575
- Environment: {
4576
- ...this.Environment,
4577
- Artifacts: this.Environment.Artifacts || {},
4578
- DevOpsActions: this.Environment.DevOpsActions || {},
4579
- Secrets: this.Environment.Secrets || {},
4580
- Sources: this.Environment.Sources || {},
4581
- },
4582
- EnvironmentLookup: this.EnvironmentLookup,
4583
- EnterpriseDataTokens: {},
4584
- };
4585
- let artifactLookup;
4586
- let artifact = {
4587
- ...this.Artifact,
4588
- ...this.SelectedHostingOptionInputControlValues,
4589
- };
4590
- if (!this.ArtifactLookup) {
4591
- artifactLookup = Guid.CreateRaw();
4592
- artifact = {
4593
- ...artifact,
4594
- Type: this.SelectedHostingOption.ArtifactType,
4595
- Name: this.SelectedHostingOption.Name,
4596
- NPMRegistry: 'https://registry.npmjs.org/',
4597
- };
4598
- }
4599
- else {
4600
- artifactLookup = this.ArtifactLookup;
4601
- }
4602
- saveEnvReq.Environment.Artifacts[artifactLookup] = artifact;
4603
- let devOpsActionLookup;
4604
- if (!this.DevOpsActionLookup) {
4605
- devOpsActionLookup = Guid.CreateRaw();
4606
- const doa = {
4607
- ...this.DevOpsAction,
4608
- ArtifactLookups: [artifactLookup],
4609
- Name: this.DevOpsActionNameFormControl.value,
4610
- Path: this.SelectedHostingOption.Path,
4611
- Templates: this.SelectedHostingOption.Templates,
4612
- };
4613
- if (this.NPMTokenFormControl?.value) {
4614
- const secretLookup = 'npm-access-token';
4615
- doa.SecretLookups = [secretLookup];
4616
- saveEnvReq.Environment.Secrets[secretLookup] = {
4617
- Name: 'NPM Access Token',
4618
- DataTokenLookup: secretLookup,
4619
- KnownAs: 'NPM_TOKEN',
4620
- };
4621
- saveEnvReq.EnterpriseDataTokens[secretLookup] = {
4622
- Name: saveEnvReq.Environment.Secrets[secretLookup].Name,
4623
- Description: saveEnvReq.Environment.Secrets[secretLookup].Name,
4624
- Value: this.NPMTokenFormControl.value,
4625
- };
4626
- }
4627
- saveEnvReq.Environment.DevOpsActions[devOpsActionLookup] = doa;
4628
- }
4629
- else {
4630
- devOpsActionLookup = this.DevOpsActionLookup;
4631
- const doa = {
4632
- ...this.DevOpsAction,
4633
- Name: this.DevOpsActionNameFormControl.value,
4634
- };
4635
- saveEnvReq.Environment.DevOpsActions[devOpsActionLookup] = doa;
4636
- }
4637
- this.eacSvc.SaveEnvironmentAsCode(saveEnvReq).then(res => {
4638
- this.ResponseEvent.emit(res);
4639
- });
4640
- }
4641
- // Helpers
4642
- setupControlsForForm() {
4643
- // this.BuildPipeline =
4644
- // this.BuildPipeline || this.HostingDetails?.HostingOptions
4645
- // ? this.HostingDetails?.HostingOptions[0]?.Lookup
4646
- // : '';
4647
- // console.log("hosting details: ", this.HostingDetails)
4648
- for (const ctrlName in this.BuildPipelineFormGroup.controls) {
4649
- //devOpsAction doesn't exist
4650
- //removes hosting details
4651
- if (ctrlName !== 'buildPipeline' && ctrlName !== 'devOpsAction') {
4652
- // console.log("removing control: ", ctrlName)
4653
- this.BuildPipelineFormGroup.removeControl(ctrlName);
4654
- }
4655
- }
4656
- this.BuildPipelineFormGroup.addControl('devOpsActionName', this.formBuilder.control(this.DevOpsAction?.Name || this.SelectedHostingOption?.Name || '', [Validators.required]));
4657
- // console.log("selected hosting options: ", this.SelectedHostingOption.Inputs);
4658
- this.SelectedHostingOption?.Inputs?.forEach((input) => {
4659
- const validators = input.Required ? [Validators.required] : [];
4660
- this.BuildPipelineFormGroup.addControl(input.Lookup, this.formBuilder.control(this.Artifact[input.Lookup] || input.DefaultValue || '', validators));
4661
- // if (this.Disabled) {
4662
- // this.FormGroup.controls[input.Lookup].disable();
4663
- // }
4664
- });
4665
- if (this.BuildPipelineFormControl?.value === 'npm-release') {
4666
- if (!this.BuildPipelineFormGroup.controls.npmToken) {
4667
- this.BuildPipelineFormGroup.addControl('npmToken', this.formBuilder.control('', this.Disabled ? [] : [Validators.required]));
4668
- if (this.Disabled) {
4669
- this.BuildPipelineFormGroup.controls.npmToken.disable();
4670
- }
4671
- }
4672
- }
4673
- else if (this.BuildPipelineFormControl?.value === 'github-artifacts-release') {
4674
- if (this.BuildPipelineFormGroup.controls.npmToken) {
4675
- this.BuildPipelineFormGroup.removeControl('npmToken');
4676
- }
4677
- }
4678
- }
4679
- loadProjectHostingDetails() {
4680
- this.HostingDetails.Loading = true;
4681
- this.appsFlowSvc.NewLoadProjectHostingDetails().subscribe((response) => {
4682
- this.HostingDetails = response.Model;
4683
- // console.log("response: ", response);
4684
- this.HostingDetails.Loading = false;
4685
- const hostOption = this.HostingDetails?.HostingOptions?.find((ho) => ho.Path === this.DevOpsAction.Path);
4686
- this.BuildPipeline = hostOption.Lookup;
4687
- // console.log("Build Pipeline HERE= ", this.BuildPipeline);
4688
- this.setupControlsForForm();
4689
- }, (err) => {
4690
- console.log('ERR: ', err);
4691
- this.HostingDetails.Loading = false;
4692
- });
4693
- console.log('HOSTING DETAILS: ', this.HostingDetails);
4694
- }
4927
+ setupBuildForm() {
4928
+ this.SourceControlFormGroup.addControl('hasBuild', this.formBldr.control(!!this.EditingApplication.LowCodeUnit?.SourceControlLookup || false, [Validators.required]));
4929
+ this.SourceControlFormGroup.addControl('sourceControlLookup', this.formBldr.control(this.EditingApplication.LowCodeUnit?.SourceControlLookup || '', []));
4930
+ }
4695
4931
  }
4696
- BuildPipelineFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BuildPipelineFormComponent, deps: [{ token: EaCService }, { token: i1$1.FormBuilder }, { token: ApplicationsFlowService }], target: i0.ɵɵFactoryTarget.Component });
4697
- BuildPipelineFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: BuildPipelineFormComponent, selector: "lcu-build-pipeline-form", inputs: { DevOpsActionLookup: ["devops-action-lookup", "DevOpsActionLookup"], Disabled: ["disabled", "Disabled"], Environment: ["environment", "Environment"], EnvironmentLookup: ["environment-lookup", "EnvironmentLookup"], HostingDetails: ["hosting-details", "HostingDetails"] }, outputs: { ResponseEvent: "response-event" }, ngImport: i0, template: "<form class=\"form-card\" [formGroup]=\"BuildPipelineFormGroup\" (ngSubmit)=\"SubmitBuildPipeline()\">\n <mat-card\n class=\"spread\" \n >\n <mat-card-header>\n <mat-card-title> Build Pipeline </mat-card-title>\n\n <mat-hint>\n Changes made here are reflected for all sources using this\n DevOpsAction\n </mat-hint>\n </mat-card-header>\n\n <mat-card-content>\n\n\n <div *ngIf=\"!HostingDetails?.Loading\">\n <mat-form-field class=\"mat-full-width\">\n <mat-select\n formControlName=\"buildPipeline\"\n placeholder=\"Build Pipeline\"\n [disabled]=\"Disabled\"\n (selectionChange)=\"BuildPipelineChanged()\"\n required\n >\n <ng-container\n *ngFor=\"let hostOption of HostingDetails?.HostingOptions; let i = index\"\n >\n <mat-option [value]=\"hostOption.Lookup\">\n {{ hostOption.Name }}\n </mat-option>\n </ng-container>\n </mat-select>\n \n <mat-hint>\n <ng-container *ngFor=\"let hostOption of HostingDetails?.HostingOptions\">\n <span *ngIf=\"BuildPipeline == hostOption?.Lookup\">\n {{ hostOption.Description }}\n </span>\n </ng-container>\n </mat-hint>\n </mat-form-field>\n \n <mat-form-field class=\"mat-full-width\">\n <input\n matInput\n formControlName=\"devOpsActionName\"\n placeholder=\"Name of DevOps Action\"\n required=\"true\"\n />\n </mat-form-field>\n \n <ng-container *ngFor=\"let input of SelectedHostingOption?.Inputs\">\n <mat-form-field class=\"mat-full-width\">\n <input\n matInput\n [formControlName]=\"input.Lookup\"\n [placeholder]=\"input.Placeholder\"\n [required]=\"input.Required\"\n />\n \n <mat-hint>{{ input.Hint }}</mat-hint>\n </mat-form-field>\n </ng-container>\n \n <div *ngIf=\"BuildPipeline == 'npm-release'\">\n <mat-form-field class=\"mat-full-width with-hint padding-bottom-4\">\n <mat-icon matPrefix>security</mat-icon>\n \n <input\n id=\"npm-token\"\n matInput\n type=\"text\"\n formControlName=\"npmToken\"\n placeholder=\"NPM token\"\n [required]=\"!Disabled\"\n style=\"-webkit-text-security: disc;\"\n />\n <mat-hint>\n Securely publish to NPM, provide an NPM Personal Access Token (PAT) with publish access to the organization used for your NPM packages. \n Learn how to create and view access tokens \n <a\n href=\"https://docs.npmjs.com/creating-and-viewing-access-tokens\"\n target=\"_blank\"\n >\n here.\n </a>\n </mat-hint>\n </mat-form-field>\n </div>\n </div>\n \n <div *ngIf=\"HostingDetails?.Loading\">\n <div class=\"spread\">\n <lcu-loader style=\"margin: auto\" [loading]=\"true\"></lcu-loader>\n \n <div class=\"margin-3\">\n <h4 class=\"mat-title\">Loading hosting details</h4>\n </div>\n </div>\n </div>\n </mat-card-content>\n <mat-card-actions fxLayoutAlign=\"center center\">\n\n <button \n *ngIf=\"!State?.Loading\"\n mat-raised-button \n type=\"submit\" \n fxFlex=\"100%\" \n color=\"primary\" \n [disabled]=\"!BuildPipelineFormGroup.valid || !BuildPipelineFormGroup.dirty\">\n <mat-icon>save</mat-icon>\n Save Build Pipeline\n </button>\n <lcu-loader [loading]=\"State?.Loading\"></lcu-loader> \n \n </mat-card-actions>\n </mat-card>\n</form>\n", styles: [""], components: [{ type: i4.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i4.MatCardHeader, selector: "mat-card-header" }, { type: i4$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i8.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i3.LoaderComponent, selector: "lcu-loader", inputs: ["diameter", "hide-inner", "loading"] }, { type: i2$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i4.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { type: i4$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i4.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4$2.MatPrefix, selector: "[matPrefix]" }, { type: i4.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { type: i5$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i5$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }] });
4698
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BuildPipelineFormComponent, decorators: [{
4932
+ SourceControlFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: SourceControlFormComponent, deps: [{ token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
4933
+ SourceControlFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: SourceControlFormComponent, selector: "lcu-source-control-form", inputs: { EditingApplication: ["editing-application", "EditingApplication"], Environment: ["environment", "Environment"] }, outputs: { SaveFormEvent: "save-form-event" }, ngImport: i0, template: "<form class=\"source-control-form\" [formGroup]=\"SourceControlFormGroup\" (ngSubmit)=\"SubmitSourceControl()\">\n\n<mat-card class=\"spread flow-card\" *ngIf=\"ProcessorType != 'Redirect'\">\n <mat-card-header>\n <mat-card-title *ngIf=\"!HasBuildFormControl.value\">\n Build & Source\n </mat-card-title>\n\n <mat-card-title *ngIf=\"HasBuildFormControl.value\">\n Source Control\n </mat-card-title>\n\n <div fxFlex></div>\n\n <mat-slide-toggle\n formControlName=\"hasBuild\"\n matTooltip=\"Has Build?\"\n >\n </mat-slide-toggle>\n\n <mat-icon\n matSuffix\n matTooltip=\"Configure source control, DevOps CI/CD, and artifacts.\"\n >\n info_outline\n </mat-icon>\n </mat-card-header>\n\n <mat-card-content>\n <mat-form-field\n class=\"mat-full-width\"\n *ngIf=\"\n HasBuildFormControl.value && SourceControlLookups?.length > 0\n \"\n >\n <mat-select\n formControlName=\"sourceControlLookup\"\n placeholder=\"Source Control\"\n (selectionChange)=\"SourceControlLookupChanged($event)\"\n [disabled]=\"\n SourceControlFormControls?.Loading || HostingDetails?.Loading\n \"\n >\n <ng-container\n *ngFor=\"let srcCtrlLookup of SourceControlLookups\"\n >\n <mat-option\n [value]=\"srcCtrlLookup\"\n *ngIf=\"SourceControls[srcCtrlLookup]; let srcCtrl\"\n >\n {{ srcCtrl.Name }}\n </mat-option>\n </ng-container>\n </mat-select>\n\n <div *ngIf=\"HasBuildFormControl?.value\">\n <h3>\n @{{\n SourceControlFormControls?.OrganizationFormControl?.value ||\n SourceControl?.Organization\n }}/{{\n SourceControlFormControls?.RepositoryFormControl?.value ||\n SourceControl?.Repository\n }}\n </h3>\n\n <p>Organization and Repository pulled from build settings</p>\n\n <mat-hint>\n CurrentBuild:\n {{ EditingApplication?.LowCodeUnit?.CurrentBuild }}\n </mat-hint>\n </div>\n </mat-form-field>\n\n <div *ngIf=\"SourceControlLookups?.length < 0\">\n <h3>\n Create source control locations under the DevOps tab above.\n </h3>\n </div>\n </mat-card-content>\n <mat-card-actions fxLayoutAlign=\"center center\">\n\n <button \n mat-raised-button \n type=\"submit\" \n fxFlex=\"100%\" \n color=\"primary\" \n [disabled]=\"!SourceControlFormGroup.valid || !SourceControlFormGroup.dirty\">\n <mat-icon>save</mat-icon>\n Save\n </button>\n \n </mat-card-actions>\n </mat-card>\n</form>\n", styles: [""], components: [{ type: i4.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i4.MatCardHeader, selector: "mat-card-header" }, { type: i12$1.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex", "name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "checked"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i8.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i2$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { type: i5$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i12.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i4$2.MatSuffix, selector: "[matSuffix]" }, { type: i4.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i4.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { type: i5$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }] });
4934
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: SourceControlFormComponent, decorators: [{
4699
4935
  type: Component,
4700
- args: [{ selector: 'lcu-build-pipeline-form', template: "<form class=\"form-card\" [formGroup]=\"BuildPipelineFormGroup\" (ngSubmit)=\"SubmitBuildPipeline()\">\n <mat-card\n class=\"spread\" \n >\n <mat-card-header>\n <mat-card-title> Build Pipeline </mat-card-title>\n\n <mat-hint>\n Changes made here are reflected for all sources using this\n DevOpsAction\n </mat-hint>\n </mat-card-header>\n\n <mat-card-content>\n\n\n <div *ngIf=\"!HostingDetails?.Loading\">\n <mat-form-field class=\"mat-full-width\">\n <mat-select\n formControlName=\"buildPipeline\"\n placeholder=\"Build Pipeline\"\n [disabled]=\"Disabled\"\n (selectionChange)=\"BuildPipelineChanged()\"\n required\n >\n <ng-container\n *ngFor=\"let hostOption of HostingDetails?.HostingOptions; let i = index\"\n >\n <mat-option [value]=\"hostOption.Lookup\">\n {{ hostOption.Name }}\n </mat-option>\n </ng-container>\n </mat-select>\n \n <mat-hint>\n <ng-container *ngFor=\"let hostOption of HostingDetails?.HostingOptions\">\n <span *ngIf=\"BuildPipeline == hostOption?.Lookup\">\n {{ hostOption.Description }}\n </span>\n </ng-container>\n </mat-hint>\n </mat-form-field>\n \n <mat-form-field class=\"mat-full-width\">\n <input\n matInput\n formControlName=\"devOpsActionName\"\n placeholder=\"Name of DevOps Action\"\n required=\"true\"\n />\n </mat-form-field>\n \n <ng-container *ngFor=\"let input of SelectedHostingOption?.Inputs\">\n <mat-form-field class=\"mat-full-width\">\n <input\n matInput\n [formControlName]=\"input.Lookup\"\n [placeholder]=\"input.Placeholder\"\n [required]=\"input.Required\"\n />\n \n <mat-hint>{{ input.Hint }}</mat-hint>\n </mat-form-field>\n </ng-container>\n \n <div *ngIf=\"BuildPipeline == 'npm-release'\">\n <mat-form-field class=\"mat-full-width with-hint padding-bottom-4\">\n <mat-icon matPrefix>security</mat-icon>\n \n <input\n id=\"npm-token\"\n matInput\n type=\"text\"\n formControlName=\"npmToken\"\n placeholder=\"NPM token\"\n [required]=\"!Disabled\"\n style=\"-webkit-text-security: disc;\"\n />\n <mat-hint>\n Securely publish to NPM, provide an NPM Personal Access Token (PAT) with publish access to the organization used for your NPM packages. \n Learn how to create and view access tokens \n <a\n href=\"https://docs.npmjs.com/creating-and-viewing-access-tokens\"\n target=\"_blank\"\n >\n here.\n </a>\n </mat-hint>\n </mat-form-field>\n </div>\n </div>\n \n <div *ngIf=\"HostingDetails?.Loading\">\n <div class=\"spread\">\n <lcu-loader style=\"margin: auto\" [loading]=\"true\"></lcu-loader>\n \n <div class=\"margin-3\">\n <h4 class=\"mat-title\">Loading hosting details</h4>\n </div>\n </div>\n </div>\n </mat-card-content>\n <mat-card-actions fxLayoutAlign=\"center center\">\n\n <button \n *ngIf=\"!State?.Loading\"\n mat-raised-button \n type=\"submit\" \n fxFlex=\"100%\" \n color=\"primary\" \n [disabled]=\"!BuildPipelineFormGroup.valid || !BuildPipelineFormGroup.dirty\">\n <mat-icon>save</mat-icon>\n Save Build Pipeline\n </button>\n <lcu-loader [loading]=\"State?.Loading\"></lcu-loader> \n \n </mat-card-actions>\n </mat-card>\n</form>\n", styles: [""] }]
4701
- }], ctorParameters: function () { return [{ type: EaCService }, { type: i1$1.FormBuilder }, { type: ApplicationsFlowService }]; }, propDecorators: { DevOpsActionLookup: [{
4702
- type: Input,
4703
- args: ['devops-action-lookup']
4704
- }], Disabled: [{
4936
+ args: [{ selector: 'lcu-source-control-form', template: "<form class=\"source-control-form\" [formGroup]=\"SourceControlFormGroup\" (ngSubmit)=\"SubmitSourceControl()\">\n\n<mat-card class=\"spread flow-card\" *ngIf=\"ProcessorType != 'Redirect'\">\n <mat-card-header>\n <mat-card-title *ngIf=\"!HasBuildFormControl.value\">\n Build & Source\n </mat-card-title>\n\n <mat-card-title *ngIf=\"HasBuildFormControl.value\">\n Source Control\n </mat-card-title>\n\n <div fxFlex></div>\n\n <mat-slide-toggle\n formControlName=\"hasBuild\"\n matTooltip=\"Has Build?\"\n >\n </mat-slide-toggle>\n\n <mat-icon\n matSuffix\n matTooltip=\"Configure source control, DevOps CI/CD, and artifacts.\"\n >\n info_outline\n </mat-icon>\n </mat-card-header>\n\n <mat-card-content>\n <mat-form-field\n class=\"mat-full-width\"\n *ngIf=\"\n HasBuildFormControl.value && SourceControlLookups?.length > 0\n \"\n >\n <mat-select\n formControlName=\"sourceControlLookup\"\n placeholder=\"Source Control\"\n (selectionChange)=\"SourceControlLookupChanged($event)\"\n [disabled]=\"\n SourceControlFormControls?.Loading || HostingDetails?.Loading\n \"\n >\n <ng-container\n *ngFor=\"let srcCtrlLookup of SourceControlLookups\"\n >\n <mat-option\n [value]=\"srcCtrlLookup\"\n *ngIf=\"SourceControls[srcCtrlLookup]; let srcCtrl\"\n >\n {{ srcCtrl.Name }}\n </mat-option>\n </ng-container>\n </mat-select>\n\n <div *ngIf=\"HasBuildFormControl?.value\">\n <h3>\n @{{\n SourceControlFormControls?.OrganizationFormControl?.value ||\n SourceControl?.Organization\n }}/{{\n SourceControlFormControls?.RepositoryFormControl?.value ||\n SourceControl?.Repository\n }}\n </h3>\n\n <p>Organization and Repository pulled from build settings</p>\n\n <mat-hint>\n CurrentBuild:\n {{ EditingApplication?.LowCodeUnit?.CurrentBuild }}\n </mat-hint>\n </div>\n </mat-form-field>\n\n <div *ngIf=\"SourceControlLookups?.length < 0\">\n <h3>\n Create source control locations under the DevOps tab above.\n </h3>\n </div>\n </mat-card-content>\n <mat-card-actions fxLayoutAlign=\"center center\">\n\n <button \n mat-raised-button \n type=\"submit\" \n fxFlex=\"100%\" \n color=\"primary\" \n [disabled]=\"!SourceControlFormGroup.valid || !SourceControlFormGroup.dirty\">\n <mat-icon>save</mat-icon>\n Save\n </button>\n \n </mat-card-actions>\n </mat-card>\n</form>\n", styles: [""] }]
4937
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }]; }, propDecorators: { EditingApplication: [{
4705
4938
  type: Input,
4706
- args: ['disabled']
4939
+ args: ['editing-application']
4707
4940
  }], Environment: [{
4708
4941
  type: Input,
4709
4942
  args: ['environment']
4710
- }], EnvironmentLookup: [{
4711
- type: Input,
4712
- args: ['environment-lookup']
4713
- }], HostingDetails: [{
4714
- type: Input,
4715
- args: ['hosting-details']
4716
- }], ResponseEvent: [{
4943
+ }], SaveFormEvent: [{
4717
4944
  type: Output,
4718
- args: ['response-event']
4945
+ args: ['save-form-event']
4719
4946
  }] } });
4720
4947
 
4721
- class DevopsSourceControlFormComponent {
4722
- // Constructors
4723
- constructor(appsFlowSvc, eacSvc, formBuilder) {
4724
- this.appsFlowSvc = appsFlowSvc;
4948
+ class BuildPipelineFormComponent {
4949
+ constructor(eacSvc, formBuilder, appsFlowSvc) {
4725
4950
  this.eacSvc = eacSvc;
4726
4951
  this.formBuilder = formBuilder;
4727
- this.SeparatorKeysCodes = [ENTER, COMMA];
4728
- this.SaveStatusEvent = new EventEmitter;
4729
- this.BuildPath = null;
4952
+ this.appsFlowSvc = appsFlowSvc;
4730
4953
  this.HostingDetails = new ProjectHostingDetails();
4731
- this.SelectedBranches = [];
4732
- this.SourceControlRoot = '';
4733
- this.UseBranches = true;
4734
- this.UseBuildPath = false;
4954
+ this.ResponseEvent = new EventEmitter;
4735
4955
  }
4736
- // Properties
4737
- get ArtifactLookups() {
4738
- return this.DevOpsAction?.ArtifactLookups;
4956
+ get Artifact() {
4957
+ // console.log("ARTIFACT: ", this.Environment?.Artifacts[this.ArtifactLookup]);
4958
+ return this.Environment?.Artifacts && this.ArtifactLookup
4959
+ ? this.Environment?.Artifacts[this.ArtifactLookup] || {}
4960
+ : {};
4739
4961
  }
4740
4962
  get ArtifactLookup() {
4741
4963
  const artLookup = this.DevOpsAction?.ArtifactLookups
@@ -4743,170 +4965,72 @@ class DevopsSourceControlFormComponent {
4743
4965
  : null;
4744
4966
  return artLookup;
4745
4967
  }
4746
- get Artifact() {
4747
- return this.Environment?.Artifacts && this.ArtifactLookup
4748
- ? this.Environment?.Artifacts[this.ArtifactLookup] || {}
4749
- : {};
4750
- }
4751
- get BranchesFormControl() {
4752
- return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'branches');
4753
- }
4754
- get BuildPathFormControl() {
4755
- return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'buildPath');
4756
- }
4757
- get DevOpsActionLookups() {
4758
- // console.log(this.DevOpsActions);
4759
- return Object.keys(this.DevOpsActions || {});
4968
+ get BuildPipelineFormControl() {
4969
+ return this.BuildPipelineFormGroup?.get('buildPipeline');
4760
4970
  }
4761
4971
  get DevOpsAction() {
4762
4972
  return this.Environment.DevOpsActions && this.DevOpsActionLookup
4763
4973
  ? this.Environment.DevOpsActions[this.DevOpsActionLookup] || {}
4764
4974
  : {};
4765
4975
  }
4766
- get DevOpsActionLookup() {
4767
- if (!!this.DevOpsActionLookupFormControl?.value) {
4768
- return this.DevOpsActionLookupFormControl.value;
4769
- }
4770
- if (!!this.EditingSourceControl?.DevOpsActionTriggerLookups) {
4771
- return this.EditingSourceControl?.DevOpsActionTriggerLookups[0];
4772
- }
4773
- else {
4774
- return null;
4775
- }
4776
- }
4777
- get DevOpsActionLookupFormControl() {
4778
- return this.DevOpsSourceControlFormGroup.get('devOpsActionLookup');
4779
- }
4780
4976
  get DevOpsActions() {
4781
4977
  return this.Environment.DevOpsActions || {};
4782
4978
  }
4783
- get EditingSourceControl() {
4784
- let sc = this.Environment?.Sources
4785
- ? this.Environment?.Sources[this.EditingSourceControlLookup]
4786
- : null;
4787
- if (sc == null && this.EditingSourceControlLookup) {
4788
- sc = {};
4789
- }
4790
- return sc;
4979
+ get DevOpsActionNameFormControl() {
4980
+ return this.BuildPipelineFormGroup.get('devOpsActionName');
4791
4981
  }
4792
- get MainBranchFormControl() {
4793
- return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'mainBranch');
4982
+ get NPMTokenFormControl() {
4983
+ return this.BuildPipelineFormGroup.get('npmToken');
4794
4984
  }
4795
- get OrganizationFormControl() {
4796
- return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'organization');
4985
+ // (ho) => ho.Lookup === this.BuildPipeline
4986
+ get SelectedHostingOption() {
4987
+ return this.HostingDetails?.HostingOptions?.find((ho) => ho.Lookup === this.BuildPipeline);
4797
4988
  }
4798
- get RepositoryFormControl() {
4799
- return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'repository');
4989
+ get SelectedHostingOptionInputControlValues() {
4990
+ return this.SelectedHostingOption?.Inputs?.reduce((prev, cur) => {
4991
+ const res = {
4992
+ ...prev,
4993
+ };
4994
+ res[cur.Lookup] = this.BuildPipelineFormGroup.controls[cur.Lookup].value;
4995
+ return res;
4996
+ }, {});
4997
+ }
4998
+ get SourceControlLookups() {
4999
+ return Object.keys(this.SourceControls || {});
5000
+ }
5001
+ get SourceControls() {
5002
+ return this.Environment.Sources || {};
4800
5003
  }
4801
5004
  get State() {
4802
5005
  return this.eacSvc.State;
4803
5006
  }
4804
- // Life Cycle
4805
- ngAfterViewInit() { }
4806
- ngOnDestroy() {
4807
- this.destroyFormControls();
4808
- }
4809
5007
  ngOnInit() {
4810
- if (this.EditingSourceControlLookup === null) {
4811
- this.CreateNewSourceControl();
4812
- }
4813
- if (this.EditingSourceControl != null) {
4814
- this.DevOpsSourceControlFormGroup = this.formBuilder.group({});
4815
- this.setupFormControls();
4816
- }
4817
- this.RefreshOrganizations();
4818
- }
4819
- // API Methods
4820
- AddBranchOption(event) {
4821
- this.addBranchOption(event.value);
4822
- event.input.value = '';
4823
- }
4824
- BranchOptionSelected(event) {
4825
- this.addBranchOption(event.option.value);
4826
- }
4827
- BranchesChanged(branches) {
4828
- this.loadProjectHostingDetails();
4829
- }
4830
- BuildPathChanged(event) {
4831
- //do something??
4832
- }
4833
- CreateNewSourceControl() {
4834
- this.SetEditingSourceControl(Guid.CreateRaw());
4835
- }
4836
- CreateRepository() {
4837
- this.CreatingRepository = true;
4838
- this.RepositoryFormControl.reset();
4839
- }
4840
- CancelCreateRepository() {
4841
- this.CreatingRepository = false;
4842
- }
4843
- DevOpsActionLookupChanged(event) {
4844
- this.configureDevOpsAction();
4845
- }
4846
- MainBranchChanged(event) {
4847
- this.emitBranchesChanged();
4848
- }
4849
- OrganizationChanged(event) {
4850
- const org = this.OrganizationFormControl;
4851
- this.RepositoryFormControl.reset();
4852
- if (this.UseBranches) {
4853
- this.BranchesFormControl.reset();
4854
- this.SelectedBranches = [];
4855
- }
4856
- this.listRepositories();
4857
- }
4858
- RefreshOrganizations() {
4859
- // this.Loading = true;
4860
- this.listOrganizations();
4861
- this.OrganizationFormControl?.reset();
4862
- this.RepositoryFormControl?.reset();
4863
- if (this.UseBranches) {
4864
- this.BranchesFormControl?.reset();
4865
- }
4866
- }
4867
- RemoveBranchOption(option) {
4868
- const index = this.SelectedBranches.indexOf(option);
4869
- if (index >= 0) {
4870
- this.SelectedBranches.splice(index, 1);
4871
- }
4872
- this.emitBranchesChanged();
4873
- }
4874
- RepositoryChanged(event) {
4875
- const repo = this.RepositoryFormControl;
4876
- if (this.UseBranches) {
4877
- this.BranchesFormControl.reset();
4878
- this.SelectedBranches = [];
4879
- this.listBranches();
4880
- }
4881
- if (!this.UseBranches) {
4882
- this.listBuildPaths();
4883
- }
4884
- }
4885
- SaveRepository() {
4886
- this.Loading = true;
4887
- const org = this.OrganizationFormControl.value;
4888
- const repoName = this.RepositoryFormControl.value;
4889
- this.appsFlowSvc
4890
- .CreateRepository(org, repoName)
4891
- .subscribe((response) => {
4892
- if (response.Status.Code === 0) {
4893
- this.listRepositories(repoName);
4894
- this.CreatingRepository = false;
4895
- }
4896
- else {
4897
- // TODO: Need to surface an error to the user...
4898
- this.Loading = false;
4899
- }
5008
+ // console.log('BuildPipeline = ', this.BuildPipeline)
5009
+ // this.BuildPipelineFormGroup = this.formBuilder.group({});
5010
+ // if (this.BuildPipelineFormGroup != null) {
5011
+ // this.BuildPipelineFormGroup.removeControl('hostingDetails');
5012
+ // }
5013
+ // this.BuildPipelineFormGroup.addControl(
5014
+ // 'hostingDetails',
5015
+ this.BuildPipelineFormGroup = this.formBuilder.group({
5016
+ buildPipeline: [this.BuildPipeline, [Validators.required]],
4900
5017
  });
5018
+ // );
5019
+ this.loadProjectHostingDetails();
5020
+ // this.setupControlsForForm();
4901
5021
  }
4902
- SetEditingSourceControl(scLookup) {
4903
- this.EditingSourceControlLookup = scLookup;
5022
+ //API METHODS
5023
+ BuildPipelineChanged() {
5024
+ //for some reason this value is coming back undefined
5025
+ // console.log("build pipeline value: ", this.BuildPipelineFormControl?.value)
5026
+ this.BuildPipeline = this.BuildPipelineFormControl?.value;
5027
+ this.setupControlsForForm();
4904
5028
  }
4905
- SubmitSourceControl() {
4906
- console.log("source control submitted: ", this.DevOpsSourceControlFormGroup.value);
4907
- this.SaveSourceControl();
5029
+ SubmitBuildPipeline() {
5030
+ // console.log("submitting build pipeline: ", this.BuildPipelineFormGroup.value);
5031
+ this.SaveEnvironment();
4908
5032
  }
4909
- SaveSourceControl() {
5033
+ SaveEnvironment() {
4910
5034
  const saveEnvReq = {
4911
5035
  Environment: {
4912
5036
  ...this.Environment,
@@ -4919,14 +5043,16 @@ class DevopsSourceControlFormComponent {
4919
5043
  EnterpriseDataTokens: {},
4920
5044
  };
4921
5045
  let artifactLookup;
4922
- let artifact = this.Artifact;
5046
+ let artifact = {
5047
+ ...this.Artifact,
5048
+ ...this.SelectedHostingOptionInputControlValues,
5049
+ };
4923
5050
  if (!this.ArtifactLookup) {
4924
5051
  artifactLookup = Guid.CreateRaw();
4925
5052
  artifact = {
4926
5053
  ...artifact,
4927
- // Type: this.HostingDetailsFormControls.SelectedHostingOption
4928
- // .ArtifactType,
4929
- // Name: this.HostingDetailsFormControls.SelectedHostingOption.Name,
5054
+ Type: this.SelectedHostingOption.ArtifactType,
5055
+ Name: this.SelectedHostingOption.Name,
4930
5056
  NPMRegistry: 'https://registry.npmjs.org/',
4931
5057
  };
4932
5058
  }
@@ -4940,214 +5066,118 @@ class DevopsSourceControlFormComponent {
4940
5066
  const doa = {
4941
5067
  ...this.DevOpsAction,
4942
5068
  ArtifactLookups: [artifactLookup],
5069
+ Name: this.DevOpsActionNameFormControl.value,
5070
+ Path: this.SelectedHostingOption.Path,
5071
+ Templates: this.SelectedHostingOption.Templates,
4943
5072
  };
4944
- saveEnvReq.Environment.DevOpsActions[devOpsActionLookup] = this.DevOpsAction;
5073
+ if (this.NPMTokenFormControl?.value) {
5074
+ const secretLookup = 'npm-access-token';
5075
+ doa.SecretLookups = [secretLookup];
5076
+ saveEnvReq.Environment.Secrets[secretLookup] = {
5077
+ Name: 'NPM Access Token',
5078
+ DataTokenLookup: secretLookup,
5079
+ KnownAs: 'NPM_TOKEN',
5080
+ };
5081
+ saveEnvReq.EnterpriseDataTokens[secretLookup] = {
5082
+ Name: saveEnvReq.Environment.Secrets[secretLookup].Name,
5083
+ Description: saveEnvReq.Environment.Secrets[secretLookup].Name,
5084
+ Value: this.NPMTokenFormControl.value,
5085
+ };
5086
+ }
5087
+ saveEnvReq.Environment.DevOpsActions[devOpsActionLookup] = doa;
4945
5088
  }
4946
5089
  else {
4947
- devOpsActionLookup = this.DevOpsActionLookupFormControl.value;
5090
+ devOpsActionLookup = this.DevOpsActionLookup;
4948
5091
  const doa = {
4949
5092
  ...this.DevOpsAction,
4950
- // Name: this.HostingDetailsFormControls.DevOpsActionNameFormControl.value,
5093
+ Name: this.DevOpsActionNameFormControl.value,
4951
5094
  };
4952
- // saveEnvReq.Environment.DevOpsActions[devOpsActionLookup] = doa;
4953
- saveEnvReq.Environment.DevOpsActions[devOpsActionLookup] = this.DevOpsAction;
5095
+ saveEnvReq.Environment.DevOpsActions[devOpsActionLookup] = doa;
4954
5096
  }
4955
- let source = {
4956
- ...this.EditingSourceControl,
4957
- Branches: this.SelectedBranches,
4958
- MainBranch: this.MainBranchFormControl.value,
4959
- };
4960
- source = {
4961
- ...source,
4962
- Type: 'GitHub',
4963
- Name: this.EditingSourceControlLookup,
4964
- DevOpsActionTriggerLookups: [devOpsActionLookup],
4965
- Organization: this.OrganizationFormControl.value,
4966
- Repository: this.RepositoryFormControl.value,
4967
- };
4968
- const scLookup = `github://${source.Organization}/${source.Repository}`;
4969
- saveEnvReq.Environment.Sources[scLookup] = source;
4970
- let resp = this.eacSvc.SaveEnvironmentAsCode(saveEnvReq);
4971
- resp.then(res => {
4972
- this.SaveStatusEvent.emit(res);
5097
+ this.eacSvc.SaveEnvironmentAsCode(saveEnvReq).then(res => {
5098
+ this.ResponseEvent.emit(res);
4973
5099
  });
4974
5100
  }
4975
5101
  // Helpers
4976
- addBranchOption(value) {
4977
- value = (value || '').trim();
4978
- if (value && this.SelectedBranches.indexOf(value) < 0) {
4979
- this.SelectedBranches.push(value);
4980
- }
4981
- this.BranchesInput.nativeElement.blur();
4982
- this.emitBranchesChanged();
4983
- }
4984
- configureDevOpsAction() {
4985
- setTimeout(() => {
4986
- this.DevOpsActionLookupFormControl.setValue(this.DevOpsActionLookup);
4987
- }, 0);
4988
- }
4989
- destroyFormControls() {
4990
- this.DevOpsSourceControlFormGroup.removeControl([this.SourceControlRoot, 'mainBranch'].join(''));
4991
- this.DevOpsSourceControlFormGroup?.removeControl([this.SourceControlRoot, 'branches'].join(''));
4992
- this.DevOpsSourceControlFormGroup?.removeControl([this.SourceControlRoot, 'buildPath'].join(''));
4993
- this.SelectedBranches = [];
4994
- this.DevOpsSourceControlFormGroup?.removeControl([this.SourceControlRoot, 'organization'].join(''));
4995
- this.DevOpsSourceControlFormGroup?.removeControl([this.SourceControlRoot, 'repository'].join(''));
4996
- }
4997
- emitBranchesChanged() {
4998
- if (this.SelectedBranches?.length > 0 &&
4999
- (!this.MainBranchFormControl.value ||
5000
- this.SelectedBranches.indexOf(this.MainBranchFormControl.value) < 0)) {
5001
- this.MainBranchFormControl.setValue(this.SelectedBranches.find((branch) => branch === 'main' || branch === 'master') || this.SelectedBranches[0]);
5002
- }
5003
- else if (this.SelectedBranches?.length <= 0) {
5004
- this.MainBranchFormControl.reset();
5005
- }
5006
- this.BranchesFormControl.setValue(this.SelectedBranches.join(','));
5007
- this.BranchesChanged(this.SelectedBranches || []);
5008
- }
5009
- listBranches() {
5010
- if (this.UseBranches) {
5011
- this.Loading = true;
5012
- this.appsFlowSvc
5013
- .ListBranches(this.OrganizationFormControl.value, this.RepositoryFormControl.value)
5014
- .subscribe((response) => {
5015
- this.BranchOptions = response.Model;
5016
- this.Loading = false;
5017
- if (this.EditingSourceControl?.Branches?.length > 0) {
5018
- this.SelectedBranches = this.EditingSourceControl.Branches;
5019
- }
5020
- else if (this.BranchOptions?.length === 1) {
5021
- this.BranchesFormControl.setValue(this.BranchOptions[0].Name);
5022
- this.SelectedBranches = [this.BranchOptions[0].Name];
5023
- }
5024
- this.emitBranchesChanged();
5025
- this.listBuildPaths();
5026
- });
5027
- }
5028
- }
5029
- listBuildPaths() {
5030
- if (this.UseBuildPath) {
5031
- this.Loading = true;
5032
- this.appsFlowSvc
5033
- .ListBuildPaths(this.OrganizationFormControl.value, this.RepositoryFormControl.value)
5034
- .subscribe((response) => {
5035
- this.BuildPathOptions = response.Model;
5036
- this.Loading = false;
5037
- if (this.BuildPathOptions?.length === 1) {
5038
- this.BuildPathFormControl.setValue(this.BuildPathOptions[0]);
5039
- }
5040
- });
5041
- }
5042
- }
5043
- listOrganizations() {
5044
- this.Loading = true;
5045
- this.appsFlowSvc
5046
- .ListOrganizations()
5047
- .subscribe((response) => {
5048
- this.OrganizationOptions = response.Model;
5049
- this.Loading = false;
5050
- if (this.EditingSourceControl?.Organization) {
5051
- setTimeout(() => {
5052
- this.OrganizationFormControl.setValue(this.EditingSourceControl.Organization);
5053
- this.listRepositories(this.EditingSourceControl?.Repository);
5054
- }, 0);
5102
+ setupControlsForForm() {
5103
+ // this.BuildPipeline =
5104
+ // this.BuildPipeline || this.HostingDetails?.HostingOptions
5105
+ // ? this.HostingDetails?.HostingOptions[0]?.Lookup
5106
+ // : '';
5107
+ // console.log("hosting details: ", this.HostingDetails)
5108
+ for (const ctrlName in this.BuildPipelineFormGroup.controls) {
5109
+ //devOpsAction doesn't exist
5110
+ //removes hosting details
5111
+ if (ctrlName !== 'buildPipeline' && ctrlName !== 'devOpsAction') {
5112
+ // console.log("removing control: ", ctrlName)
5113
+ this.BuildPipelineFormGroup.removeControl(ctrlName);
5055
5114
  }
5115
+ }
5116
+ this.BuildPipelineFormGroup.addControl('devOpsActionName', this.formBuilder.control(this.DevOpsAction?.Name || this.SelectedHostingOption?.Name || '', [Validators.required]));
5117
+ // console.log("selected hosting options: ", this.SelectedHostingOption.Inputs);
5118
+ this.SelectedHostingOption?.Inputs?.forEach((input) => {
5119
+ const validators = input.Required ? [Validators.required] : [];
5120
+ this.BuildPipelineFormGroup.addControl(input.Lookup, this.formBuilder.control(this.Artifact[input.Lookup] || input.DefaultValue || '', validators));
5121
+ // if (this.Disabled) {
5122
+ // this.FormGroup.controls[input.Lookup].disable();
5123
+ // }
5056
5124
  });
5057
- }
5058
- listRepositories(activeRepo = null) {
5059
- this.Loading = true;
5060
- this.appsFlowSvc
5061
- .ListRepositories(this.OrganizationFormControl.value)
5062
- .subscribe((response) => {
5063
- this.RepositoryOptions = response.Model;
5064
- this.Loading = false;
5065
- if (activeRepo) {
5066
- setTimeout(() => {
5067
- this.RepositoryFormControl.setValue(activeRepo);
5068
- this.listBranches();
5069
- if (!this.UseBranches) {
5070
- this.listBuildPaths();
5071
- }
5072
- }, 0);
5125
+ if (this.BuildPipelineFormControl?.value === 'npm-release') {
5126
+ if (!this.BuildPipelineFormGroup.controls.npmToken) {
5127
+ this.BuildPipelineFormGroup.addControl('npmToken', this.formBuilder.control('', this.Disabled ? [] : [Validators.required]));
5128
+ if (this.Disabled) {
5129
+ this.BuildPipelineFormGroup.controls.npmToken.disable();
5130
+ }
5073
5131
  }
5074
- else if (this.RepositoryOptions?.length <= 0) {
5075
- this.CreatingRepository = true;
5132
+ }
5133
+ else if (this.BuildPipelineFormControl?.value === 'github-artifacts-release') {
5134
+ if (this.BuildPipelineFormGroup.controls.npmToken) {
5135
+ this.BuildPipelineFormGroup.removeControl('npmToken');
5076
5136
  }
5077
- });
5078
- }
5079
- loadProjectHostingDetails() {
5080
- if (this.SelectedBranches?.length > 0) {
5081
- this.HostingDetails.Loading = true;
5082
- this.appsFlowSvc
5083
- .LoadProjectHostingDetails(this.OrganizationFormControl?.value, this.RepositoryFormControl?.value, this.MainBranchFormControl?.value)
5084
- .subscribe((response) => {
5085
- this.HostingDetails = response.Model;
5086
- this.HostingDetails.Loading = false;
5087
- this.configureDevOpsAction();
5088
- }, (err) => {
5089
- this.HostingDetails.Loading = false;
5090
- });
5091
5137
  }
5092
5138
  }
5093
- setupFormControls() {
5094
- // this.destroyFormControls();
5095
- this.DevOpsSourceControlFormGroup.addControl('devOpsActionLookup', new FormControl(this.DevOpsActionLookup || '', []));
5096
- this.DevOpsSourceControlFormGroup.addControl([this.SourceControlRoot, 'organization'].join(''), new FormControl(this.EditingSourceControl.Organization ?? '', Validators.required));
5097
- this.DevOpsSourceControlFormGroup.addControl([this.SourceControlRoot, 'repository'].join(''), new FormControl(this.EditingSourceControl.Repository ?? '', Validators.required));
5098
- if (this.UseBranches) {
5099
- this.DevOpsSourceControlFormGroup.addControl([this.SourceControlRoot, 'branches'].join(''), new FormControl(this.EditingSourceControl?.Branches ?? '', Validators.required));
5100
- this.SelectedBranches = this.EditingSourceControl?.Branches;
5101
- this.DevOpsSourceControlFormGroup.addControl([this.SourceControlRoot, 'mainBranch'].join(''), new FormControl(this.EditingSourceControl.MainBranch ?? '', Validators.required));
5102
- }
5103
- if (this.UseBuildPath) {
5104
- this.DevOpsSourceControlFormGroup.addControl([this.SourceControlRoot, 'buildPath'].join(''), new FormControl(this.BuildPath ?? '', Validators.required));
5105
- }
5139
+ loadProjectHostingDetails() {
5140
+ this.HostingDetails.Loading = true;
5141
+ this.appsFlowSvc.NewLoadProjectHostingDetails().subscribe((response) => {
5142
+ this.HostingDetails = response.Model;
5143
+ // console.log("response: ", response);
5144
+ this.HostingDetails.Loading = false;
5145
+ const hostOption = this.HostingDetails?.HostingOptions?.find((ho) => ho.Path === this.DevOpsAction.Path);
5146
+ this.BuildPipeline = hostOption.Lookup;
5147
+ // console.log("Build Pipeline HERE= ", this.BuildPipeline);
5148
+ this.setupControlsForForm();
5149
+ }, (err) => {
5150
+ console.log('ERR: ', err);
5151
+ this.HostingDetails.Loading = false;
5152
+ });
5153
+ console.log('HOSTING DETAILS: ', this.HostingDetails);
5106
5154
  }
5107
5155
  }
5108
- DevopsSourceControlFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: DevopsSourceControlFormComponent, deps: [{ token: ApplicationsFlowService }, { token: EaCService }, { token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
5109
- DevopsSourceControlFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: DevopsSourceControlFormComponent, selector: "lcu-devops-source-control-form", inputs: { EditingSourceControlLookup: ["editing-source-control-lookup", "EditingSourceControlLookup"], Environment: ["environment", "Environment"], EnvironmentLookup: ["environment-lookup", "EnvironmentLookup"] }, outputs: { SaveStatusEvent: "save-status-event" }, viewQueries: [{ propertyName: "BranchesInput", first: true, predicate: ["branches"], descendants: true }], ngImport: i0, template: "<form class=\"form-card\" [formGroup]=\"DevOpsSourceControlFormGroup\" (ngSubmit)=\"SubmitSourceControl()\">\n\n <mat-card class=\"spread\" class=\"sc-card\">\n <mat-card-header>\n <mat-card-title> Source Control </mat-card-title>\n\n <div fxFlex></div>\n\n <mat-icon matSuffix matTooltip=\"Configure source control, DevOps CI/CD, and artifacts.\">\n info_outline\n </mat-icon>\n </mat-card-header>\n\n <mat-card-content>\n <div class=\"card\">\n <mat-form-field class=\"mat-full-width\">\n <mat-select formControlName=\"devOpsActionLookup\" placeholder=\"DevOps Action\"\n [disabled]=\"HostingDetails?.Loading\" (selectionChange)=\"DevOpsActionLookupChanged($event)\">\n <ng-container *ngFor=\"let devOpsActionLookup of DevOpsActionLookups\">\n <mat-option [value]=\"devOpsActionLookup\" *ngIf=\"DevOpsActions[devOpsActionLookup]; let devOpsAction\">\n {{ devOpsAction.Name }}\n </mat-option>\n </ng-container>\n\n <mat-option value=\"\">-- Create New --</mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"card\" *ngIf=\"OrganizationFormControl?.valid || !Loading\">\n <mat-form-field class=\"mat-full-width with-hint margin-bottom\" *ngIf=\"OrganizationOptions?.length > 0\">\n <mat-icon class=\"org-icon\" matPrefix>corporate_fare</mat-icon>\n\n <mat-select [formControlName]=\"SourceControlRoot + 'organization'\" placeholder=\"Organization\"\n (selectionChange)=\"OrganizationChanged($event)\" [disabled]=\"Loading || HostingDetails?.Loading\" required>\n <ng-container *ngFor=\"let orgOpt of OrganizationOptions\">\n <mat-option [value]=\"orgOpt.Name\">\n {{ orgOpt.Name }}\n </mat-option>\n </ng-container>\n </mat-select>\n\n <mat-icon matSuffix (click)=\"RefreshOrganizations()\" matTooltip=\"Refresh Organization\"> refresh </mat-icon>\n\n <a matSuffix href=\"/.oauth/github?oauth-force-edit=true\" target=\"_blank\" color=\"accent\">\n <mat-icon color=\"accent\" matTooltip=\"Re-authorize Organizations\"> launch </mat-icon>\n </a>\n\n <mat-hint>\n If you don't have an organization or would like to create a new one,\n <a href=\"https://github.com/account/organizations/new\" target=\"_blank\">\n start here\n </a>\n </mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"card\" *ngIf=\"\n RepositoryFormControl?.valid ||\n (OrganizationFormControl?.valid && !Loading)\n \">\n <mat-form-field class=\"mat-full-width\">\n <mat-icon class=\"org-icon\" matPrefix>description</mat-icon>\n\n <mat-select [formControlName]=\"SourceControlRoot + 'repository'\" [placeholder]=\"\n OrganizationFormControl?.valid\n ? 'Repository'\n : 'Repository (select organization first)'\n \" [disabled]=\"\n !OrganizationFormControl?.valid || Loading || HostingDetails?.Loading\n \" (selectionChange)=\"RepositoryChanged($event)\" *ngIf=\"!CreatingRepository\" required>\n <ng-container *ngFor=\"let repoOpt of RepositoryOptions\">\n <mat-option [value]=\"repoOpt.Name\">\n {{ repoOpt.Name }}\n </mat-option>\n </ng-container>\n </mat-select>\n\n <input matInput placeholder=\"Repository (creates new if does not exist)\"\n [formControlName]=\"SourceControlRoot + 'repository'\" *ngIf=\"CreatingRepository\"\n [fxHide]=\"Loading || HostingDetails?.Loading\" required />\n\n <mat-icon matSuffix (click)=\"CreateRepository()\" [fxHide]=\"Loading || HostingDetails?.Loading\"\n *ngIf=\"!CreatingRepository && OrganizationFormControl?.valid\">\n add_circle\n </mat-icon>\n\n <button mat-button type=\"button\" (click)=\"SaveRepository()\"\n *ngIf=\"CreatingRepository && RepositoryFormControl?.valid\">\n\n <mat-icon matSuffix color=\"primary\">\n save\n </mat-icon>\n </button>\n\n <button mat-button type=\"button\" (click)=\"CancelCreateRepository()\" *ngIf=\"CreatingRepository\">\n\n <mat-icon matSuffix>\n cancel\n </mat-icon>\n </button>\n </mat-form-field>\n </div>\n\n <div class=\"card\" *ngIf=\"\n (BranchesFormControl?.valid ||\n (OrganizationFormControl?.valid &&\n RepositoryFormControl?.valid &&\n !Loading)) &&\n !CreatingRepository &&\n UseBranches\n \">\n <mat-form-field class=\"mat-full-width\">\n <mat-icon class=\"org-icon\" matPrefix>account_tree</mat-icon>\n\n <mat-label>Selected Branches</mat-label>\n\n <mat-autocomplete (optionSelected)=\"BranchOptionSelected($event)\" #branchOptions=\"matAutocomplete\">\n <ng-container *ngFor=\"let branchOpt of BranchOptions\">\n <mat-option [value]=\"branchOpt.Name\">\n {{ branchOpt.Name }}\n </mat-option>\n </ng-container>\n </mat-autocomplete>\n\n <mat-chip-list #selectedBranches>\n <mat-chip [removable]=\"true\" (removed)=\"RemoveBranchOption(selBranch)\"\n *ngFor=\"let selBranch of SelectedBranches\">\n {{ selBranch }}\n <mat-icon matChipRemove>cancel</mat-icon>\n </mat-chip>\n\n <input matInput placeholder=\"New Branch...\" [formControlName]=\"SourceControlRoot + 'branches'\" #branches\n [matAutocomplete]=\"branchOptions\" [matChipInputFor]=\"selectedBranches\"\n [matChipInputSeparatorKeyCodes]=\"SeparatorKeysCodes\" [matChipInputAddOnBlur]=\"true\"\n (matChipInputTokenEnd)=\"AddBranchOption($event)\" [disabled]=\"Loading || HostingDetails?.Loading\"\n required />\n </mat-chip-list>\n </mat-form-field>\n\n <mat-form-field class=\"mat-full-width with-hint\" [fxShow]=\"SelectedBranches?.length > 1\">\n <mat-icon class=\"org-icon\" matPrefix>account_tree</mat-icon>\n\n <mat-select [formControlName]=\"SourceControlRoot + 'mainBranch'\" placeholder=\"Main Branch\"\n [disabled]=\"Loading || HostingDetails?.Loading\" (selectionChange)=\"MainBranchChanged($event)\" required>\n <ng-container *ngFor=\"let branch of SelectedBranches\">\n <mat-option [value]=\"branch\">\n {{ branch }}\n </mat-option>\n </ng-container>\n </mat-select>\n\n <mat-icon matSuffix (click)=\"RefreshOrganizations()\"> refresh </mat-icon>\n\n <a matSuffix mat-icon-button href=\"/.oauth/github?oauth-force-edit=true\" target=\"_blank\" color=\"accent\">\n <mat-icon matTooltip=\"Re-authorize Organizations\" color=\"accent\"> launch </mat-icon>\n </a>\n\n <mat-hint>\n If you don't have an organization or would like to create a new one,\n <a href=\"https://github.com/account/organizations/new\" target=\"_blank\">\n start here\n </a>\n </mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"card\" *ngIf=\"\n (BuildPathFormControl?.valid ||\n (OrganizationFormControl?.valid &&\n RepositoryFormControl?.valid &&\n !Loading)) &&\n !CreatingRepository &&\n UseBuildPath\n \">\n <mat-form-field class=\"mat-full-width with-hint\">\n <mat-icon class=\"org-icon\" matPrefix>build</mat-icon>\n\n <mat-select [formControlName]=\"SourceControlRoot + 'buildPath'\" placeholder=\"Build Path\"\n [disabled]=\"Loading || BuildPathDisabled\" (selectionChange)=\"BuildPathChanged($event)\" required>\n <ng-container *ngFor=\"let buildPath of BuildPathOptions\">\n <mat-option [value]=\"buildPath\">\n {{ buildPath }}\n </mat-option>\n </ng-container>\n </mat-select>\n\n <mat-hint>\n The build path identifies which build action to use for your\n configuration.\n </mat-hint>\n </mat-form-field>\n </div>\n\n <div *ngIf=\"Loading\">\n <div class=\"spread\">\n <lcu-loader style=\"margin: auto\" [loading]=\"true\"></lcu-loader>\n\n <div class=\"margin-3\">\n <h4 class=\"mat-title\" *ngIf=\"!OrganizationFormControl?.valid\">\n Loading organizations\n </h4>\n\n <h4 class=\"mat-title\" *ngIf=\"\n OrganizationFormControl?.valid && !RepositoryFormControl?.valid\n \">\n Loading repositories\n </h4>\n\n <h4 class=\"mat-title\" *ngIf=\"RepositoryFormControl?.valid && !BranchesFormControl?.valid\">\n Loading branches\n </h4>\n\n <h4 class=\"mat-title\" *ngIf=\"\n (RepositoryFormControl?.valid || BranchesFormControl?.valid) &&\n !BuildPathFormControl?.valid\n \">\n Loading build paths\n </h4>\n </div>\n </div>\n </div>\n <!-- </div> -->\n\n </mat-card-content>\n <mat-card-actions fxLayoutAlign=\"center center\">\n\n <button \n mat-raised-button \n *ngIf=\"!State?.Loading\"\n type=\"submit\" \n fxFlex=\"100%\" \n color=\"primary\" \n [disabled]=\"!DevOpsSourceControlFormGroup.valid || !DevOpsSourceControlFormGroup.dirty\">\n <mat-icon>save</mat-icon>\n Save Source Control\n </button>\n <lcu-loader [loading]=\"State?.Loading\"></lcu-loader>\n \n </mat-card-actions>\n </mat-card>\n</form>", styles: [".form-card,.sc-card{width:100%}.margin-bottom{margin-bottom:15px}\n"], components: [{ type: i4.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i4.MatCardHeader, selector: "mat-card-header" }, { type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i8.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i2$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i8$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { type: i9$1.MatChipList, selector: "mat-chip-list", inputs: ["errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { type: i2$1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { type: i3.LoaderComponent, selector: "lcu-loader", inputs: ["diameter", "hide-inner", "loading"] }], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i4.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { type: i5$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i4$2.MatSuffix, selector: "[matSuffix]" }, { type: i12.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i4.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$2.MatPrefix, selector: "[matPrefix]" }, { type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i4$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i11.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9.DefaultShowHideDirective, selector: " [fxShow], [fxShow.print], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide], [fxHide.print], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]", inputs: ["fxShow", "fxShow.print", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.print", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { type: i4$2.MatLabel, selector: "mat-label" }, { type: i9$1.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { type: i9$1.MatChipRemove, selector: "[matChipRemove]" }, { type: i8$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { type: i9$1.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { type: i4.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { type: i5$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }] });
5110
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: DevopsSourceControlFormComponent, decorators: [{
5156
+ BuildPipelineFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BuildPipelineFormComponent, deps: [{ token: EaCService }, { token: i1$1.FormBuilder }, { token: ApplicationsFlowService }], target: i0.ɵɵFactoryTarget.Component });
5157
+ BuildPipelineFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: BuildPipelineFormComponent, selector: "lcu-build-pipeline-form", inputs: { DevOpsActionLookup: ["devops-action-lookup", "DevOpsActionLookup"], Disabled: ["disabled", "Disabled"], Environment: ["environment", "Environment"], EnvironmentLookup: ["environment-lookup", "EnvironmentLookup"], HostingDetails: ["hosting-details", "HostingDetails"] }, outputs: { ResponseEvent: "response-event" }, ngImport: i0, template: "<form class=\"form-card\" [formGroup]=\"BuildPipelineFormGroup\" (ngSubmit)=\"SubmitBuildPipeline()\">\n <mat-card\n class=\"spread\" \n >\n <mat-card-header>\n <mat-card-title> Build Pipeline </mat-card-title>\n\n <mat-hint>\n Changes made here are reflected for all sources using this\n DevOpsAction\n </mat-hint>\n </mat-card-header>\n\n <mat-card-content>\n\n\n <div *ngIf=\"!HostingDetails?.Loading\">\n <mat-form-field class=\"mat-full-width\">\n <mat-select\n formControlName=\"buildPipeline\"\n placeholder=\"Build Pipeline\"\n [disabled]=\"Disabled\"\n (selectionChange)=\"BuildPipelineChanged()\"\n required\n >\n <ng-container\n *ngFor=\"let hostOption of HostingDetails?.HostingOptions; let i = index\"\n >\n <mat-option [value]=\"hostOption.Lookup\">\n {{ hostOption.Name }}\n </mat-option>\n </ng-container>\n </mat-select>\n \n <mat-hint>\n <ng-container *ngFor=\"let hostOption of HostingDetails?.HostingOptions\">\n <span *ngIf=\"BuildPipeline == hostOption?.Lookup\">\n {{ hostOption.Description }}\n </span>\n </ng-container>\n </mat-hint>\n </mat-form-field>\n \n <mat-form-field class=\"mat-full-width\">\n <input\n matInput\n formControlName=\"devOpsActionName\"\n placeholder=\"Name of DevOps Action\"\n required=\"true\"\n />\n </mat-form-field>\n \n <ng-container *ngFor=\"let input of SelectedHostingOption?.Inputs\">\n <mat-form-field class=\"mat-full-width\">\n <input\n matInput\n [formControlName]=\"input.Lookup\"\n [placeholder]=\"input.Placeholder\"\n [required]=\"input.Required\"\n />\n \n <mat-hint>{{ input.Hint }}</mat-hint>\n </mat-form-field>\n </ng-container>\n \n <div *ngIf=\"BuildPipeline == 'npm-release'\">\n <mat-form-field class=\"mat-full-width with-hint padding-bottom-4\">\n <mat-icon matPrefix>security</mat-icon>\n \n <input\n id=\"npm-token\"\n matInput\n type=\"text\"\n formControlName=\"npmToken\"\n placeholder=\"NPM token\"\n [required]=\"!Disabled\"\n style=\"-webkit-text-security: disc;\"\n />\n <mat-hint>\n Securely publish to NPM, provide an NPM Personal Access Token (PAT) with publish access to the organization used for your NPM packages. \n Learn how to create and view access tokens \n <a\n href=\"https://docs.npmjs.com/creating-and-viewing-access-tokens\"\n target=\"_blank\"\n >\n here.\n </a>\n </mat-hint>\n </mat-form-field>\n </div>\n </div>\n \n <div *ngIf=\"HostingDetails?.Loading\">\n <div class=\"spread\">\n <lcu-loader style=\"margin: auto\" [loading]=\"true\"></lcu-loader>\n \n <div class=\"margin-3\">\n <h4 class=\"mat-title\">Loading hosting details</h4>\n </div>\n </div>\n </div>\n </mat-card-content>\n <mat-card-actions fxLayoutAlign=\"center center\">\n\n <button \n *ngIf=\"!State?.Loading\"\n mat-raised-button \n type=\"submit\" \n fxFlex=\"100%\" \n color=\"primary\" \n [disabled]=\"!BuildPipelineFormGroup.valid || !BuildPipelineFormGroup.dirty\">\n <mat-icon>save</mat-icon>\n Save Build Pipeline\n </button>\n <lcu-loader [loading]=\"State?.Loading\"></lcu-loader> \n \n </mat-card-actions>\n </mat-card>\n</form>\n", styles: [""], components: [{ type: i4.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i4.MatCardHeader, selector: "mat-card-header" }, { type: i4$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i7.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i8.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i3.LoaderComponent, selector: "lcu-loader", inputs: ["diameter", "hide-inner", "loading"] }, { type: i2$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i4.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { type: i4$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i4.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i4$2.MatPrefix, selector: "[matPrefix]" }, { type: i4.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { type: i5$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i5$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }] });
5158
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: BuildPipelineFormComponent, decorators: [{
5111
5159
  type: Component,
5112
- args: [{ selector: 'lcu-devops-source-control-form', template: "<form class=\"form-card\" [formGroup]=\"DevOpsSourceControlFormGroup\" (ngSubmit)=\"SubmitSourceControl()\">\n\n <mat-card class=\"spread\" class=\"sc-card\">\n <mat-card-header>\n <mat-card-title> Source Control </mat-card-title>\n\n <div fxFlex></div>\n\n <mat-icon matSuffix matTooltip=\"Configure source control, DevOps CI/CD, and artifacts.\">\n info_outline\n </mat-icon>\n </mat-card-header>\n\n <mat-card-content>\n <div class=\"card\">\n <mat-form-field class=\"mat-full-width\">\n <mat-select formControlName=\"devOpsActionLookup\" placeholder=\"DevOps Action\"\n [disabled]=\"HostingDetails?.Loading\" (selectionChange)=\"DevOpsActionLookupChanged($event)\">\n <ng-container *ngFor=\"let devOpsActionLookup of DevOpsActionLookups\">\n <mat-option [value]=\"devOpsActionLookup\" *ngIf=\"DevOpsActions[devOpsActionLookup]; let devOpsAction\">\n {{ devOpsAction.Name }}\n </mat-option>\n </ng-container>\n\n <mat-option value=\"\">-- Create New --</mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"card\" *ngIf=\"OrganizationFormControl?.valid || !Loading\">\n <mat-form-field class=\"mat-full-width with-hint margin-bottom\" *ngIf=\"OrganizationOptions?.length > 0\">\n <mat-icon class=\"org-icon\" matPrefix>corporate_fare</mat-icon>\n\n <mat-select [formControlName]=\"SourceControlRoot + 'organization'\" placeholder=\"Organization\"\n (selectionChange)=\"OrganizationChanged($event)\" [disabled]=\"Loading || HostingDetails?.Loading\" required>\n <ng-container *ngFor=\"let orgOpt of OrganizationOptions\">\n <mat-option [value]=\"orgOpt.Name\">\n {{ orgOpt.Name }}\n </mat-option>\n </ng-container>\n </mat-select>\n\n <mat-icon matSuffix (click)=\"RefreshOrganizations()\" matTooltip=\"Refresh Organization\"> refresh </mat-icon>\n\n <a matSuffix href=\"/.oauth/github?oauth-force-edit=true\" target=\"_blank\" color=\"accent\">\n <mat-icon color=\"accent\" matTooltip=\"Re-authorize Organizations\"> launch </mat-icon>\n </a>\n\n <mat-hint>\n If you don't have an organization or would like to create a new one,\n <a href=\"https://github.com/account/organizations/new\" target=\"_blank\">\n start here\n </a>\n </mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"card\" *ngIf=\"\n RepositoryFormControl?.valid ||\n (OrganizationFormControl?.valid && !Loading)\n \">\n <mat-form-field class=\"mat-full-width\">\n <mat-icon class=\"org-icon\" matPrefix>description</mat-icon>\n\n <mat-select [formControlName]=\"SourceControlRoot + 'repository'\" [placeholder]=\"\n OrganizationFormControl?.valid\n ? 'Repository'\n : 'Repository (select organization first)'\n \" [disabled]=\"\n !OrganizationFormControl?.valid || Loading || HostingDetails?.Loading\n \" (selectionChange)=\"RepositoryChanged($event)\" *ngIf=\"!CreatingRepository\" required>\n <ng-container *ngFor=\"let repoOpt of RepositoryOptions\">\n <mat-option [value]=\"repoOpt.Name\">\n {{ repoOpt.Name }}\n </mat-option>\n </ng-container>\n </mat-select>\n\n <input matInput placeholder=\"Repository (creates new if does not exist)\"\n [formControlName]=\"SourceControlRoot + 'repository'\" *ngIf=\"CreatingRepository\"\n [fxHide]=\"Loading || HostingDetails?.Loading\" required />\n\n <mat-icon matSuffix (click)=\"CreateRepository()\" [fxHide]=\"Loading || HostingDetails?.Loading\"\n *ngIf=\"!CreatingRepository && OrganizationFormControl?.valid\">\n add_circle\n </mat-icon>\n\n <button mat-button type=\"button\" (click)=\"SaveRepository()\"\n *ngIf=\"CreatingRepository && RepositoryFormControl?.valid\">\n\n <mat-icon matSuffix color=\"primary\">\n save\n </mat-icon>\n </button>\n\n <button mat-button type=\"button\" (click)=\"CancelCreateRepository()\" *ngIf=\"CreatingRepository\">\n\n <mat-icon matSuffix>\n cancel\n </mat-icon>\n </button>\n </mat-form-field>\n </div>\n\n <div class=\"card\" *ngIf=\"\n (BranchesFormControl?.valid ||\n (OrganizationFormControl?.valid &&\n RepositoryFormControl?.valid &&\n !Loading)) &&\n !CreatingRepository &&\n UseBranches\n \">\n <mat-form-field class=\"mat-full-width\">\n <mat-icon class=\"org-icon\" matPrefix>account_tree</mat-icon>\n\n <mat-label>Selected Branches</mat-label>\n\n <mat-autocomplete (optionSelected)=\"BranchOptionSelected($event)\" #branchOptions=\"matAutocomplete\">\n <ng-container *ngFor=\"let branchOpt of BranchOptions\">\n <mat-option [value]=\"branchOpt.Name\">\n {{ branchOpt.Name }}\n </mat-option>\n </ng-container>\n </mat-autocomplete>\n\n <mat-chip-list #selectedBranches>\n <mat-chip [removable]=\"true\" (removed)=\"RemoveBranchOption(selBranch)\"\n *ngFor=\"let selBranch of SelectedBranches\">\n {{ selBranch }}\n <mat-icon matChipRemove>cancel</mat-icon>\n </mat-chip>\n\n <input matInput placeholder=\"New Branch...\" [formControlName]=\"SourceControlRoot + 'branches'\" #branches\n [matAutocomplete]=\"branchOptions\" [matChipInputFor]=\"selectedBranches\"\n [matChipInputSeparatorKeyCodes]=\"SeparatorKeysCodes\" [matChipInputAddOnBlur]=\"true\"\n (matChipInputTokenEnd)=\"AddBranchOption($event)\" [disabled]=\"Loading || HostingDetails?.Loading\"\n required />\n </mat-chip-list>\n </mat-form-field>\n\n <mat-form-field class=\"mat-full-width with-hint\" [fxShow]=\"SelectedBranches?.length > 1\">\n <mat-icon class=\"org-icon\" matPrefix>account_tree</mat-icon>\n\n <mat-select [formControlName]=\"SourceControlRoot + 'mainBranch'\" placeholder=\"Main Branch\"\n [disabled]=\"Loading || HostingDetails?.Loading\" (selectionChange)=\"MainBranchChanged($event)\" required>\n <ng-container *ngFor=\"let branch of SelectedBranches\">\n <mat-option [value]=\"branch\">\n {{ branch }}\n </mat-option>\n </ng-container>\n </mat-select>\n\n <mat-icon matSuffix (click)=\"RefreshOrganizations()\"> refresh </mat-icon>\n\n <a matSuffix mat-icon-button href=\"/.oauth/github?oauth-force-edit=true\" target=\"_blank\" color=\"accent\">\n <mat-icon matTooltip=\"Re-authorize Organizations\" color=\"accent\"> launch </mat-icon>\n </a>\n\n <mat-hint>\n If you don't have an organization or would like to create a new one,\n <a href=\"https://github.com/account/organizations/new\" target=\"_blank\">\n start here\n </a>\n </mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"card\" *ngIf=\"\n (BuildPathFormControl?.valid ||\n (OrganizationFormControl?.valid &&\n RepositoryFormControl?.valid &&\n !Loading)) &&\n !CreatingRepository &&\n UseBuildPath\n \">\n <mat-form-field class=\"mat-full-width with-hint\">\n <mat-icon class=\"org-icon\" matPrefix>build</mat-icon>\n\n <mat-select [formControlName]=\"SourceControlRoot + 'buildPath'\" placeholder=\"Build Path\"\n [disabled]=\"Loading || BuildPathDisabled\" (selectionChange)=\"BuildPathChanged($event)\" required>\n <ng-container *ngFor=\"let buildPath of BuildPathOptions\">\n <mat-option [value]=\"buildPath\">\n {{ buildPath }}\n </mat-option>\n </ng-container>\n </mat-select>\n\n <mat-hint>\n The build path identifies which build action to use for your\n configuration.\n </mat-hint>\n </mat-form-field>\n </div>\n\n <div *ngIf=\"Loading\">\n <div class=\"spread\">\n <lcu-loader style=\"margin: auto\" [loading]=\"true\"></lcu-loader>\n\n <div class=\"margin-3\">\n <h4 class=\"mat-title\" *ngIf=\"!OrganizationFormControl?.valid\">\n Loading organizations\n </h4>\n\n <h4 class=\"mat-title\" *ngIf=\"\n OrganizationFormControl?.valid && !RepositoryFormControl?.valid\n \">\n Loading repositories\n </h4>\n\n <h4 class=\"mat-title\" *ngIf=\"RepositoryFormControl?.valid && !BranchesFormControl?.valid\">\n Loading branches\n </h4>\n\n <h4 class=\"mat-title\" *ngIf=\"\n (RepositoryFormControl?.valid || BranchesFormControl?.valid) &&\n !BuildPathFormControl?.valid\n \">\n Loading build paths\n </h4>\n </div>\n </div>\n </div>\n <!-- </div> -->\n\n </mat-card-content>\n <mat-card-actions fxLayoutAlign=\"center center\">\n\n <button \n mat-raised-button \n *ngIf=\"!State?.Loading\"\n type=\"submit\" \n fxFlex=\"100%\" \n color=\"primary\" \n [disabled]=\"!DevOpsSourceControlFormGroup.valid || !DevOpsSourceControlFormGroup.dirty\">\n <mat-icon>save</mat-icon>\n Save Source Control\n </button>\n <lcu-loader [loading]=\"State?.Loading\"></lcu-loader>\n \n </mat-card-actions>\n </mat-card>\n</form>", styles: [".form-card,.sc-card{width:100%}.margin-bottom{margin-bottom:15px}\n"] }]
5113
- }], ctorParameters: function () { return [{ type: ApplicationsFlowService }, { type: EaCService }, { type: i1$1.FormBuilder }]; }, propDecorators: { EditingSourceControlLookup: [{
5160
+ args: [{ selector: 'lcu-build-pipeline-form', template: "<form class=\"form-card\" [formGroup]=\"BuildPipelineFormGroup\" (ngSubmit)=\"SubmitBuildPipeline()\">\n <mat-card\n class=\"spread\" \n >\n <mat-card-header>\n <mat-card-title> Build Pipeline </mat-card-title>\n\n <mat-hint>\n Changes made here are reflected for all sources using this\n DevOpsAction\n </mat-hint>\n </mat-card-header>\n\n <mat-card-content>\n\n\n <div *ngIf=\"!HostingDetails?.Loading\">\n <mat-form-field class=\"mat-full-width\">\n <mat-select\n formControlName=\"buildPipeline\"\n placeholder=\"Build Pipeline\"\n [disabled]=\"Disabled\"\n (selectionChange)=\"BuildPipelineChanged()\"\n required\n >\n <ng-container\n *ngFor=\"let hostOption of HostingDetails?.HostingOptions; let i = index\"\n >\n <mat-option [value]=\"hostOption.Lookup\">\n {{ hostOption.Name }}\n </mat-option>\n </ng-container>\n </mat-select>\n \n <mat-hint>\n <ng-container *ngFor=\"let hostOption of HostingDetails?.HostingOptions\">\n <span *ngIf=\"BuildPipeline == hostOption?.Lookup\">\n {{ hostOption.Description }}\n </span>\n </ng-container>\n </mat-hint>\n </mat-form-field>\n \n <mat-form-field class=\"mat-full-width\">\n <input\n matInput\n formControlName=\"devOpsActionName\"\n placeholder=\"Name of DevOps Action\"\n required=\"true\"\n />\n </mat-form-field>\n \n <ng-container *ngFor=\"let input of SelectedHostingOption?.Inputs\">\n <mat-form-field class=\"mat-full-width\">\n <input\n matInput\n [formControlName]=\"input.Lookup\"\n [placeholder]=\"input.Placeholder\"\n [required]=\"input.Required\"\n />\n \n <mat-hint>{{ input.Hint }}</mat-hint>\n </mat-form-field>\n </ng-container>\n \n <div *ngIf=\"BuildPipeline == 'npm-release'\">\n <mat-form-field class=\"mat-full-width with-hint padding-bottom-4\">\n <mat-icon matPrefix>security</mat-icon>\n \n <input\n id=\"npm-token\"\n matInput\n type=\"text\"\n formControlName=\"npmToken\"\n placeholder=\"NPM token\"\n [required]=\"!Disabled\"\n style=\"-webkit-text-security: disc;\"\n />\n <mat-hint>\n Securely publish to NPM, provide an NPM Personal Access Token (PAT) with publish access to the organization used for your NPM packages. \n Learn how to create and view access tokens \n <a\n href=\"https://docs.npmjs.com/creating-and-viewing-access-tokens\"\n target=\"_blank\"\n >\n here.\n </a>\n </mat-hint>\n </mat-form-field>\n </div>\n </div>\n \n <div *ngIf=\"HostingDetails?.Loading\">\n <div class=\"spread\">\n <lcu-loader style=\"margin: auto\" [loading]=\"true\"></lcu-loader>\n \n <div class=\"margin-3\">\n <h4 class=\"mat-title\">Loading hosting details</h4>\n </div>\n </div>\n </div>\n </mat-card-content>\n <mat-card-actions fxLayoutAlign=\"center center\">\n\n <button \n *ngIf=\"!State?.Loading\"\n mat-raised-button \n type=\"submit\" \n fxFlex=\"100%\" \n color=\"primary\" \n [disabled]=\"!BuildPipelineFormGroup.valid || !BuildPipelineFormGroup.dirty\">\n <mat-icon>save</mat-icon>\n Save Build Pipeline\n </button>\n <lcu-loader [loading]=\"State?.Loading\"></lcu-loader> \n \n </mat-card-actions>\n </mat-card>\n</form>\n", styles: [""] }]
5161
+ }], ctorParameters: function () { return [{ type: EaCService }, { type: i1$1.FormBuilder }, { type: ApplicationsFlowService }]; }, propDecorators: { DevOpsActionLookup: [{
5114
5162
  type: Input,
5115
- args: ['editing-source-control-lookup']
5163
+ args: ['devops-action-lookup']
5164
+ }], Disabled: [{
5165
+ type: Input,
5166
+ args: ['disabled']
5116
5167
  }], Environment: [{
5117
5168
  type: Input,
5118
5169
  args: ['environment']
5119
5170
  }], EnvironmentLookup: [{
5120
5171
  type: Input,
5121
5172
  args: ['environment-lookup']
5122
- }], SaveStatusEvent: [{
5173
+ }], HostingDetails: [{
5174
+ type: Input,
5175
+ args: ['hosting-details']
5176
+ }], ResponseEvent: [{
5123
5177
  type: Output,
5124
- args: ['save-status-event']
5125
- }], BranchesInput: [{
5126
- type: ViewChild,
5127
- args: ['branches']
5178
+ args: ['response-event']
5128
5179
  }] } });
5129
5180
 
5130
- class SourceControlDialogComponent {
5131
- constructor(dialogRef, data) {
5132
- this.dialogRef = dialogRef;
5133
- this.data = data;
5134
- }
5135
- ngOnInit() {
5136
- }
5137
- CloseDialog() {
5138
- this.dialogRef.close();
5139
- }
5140
- }
5141
- SourceControlDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: SourceControlDialogComponent, deps: [{ token: i1$4.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
5142
- SourceControlDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: SourceControlDialogComponent, selector: "lcu-source-control-dialog", ngImport: i0, template: "\n<div class=\"dialog-header\" fxLayoutAlign=\"end center\">\n <button mat-icon-button (click)=\"CloseDialog()\">\n <mat-icon>cancel</mat-icon>\n </button>\n</div>\n\n<div fxLayoutAlign=\"center center\">\n <lcu-devops-source-control-form\n [environment]=\"data.environment\"\n [environment-lookup]=\"data.environmentLookup\"\n [editing-source-control-lookup]=\"data.scLookup\">\n </lcu-devops-source-control-form>\n</div>", styles: [".dialog-header{width:100%}\n"], components: [{ type: i2$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: DevopsSourceControlFormComponent, selector: "lcu-devops-source-control-form", inputs: ["editing-source-control-lookup", "environment", "environment-lookup"], outputs: ["save-status-event"] }], directives: [{ type: i5$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }] });
5143
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: SourceControlDialogComponent, decorators: [{
5144
- type: Component,
5145
- args: [{ selector: 'lcu-source-control-dialog', template: "\n<div class=\"dialog-header\" fxLayoutAlign=\"end center\">\n <button mat-icon-button (click)=\"CloseDialog()\">\n <mat-icon>cancel</mat-icon>\n </button>\n</div>\n\n<div fxLayoutAlign=\"center center\">\n <lcu-devops-source-control-form\n [environment]=\"data.environment\"\n [environment-lookup]=\"data.environmentLookup\"\n [editing-source-control-lookup]=\"data.scLookup\">\n </lcu-devops-source-control-form>\n</div>", styles: [".dialog-header{width:100%}\n"] }]
5146
- }], ctorParameters: function () { return [{ type: i1$4.MatDialogRef }, { type: undefined, decorators: [{
5147
- type: Inject,
5148
- args: [MAT_DIALOG_DATA]
5149
- }] }]; } });
5150
-
5151
5181
  class BuildPipelineDialogComponent {
5152
5182
  constructor(dialogRef, data) {
5153
5183
  this.dialogRef = dialogRef;