From ade5ac1212caca3e0461db69b529487e8644991d Mon Sep 17 00:00:00 2001 From: Derek Holloway Date: Tue, 19 Aug 2025 20:25:11 -0700 Subject: [PATCH 1/7] Create edit company --- .../pages/company/editor/editor.component.html | 4 ++-- .../app/pages/company/editor/editor.component.ts | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Client/src/app/pages/company/editor/editor.component.html b/src/Client/src/app/pages/company/editor/editor.component.html index 7f99919..db1c67f 100644 --- a/src/Client/src/app/pages/company/editor/editor.component.html +++ b/src/Client/src/app/pages/company/editor/editor.component.html @@ -41,7 +41,7 @@
- + @@ -64,7 +64,7 @@
- +
diff --git a/src/Client/src/app/pages/company/editor/editor.component.ts b/src/Client/src/app/pages/company/editor/editor.component.ts index 5ae8f2b..5664d6d 100644 --- a/src/Client/src/app/pages/company/editor/editor.component.ts +++ b/src/Client/src/app/pages/company/editor/editor.component.ts @@ -30,8 +30,19 @@ export class CompanyEditorComponent { }; ngOnInit(){ - // Query param CompanyID -> Edit - // Query param null -> New + this.route.queryParams.subscribe(params => { + const CompanyID = params['CompanyID'] ? +params['CompanyID'] : null; + if (CompanyID !== null){ + this.http.get("api/company?CompanyID=" + CompanyID).subscribe({ + next: data => { + this.newListing = data; + }, + error: err => { + this.ErrorMsg = err.error; + } + }); + } + }); } ngAfterViewInit(){ -- 2.52.0 From 8bb8b4aedf1794210b78a9fa0a2eaf1c496962bc Mon Sep 17 00:00:00 2001 From: Derek Holloway Date: Tue, 19 Aug 2025 20:39:59 -0700 Subject: [PATCH 2/7] Update SetCompany API for better ease of use --- src/Server/Controllers/CompanyController.cs | 29 ++++++++++----------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/Server/Controllers/CompanyController.cs b/src/Server/Controllers/CompanyController.cs index 7838f2c..828bd91 100644 --- a/src/Server/Controllers/CompanyController.cs +++ b/src/Server/Controllers/CompanyController.cs @@ -29,25 +29,24 @@ namespace BoredCareers.Controllers { } [HttpPost] - public async Task SetCompany([FromBody] Company company, [FromQuery] bool newCompany = false) { + public async Task SetCompany([FromBody] Company company) { if (isLoggedIn()) { - if (newCompany) { - Company? test = await _databaseService.GetCompany(Convert.ToInt32(company.ID)); - if (test == null) { - company.ID = await _databaseService.SetCompany(company); + Company? test = await _databaseService.GetCompany(Convert.ToInt32(company.ID)); + if (test == null) { + company.ID = await _databaseService.SetCompany(company); - - await _databaseService.SetEmployee(new Employee() { - AccountID = getLoggedInUserID(), - AccountName = getLoggedInUser().UserName, - AccountEmail = getLoggedInUser().Email, - Company = company - }); - return Ok(); - } - return NotFound("The company already exists"); + await _databaseService.SetEmployee(new Employee() { + AccountID = getLoggedInUserID(), + AccountName = getLoggedInUser().UserName, + AccountEmail = getLoggedInUser().Email, + Company = company + }); + return Ok(); } else { if (await isLoggedInUserEmployeeOf(Convert.ToInt32(company.ID))) { + if (company.Email != test.Email) { + company.EmailVerified = false; + } await _databaseService.SetCompany(company); return Ok(); } -- 2.52.0 From fee10939bb4443f7dd1ce0dfe728f5fd7eb4fd14 Mon Sep 17 00:00:00 2001 From: Derek Holloway Date: Tue, 19 Aug 2025 20:42:30 -0700 Subject: [PATCH 3/7] Standardize new vs update --- .../app/pages/company/editor/editor.component.html | 6 +++++- .../app/pages/company/editor/editor.component.ts | 6 ++++-- .../app/pages/jobs/editor/jobeditor.component.html | 6 +++++- .../app/pages/jobs/editor/jobeditor.component.ts | 14 +++++--------- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/Client/src/app/pages/company/editor/editor.component.html b/src/Client/src/app/pages/company/editor/editor.component.html index db1c67f..53a4e56 100644 --- a/src/Client/src/app/pages/company/editor/editor.component.html +++ b/src/Client/src/app/pages/company/editor/editor.component.html @@ -156,7 +156,11 @@
- + @if(isNewCompany){ + + }@else{ + + }
diff --git a/src/Client/src/app/pages/jobs/editor/jobeditor.component.ts b/src/Client/src/app/pages/jobs/editor/jobeditor.component.ts index 941e2b4..df01516 100644 --- a/src/Client/src/app/pages/jobs/editor/jobeditor.component.ts +++ b/src/Client/src/app/pages/jobs/editor/jobeditor.component.ts @@ -20,9 +20,9 @@ export class JobEditorComponent { currentStep: number = 0; public Listing: JobListing = new JobListing(); + public isNewListing: boolean = true; public mode: string = ""; - public modeID: number = 0; constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) { this.title.setTitle("Jobs - Editor | BoredCareers"); @@ -39,10 +39,11 @@ export class JobEditorComponent { this.router.navigate([""]); }else if (CompanyID !== null ){ this.mode = "new"; - this.modeID = CompanyID; + this.Listing.companyID = CompanyID; }else if(JobID !== null){ this.mode = "edit"; - this.modeID = JobID; + this.Listing.id = JobID; + this.isNewListing = false; }else if (CompanyID === null && JobID === null){ this.router.navigate([""]); } @@ -90,14 +91,9 @@ export class JobEditorComponent { } SubmitForm(jobListing: JobListing){ - if (this.mode === "new"){ - jobListing.companyID = this.modeID; - } else if (this.mode === "edit"){ - jobListing.id = this.modeID; - } this.http.post("api/joblisting", jobListing).subscribe({ next: data => { - this.router.navigate([""]); + this.router.navigate(["/company"]); }, error: err => { this.ErrorMsg = err.error; -- 2.52.0 From dd62bc36f48847e3fa147ab01c2042f7c80521d1 Mon Sep 17 00:00:00 2001 From: Derek Holloway Date: Tue, 19 Aug 2025 20:42:37 -0700 Subject: [PATCH 4/7] fix nav --- src/Client/src/app/pages/resumes/editor/editor.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client/src/app/pages/resumes/editor/editor.component.ts b/src/Client/src/app/pages/resumes/editor/editor.component.ts index d7fe920..df4bdfc 100644 --- a/src/Client/src/app/pages/resumes/editor/editor.component.ts +++ b/src/Client/src/app/pages/resumes/editor/editor.component.ts @@ -84,7 +84,7 @@ export class ResumesEditorComponent { resume.accountID = this.auth.loggedInUser.id; this.http.post("api/resume", resume).subscribe({ next: data => { - this.router.navigate(["/"]); + this.router.navigate(["/resumes"]); }, error: err => { this.ErrorMsg = err.error; -- 2.52.0 From f1366ffe3b36350c7b1a29a1c18c29051b45de1d Mon Sep 17 00:00:00 2001 From: Derek Holloway Date: Tue, 19 Aug 2025 21:17:18 -0700 Subject: [PATCH 5/7] Remove unused library --- src/Server/Program.cs | 1 - src/Server/Services/ResumeService.cs | 93 ---------------------------- 2 files changed, 94 deletions(-) delete mode 100644 src/Server/Services/ResumeService.cs diff --git a/src/Server/Program.cs b/src/Server/Program.cs index 4301875..b4435a7 100755 --- a/src/Server/Program.cs +++ b/src/Server/Program.cs @@ -175,7 +175,6 @@ builder.Services.AddRateLimiter(options => { //////////////////////////////// builder.Services.AddHostedService(); -ResumeService.init(); //////////////////////////////// ///// ASPNET Core Function ///// diff --git a/src/Server/Services/ResumeService.cs b/src/Server/Services/ResumeService.cs deleted file mode 100644 index 92686f6..0000000 --- a/src/Server/Services/ResumeService.cs +++ /dev/null @@ -1,93 +0,0 @@ -using Ganss.Xss; - -namespace BoredCareers.Services { - public class ResumeService { - - static HtmlSanitizer _self = new HtmlSanitizer(); - - public static void init() { - // Clear default allowed tags and attributes - _self.AllowedAttributes.Clear(); - _self.AllowedSchemes.Clear(); - _self.AllowedAtRules.Clear(); - _self.AllowedClasses.Clear(); - - // Allowed HTML Tags - _self.AllowedTags.Clear(); - string[] safeTags = [ - "b", "strong", "i", "em", "u", "small", "mark", "del", "ins", "sub", "sup", - "p", "br", "hr", "div", "span", - "section", "article", "header", "footer", "aside", "main", "nav", - "ul", "ol", "li", "dl", "dt", "dd", - "h1", "h2", "h3", "h4", "h5", "h6", - "blockquote", "q", "cite", - "code", "pre", "samp", "kbd", "var", - "table", "thead", "tbody", "tfoot", "tr", "td", "th", - ]; - foreach (string cur in safeTags) { - _self.AllowedTags.Add(cur); - } - - // Allow inline styles only - _self.AllowedAttributes.Add("style"); - string[] safeCssProperties = [ - "align-content", "align-items", "align-self", "all", - "animation", "animation-delay", "animation-direction", "animation-duration", - "animation-fill-mode", "animation-iteration-count", "animation-name", "animation-play-state", - "animation-timing-function", "backface-visibility", "background-color", "background-clip", - "background-origin", "background-position", "background-repeat", "background-size", - "border", "border-bottom", "border-bottom-color", "border-bottom-left-radius", - "border-bottom-right-radius", "border-bottom-style", "border-bottom-width", "border-color", - "border-image-outset", "border-image-repeat", "border-image-slice", "border-image-source", - "border-image-width", "border-left", "border-left-color", "border-left-style", - "border-left-width", "border-radius", "border-right", "border-right-color", - "border-right-style", "border-right-width", "border-spacing", "border-style", - "border-top", "border-top-color", "border-top-left-radius", "border-top-right-radius", - "border-top-style", "border-top-width", "border-width", "bottom", - "box-decoration-break", "box-shadow", "box-sizing", "caption-side", - "clear", "color", "column-count", "column-fill", - "column-gap", "column-rule-color", "column-rule-style", "column-rule-width", - "column-span", "column-width", "columns", "counter-increment", - "counter-reset", "direction", "display", "empty-cells", - "flex", "flex-basis", "flex-direction", "flex-flow", - "flex-grow", "flex-shrink", "flex-wrap", "float", - "font-family", "font-feature-settings", "font-kerning", "font-language-override", - "font-size", "font-size-adjust", "font-stretch", "font-style", - "font-synthesis", "font-variant", "font-variant-alternates", "font-variant-caps", - "font-variant-east-asian", "font-variant-ligatures", "font-variant-numeric", "font-variant-position", - "font-weight", "grid", "grid-area", "grid-auto-columns", - "grid-auto-flow", "grid-auto-rows", "grid-column", "grid-column-end", - "grid-column-gap", "grid-column-start", "grid-gap", "grid-row", - "grid-row-end", "grid-row-gap", "grid-row-start", "grid-template", - "grid-template-areas", "grid-template-columns", "grid-template-rows", "height", - "hyphens", "image-rendering", "isolation", "justify-content", - "left", "letter-spacing", "line-height", "list-style-position", - "list-style-type", "margin", "margin-bottom", "margin-left", - "margin-right", "margin-top", "max-height", "max-width", - "min-height", "min-width", "object-fit", "object-position", - "opacity", "order", "orphans", "outline-color", - "outline-offset", "outline-style", "outline-width", "overflow", - "overflow-wrap", "overflow-x", "overflow-y", "padding", - "padding-bottom", "padding-left", "padding-right", "padding-top", - "page-break-after", "page-break-before", "page-break-inside", "perspective", - "perspective-origin", "pointer-events", "position", "quotes", - "resize", "right", "scroll-behavior", "table-layout", - "tab-size", "text-align", "text-align-last", "text-combine-upright", - "text-indent", "text-justify", "text-orientation", "text-overflow", - "text-shadow", "text-transform", "text-underline-position", "top", - "transform", "transform-origin", "transform-style", "transition", - "transition-delay", "transition-duration", "transition-property", "transition-timing-function", - "unicode-bidi", "user-select", "vertical-align", "visibility", - "white-space", "widows", "width", "word-break", - "word-spacing", "word-wrap", "writing-mode", "z-index" - ]; - foreach (string cur in safeCssProperties) { - _self.AllowedCssProperties.Add(cur); - } - } - - public static string RemoveJavascript(string InputHTML) { - return _self.Sanitize(InputHTML); - } - } -} \ No newline at end of file -- 2.52.0 From 3bfbfb9c4a41f477a0614259bf886ac1b6d4b79c Mon Sep 17 00:00:00 2001 From: Derek Holloway Date: Tue, 19 Aug 2025 21:17:48 -0700 Subject: [PATCH 6/7] Cleanup Libraries -> 92M down to 22M compiled --- src/Server/Controllers/ApplicationController.cs | 1 - src/Server/Controllers/AuthenticationController.cs | 1 - src/Server/Controllers/CompanyController.cs | 2 +- src/Server/Controllers/EmployeeController.cs | 1 - src/Server/Controllers/JobListingController.cs | 1 - src/Server/Controllers/ResumeController.cs | 1 - src/Server/Server.csproj | 12 ++---------- 7 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/Server/Controllers/ApplicationController.cs b/src/Server/Controllers/ApplicationController.cs index 0b9f1d6..5d74675 100644 --- a/src/Server/Controllers/ApplicationController.cs +++ b/src/Server/Controllers/ApplicationController.cs @@ -1,7 +1,6 @@ using Microsoft.AspNetCore.Mvc; using BoredCareers.Services.DatabaseService; using BoredCareers.Entities; -using System.Web.Http; namespace BoredCareers.Controllers { [ApiController] diff --git a/src/Server/Controllers/AuthenticationController.cs b/src/Server/Controllers/AuthenticationController.cs index 7fe6825..41307d7 100755 --- a/src/Server/Controllers/AuthenticationController.cs +++ b/src/Server/Controllers/AuthenticationController.cs @@ -1,7 +1,6 @@ using Microsoft.AspNetCore.Mvc; using BoredCareers.Services.DatabaseService; using BoredCareers.Entities; -using System.Web.Http; using System.Text.Json; using System.Text; diff --git a/src/Server/Controllers/CompanyController.cs b/src/Server/Controllers/CompanyController.cs index 828bd91..003d06f 100644 --- a/src/Server/Controllers/CompanyController.cs +++ b/src/Server/Controllers/CompanyController.cs @@ -1,7 +1,6 @@ using Microsoft.AspNetCore.Mvc; using BoredCareers.Services.DatabaseService; using BoredCareers.Entities; -using System.Web.Http; using BoredCareers.Services; namespace BoredCareers.Controllers { @@ -41,6 +40,7 @@ namespace BoredCareers.Controllers { AccountEmail = getLoggedInUser().Email, Company = company }); + await SendVerify(Convert.ToInt32(company.ID)); return Ok(); } else { if (await isLoggedInUserEmployeeOf(Convert.ToInt32(company.ID))) { diff --git a/src/Server/Controllers/EmployeeController.cs b/src/Server/Controllers/EmployeeController.cs index e5d4e7d..0a785ce 100644 --- a/src/Server/Controllers/EmployeeController.cs +++ b/src/Server/Controllers/EmployeeController.cs @@ -1,7 +1,6 @@ using Microsoft.AspNetCore.Mvc; using BoredCareers.Services.DatabaseService; using BoredCareers.Entities; -using System.Web.Http; namespace BoredCareers.Controllers { [ApiController] diff --git a/src/Server/Controllers/JobListingController.cs b/src/Server/Controllers/JobListingController.cs index 63a6941..18e90c3 100644 --- a/src/Server/Controllers/JobListingController.cs +++ b/src/Server/Controllers/JobListingController.cs @@ -1,7 +1,6 @@ using Microsoft.AspNetCore.Mvc; using BoredCareers.Services.DatabaseService; using BoredCareers.Entities; -using System.Web.Http; namespace BoredCareers.Controllers { [ApiController] diff --git a/src/Server/Controllers/ResumeController.cs b/src/Server/Controllers/ResumeController.cs index 02ae46a..2d5c67b 100644 --- a/src/Server/Controllers/ResumeController.cs +++ b/src/Server/Controllers/ResumeController.cs @@ -1,7 +1,6 @@ using Microsoft.AspNetCore.Mvc; using BoredCareers.Services.DatabaseService; using BoredCareers.Entities; -using System.Web.Http; namespace BoredCareers.Controllers { [ApiController] diff --git a/src/Server/Server.csproj b/src/Server/Server.csproj index 0225aff..88017e7 100755 --- a/src/Server/Server.csproj +++ b/src/Server/Server.csproj @@ -8,18 +8,10 @@ - - - - - + + - - - - - -- 2.52.0 From 66cf419165798822adcd172db8bec6aae53fd02b Mon Sep 17 00:00:00 2001 From: Derek Holloway Date: Tue, 19 Aug 2025 21:17:55 -0700 Subject: [PATCH 7/7] Update ToDo --- ToDo.yaml | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/ToDo.yaml b/ToDo.yaml index c4a3165..d0eb9cb 100755 --- a/ToDo.yaml +++ b/ToDo.yaml @@ -1,13 +1,4 @@ Server: - Emails: - Dont follow theme of website - - When a company is created: - Send email -> verify ownership of the email - - Resume: - Block API Access as much as possible [ Disallow AI keyword filters ] - Auth: Make sure autorenew works @@ -21,13 +12,9 @@ Server: Need to update notification email Create page to notify cx that their work email has been verified - Server.csproj: - Find a way to keep all the libraries up to date - Client: jobs/editor: Job Listing Skills exists but isn't implimented in the UI - Tab doesnt do anything Want to add completed job listing preview at end of carosel Resume: @@ -41,23 +28,17 @@ Client: Mark ghost listings to allow users to be informed and put companies on blast company/editor: - Need to lookup company before making a new one - Tab key does nothing + Keyboard Tab key does nothing Format phone number for database Check DataType's for email and phone. - Setup QueryParam's for Edit and New Edit employees not implimented yet resume/editor: - Not fully tested yet - When adding new fields the fields above it glitch out and disappear There is no data validation Company: Need to impliment Add employee Need to impliment Remove employee - Edit Company -> Dont allow edit of company email due to it being verified - database: Add Applied Jobs Table \ No newline at end of file -- 2.52.0