Skip to content

Commit

Permalink
Replace DevExtreme with Angular and add services (#66)
Browse files Browse the repository at this point in the history
* Accordion replace with material complete

* Clean up security output and finish deployments

* Fix auth and header as material

* Change user panel to material and fix elevation

* Got typography working

* Replaced environment grid with table

* Update lock icon color

* Deploy force dialog done

* Completed first reactive form

* Remove uncessary destroyRef

* Move all takeUntilDestroyet into constructors

* Fix required issue

* Finished deploy rollback

* Replaced popover and added mtx extended components

* Drage and dro for queue list done in material

* Removed label for pull request

* Add arrow to autocomplete

* Add alert panel and select list for pull requests

* Finished add repo dialog

* Completed add repo dialog

* Completed all dialogs

* Fixed loading errors

* Environments page finished

* Repositories page complete

* Settings tabs and left nav converted to material

* Started environment form

* Fixed settings loading issues

* Environment fields complete

* Add 2x form field

* Switch automation input to table

* Update exclude from rollback and finish environment form conversion

* Replace accordion on settings form with material

* Fix initial environment not open

* Expand first queue by default

* Migrated slack form added reveal password

* Email alias grid in material

* Email alias grid migrated to Material

* JIRA form converted to Material

* Fix settings save and cancel

* Completed deploy form to Material

* Convert Badge Form to material

* Add color preview for badges

* Replaced toast with styled snackbar

* Move side nav to material

* Menu toggle with animations

* Backdrop and hide on mobile

* Convert side-nav to material

* Styled side nav

* Add services working

* Settings saving

* Services saving and loading correctly

* Removed all devextreme dependencies

* Fixed unauthorized page showing side nav and add reboot

* Lowered side of settings
  • Loading branch information
greggbjensen authored Aug 22, 2024
1 parent 4e6224f commit d62cd26
Show file tree
Hide file tree
Showing 152 changed files with 4,068 additions and 23,893 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private string CreateJwt(string gitHubToken)
new Claim(JwtRegisteredClaimNames.Jti,
Guid.NewGuid().ToString())
}),
Expires = DateTime.UtcNow.AddMinutes(5),
Expires = DateTime.UtcNow.AddHours(8), // Same time as GitHub token expiration.
Issuer = _jwtOptions.Issuer,
Audience = _jwtOptions.Audience,
SigningCredentials = new SigningCredentials(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public async Task<bool> HasOwnerAccessAsync(string owner)
}
catch (Exception ex)
{
_logger.LogWarning(ex, $"User did not have access to {owner}, trying user account");
_logger.LogWarning($"User did not have access to {owner}, trying user account.\n{ex.Message}");
}

if (!hasAccess)
Expand All @@ -109,9 +109,9 @@ public async Task<bool> HasOwnerAccessAsync(string owner)
var user = await _client.User.Current();
hasAccess = string.Equals(owner, user.Login, StringComparison.OrdinalIgnoreCase);
}
catch (Exception e)
catch (Exception ex)
{
_logger.LogWarning(e, $"User did not have access {owner} user account");
_logger.LogWarning($"User did not have access {owner} user account.\n {ex.Message}");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ public async Task<DeployStateComparison> CompareDeployStateAsync(DeployStateComp
var sourceState = await GetOrCreateDeployState(input.Owner, input.Repo, sourceStateName);
var targetState = await GetOrCreateDeployState(input.Owner, input.Repo, targetStateName);

var targetServiceLookUp = targetState.Services.ToDictionary(s => s.Name, s => s,
var targetServiceLookUp = targetState.Services!.ToDictionary(s => s.Name, s => s,
StringComparer.OrdinalIgnoreCase);
var remainingServices = new List<DeployedService>(targetState.Services);
var serviceComparisons = new List<ServiceComparison>(sourceState.Services.Count);
var remainingServices = new List<DeployedService>(targetState.Services!);
var serviceComparisons = new List<ServiceComparison>(sourceState.Services!.Count);
foreach (var sourceService in sourceState.Services)
{
var serviceComparison = new ServiceComparison
Expand Down Expand Up @@ -191,6 +191,11 @@ private async Task<DeployState> GetOrCreateDeployState(string owner, string repo
await _parameterStore.SetAsync(owner, repo, name, state);
}

if (state.Services == null)
{
state.Services = new List<DeployedService>();
}

return state;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
public class DeployState
{
public int PullNumber { get; set; }
public List<DeployedService> Services { get; set; } = null!;
public List<DeployedService>? Services { get; set; } = null!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static IServiceCollection AddGitHubAuthentication(this IServiceCollection
IssuerSigningKey = securityKey,
ValidateIssuer = true,
ValidateAudience = true,
ValidateLifetime = false,
ValidateLifetime = true,
ValidateIssuerSigningKey = true,
NameClaimType = JwtRegisteredClaimNames.Sub
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Net;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption;
Expand Down Expand Up @@ -52,7 +53,7 @@ public static IServiceCollection AddPrDeployApi(this IServiceCollection services
var userToken = s.GetRequiredService<ISecurityContext>().UserToken;
if (string.IsNullOrEmpty(userToken))
{
throw new BadHttpRequestException("No token in security context.");
throw new HttpRequestException("No token in security context.", null, HttpStatusCode.Unauthorized);
}

var credentials = new Credentials(userToken);
Expand Down
5 changes: 5 additions & 0 deletions prdeploy-api/src/PrDeploy.Api/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"Aws": {
"Region": "us-west-2",
"Profile": "prdeploy",
"SecretPathPrefix": "/prdeploy"
},
"Serilog": {
"MinimumLevel": {
"Default": "Debug"
Expand Down
12 changes: 0 additions & 12 deletions prdeploy-app/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,12 @@
"inlineStyleLanguage": "scss",
"assets": ["src/favicon.ico", "src/assets"],
"styles": [
"node_modules/devextreme/dist/css/dx.common.css",
"node_modules/bootstrap-icons/font/bootstrap-icons.css",
"src/themes/generated/theme.prdeploy.scss",
"src/themes/m3-theme.scss",
"src/dx-styles.scss",
"src/styles.scss"
],
"stylePreprocessorOptions": {
"includePaths": ["src/sass"]
},
"allowedCommonJsDependencies": [
"jszip",
"devexpress-diagram",
"devexpress-gantt",
"devextreme-quill",
"devextreme-showdown",
"country-state-city-slim"
],
"scripts": ["node_modules/marked/marked.min.js", "node_modules/emoji-toolkit/lib/js/joypixels.min.js"]
},
"configurations": {
Expand Down
35 changes: 0 additions & 35 deletions prdeploy-app/devextreme.json

This file was deleted.

Loading

0 comments on commit d62cd26

Please sign in to comment.