@lowcodeunit/applications-flow-common 1.33.104-lets-get-social-ish → 1.33.108-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.
@@ -1210,14 +1210,14 @@
1210
1210
  });
1211
1211
  EaCService.prototype.DeleteApplication = function (appLookup, appName) {
1212
1212
  return __awaiter(this, void 0, void 0, function () {
1213
- return __generator(this, function (_b) {
1214
- switch (_b.label) {
1213
+ return __generator(this, function (_c) {
1214
+ switch (_c.label) {
1215
1215
  case 0:
1216
1216
  if (!confirm("Are you sure you want to delete application '" + appName + "'?")) return [3 /*break*/, 2];
1217
1217
  return [4 /*yield*/, this.projectService.DeleteApplication(this.State, appLookup)];
1218
1218
  case 1:
1219
- _b.sent();
1220
- _b.label = 2;
1219
+ _c.sent();
1220
+ _c.label = 2;
1221
1221
  case 2: return [2 /*return*/];
1222
1222
  }
1223
1223
  });
@@ -1225,14 +1225,14 @@
1225
1225
  };
1226
1226
  EaCService.prototype.DeleteDevOpsAction = function (doaLookup) {
1227
1227
  return __awaiter(this, void 0, void 0, function () {
1228
- return __generator(this, function (_b) {
1229
- switch (_b.label) {
1228
+ return __generator(this, function (_c) {
1229
+ switch (_c.label) {
1230
1230
  case 0:
1231
1231
  if (!confirm("Are you sure you want to delete DevOps action '" + doaLookup + "'?")) return [3 /*break*/, 2];
1232
1232
  return [4 /*yield*/, this.projectService.DeleteDevOpsAction(this.State, doaLookup)];
1233
1233
  case 1:
1234
- _b.sent();
1235
- _b.label = 2;
1234
+ _c.sent();
1235
+ _c.label = 2;
1236
1236
  case 2: return [2 /*return*/];
1237
1237
  }
1238
1238
  });
@@ -1240,14 +1240,14 @@
1240
1240
  };
1241
1241
  EaCService.prototype.DeleteProject = function (projectLookup) {
1242
1242
  return __awaiter(this, void 0, void 0, function () {
1243
- return __generator(this, function (_b) {
1244
- switch (_b.label) {
1243
+ return __generator(this, function (_c) {
1244
+ switch (_c.label) {
1245
1245
  case 0:
1246
1246
  if (!confirm("Are you sure you want to delete Project '" + projectLookup + "'?")) return [3 /*break*/, 2];
1247
1247
  return [4 /*yield*/, this.projectService.DeleteProject(this.State, projectLookup)];
1248
1248
  case 1:
1249
- _b.sent();
1250
- _b.label = 2;
1249
+ _c.sent();
1250
+ _c.label = 2;
1251
1251
  case 2: return [2 /*return*/];
1252
1252
  }
1253
1253
  });
@@ -1255,14 +1255,14 @@
1255
1255
  };
1256
1256
  EaCService.prototype.DeleteSourceControl = function (scLookup) {
1257
1257
  return __awaiter(this, void 0, void 0, function () {
1258
- return __generator(this, function (_b) {
1259
- switch (_b.label) {
1258
+ return __generator(this, function (_c) {
1259
+ switch (_c.label) {
1260
1260
  case 0:
1261
1261
  if (!confirm("Are you sure you want to delete Source Control '" + scLookup + "'?")) return [3 /*break*/, 2];
1262
1262
  return [4 /*yield*/, this.projectService.DeleteSourceControl(this.State, scLookup)];
1263
1263
  case 1:
1264
- _b.sent();
1265
- _b.label = 2;
1264
+ _c.sent();
1265
+ _c.label = 2;
1266
1266
  case 2: return [2 /*return*/];
1267
1267
  }
1268
1268
  });
@@ -1273,11 +1273,11 @@
1273
1273
  // });
1274
1274
  EaCService.prototype.EnsureUserEnterprise = function () {
1275
1275
  return __awaiter(this, void 0, void 0, function () {
1276
- return __generator(this, function (_b) {
1277
- switch (_b.label) {
1276
+ return __generator(this, function (_c) {
1277
+ switch (_c.label) {
1278
1278
  case 0: return [4 /*yield*/, this.projectService.EnsureUserEnterprise(this.State)];
1279
1279
  case 1:
1280
- _b.sent();
1280
+ _c.sent();
1281
1281
  return [2 /*return*/];
1282
1282
  }
1283
1283
  });
@@ -1285,11 +1285,11 @@
1285
1285
  };
1286
1286
  EaCService.prototype.GetActiveEnterprise = function () {
1287
1287
  return __awaiter(this, void 0, void 0, function () {
1288
- return __generator(this, function (_b) {
1289
- switch (_b.label) {
1288
+ return __generator(this, function (_c) {
1289
+ switch (_c.label) {
1290
1290
  case 0: return [4 /*yield*/, this.projectService.GetActiveEnterprise(this.State)];
1291
1291
  case 1:
1292
- _b.sent();
1292
+ _c.sent();
1293
1293
  return [2 /*return*/];
1294
1294
  }
1295
1295
  });
@@ -1304,11 +1304,11 @@
1304
1304
  });
1305
1305
  EaCService.prototype.HasValidConnection = function () {
1306
1306
  return __awaiter(this, void 0, void 0, function () {
1307
- return __generator(this, function (_b) {
1308
- switch (_b.label) {
1307
+ return __generator(this, function (_c) {
1308
+ switch (_c.label) {
1309
1309
  case 0: return [4 /*yield*/, this.projectService.HasValidConnection(this.State)];
1310
1310
  case 1:
1311
- _b.sent();
1311
+ _c.sent();
1312
1312
  return [2 /*return*/];
1313
1313
  }
1314
1314
  });
@@ -1316,11 +1316,11 @@
1316
1316
  };
1317
1317
  EaCService.prototype.ListEnterprises = function () {
1318
1318
  return __awaiter(this, void 0, void 0, function () {
1319
- return __generator(this, function (_b) {
1320
- switch (_b.label) {
1319
+ return __generator(this, function (_c) {
1320
+ switch (_c.label) {
1321
1321
  case 0: return [4 /*yield*/, this.projectService.ListEnterprises(this.State)];
1322
1322
  case 1:
1323
- _b.sent();
1323
+ _c.sent();
1324
1324
  return [2 /*return*/];
1325
1325
  }
1326
1326
  });
@@ -1328,11 +1328,11 @@
1328
1328
  };
1329
1329
  EaCService.prototype.LoadEnterpriseAsCode = function () {
1330
1330
  return __awaiter(this, void 0, void 0, function () {
1331
- return __generator(this, function (_b) {
1332
- switch (_b.label) {
1331
+ return __generator(this, function (_c) {
1332
+ switch (_c.label) {
1333
1333
  case 0: return [4 /*yield*/, this.projectService.LoadEnterpriseAsCode(this.State)];
1334
1334
  case 1:
1335
- _b.sent();
1335
+ _c.sent();
1336
1336
  return [2 /*return*/];
1337
1337
  }
1338
1338
  });
@@ -1340,11 +1340,11 @@
1340
1340
  };
1341
1341
  EaCService.prototype.SaveApplicationAsCode = function (req) {
1342
1342
  return __awaiter(this, void 0, void 0, function () {
1343
- return __generator(this, function (_b) {
1344
- switch (_b.label) {
1343
+ return __generator(this, function (_c) {
1344
+ switch (_c.label) {
1345
1345
  case 0: return [4 /*yield*/, this.handleSaveApplication(req)];
1346
1346
  case 1:
1347
- _b.sent();
1347
+ _c.sent();
1348
1348
  return [2 /*return*/];
1349
1349
  }
1350
1350
  });
@@ -1352,11 +1352,11 @@
1352
1352
  };
1353
1353
  EaCService.prototype.SaveDFSModifier = function (req) {
1354
1354
  return __awaiter(this, void 0, void 0, function () {
1355
- return __generator(this, function (_b) {
1356
- switch (_b.label) {
1355
+ return __generator(this, function (_c) {
1356
+ switch (_c.label) {
1357
1357
  case 0: return [4 /*yield*/, this.handleSaveDFSModifier(req)];
1358
1358
  case 1:
1359
- _b.sent();
1359
+ _c.sent();
1360
1360
  return [2 /*return*/];
1361
1361
  }
1362
1362
  });
@@ -1364,11 +1364,11 @@
1364
1364
  };
1365
1365
  EaCService.prototype.SaveEnterpriseAsCode = function (eac) {
1366
1366
  return __awaiter(this, void 0, void 0, function () {
1367
- return __generator(this, function (_b) {
1368
- switch (_b.label) {
1367
+ return __generator(this, function (_c) {
1368
+ switch (_c.label) {
1369
1369
  case 0: return [4 /*yield*/, this.projectService.SaveEnterpriseAsCode(this.State, eac)];
1370
1370
  case 1:
1371
- _b.sent();
1371
+ _c.sent();
1372
1372
  return [2 /*return*/];
1373
1373
  }
1374
1374
  });
@@ -1376,11 +1376,11 @@
1376
1376
  };
1377
1377
  EaCService.prototype.SaveEnvironmentAsCode = function (req) {
1378
1378
  return __awaiter(this, void 0, void 0, function () {
1379
- return __generator(this, function (_b) {
1380
- switch (_b.label) {
1379
+ return __generator(this, function (_c) {
1380
+ switch (_c.label) {
1381
1381
  case 0: return [4 /*yield*/, this.handleSaveEnvironment(req)];
1382
1382
  case 1:
1383
- _b.sent();
1383
+ _c.sent();
1384
1384
  return [2 /*return*/];
1385
1385
  }
1386
1386
  });
@@ -1388,11 +1388,11 @@
1388
1388
  };
1389
1389
  EaCService.prototype.SaveProjectAsCode = function (req) {
1390
1390
  return __awaiter(this, void 0, void 0, function () {
1391
- return __generator(this, function (_b) {
1392
- switch (_b.label) {
1391
+ return __generator(this, function (_c) {
1392
+ switch (_c.label) {
1393
1393
  case 0: return [4 /*yield*/, this.handleSaveProject(req.ProjectLookup, req.Project)];
1394
1394
  case 1:
1395
- _b.sent();
1395
+ _c.sent();
1396
1396
  return [2 /*return*/];
1397
1397
  }
1398
1398
  });
@@ -1400,7 +1400,7 @@
1400
1400
  };
1401
1401
  EaCService.prototype.SetActiveEnterprise = function (eventValue) {
1402
1402
  return __awaiter(this, void 0, void 0, function () {
1403
- return __generator(this, function (_b) {
1403
+ return __generator(this, function (_c) {
1404
1404
  this.projectService.SetActiveEnterprise(this.State, eventValue);
1405
1405
  return [2 /*return*/];
1406
1406
  });
@@ -1408,7 +1408,7 @@
1408
1408
  };
1409
1409
  EaCService.prototype.SetCreatingProject = function (creatingProject) {
1410
1410
  return __awaiter(this, void 0, void 0, function () {
1411
- return __generator(this, function (_b) {
1411
+ return __generator(this, function (_c) {
1412
1412
  this.projectService.SetCreatingProject(creatingProject);
1413
1413
  return [2 /*return*/];
1414
1414
  });
@@ -1416,11 +1416,11 @@
1416
1416
  };
1417
1417
  EaCService.prototype.SetEditProjectSettings = function (projectLookup) {
1418
1418
  return __awaiter(this, void 0, void 0, function () {
1419
- return __generator(this, function (_b) {
1420
- switch (_b.label) {
1419
+ return __generator(this, function (_c) {
1420
+ switch (_c.label) {
1421
1421
  case 0: return [4 /*yield*/, this.projectService.SetEditProjectSettings(this.State, projectLookup)];
1422
1422
  case 1:
1423
- _b.sent();
1423
+ _c.sent();
1424
1424
  return [2 /*return*/];
1425
1425
  }
1426
1426
  });
@@ -1428,14 +1428,14 @@
1428
1428
  };
1429
1429
  EaCService.prototype.UnpackLowCodeUnit = function (req) {
1430
1430
  return __awaiter(this, void 0, void 0, function () {
1431
- return __generator(this, function (_b) {
1432
- switch (_b.label) {
1431
+ return __generator(this, function (_c) {
1432
+ switch (_c.label) {
1433
1433
  case 0:
1434
1434
  if (!confirm("Are you sure you want to unpack application '" + req.ApplicationName + "' with version '" + req.Version + "'?")) return [3 /*break*/, 2];
1435
1435
  return [4 /*yield*/, this.projectService.UnpackLowCodeUnit(this.State, req)];
1436
1436
  case 1:
1437
- _b.sent();
1438
- _b.label = 2;
1437
+ _c.sent();
1438
+ _c.label = 2;
1439
1439
  case 2: return [2 /*return*/];
1440
1440
  }
1441
1441
  });
@@ -1446,8 +1446,8 @@
1446
1446
  var _a;
1447
1447
  return __awaiter(this, void 0, void 0, function () {
1448
1448
  var saveEaC, existingProj;
1449
- return __generator(this, function (_b) {
1450
- switch (_b.label) {
1449
+ return __generator(this, function (_c) {
1450
+ switch (_c.label) {
1451
1451
  case 0:
1452
1452
  saveEaC = {
1453
1453
  EnterpriseLookup: this.State.EaC.EnterpriseLookup,
@@ -1467,7 +1467,7 @@
1467
1467
  }
1468
1468
  return [4 /*yield*/, this.projectService.SaveEnterpriseAsCode(this.State, saveEaC)];
1469
1469
  case 1:
1470
- _b.sent();
1470
+ _c.sent();
1471
1471
  return [2 /*return*/];
1472
1472
  }
1473
1473
  });
@@ -1476,8 +1476,8 @@
1476
1476
  EaCService.prototype.handleSaveDFSModifier = function (req) {
1477
1477
  return __awaiter(this, void 0, void 0, function () {
1478
1478
  var saveEaC;
1479
- return __generator(this, function (_b) {
1480
- switch (_b.label) {
1479
+ return __generator(this, function (_c) {
1480
+ switch (_c.label) {
1481
1481
  case 0:
1482
1482
  saveEaC = {
1483
1483
  EnterpriseLookup: this.State.EaC.EnterpriseLookup,
@@ -1494,20 +1494,21 @@
1494
1494
  }
1495
1495
  return [4 /*yield*/, this.projectService.SaveEnterpriseAsCode(this.State, saveEaC)];
1496
1496
  case 1:
1497
- _b.sent();
1497
+ _c.sent();
1498
1498
  return [2 /*return*/];
1499
1499
  }
1500
1500
  });
1501
1501
  });
1502
1502
  };
1503
1503
  EaCService.prototype.handleSaveEnvironment = function (req) {
1504
+ var _a, _b;
1504
1505
  return __awaiter(this, void 0, void 0, function () {
1505
1506
  var saveEaC;
1506
- return __generator(this, function (_b) {
1507
- switch (_b.label) {
1507
+ return __generator(this, function (_c) {
1508
+ switch (_c.label) {
1508
1509
  case 0:
1509
1510
  saveEaC = {
1510
- EnterpriseLookup: this.State.EaC.EnterpriseLookup,
1511
+ EnterpriseLookup: (_b = (_a = this.State) === null || _a === void 0 ? void 0 : _a.EaC) === null || _b === void 0 ? void 0 : _b.EnterpriseLookup,
1511
1512
  DataTokens: {},
1512
1513
  Environments: {},
1513
1514
  };
@@ -1519,7 +1520,7 @@
1519
1520
  }
1520
1521
  return [4 /*yield*/, this.projectService.SaveEnterpriseAsCode(this.State, saveEaC)];
1521
1522
  case 1:
1522
- _b.sent();
1523
+ _c.sent();
1523
1524
  return [2 /*return*/];
1524
1525
  }
1525
1526
  });
@@ -1530,8 +1531,8 @@
1530
1531
  return __awaiter(this, void 0, void 0, function () {
1531
1532
  var projHosts, saveEaC;
1532
1533
  var _this = this;
1533
- return __generator(this, function (_b) {
1534
- switch (_b.label) {
1534
+ return __generator(this, function (_c) {
1535
+ switch (_c.label) {
1535
1536
  case 0:
1536
1537
  projHosts = {};
1537
1538
  (_a = project === null || project === void 0 ? void 0 : project.Hosts) === null || _a === void 0 ? void 0 : _a.forEach(function (host) {
@@ -1547,7 +1548,7 @@
1547
1548
  saveEaC.Projects[projectLookup] = project;
1548
1549
  return [4 /*yield*/, this.projectService.SaveEnterpriseAsCode(this.State, saveEaC)];
1549
1550
  case 1:
1550
- _b.sent();
1551
+ _c.sent();
1551
1552
  this.SetEditProjectSettings(projectLookup);
1552
1553
  return [2 /*return*/];
1553
1554
  }
@@ -5568,10 +5569,10 @@
5568
5569
  // @Input('repository')
5569
5570
  // public Repository: string;
5570
5571
  get: function () {
5571
- var _a, _b, _c;
5572
- console.log("ARTIFACT: ", (_a = this.Environment) === null || _a === void 0 ? void 0 : _a.Artifacts[this.ArtifactLookup]);
5573
- return ((_b = this.Environment) === null || _b === void 0 ? void 0 : _b.Artifacts) && this.ArtifactLookup
5574
- ? ((_c = this.Environment) === null || _c === void 0 ? void 0 : _c.Artifacts[this.ArtifactLookup]) || {}
5572
+ var _a, _b;
5573
+ // console.log("ARTIFACT: ", this.Environment?.Artifacts[this.ArtifactLookup]);
5574
+ return ((_a = this.Environment) === null || _a === void 0 ? void 0 : _a.Artifacts) && this.ArtifactLookup
5575
+ ? ((_b = this.Environment) === null || _b === void 0 ? void 0 : _b.Artifacts[this.ArtifactLookup]) || {}
5575
5576
  : {};
5576
5577
  },
5577
5578
  enumerable: false,
@@ -5692,6 +5693,7 @@
5692
5693
  };
5693
5694
  BuildPipelineFormComponent.prototype.SubmitBuildPipeline = function () {
5694
5695
  console.log("submitting build pipeline: ", this.BuildPipelineFormGroup.value);
5696
+ this.SaveEnvironment();
5695
5697
  };
5696
5698
  BuildPipelineFormComponent.prototype.SaveEnvironment = function () {
5697
5699
  var _a;
@@ -5736,22 +5738,10 @@
5736
5738
  var doa = Object.assign(Object.assign({}, this.DevOpsAction), { Name: this.DevOpsActionNameFormControl.value });
5737
5739
  saveEnvReq.Environment.DevOpsActions[devOpsActionLookup] = doa;
5738
5740
  }
5739
- // let source: EaCSourceControl = {
5740
- // ...this.EditingSourceControl,
5741
- // Branches: this.SourceControlFormControls.SelectedBranches,
5742
- // MainBranch: this.SourceControlFormControls.MainBranchFormControl.value,
5743
- // };
5744
- // source = {
5745
- // ...source,
5746
- // Type: 'GitHub',
5747
- // Name: this.EditingSourceControlLookup,
5748
- // DevOpsActionTriggerLookups: [devOpsActionLookup],
5749
- // Organization:
5750
- // this.SourceControlFormControls.OrganizationFormControl.value,
5751
- // Repository: this.SourceControlFormControls.RepositoryFormControl.value,
5752
- // };
5753
- // const scLookup = `github://${source.Organization}/${source.Repository}`;
5754
- // saveEnvReq.Environment.Sources[scLookup] = source;
5741
+ var source = Object.assign(Object.assign({}, this.EditingSourceControl), { Branches: this.EditingSourceControl.SelectedBranches, MainBranch: this.EditingSourceControl.MainBranchFormControl.value });
5742
+ source = Object.assign(Object.assign({}, source), { Type: 'GitHub', Name: this.EditingSourceControlLookup, DevOpsActionTriggerLookups: [devOpsActionLookup], Organization: this.EditingSourceControl.OrganizationFormControl.value, Repository: this.EditingSourceControl.RepositoryFormControl.value });
5743
+ var scLookup = "github://" + source.Organization + "/" + source.Repository;
5744
+ saveEnvReq.Environment.Sources[scLookup] = source;
5755
5745
  this.eacSvc.SaveEnvironmentAsCode(saveEnvReq);
5756
5746
  };
5757
5747
  // Helpers
@@ -5850,8 +5840,35 @@
5850
5840
  this.UseBranches = true;
5851
5841
  this.UseBuildPath = false;
5852
5842
  }
5853
- Object.defineProperty(DevopsSourceControlFormComponent.prototype, "BranchesFormControl", {
5843
+ Object.defineProperty(DevopsSourceControlFormComponent.prototype, "ArtifactLookups", {
5854
5844
  // Properties
5845
+ get: function () {
5846
+ var _a;
5847
+ return (_a = this.DevOpsAction) === null || _a === void 0 ? void 0 : _a.ArtifactLookups;
5848
+ },
5849
+ enumerable: false,
5850
+ configurable: true
5851
+ });
5852
+ Object.defineProperty(DevopsSourceControlFormComponent.prototype, "ArtifactLookup", {
5853
+ get: function () {
5854
+ var _a, _b;
5855
+ 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;
5856
+ return artLookup;
5857
+ },
5858
+ enumerable: false,
5859
+ configurable: true
5860
+ });
5861
+ Object.defineProperty(DevopsSourceControlFormComponent.prototype, "Artifact", {
5862
+ get: function () {
5863
+ var _a, _b;
5864
+ return ((_a = this.Environment) === null || _a === void 0 ? void 0 : _a.Artifacts) && this.ArtifactLookup
5865
+ ? ((_b = this.Environment) === null || _b === void 0 ? void 0 : _b.Artifacts[this.ArtifactLookup]) || {}
5866
+ : {};
5867
+ },
5868
+ enumerable: false,
5869
+ configurable: true
5870
+ });
5871
+ Object.defineProperty(DevopsSourceControlFormComponent.prototype, "BranchesFormControl", {
5855
5872
  get: function () {
5856
5873
  return this.DevOpsSourceControlFormGroup.get(this.SourceControlRoot + 'branches');
5857
5874
  },
@@ -5867,11 +5884,21 @@
5867
5884
  });
5868
5885
  Object.defineProperty(DevopsSourceControlFormComponent.prototype, "DevOpsActionLookups", {
5869
5886
  get: function () {
5887
+ // console.log(this.DevOpsActions);
5870
5888
  return Object.keys(this.DevOpsActions || {});
5871
5889
  },
5872
5890
  enumerable: false,
5873
5891
  configurable: true
5874
5892
  });
5893
+ Object.defineProperty(DevopsSourceControlFormComponent.prototype, "DevOpsAction", {
5894
+ get: function () {
5895
+ return this.Environment.DevOpsActions && this.DevOpsActionLookup
5896
+ ? this.Environment.DevOpsActions[this.DevOpsActionLookup] || {}
5897
+ : {};
5898
+ },
5899
+ enumerable: false,
5900
+ configurable: true
5901
+ });
5875
5902
  Object.defineProperty(DevopsSourceControlFormComponent.prototype, "DevOpsActionLookup", {
5876
5903
  get: function () {
5877
5904
  var _a, _b, _c;
@@ -6040,90 +6067,67 @@
6040
6067
  };
6041
6068
  DevopsSourceControlFormComponent.prototype.SubmitSourceControl = function () {
6042
6069
  console.log("source control submitted: ", this.DevOpsSourceControlFormGroup.value);
6070
+ this.SaveSourceControl();
6071
+ };
6072
+ DevopsSourceControlFormComponent.prototype.SaveSourceControl = function () {
6073
+ var saveEnvReq = {
6074
+ Environment: Object.assign(Object.assign({}, this.Environment), { Artifacts: this.Environment.Artifacts || {}, DevOpsActions: this.Environment.DevOpsActions || {}, Secrets: this.Environment.Secrets || {}, Sources: this.Environment.Sources || {} }),
6075
+ EnvironmentLookup: this.EnvironmentLookup,
6076
+ EnterpriseDataTokens: {},
6077
+ };
6078
+ var artifactLookup;
6079
+ // let artifact: EaCArtifact = {
6080
+ // ...this.Artifact,
6081
+ // ...this.HostingDetailsFormControls
6082
+ // .SelectedHostingOptionInputControlValues,
6083
+ // };
6084
+ var artifact = this.Artifact;
6085
+ if (!this.ArtifactLookup) {
6086
+ artifactLookup = i2.Guid.CreateRaw();
6087
+ artifact = Object.assign(Object.assign({}, artifact), {
6088
+ // Type: this.HostingDetailsFormControls.SelectedHostingOption
6089
+ // .ArtifactType,
6090
+ // Name: this.HostingDetailsFormControls.SelectedHostingOption.Name,
6091
+ NPMRegistry: 'https://registry.npmjs.org/'
6092
+ });
6093
+ }
6094
+ else {
6095
+ artifactLookup = this.ArtifactLookup;
6096
+ }
6097
+ saveEnvReq.Environment.Artifacts[artifactLookup] = artifact;
6098
+ var devOpsActionLookup;
6099
+ if (!this.DevOpsActionLookup) {
6100
+ devOpsActionLookup = i2.Guid.CreateRaw();
6101
+ var doa = Object.assign(Object.assign({}, this.DevOpsAction), { ArtifactLookups: [artifactLookup] });
6102
+ // if (this.HostingDetailsFormControls.NPMTokenFormControl?.value) {
6103
+ // const secretLookup = 'npm-access-token';
6104
+ // doa.SecretLookups = [secretLookup];
6105
+ // saveEnvReq.Environment.Secrets[secretLookup] = {
6106
+ // Name: 'NPM Access Token',
6107
+ // DataTokenLookup: secretLookup,
6108
+ // KnownAs: 'NPM_TOKEN',
6109
+ // };
6110
+ // saveEnvReq.EnterpriseDataTokens[secretLookup] = {
6111
+ // Name: saveEnvReq.Environment.Secrets[secretLookup].Name,
6112
+ // Description: saveEnvReq.Environment.Secrets[secretLookup].Name,
6113
+ // Value: this.NPMTokenFormControl.value,
6114
+ // };
6115
+ // }
6116
+ // saveEnvReq.Environment.DevOpsActions[devOpsActionLookup] = doa;
6117
+ saveEnvReq.Environment.DevOpsActions[devOpsActionLookup] = this.DevOpsAction;
6118
+ }
6119
+ else {
6120
+ devOpsActionLookup = this.DevOpsActionLookupFormControl.value;
6121
+ var doa = Object.assign({}, this.DevOpsAction);
6122
+ // saveEnvReq.Environment.DevOpsActions[devOpsActionLookup] = doa;
6123
+ saveEnvReq.Environment.DevOpsActions[devOpsActionLookup] = this.DevOpsAction;
6124
+ }
6125
+ var source = Object.assign(Object.assign({}, this.EditingSourceControl), { Branches: this.SelectedBranches, MainBranch: this.MainBranchFormControl.value });
6126
+ source = Object.assign(Object.assign({}, source), { Type: 'GitHub', Name: this.EditingSourceControlLookup, DevOpsActionTriggerLookups: [devOpsActionLookup], Organization: this.OrganizationFormControl.value, Repository: this.RepositoryFormControl.value });
6127
+ var scLookup = "github://" + source.Organization + "/" + source.Repository;
6128
+ saveEnvReq.Environment.Sources[scLookup] = source;
6129
+ this.eacSvc.SaveEnvironmentAsCode(saveEnvReq);
6043
6130
  };
6044
- // public SaveSourceControl(): void {
6045
- // const saveEnvReq: SaveEnvironmentAsCodeEventRequest = {
6046
- // Environment: {
6047
- // ...this.Environment,
6048
- // Artifacts: this.Environment.Artifacts || {},
6049
- // DevOpsActions: this.Environment.DevOpsActions || {},
6050
- // Secrets: this.Environment.Secrets || {},
6051
- // Sources: this.Environment.Sources || {},
6052
- // },
6053
- // EnvironmentLookup: this.EnvironmentLookup,
6054
- // EnterpriseDataTokens: {},
6055
- // };
6056
- // let artifactLookup: string;
6057
- // let artifact: EaCArtifact = {
6058
- // ...this.Artifact,
6059
- // ...this.HostingDetailsFormControls
6060
- // .SelectedHostingOptionInputControlValues,
6061
- // };
6062
- // // if (!this.ArtifactLookup) {
6063
- // // artifactLookup = Guid.CreateRaw();
6064
- // // artifact = {
6065
- // // ...artifact,
6066
- // // Type: this.HostingDetailsFormControls.SelectedHostingOption
6067
- // // .ArtifactType,
6068
- // // Name: this.HostingDetailsFormControls.SelectedHostingOption.Name,
6069
- // // NPMRegistry: 'https://registry.npmjs.org/',
6070
- // // };
6071
- // // } else {
6072
- // // artifactLookup = this.ArtifactLookup;
6073
- // // }
6074
- // saveEnvReq.Environment.Artifacts[artifactLookup] = artifact;
6075
- // let devOpsActionLookup: string;
6076
- // if (!this.DevOpsActionLookup) {
6077
- // devOpsActionLookup = Guid.CreateRaw();
6078
- // // const doa: EaCDevOpsAction = {
6079
- // // ...this.DevOpsAction,
6080
- // // ArtifactLookups: [artifactLookup],
6081
- // // Name: this.HostingDetailsFormControls.DevOpsActionNameFormControl.value,
6082
- // // Path: this.HostingDetailsFormControls.SelectedHostingOption.Path,
6083
- // // Templates:
6084
- // // this.HostingDetailsFormControls.SelectedHostingOption.Templates,
6085
- // // };
6086
- // if (this.HostingDetailsFormControls.NPMTokenFormControl?.value) {
6087
- // const secretLookup = 'npm-access-token';
6088
- // doa.SecretLookups = [secretLookup];
6089
- // saveEnvReq.Environment.Secrets[secretLookup] = {
6090
- // Name: 'NPM Access Token',
6091
- // DataTokenLookup: secretLookup,
6092
- // KnownAs: 'NPM_TOKEN',
6093
- // };
6094
- // saveEnvReq.EnterpriseDataTokens[secretLookup] = {
6095
- // Name: saveEnvReq.Environment.Secrets[secretLookup].Name,
6096
- // Description: saveEnvReq.Environment.Secrets[secretLookup].Name,
6097
- // Value: this.NPMTokenFormControl.value,
6098
- // };
6099
- // }
6100
- // saveEnvReq.Environment.DevOpsActions[devOpsActionLookup] = doa;
6101
- // } else {
6102
- // devOpsActionLookup = this.DevOpsActionLookupFormControl.value;
6103
- // const doa: EaCDevOpsAction = {
6104
- // ...this.DevOpsAction,
6105
- // Name: this.HostingDetailsFormControls.DevOpsActionNameFormControl.value,
6106
- // };
6107
- // saveEnvReq.Environment.DevOpsActions[devOpsActionLookup] = doa;
6108
- // }
6109
- // let source: EaCSourceControl = {
6110
- // ...this.EditingSourceControl,
6111
- // Branches: this.SelectedBranches,
6112
- // MainBranch: this.MainBranchFormControl.value,
6113
- // };
6114
- // source = {
6115
- // ...source,
6116
- // Type: 'GitHub',
6117
- // Name: this.EditingSourceControlLookup,
6118
- // DevOpsActionTriggerLookups: [devOpsActionLookup],
6119
- // Organization:
6120
- // this.OrganizationFormControl.value,
6121
- // Repository: this.RepositoryFormControl.value,
6122
- // };
6123
- // const scLookup = `github://${source.Organization}/${source.Repository}`;
6124
- // saveEnvReq.Environment.Sources[scLookup] = source;
6125
- // this.eacSvc.SaveEnvironmentAsCode(saveEnvReq);
6126
- // }
6127
6131
  // Helpers
6128
6132
  DevopsSourceControlFormComponent.prototype.addBranchOption = function (value) {
6129
6133
  value = (value || '').trim();
@@ -6289,6 +6293,7 @@
6289
6293
  DevopsSourceControlFormComponent.propDecorators = {
6290
6294
  EditingSourceControlLookup: [{ type: i0.Input, args: ['editing-source-control-lookup',] }],
6291
6295
  Environment: [{ type: i0.Input, args: ['environment',] }],
6296
+ EnvironmentLookup: [{ type: i0.Input, args: ['environment-lookup',] }],
6292
6297
  BranchesInput: [{ type: i0.ViewChild, args: ['branches',] }]
6293
6298
  };
6294
6299
 
@@ -6304,7 +6309,7 @@
6304
6309
  SourceControlDialogComponent.decorators = [
6305
6310
  { type: i0.Component, args: [{
6306
6311
  selector: 'lcu-source-control-dialog',
6307
- template: "\n<div fxLayoutAlign=\"center center\">\n <lcu-devops-source-control-form\n [environment]=\"data.environment\"\n [editing-source-control-lookup]=\"data.scLookup\">\n </lcu-devops-source-control-form>\n</div>",
6312
+ template: "\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>",
6308
6313
  styles: [""]
6309
6314
  },] }
6310
6315
  ];
@@ -6393,7 +6398,7 @@
6393
6398
  EditApplicationFormComponent.decorators = [
6394
6399
  { type: i0.Component, args: [{
6395
6400
  selector: 'lcu-edit-application-form',
6396
- template: "<form class=\"form-card\" [formGroup]=\"ApplicationFormGroup\" (ngSubmit)=\"SubmitApplicationControl()\" >\n <mat-card class=\"spread flow-card\">\n <mat-card-header>\n <mat-card-title>\n <ng-container *ngIf=\"EditingApplication?.Application\">\n Edit Application:\n {{ EditingApplication.Application?.Name }}\n </ng-container>\n\n <ng-container *ngIf=\"!EditingApplication?.Application\">\n Create an Application\n </ng-container>\n </mat-card-title>\n </mat-card-header>\n\n <mat-card-content>\n <mat-form-field class=\"mat-full-width\">\n <input\n matInput\n placeholder=\"Name\"\n formControlName=\"name\"\n required\n />\n </mat-form-field>\n\n <mat-form-field class=\"mat-full-width\">\n <textarea\n matInput\n placeholder=\"Description\"\n formControlName=\"description\"\n rows=\"3\"\n required\n ></textarea>\n </mat-form-field>\n\n <mat-form-field class=\"mat-full-width\">\n <input\n matInput\n placeholder=\"Route\"\n formControlName=\"route\"\n required\n />\n </mat-form-field>\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]=\"!ApplicationFormGroup.valid || !ApplicationFormGroup.dirty\">\n <mat-icon>save</mat-icon>\n Save Source Control\n </button>\n \n </mat-card-actions>\n </mat-card>\n</form>\n",
6401
+ template: "<form class=\"form-card\" [formGroup]=\"ApplicationFormGroup\" (ngSubmit)=\"SubmitApplicationControl()\" >\n <mat-card class=\"spread flow-card\">\n <mat-card-header>\n <mat-card-title>\n <ng-container *ngIf=\"EditingApplication?.Application\">\n Edit Application:\n {{ EditingApplication.Application?.Name }}\n </ng-container>\n\n <ng-container *ngIf=\"!EditingApplication?.Application\">\n Create an Application\n </ng-container>\n </mat-card-title>\n </mat-card-header>\n\n <mat-card-content>\n <mat-form-field class=\"mat-full-width\">\n <input\n matInput\n placeholder=\"Name\"\n formControlName=\"name\"\n required\n />\n </mat-form-field>\n\n <mat-form-field class=\"mat-full-width\">\n <textarea\n matInput\n placeholder=\"Description\"\n formControlName=\"description\"\n rows=\"3\"\n required\n ></textarea>\n </mat-form-field>\n\n <mat-form-field class=\"mat-full-width\">\n <input\n matInput\n placeholder=\"Route\"\n formControlName=\"route\"\n required\n />\n </mat-form-field>\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]=\"!ApplicationFormGroup.valid || !ApplicationFormGroup.dirty\">\n <mat-icon>save</mat-icon>\n Save\n </button>\n \n </mat-card-actions>\n </mat-card>\n</form>\n",
6397
6402
  styles: [""]
6398
6403
  },] }
6399
6404
  ];