@lowcodeunit/applications-flow-common 1.33.97-lets-get-social-ish → 1.33.98-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.
@@ -5482,36 +5482,464 @@
5482
5482
  };
5483
5483
 
5484
5484
  var BuildPipelineFormComponent = /** @class */ (function () {
5485
- function BuildPipelineFormComponent() {
5485
+ function BuildPipelineFormComponent(formBldr, appsFlowSvc) {
5486
+ this.formBldr = formBldr;
5487
+ this.appsFlowSvc = appsFlowSvc;
5488
+ this.HostingDetails = new ProjectHostingDetails();
5486
5489
  }
5490
+ Object.defineProperty(BuildPipelineFormComponent.prototype, "Artifact", {
5491
+ //PROPERTIES
5492
+ get: function () {
5493
+ var _a, _b;
5494
+ return ((_a = this.Environment) === null || _a === void 0 ? void 0 : _a.Artifacts) && this.ArtifactLookup
5495
+ ? ((_b = this.Environment) === null || _b === void 0 ? void 0 : _b.Artifacts[this.ArtifactLookup]) || {}
5496
+ : {};
5497
+ },
5498
+ enumerable: false,
5499
+ configurable: true
5500
+ });
5501
+ Object.defineProperty(BuildPipelineFormComponent.prototype, "ArtifactLookup", {
5502
+ get: function () {
5503
+ var _a, _b;
5504
+ var artLookup = ((_a = this.DevOpsAction) === null || _a === void 0 ? void 0 : _a.ArtifactLookups) ? (_b = this.DevOpsAction) === null || _b === void 0 ? void 0 : _b.ArtifactLookups[0] : null;
5505
+ return artLookup;
5506
+ },
5507
+ enumerable: false,
5508
+ configurable: true
5509
+ });
5510
+ Object.defineProperty(BuildPipelineFormComponent.prototype, "DevOpsAction", {
5511
+ get: function () {
5512
+ return this.Environment.DevOpsActions && this.DevOpsActionLookup
5513
+ ? this.Environment.DevOpsActions[this.DevOpsActionLookup] || {}
5514
+ : {};
5515
+ },
5516
+ enumerable: false,
5517
+ configurable: true
5518
+ });
5519
+ Object.defineProperty(BuildPipelineFormComponent.prototype, "DevOpsActions", {
5520
+ get: function () {
5521
+ return this.Environment.DevOpsActions || {};
5522
+ },
5523
+ enumerable: false,
5524
+ configurable: true
5525
+ });
5526
+ Object.defineProperty(BuildPipelineFormComponent.prototype, "EditingSourceControl", {
5527
+ get: function () {
5528
+ var _a, _b;
5529
+ var sc = ((_a = this.Environment) === null || _a === void 0 ? void 0 : _a.Sources) ? (_b = this.Environment) === null || _b === void 0 ? void 0 : _b.Sources[this.EditingSourceControlLookup] : null;
5530
+ if (sc == null && this.EditingSourceControlLookup) {
5531
+ sc = {};
5532
+ }
5533
+ return sc;
5534
+ },
5535
+ enumerable: false,
5536
+ configurable: true
5537
+ });
5538
+ Object.defineProperty(BuildPipelineFormComponent.prototype, "SourceControlLookups", {
5539
+ get: function () {
5540
+ return Object.keys(this.SourceControls || {});
5541
+ },
5542
+ enumerable: false,
5543
+ configurable: true
5544
+ });
5545
+ Object.defineProperty(BuildPipelineFormComponent.prototype, "SourceControls", {
5546
+ get: function () {
5547
+ return this.Environment.Sources || {};
5548
+ },
5549
+ enumerable: false,
5550
+ configurable: true
5551
+ });
5487
5552
  BuildPipelineFormComponent.prototype.ngOnInit = function () {
5488
5553
  };
5554
+ //API METHODS
5555
+ //HELPERS
5556
+ BuildPipelineFormComponent.prototype.loadProjectHostingDetails = function () {
5557
+ var _this = this;
5558
+ this.HostingDetails.Loading = true;
5559
+ this.appsFlowSvc
5560
+ .LoadProjectHostingDetails(this.Organization, this.Repository, this.MainBranch)
5561
+ .subscribe(function (response) {
5562
+ _this.HostingDetails = response.Model;
5563
+ _this.HostingDetails.Loading = false;
5564
+ }, function (err) {
5565
+ _this.HostingDetails.Loading = false;
5566
+ });
5567
+ };
5489
5568
  return BuildPipelineFormComponent;
5490
5569
  }());
5491
5570
  BuildPipelineFormComponent.decorators = [
5492
5571
  { type: i0.Component, args: [{
5493
5572
  selector: 'lcu-build-pipeline-form',
5494
- template: "<p>build-pipeline-form works!</p>\n",
5573
+ template: "<div class=\"form-card\" fxFlex=\"35%\" fxFlex.lt-md=\"100%\">\n <mat-card\n class=\"spread\"\n *ngIf=\"EditingSourceControl?.Branches?.length > 0\"\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 <ng-container>\n <lcu-hosting-details-form-group\n [artifact]=\"Artifact\"\n [devops-action]=\"DevOpsActions[DevOpsActionLookup]\"\n [details]=\"HostingDetails\"\n [formGroup]=\"DevOpsFormGroup\"\n [organization]=\"Organization\"\n [disabled]=\"HostingDetails?.Loading\"\n ></lcu-hosting-details-form-group>\n </ng-container>\n </mat-card-content>\n </mat-card>\n </div>\n",
5495
5574
  styles: [""]
5496
5575
  },] }
5497
5576
  ];
5498
- BuildPipelineFormComponent.ctorParameters = function () { return []; };
5577
+ BuildPipelineFormComponent.ctorParameters = function () { return [
5578
+ { type: forms.FormBuilder },
5579
+ { type: ApplicationsFlowService }
5580
+ ]; };
5581
+ BuildPipelineFormComponent.propDecorators = {
5582
+ DevOpsActionLookup: [{ type: i0.Input, args: ['devops-action-lookup',] }],
5583
+ Environment: [{ type: i0.Input, args: ['environment',] }],
5584
+ MainBranch: [{ type: i0.Input, args: ['main-branch',] }],
5585
+ Organization: [{ type: i0.Input, args: ['organization',] }],
5586
+ Repository: [{ type: i0.Input, args: ['repository',] }]
5587
+ };
5499
5588
 
5500
5589
  var DevopsSourceControlFormComponent = /** @class */ (function () {
5501
- function DevopsSourceControlFormComponent() {
5590
+ // Constructors
5591
+ function DevopsSourceControlFormComponent(formBuilder, appsFlowSvc) {
5592
+ this.formBuilder = formBuilder;
5593
+ this.appsFlowSvc = appsFlowSvc;
5594
+ this.SeparatorKeysCodes = [keycodes.ENTER, keycodes.COMMA];
5595
+ this.BuildPath = null;
5596
+ this.HostingDetails = new ProjectHostingDetails();
5597
+ this.SelectedBranches = [];
5598
+ this.SourceControlRoot = '';
5599
+ this.UseBranches = true;
5600
+ this.UseBuildPath = false;
5502
5601
  }
5602
+ Object.defineProperty(DevopsSourceControlFormComponent.prototype, "BranchesFormControl", {
5603
+ // Fields
5604
+ // Properties
5605
+ get: function () {
5606
+ return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'branches');
5607
+ },
5608
+ enumerable: false,
5609
+ configurable: true
5610
+ });
5611
+ Object.defineProperty(DevopsSourceControlFormComponent.prototype, "BuildPathFormControl", {
5612
+ get: function () {
5613
+ return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'buildPath');
5614
+ },
5615
+ enumerable: false,
5616
+ configurable: true
5617
+ });
5618
+ Object.defineProperty(DevopsSourceControlFormComponent.prototype, "DevOpsActionLookups", {
5619
+ get: function () {
5620
+ return Object.keys(this.DevOpsActions || {});
5621
+ },
5622
+ enumerable: false,
5623
+ configurable: true
5624
+ });
5625
+ Object.defineProperty(DevopsSourceControlFormComponent.prototype, "DevOpsActionLookup", {
5626
+ get: function () {
5627
+ var _a, _b, _c;
5628
+ if (!!((_a = this.DevOpsActionLookupFormControl) === null || _a === void 0 ? void 0 : _a.value)) {
5629
+ return this.DevOpsActionLookupFormControl.value;
5630
+ }
5631
+ if (!!((_b = this.EditingSourceControl) === null || _b === void 0 ? void 0 : _b.DevOpsActionTriggerLookups)) {
5632
+ return (_c = this.EditingSourceControl) === null || _c === void 0 ? void 0 : _c.DevOpsActionTriggerLookups[0];
5633
+ }
5634
+ else {
5635
+ return null;
5636
+ }
5637
+ },
5638
+ enumerable: false,
5639
+ configurable: true
5640
+ });
5641
+ Object.defineProperty(DevopsSourceControlFormComponent.prototype, "DevOpsActionLookupFormControl", {
5642
+ get: function () {
5643
+ return this.DevOpsSourceControlFormGroup.get('devOpsActionLookup');
5644
+ },
5645
+ enumerable: false,
5646
+ configurable: true
5647
+ });
5648
+ Object.defineProperty(DevopsSourceControlFormComponent.prototype, "DevOpsActions", {
5649
+ get: function () {
5650
+ return this.Environment.DevOpsActions || {};
5651
+ },
5652
+ enumerable: false,
5653
+ configurable: true
5654
+ });
5655
+ Object.defineProperty(DevopsSourceControlFormComponent.prototype, "EditingSourceControl", {
5656
+ get: function () {
5657
+ var _a, _b;
5658
+ var sc = ((_a = this.Environment) === null || _a === void 0 ? void 0 : _a.Sources) ? (_b = this.Environment) === null || _b === void 0 ? void 0 : _b.Sources[this.EditingSourceControlLookup] : null;
5659
+ if (sc == null && this.EditingSourceControlLookup) {
5660
+ sc = {};
5661
+ }
5662
+ return sc;
5663
+ },
5664
+ enumerable: false,
5665
+ configurable: true
5666
+ });
5667
+ Object.defineProperty(DevopsSourceControlFormComponent.prototype, "MainBranchFormControl", {
5668
+ get: function () {
5669
+ return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'mainBranch');
5670
+ },
5671
+ enumerable: false,
5672
+ configurable: true
5673
+ });
5674
+ Object.defineProperty(DevopsSourceControlFormComponent.prototype, "OrganizationFormControl", {
5675
+ get: function () {
5676
+ return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'organization');
5677
+ },
5678
+ enumerable: false,
5679
+ configurable: true
5680
+ });
5681
+ Object.defineProperty(DevopsSourceControlFormComponent.prototype, "RepositoryFormControl", {
5682
+ get: function () {
5683
+ return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'repository');
5684
+ },
5685
+ enumerable: false,
5686
+ configurable: true
5687
+ });
5688
+ // Life Cycle
5689
+ DevopsSourceControlFormComponent.prototype.ngAfterViewInit = function () { };
5690
+ DevopsSourceControlFormComponent.prototype.ngOnDestroy = function () {
5691
+ this.destroyFormControls();
5692
+ };
5503
5693
  DevopsSourceControlFormComponent.prototype.ngOnInit = function () {
5694
+ this.setupFormControls();
5695
+ this.RefreshOrganizations();
5696
+ };
5697
+ // API Methods
5698
+ DevopsSourceControlFormComponent.prototype.AddBranchOption = function (event) {
5699
+ this.addBranchOption(event.value);
5700
+ event.input.value = '';
5701
+ };
5702
+ DevopsSourceControlFormComponent.prototype.BranchOptionSelected = function (event) {
5703
+ this.addBranchOption(event.option.value);
5704
+ };
5705
+ DevopsSourceControlFormComponent.prototype.BranchesChanged = function (branches) {
5706
+ this.loadProjectHostingDetails();
5707
+ };
5708
+ DevopsSourceControlFormComponent.prototype.BuildPathChanged = function (event) {
5709
+ };
5710
+ DevopsSourceControlFormComponent.prototype.CreateRepository = function () {
5711
+ this.CreatingRepository = true;
5712
+ this.RepositoryFormControl.reset();
5713
+ };
5714
+ DevopsSourceControlFormComponent.prototype.CancelCreateRepository = function () {
5715
+ this.CreatingRepository = false;
5716
+ };
5717
+ DevopsSourceControlFormComponent.prototype.DevOpsActionLookupChanged = function (event) {
5718
+ this.configureDevOpsAction();
5719
+ };
5720
+ DevopsSourceControlFormComponent.prototype.MainBranchChanged = function (event) {
5721
+ this.emitBranchesChanged();
5722
+ };
5723
+ DevopsSourceControlFormComponent.prototype.OrganizationChanged = function (event) {
5724
+ var org = this.OrganizationFormControl;
5725
+ this.RepositoryFormControl.reset();
5726
+ if (this.UseBranches) {
5727
+ this.BranchesFormControl.reset();
5728
+ this.SelectedBranches = [];
5729
+ }
5730
+ this.listRepositories();
5731
+ };
5732
+ DevopsSourceControlFormComponent.prototype.RefreshOrganizations = function () {
5733
+ var _a, _b, _c;
5734
+ // this.Loading = true;
5735
+ this.listOrganizations();
5736
+ (_a = this.OrganizationFormControl) === null || _a === void 0 ? void 0 : _a.reset();
5737
+ (_b = this.RepositoryFormControl) === null || _b === void 0 ? void 0 : _b.reset();
5738
+ if (this.UseBranches) {
5739
+ (_c = this.BranchesFormControl) === null || _c === void 0 ? void 0 : _c.reset();
5740
+ }
5741
+ };
5742
+ DevopsSourceControlFormComponent.prototype.RemoveBranchOption = function (option) {
5743
+ var index = this.SelectedBranches.indexOf(option);
5744
+ if (index >= 0) {
5745
+ this.SelectedBranches.splice(index, 1);
5746
+ }
5747
+ this.emitBranchesChanged();
5748
+ };
5749
+ DevopsSourceControlFormComponent.prototype.RepositoryChanged = function (event) {
5750
+ var repo = this.RepositoryFormControl;
5751
+ if (this.UseBranches) {
5752
+ this.BranchesFormControl.reset();
5753
+ this.SelectedBranches = [];
5754
+ this.listBranches();
5755
+ }
5756
+ if (!this.UseBranches) {
5757
+ this.listBuildPaths();
5758
+ }
5759
+ };
5760
+ DevopsSourceControlFormComponent.prototype.SaveRepository = function () {
5761
+ var _this = this;
5762
+ this.Loading = true;
5763
+ var org = this.OrganizationFormControl.value;
5764
+ var repoName = this.RepositoryFormControl.value;
5765
+ this.appsFlowSvc
5766
+ .CreateRepository(org, repoName)
5767
+ .subscribe(function (response) {
5768
+ if (response.Status.Code === 0) {
5769
+ _this.listRepositories(repoName);
5770
+ _this.CreatingRepository = false;
5771
+ }
5772
+ else {
5773
+ // TODO: Need to surface an error to the user...
5774
+ _this.Loading = false;
5775
+ }
5776
+ });
5777
+ };
5778
+ // Helpers
5779
+ DevopsSourceControlFormComponent.prototype.addBranchOption = function (value) {
5780
+ value = (value || '').trim();
5781
+ if (value && this.SelectedBranches.indexOf(value) < 0) {
5782
+ this.SelectedBranches.push(value);
5783
+ }
5784
+ this.BranchesInput.nativeElement.blur();
5785
+ this.emitBranchesChanged();
5786
+ };
5787
+ DevopsSourceControlFormComponent.prototype.configureDevOpsAction = function () {
5788
+ var _this = this;
5789
+ setTimeout(function () {
5790
+ _this.DevOpsActionLookupFormControl.setValue(_this.DevOpsActionLookup);
5791
+ }, 0);
5792
+ };
5793
+ DevopsSourceControlFormComponent.prototype.destroyFormControls = function () {
5794
+ var _a, _b, _c, _d;
5795
+ this.DevOpsSourceControlFormGroup.removeControl([this.SourceControlRoot, 'mainBranch'].join(''));
5796
+ (_a = this.DevOpsSourceControlFormGroup) === null || _a === void 0 ? void 0 : _a.removeControl([this.SourceControlRoot, 'branches'].join(''));
5797
+ (_b = this.DevOpsSourceControlFormGroup) === null || _b === void 0 ? void 0 : _b.removeControl([this.SourceControlRoot, 'buildPath'].join(''));
5798
+ this.SelectedBranches = [];
5799
+ (_c = this.DevOpsSourceControlFormGroup) === null || _c === void 0 ? void 0 : _c.removeControl([this.SourceControlRoot, 'organization'].join(''));
5800
+ (_d = this.DevOpsSourceControlFormGroup) === null || _d === void 0 ? void 0 : _d.removeControl([this.SourceControlRoot, 'repository'].join(''));
5801
+ };
5802
+ DevopsSourceControlFormComponent.prototype.emitBranchesChanged = function () {
5803
+ var _a, _b;
5804
+ if (((_a = this.SelectedBranches) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
5805
+ (!this.MainBranchFormControl.value ||
5806
+ this.SelectedBranches.indexOf(this.MainBranchFormControl.value) < 0)) {
5807
+ this.MainBranchFormControl.setValue(this.SelectedBranches.find(function (branch) { return branch === 'main' || branch === 'master'; }) || this.SelectedBranches[0]);
5808
+ }
5809
+ else if (((_b = this.SelectedBranches) === null || _b === void 0 ? void 0 : _b.length) <= 0) {
5810
+ this.MainBranchFormControl.reset();
5811
+ }
5812
+ this.BranchesFormControl.setValue(this.SelectedBranches.join(','));
5813
+ this.BranchesChanged(this.SelectedBranches || []);
5814
+ };
5815
+ DevopsSourceControlFormComponent.prototype.listBranches = function () {
5816
+ var _this = this;
5817
+ if (this.UseBranches) {
5818
+ this.Loading = true;
5819
+ this.appsFlowSvc
5820
+ .ListBranches(this.OrganizationFormControl.value, this.RepositoryFormControl.value)
5821
+ .subscribe(function (response) {
5822
+ var _a, _b, _c;
5823
+ _this.BranchOptions = response.Model;
5824
+ _this.Loading = false;
5825
+ if (((_b = (_a = _this.EditingSourceControl) === null || _a === void 0 ? void 0 : _a.Branches) === null || _b === void 0 ? void 0 : _b.length) > 0) {
5826
+ _this.SelectedBranches = _this.EditingSourceControl.Branches;
5827
+ }
5828
+ else if (((_c = _this.BranchOptions) === null || _c === void 0 ? void 0 : _c.length) === 1) {
5829
+ _this.BranchesFormControl.setValue(_this.BranchOptions[0].Name);
5830
+ _this.SelectedBranches = [_this.BranchOptions[0].Name];
5831
+ }
5832
+ _this.emitBranchesChanged();
5833
+ _this.listBuildPaths();
5834
+ });
5835
+ }
5836
+ };
5837
+ DevopsSourceControlFormComponent.prototype.listBuildPaths = function () {
5838
+ var _this = this;
5839
+ if (this.UseBuildPath) {
5840
+ this.Loading = true;
5841
+ this.appsFlowSvc
5842
+ .ListBuildPaths(this.OrganizationFormControl.value, this.RepositoryFormControl.value)
5843
+ .subscribe(function (response) {
5844
+ var _a;
5845
+ _this.BuildPathOptions = response.Model;
5846
+ _this.Loading = false;
5847
+ if (((_a = _this.BuildPathOptions) === null || _a === void 0 ? void 0 : _a.length) === 1) {
5848
+ _this.BuildPathFormControl.setValue(_this.BuildPathOptions[0]);
5849
+ }
5850
+ });
5851
+ }
5852
+ };
5853
+ DevopsSourceControlFormComponent.prototype.listOrganizations = function () {
5854
+ var _this = this;
5855
+ this.Loading = true;
5856
+ this.appsFlowSvc
5857
+ .ListOrganizations()
5858
+ .subscribe(function (response) {
5859
+ var _a;
5860
+ _this.OrganizationOptions = response.Model;
5861
+ _this.Loading = false;
5862
+ if ((_a = _this.EditingSourceControl) === null || _a === void 0 ? void 0 : _a.Organization) {
5863
+ setTimeout(function () {
5864
+ var _a;
5865
+ _this.OrganizationFormControl.setValue(_this.EditingSourceControl.Organization);
5866
+ _this.listRepositories((_a = _this.EditingSourceControl) === null || _a === void 0 ? void 0 : _a.Repository);
5867
+ }, 0);
5868
+ }
5869
+ });
5870
+ };
5871
+ DevopsSourceControlFormComponent.prototype.listRepositories = function (activeRepo) {
5872
+ var _this = this;
5873
+ if (activeRepo === void 0) { activeRepo = null; }
5874
+ this.Loading = true;
5875
+ this.appsFlowSvc
5876
+ .ListRepositories(this.OrganizationFormControl.value)
5877
+ .subscribe(function (response) {
5878
+ var _a;
5879
+ _this.RepositoryOptions = response.Model;
5880
+ _this.Loading = false;
5881
+ if (activeRepo) {
5882
+ setTimeout(function () {
5883
+ _this.RepositoryFormControl.setValue(activeRepo);
5884
+ _this.listBranches();
5885
+ if (!_this.UseBranches) {
5886
+ _this.listBuildPaths();
5887
+ }
5888
+ }, 0);
5889
+ }
5890
+ else if (((_a = _this.RepositoryOptions) === null || _a === void 0 ? void 0 : _a.length) <= 0) {
5891
+ _this.CreatingRepository = true;
5892
+ }
5893
+ });
5894
+ };
5895
+ DevopsSourceControlFormComponent.prototype.loadProjectHostingDetails = function () {
5896
+ var _this = this;
5897
+ var _a, _b, _c, _d;
5898
+ if (((_a = this.SelectedBranches) === null || _a === void 0 ? void 0 : _a.length) > 0) {
5899
+ this.HostingDetails.Loading = true;
5900
+ this.appsFlowSvc
5901
+ .LoadProjectHostingDetails((_b = this.OrganizationFormControl) === null || _b === void 0 ? void 0 : _b.value, (_c = this.RepositoryFormControl) === null || _c === void 0 ? void 0 : _c.value, (_d = this.MainBranchFormControl) === null || _d === void 0 ? void 0 : _d.value)
5902
+ .subscribe(function (response) {
5903
+ _this.HostingDetails = response.Model;
5904
+ _this.HostingDetails.Loading = false;
5905
+ _this.configureDevOpsAction();
5906
+ }, function (err) {
5907
+ _this.HostingDetails.Loading = false;
5908
+ });
5909
+ }
5910
+ };
5911
+ DevopsSourceControlFormComponent.prototype.setupFormControls = function () {
5912
+ var _a, _b, _c, _d, _e, _f, _g;
5913
+ this.destroyFormControls();
5914
+ this.DevOpsSourceControlFormGroup.addControl('devOpsActionLookup', new forms.FormControl(this.DevOpsActionLookup || '', []));
5915
+ this.DevOpsSourceControlFormGroup.addControl([this.SourceControlRoot, 'organization'].join(''), new forms.FormControl((_a = this.EditingSourceControl.Organization) !== null && _a !== void 0 ? _a : '', forms.Validators.required));
5916
+ this.DevOpsSourceControlFormGroup.addControl([this.SourceControlRoot, 'repository'].join(''), new forms.FormControl((_b = this.EditingSourceControl.Repository) !== null && _b !== void 0 ? _b : '', forms.Validators.required));
5917
+ if (this.UseBranches) {
5918
+ this.DevOpsSourceControlFormGroup.addControl([this.SourceControlRoot, 'branches'].join(''), new forms.FormControl((_d = (_c = this.EditingSourceControl) === null || _c === void 0 ? void 0 : _c.Branches) !== null && _d !== void 0 ? _d : '', forms.Validators.required));
5919
+ this.SelectedBranches = (_e = this.EditingSourceControl) === null || _e === void 0 ? void 0 : _e.Branches;
5920
+ this.DevOpsSourceControlFormGroup.addControl([this.SourceControlRoot, 'mainBranch'].join(''), new forms.FormControl((_f = this.EditingSourceControl.MainBranch) !== null && _f !== void 0 ? _f : '', forms.Validators.required));
5921
+ }
5922
+ if (this.UseBuildPath) {
5923
+ this.DevOpsSourceControlFormGroup.addControl([this.SourceControlRoot, 'buildPath'].join(''), new forms.FormControl((_g = this.BuildPath) !== null && _g !== void 0 ? _g : '', forms.Validators.required));
5924
+ }
5504
5925
  };
5505
5926
  return DevopsSourceControlFormComponent;
5506
5927
  }());
5507
5928
  DevopsSourceControlFormComponent.decorators = [
5508
5929
  { type: i0.Component, args: [{
5509
5930
  selector: 'lcu-devops-source-control-form',
5510
- template: "<p>devops-source-control-form works!</p>\n",
5931
+ template: "<div class=\"form-card\" fxFlex=\"35%\" fxFlex.lt-md=\"100%\">\n <mat-card class=\"spread\">\n <mat-card-header>\n <mat-card-title> Source Control </mat-card-title>\n\n <div fxFlex></div>\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 <div [formGroup]=\"DevOpsSourceControlFormGroup\">\n <div class=\"card\">\n <mat-form-field class=\"mat-full-width\">\n <mat-select\n formControlName=\"devOpsActionLookup\"\n placeholder=\"DevOps Action\"\n [disabled]=\"HostingDetails?.Loading\"\n (selectionChange)=\"DevOpsActionLookupChanged($event)\"\n >\n <ng-container\n *ngFor=\"let devOpsActionLookup of DevOpsActionLookups\"\n >\n <mat-option\n [value]=\"devOpsActionLookup\"\n *ngIf=\"DevOpsActions[devOpsActionLookup]; let devOpsAction\"\n >\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\n class=\"mat-full-width with-hint\"\n *ngIf=\"OrganizationOptions?.length > 0\"\n >\n <mat-icon class=\"org-icon\" matPrefix>corporate_fare</mat-icon>\n \n <mat-select\n [formControlName]=\"SourceControlRoot + 'organization'\"\n placeholder=\"Organization\"\n (selectionChange)=\"OrganizationChanged($event)\"\n [disabled]=\"Loading || HostingDetails?.Loading\"\n required\n >\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\n matSuffix\n href=\"/.oauth/github?oauth-force-edit=true\"\n target=\"_blank\"\n color=\"accent\"\n >\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\n href=\"https://github.com/account/organizations/new\"\n target=\"_blank\"\n >\n start here\n </a>\n </mat-hint>\n </mat-form-field>\n </div>\n \n <div\n class=\"card\"\n *ngIf=\"\n RepositoryFormControl?.valid ||\n (OrganizationFormControl?.valid && !Loading)\n \"\n >\n <mat-form-field class=\"mat-full-width\">\n <mat-icon class=\"org-icon\" matPrefix>description</mat-icon>\n \n <mat-select\n [formControlName]=\"SourceControlRoot + 'repository'\"\n [placeholder]=\"\n OrganizationFormControl?.valid\n ? 'Repository'\n : 'Repository (select organization first)'\n \"\n [disabled]=\"\n !OrganizationFormControl?.valid || Loading || HostingDetails?.Loading\n \"\n (selectionChange)=\"RepositoryChanged($event)\"\n *ngIf=\"!CreatingRepository\"\n required\n >\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\n matInput\n placeholder=\"Repository (creates new if does not exist)\"\n [formControlName]=\"SourceControlRoot + 'repository'\"\n *ngIf=\"CreatingRepository\"\n [fxHide]=\"Loading || HostingDetails?.Loading\"\n required\n />\n \n <mat-icon\n matSuffix\n (click)=\"CreateRepository()\"\n [fxHide]=\"Loading || HostingDetails?.Loading\"\n *ngIf=\"!CreatingRepository && OrganizationFormControl?.valid\"\n >\n add_circle\n </mat-icon>\n \n <button mat-button type=\"button\" \n (click)=\"SaveRepository()\" \n *ngIf=\"CreatingRepository && RepositoryFormControl?.valid\">\n \n <mat-icon\n matSuffix\n color=\"primary\"\n >\n save\n </mat-icon>\n </button>\n \n <button mat-button type=\"button\" \n (click)=\"CancelCreateRepository()\"\n *ngIf=\"CreatingRepository\">\n \n <mat-icon\n matSuffix\n \n >\n cancel\n </mat-icon>\n </button>\n </mat-form-field>\n </div>\n \n <div\n class=\"card\"\n *ngIf=\"\n (BranchesFormControl?.valid ||\n (OrganizationFormControl?.valid &&\n RepositoryFormControl?.valid &&\n !Loading)) &&\n !CreatingRepository &&\n UseBranches\n \"\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\n (optionSelected)=\"BranchOptionSelected($event)\"\n #branchOptions=\"matAutocomplete\"\n >\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\n [removable]=\"true\"\n (removed)=\"RemoveBranchOption(selBranch)\"\n *ngFor=\"let selBranch of SelectedBranches\"\n >\n {{ selBranch }}\n <mat-icon matChipRemove>cancel</mat-icon>\n </mat-chip>\n \n <input\n matInput\n placeholder=\"New Branch...\"\n [formControlName]=\"SourceControlRoot + 'branches'\"\n #branches\n [matAutocomplete]=\"branchOptions\"\n [matChipInputFor]=\"selectedBranches\"\n [matChipInputSeparatorKeyCodes]=\"SeparatorKeysCodes\"\n [matChipInputAddOnBlur]=\"true\"\n (matChipInputTokenEnd)=\"AddBranchOption($event)\"\n [disabled]=\"Loading || HostingDetails?.Loading\"\n required\n />\n </mat-chip-list>\n </mat-form-field>\n \n <mat-form-field\n class=\"mat-full-width with-hint\"\n [fxShow]=\"SelectedBranches?.length > 1\"\n >\n <mat-icon class=\"org-icon\" matPrefix>account_tree</mat-icon>\n \n <mat-select\n [formControlName]=\"SourceControlRoot + 'mainBranch'\"\n placeholder=\"Main Branch\"\n [disabled]=\"Loading || HostingDetails?.Loading\"\n (selectionChange)=\"MainBranchChanged($event)\"\n required\n >\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\n matSuffix\n mat-icon-button\n href=\"/.oauth/github?oauth-force-edit=true\"\n \n target=\"_blank\"\n color=\"accent\"\n >\n <mat-icon\n matTooltip=\"Re-authorize Organizations\"\n 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\n href=\"https://github.com/account/organizations/new\"\n target=\"_blank\"\n >\n start here\n </a>\n </mat-hint>\n </mat-form-field>\n </div>\n \n <div\n class=\"card\"\n *ngIf=\"\n (BuildPathFormControl?.valid ||\n (OrganizationFormControl?.valid &&\n RepositoryFormControl?.valid &&\n !Loading)) &&\n !CreatingRepository &&\n UseBuildPath\n \"\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\n [formControlName]=\"SourceControlRoot + 'buildPath'\"\n placeholder=\"Build Path\"\n [disabled]=\"Loading || BuildPathDisabled\"\n (selectionChange)=\"BuildPathChanged($event)\"\n required\n >\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\n class=\"mat-title\"\n *ngIf=\"\n OrganizationFormControl?.valid && !RepositoryFormControl?.valid\n \"\n >\n Loading repositories\n </h4>\n \n <h4\n class=\"mat-title\"\n *ngIf=\"RepositoryFormControl?.valid && !BranchesFormControl?.valid\"\n >\n Loading branches\n </h4>\n \n <h4\n class=\"mat-title\"\n *ngIf=\"\n (RepositoryFormControl?.valid || BranchesFormControl?.valid) &&\n !BuildPathFormControl?.valid\n \"\n >\n Loading build paths\n </h4>\n </div>\n </div>\n </div>\n </div>\n \n </mat-card-content>\n </mat-card>\n </div>\n",
5511
5932
  styles: [""]
5512
5933
  },] }
5513
5934
  ];
5514
- DevopsSourceControlFormComponent.ctorParameters = function () { return []; };
5935
+ DevopsSourceControlFormComponent.ctorParameters = function () { return [
5936
+ { type: forms.FormBuilder },
5937
+ { type: ApplicationsFlowService }
5938
+ ]; };
5939
+ DevopsSourceControlFormComponent.propDecorators = {
5940
+ BranchesInput: [{ type: i0.ViewChild, args: ['branches',] }],
5941
+ Environment: [{ type: i0.Input, args: ['environment',] }]
5942
+ };
5515
5943
 
5516
5944
  var ApplicationsFlowModule = /** @class */ (function () {
5517
5945
  function ApplicationsFlowModule() {