@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.
@@ -4211,32 +4211,385 @@ SourceControlFormComponent.propDecorators = {
4211
4211
  };
4212
4212
 
4213
4213
  class BuildPipelineFormComponent {
4214
- constructor() { }
4214
+ constructor(formBldr, appsFlowSvc) {
4215
+ this.formBldr = formBldr;
4216
+ this.appsFlowSvc = appsFlowSvc;
4217
+ this.HostingDetails = new ProjectHostingDetails();
4218
+ }
4219
+ //PROPERTIES
4220
+ get Artifact() {
4221
+ var _a, _b;
4222
+ return ((_a = this.Environment) === null || _a === void 0 ? void 0 : _a.Artifacts) && this.ArtifactLookup
4223
+ ? ((_b = this.Environment) === null || _b === void 0 ? void 0 : _b.Artifacts[this.ArtifactLookup]) || {}
4224
+ : {};
4225
+ }
4226
+ get ArtifactLookup() {
4227
+ var _a, _b;
4228
+ const 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;
4229
+ return artLookup;
4230
+ }
4231
+ get DevOpsAction() {
4232
+ return this.Environment.DevOpsActions && this.DevOpsActionLookup
4233
+ ? this.Environment.DevOpsActions[this.DevOpsActionLookup] || {}
4234
+ : {};
4235
+ }
4236
+ get DevOpsActions() {
4237
+ return this.Environment.DevOpsActions || {};
4238
+ }
4239
+ get EditingSourceControl() {
4240
+ var _a, _b;
4241
+ let 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;
4242
+ if (sc == null && this.EditingSourceControlLookup) {
4243
+ sc = {};
4244
+ }
4245
+ return sc;
4246
+ }
4247
+ get SourceControlLookups() {
4248
+ return Object.keys(this.SourceControls || {});
4249
+ }
4250
+ get SourceControls() {
4251
+ return this.Environment.Sources || {};
4252
+ }
4215
4253
  ngOnInit() {
4216
4254
  }
4255
+ //API METHODS
4256
+ //HELPERS
4257
+ loadProjectHostingDetails() {
4258
+ this.HostingDetails.Loading = true;
4259
+ this.appsFlowSvc
4260
+ .LoadProjectHostingDetails(this.Organization, this.Repository, this.MainBranch)
4261
+ .subscribe((response) => {
4262
+ this.HostingDetails = response.Model;
4263
+ this.HostingDetails.Loading = false;
4264
+ }, (err) => {
4265
+ this.HostingDetails.Loading = false;
4266
+ });
4267
+ }
4217
4268
  }
4218
4269
  BuildPipelineFormComponent.decorators = [
4219
4270
  { type: Component, args: [{
4220
4271
  selector: 'lcu-build-pipeline-form',
4221
- template: "<p>build-pipeline-form works!</p>\n",
4272
+ 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",
4222
4273
  styles: [""]
4223
4274
  },] }
4224
4275
  ];
4225
- BuildPipelineFormComponent.ctorParameters = () => [];
4276
+ BuildPipelineFormComponent.ctorParameters = () => [
4277
+ { type: FormBuilder },
4278
+ { type: ApplicationsFlowService }
4279
+ ];
4280
+ BuildPipelineFormComponent.propDecorators = {
4281
+ DevOpsActionLookup: [{ type: Input, args: ['devops-action-lookup',] }],
4282
+ Environment: [{ type: Input, args: ['environment',] }],
4283
+ MainBranch: [{ type: Input, args: ['main-branch',] }],
4284
+ Organization: [{ type: Input, args: ['organization',] }],
4285
+ Repository: [{ type: Input, args: ['repository',] }]
4286
+ };
4226
4287
 
4227
4288
  class DevopsSourceControlFormComponent {
4228
- constructor() { }
4289
+ // Constructors
4290
+ constructor(formBuilder, appsFlowSvc) {
4291
+ this.formBuilder = formBuilder;
4292
+ this.appsFlowSvc = appsFlowSvc;
4293
+ this.SeparatorKeysCodes = [ENTER, COMMA];
4294
+ this.BuildPath = null;
4295
+ this.HostingDetails = new ProjectHostingDetails();
4296
+ this.SelectedBranches = [];
4297
+ this.SourceControlRoot = '';
4298
+ this.UseBranches = true;
4299
+ this.UseBuildPath = false;
4300
+ }
4301
+ // Fields
4302
+ // Properties
4303
+ get BranchesFormControl() {
4304
+ return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'branches');
4305
+ }
4306
+ get BuildPathFormControl() {
4307
+ return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'buildPath');
4308
+ }
4309
+ get DevOpsActionLookups() {
4310
+ return Object.keys(this.DevOpsActions || {});
4311
+ }
4312
+ get DevOpsActionLookup() {
4313
+ var _a, _b, _c;
4314
+ if (!!((_a = this.DevOpsActionLookupFormControl) === null || _a === void 0 ? void 0 : _a.value)) {
4315
+ return this.DevOpsActionLookupFormControl.value;
4316
+ }
4317
+ if (!!((_b = this.EditingSourceControl) === null || _b === void 0 ? void 0 : _b.DevOpsActionTriggerLookups)) {
4318
+ return (_c = this.EditingSourceControl) === null || _c === void 0 ? void 0 : _c.DevOpsActionTriggerLookups[0];
4319
+ }
4320
+ else {
4321
+ return null;
4322
+ }
4323
+ }
4324
+ get DevOpsActionLookupFormControl() {
4325
+ return this.DevOpsSourceControlFormGroup.get('devOpsActionLookup');
4326
+ }
4327
+ get DevOpsActions() {
4328
+ return this.Environment.DevOpsActions || {};
4329
+ }
4330
+ get EditingSourceControl() {
4331
+ var _a, _b;
4332
+ let 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;
4333
+ if (sc == null && this.EditingSourceControlLookup) {
4334
+ sc = {};
4335
+ }
4336
+ return sc;
4337
+ }
4338
+ get MainBranchFormControl() {
4339
+ return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'mainBranch');
4340
+ }
4341
+ get OrganizationFormControl() {
4342
+ return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'organization');
4343
+ }
4344
+ get RepositoryFormControl() {
4345
+ return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'repository');
4346
+ }
4347
+ // Life Cycle
4348
+ ngAfterViewInit() { }
4349
+ ngOnDestroy() {
4350
+ this.destroyFormControls();
4351
+ }
4229
4352
  ngOnInit() {
4353
+ this.setupFormControls();
4354
+ this.RefreshOrganizations();
4355
+ }
4356
+ // API Methods
4357
+ AddBranchOption(event) {
4358
+ this.addBranchOption(event.value);
4359
+ event.input.value = '';
4360
+ }
4361
+ BranchOptionSelected(event) {
4362
+ this.addBranchOption(event.option.value);
4363
+ }
4364
+ BranchesChanged(branches) {
4365
+ this.loadProjectHostingDetails();
4366
+ }
4367
+ BuildPathChanged(event) {
4368
+ }
4369
+ CreateRepository() {
4370
+ this.CreatingRepository = true;
4371
+ this.RepositoryFormControl.reset();
4372
+ }
4373
+ CancelCreateRepository() {
4374
+ this.CreatingRepository = false;
4375
+ }
4376
+ DevOpsActionLookupChanged(event) {
4377
+ this.configureDevOpsAction();
4378
+ }
4379
+ MainBranchChanged(event) {
4380
+ this.emitBranchesChanged();
4381
+ }
4382
+ OrganizationChanged(event) {
4383
+ const org = this.OrganizationFormControl;
4384
+ this.RepositoryFormControl.reset();
4385
+ if (this.UseBranches) {
4386
+ this.BranchesFormControl.reset();
4387
+ this.SelectedBranches = [];
4388
+ }
4389
+ this.listRepositories();
4390
+ }
4391
+ RefreshOrganizations() {
4392
+ var _a, _b, _c;
4393
+ // this.Loading = true;
4394
+ this.listOrganizations();
4395
+ (_a = this.OrganizationFormControl) === null || _a === void 0 ? void 0 : _a.reset();
4396
+ (_b = this.RepositoryFormControl) === null || _b === void 0 ? void 0 : _b.reset();
4397
+ if (this.UseBranches) {
4398
+ (_c = this.BranchesFormControl) === null || _c === void 0 ? void 0 : _c.reset();
4399
+ }
4400
+ }
4401
+ RemoveBranchOption(option) {
4402
+ const index = this.SelectedBranches.indexOf(option);
4403
+ if (index >= 0) {
4404
+ this.SelectedBranches.splice(index, 1);
4405
+ }
4406
+ this.emitBranchesChanged();
4407
+ }
4408
+ RepositoryChanged(event) {
4409
+ const repo = this.RepositoryFormControl;
4410
+ if (this.UseBranches) {
4411
+ this.BranchesFormControl.reset();
4412
+ this.SelectedBranches = [];
4413
+ this.listBranches();
4414
+ }
4415
+ if (!this.UseBranches) {
4416
+ this.listBuildPaths();
4417
+ }
4418
+ }
4419
+ SaveRepository() {
4420
+ this.Loading = true;
4421
+ const org = this.OrganizationFormControl.value;
4422
+ const repoName = this.RepositoryFormControl.value;
4423
+ this.appsFlowSvc
4424
+ .CreateRepository(org, repoName)
4425
+ .subscribe((response) => {
4426
+ if (response.Status.Code === 0) {
4427
+ this.listRepositories(repoName);
4428
+ this.CreatingRepository = false;
4429
+ }
4430
+ else {
4431
+ // TODO: Need to surface an error to the user...
4432
+ this.Loading = false;
4433
+ }
4434
+ });
4435
+ }
4436
+ // Helpers
4437
+ addBranchOption(value) {
4438
+ value = (value || '').trim();
4439
+ if (value && this.SelectedBranches.indexOf(value) < 0) {
4440
+ this.SelectedBranches.push(value);
4441
+ }
4442
+ this.BranchesInput.nativeElement.blur();
4443
+ this.emitBranchesChanged();
4444
+ }
4445
+ configureDevOpsAction() {
4446
+ setTimeout(() => {
4447
+ this.DevOpsActionLookupFormControl.setValue(this.DevOpsActionLookup);
4448
+ }, 0);
4449
+ }
4450
+ destroyFormControls() {
4451
+ var _a, _b, _c, _d;
4452
+ this.DevOpsSourceControlFormGroup.removeControl([this.SourceControlRoot, 'mainBranch'].join(''));
4453
+ (_a = this.DevOpsSourceControlFormGroup) === null || _a === void 0 ? void 0 : _a.removeControl([this.SourceControlRoot, 'branches'].join(''));
4454
+ (_b = this.DevOpsSourceControlFormGroup) === null || _b === void 0 ? void 0 : _b.removeControl([this.SourceControlRoot, 'buildPath'].join(''));
4455
+ this.SelectedBranches = [];
4456
+ (_c = this.DevOpsSourceControlFormGroup) === null || _c === void 0 ? void 0 : _c.removeControl([this.SourceControlRoot, 'organization'].join(''));
4457
+ (_d = this.DevOpsSourceControlFormGroup) === null || _d === void 0 ? void 0 : _d.removeControl([this.SourceControlRoot, 'repository'].join(''));
4458
+ }
4459
+ emitBranchesChanged() {
4460
+ var _a, _b;
4461
+ if (((_a = this.SelectedBranches) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
4462
+ (!this.MainBranchFormControl.value ||
4463
+ this.SelectedBranches.indexOf(this.MainBranchFormControl.value) < 0)) {
4464
+ this.MainBranchFormControl.setValue(this.SelectedBranches.find((branch) => branch === 'main' || branch === 'master') || this.SelectedBranches[0]);
4465
+ }
4466
+ else if (((_b = this.SelectedBranches) === null || _b === void 0 ? void 0 : _b.length) <= 0) {
4467
+ this.MainBranchFormControl.reset();
4468
+ }
4469
+ this.BranchesFormControl.setValue(this.SelectedBranches.join(','));
4470
+ this.BranchesChanged(this.SelectedBranches || []);
4471
+ }
4472
+ listBranches() {
4473
+ if (this.UseBranches) {
4474
+ this.Loading = true;
4475
+ this.appsFlowSvc
4476
+ .ListBranches(this.OrganizationFormControl.value, this.RepositoryFormControl.value)
4477
+ .subscribe((response) => {
4478
+ var _a, _b, _c;
4479
+ this.BranchOptions = response.Model;
4480
+ this.Loading = false;
4481
+ if (((_b = (_a = this.EditingSourceControl) === null || _a === void 0 ? void 0 : _a.Branches) === null || _b === void 0 ? void 0 : _b.length) > 0) {
4482
+ this.SelectedBranches = this.EditingSourceControl.Branches;
4483
+ }
4484
+ else if (((_c = this.BranchOptions) === null || _c === void 0 ? void 0 : _c.length) === 1) {
4485
+ this.BranchesFormControl.setValue(this.BranchOptions[0].Name);
4486
+ this.SelectedBranches = [this.BranchOptions[0].Name];
4487
+ }
4488
+ this.emitBranchesChanged();
4489
+ this.listBuildPaths();
4490
+ });
4491
+ }
4492
+ }
4493
+ listBuildPaths() {
4494
+ if (this.UseBuildPath) {
4495
+ this.Loading = true;
4496
+ this.appsFlowSvc
4497
+ .ListBuildPaths(this.OrganizationFormControl.value, this.RepositoryFormControl.value)
4498
+ .subscribe((response) => {
4499
+ var _a;
4500
+ this.BuildPathOptions = response.Model;
4501
+ this.Loading = false;
4502
+ if (((_a = this.BuildPathOptions) === null || _a === void 0 ? void 0 : _a.length) === 1) {
4503
+ this.BuildPathFormControl.setValue(this.BuildPathOptions[0]);
4504
+ }
4505
+ });
4506
+ }
4507
+ }
4508
+ listOrganizations() {
4509
+ this.Loading = true;
4510
+ this.appsFlowSvc
4511
+ .ListOrganizations()
4512
+ .subscribe((response) => {
4513
+ var _a;
4514
+ this.OrganizationOptions = response.Model;
4515
+ this.Loading = false;
4516
+ if ((_a = this.EditingSourceControl) === null || _a === void 0 ? void 0 : _a.Organization) {
4517
+ setTimeout(() => {
4518
+ var _a;
4519
+ this.OrganizationFormControl.setValue(this.EditingSourceControl.Organization);
4520
+ this.listRepositories((_a = this.EditingSourceControl) === null || _a === void 0 ? void 0 : _a.Repository);
4521
+ }, 0);
4522
+ }
4523
+ });
4524
+ }
4525
+ listRepositories(activeRepo = null) {
4526
+ this.Loading = true;
4527
+ this.appsFlowSvc
4528
+ .ListRepositories(this.OrganizationFormControl.value)
4529
+ .subscribe((response) => {
4530
+ var _a;
4531
+ this.RepositoryOptions = response.Model;
4532
+ this.Loading = false;
4533
+ if (activeRepo) {
4534
+ setTimeout(() => {
4535
+ this.RepositoryFormControl.setValue(activeRepo);
4536
+ this.listBranches();
4537
+ if (!this.UseBranches) {
4538
+ this.listBuildPaths();
4539
+ }
4540
+ }, 0);
4541
+ }
4542
+ else if (((_a = this.RepositoryOptions) === null || _a === void 0 ? void 0 : _a.length) <= 0) {
4543
+ this.CreatingRepository = true;
4544
+ }
4545
+ });
4546
+ }
4547
+ loadProjectHostingDetails() {
4548
+ var _a, _b, _c, _d;
4549
+ if (((_a = this.SelectedBranches) === null || _a === void 0 ? void 0 : _a.length) > 0) {
4550
+ this.HostingDetails.Loading = true;
4551
+ this.appsFlowSvc
4552
+ .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)
4553
+ .subscribe((response) => {
4554
+ this.HostingDetails = response.Model;
4555
+ this.HostingDetails.Loading = false;
4556
+ this.configureDevOpsAction();
4557
+ }, (err) => {
4558
+ this.HostingDetails.Loading = false;
4559
+ });
4560
+ }
4561
+ }
4562
+ setupFormControls() {
4563
+ var _a, _b, _c, _d, _e, _f, _g;
4564
+ this.destroyFormControls();
4565
+ this.DevOpsSourceControlFormGroup.addControl('devOpsActionLookup', new FormControl(this.DevOpsActionLookup || '', []));
4566
+ this.DevOpsSourceControlFormGroup.addControl([this.SourceControlRoot, 'organization'].join(''), new FormControl((_a = this.EditingSourceControl.Organization) !== null && _a !== void 0 ? _a : '', Validators.required));
4567
+ this.DevOpsSourceControlFormGroup.addControl([this.SourceControlRoot, 'repository'].join(''), new FormControl((_b = this.EditingSourceControl.Repository) !== null && _b !== void 0 ? _b : '', Validators.required));
4568
+ if (this.UseBranches) {
4569
+ this.DevOpsSourceControlFormGroup.addControl([this.SourceControlRoot, 'branches'].join(''), new FormControl((_d = (_c = this.EditingSourceControl) === null || _c === void 0 ? void 0 : _c.Branches) !== null && _d !== void 0 ? _d : '', Validators.required));
4570
+ this.SelectedBranches = (_e = this.EditingSourceControl) === null || _e === void 0 ? void 0 : _e.Branches;
4571
+ this.DevOpsSourceControlFormGroup.addControl([this.SourceControlRoot, 'mainBranch'].join(''), new FormControl((_f = this.EditingSourceControl.MainBranch) !== null && _f !== void 0 ? _f : '', Validators.required));
4572
+ }
4573
+ if (this.UseBuildPath) {
4574
+ this.DevOpsSourceControlFormGroup.addControl([this.SourceControlRoot, 'buildPath'].join(''), new FormControl((_g = this.BuildPath) !== null && _g !== void 0 ? _g : '', Validators.required));
4575
+ }
4230
4576
  }
4231
4577
  }
4232
4578
  DevopsSourceControlFormComponent.decorators = [
4233
4579
  { type: Component, args: [{
4234
4580
  selector: 'lcu-devops-source-control-form',
4235
- template: "<p>devops-source-control-form works!</p>\n",
4581
+ 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",
4236
4582
  styles: [""]
4237
4583
  },] }
4238
4584
  ];
4239
- DevopsSourceControlFormComponent.ctorParameters = () => [];
4585
+ DevopsSourceControlFormComponent.ctorParameters = () => [
4586
+ { type: FormBuilder },
4587
+ { type: ApplicationsFlowService }
4588
+ ];
4589
+ DevopsSourceControlFormComponent.propDecorators = {
4590
+ BranchesInput: [{ type: ViewChild, args: ['branches',] }],
4591
+ Environment: [{ type: Input, args: ['environment',] }]
4592
+ };
4240
4593
 
4241
4594
  class ApplicationsFlowModule {
4242
4595
  static forRoot() {