From c48464f4559f11e1c96641106c90e0f174c3da40 Mon Sep 17 00:00:00 2001 From: Adam Buckingham Date: Thu, 16 Jan 2025 10:03:52 -0500 Subject: [PATCH 1/3] Brought back ART Modal point to art-api-dev --- .../results-detail/art-modal/art-modal.component.html | 2 +- .../summary/results-detail/results-detail.component.html | 5 ++++- src/environments/environment.dev.ts | 2 +- src/environments/environment.local.ts | 2 +- src/environments/environment.staging.ts | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/app/solicitation/summary/results-detail/art-modal/art-modal.component.html b/src/app/solicitation/summary/results-detail/art-modal/art-modal.component.html index 437fb7d..e5084c1 100644 --- a/src/app/solicitation/summary/results-detail/art-modal/art-modal.component.html +++ b/src/app/solicitation/summary/results-detail/art-modal/art-modal.component.html @@ -1,4 +1,4 @@ - + {{solicitation.title}}
+ +
diff --git a/src/environments/environment.dev.ts b/src/environments/environment.dev.ts index 4c1b912..d4d0fb3 100644 --- a/src/environments/environment.dev.ts +++ b/src/environments/environment.dev.ts @@ -8,7 +8,7 @@ export const environment = { SERVER_URL: 'https://srt-server-dev.app.cloud.gov/api', EMAIL_NOTIFICATION: true, FILE_UPLOAD_API: 'http://srt-server-dev.app.cloud.gov/file/upload', - ART_API_SERVER:'https://art-api.app.cloud.gov', + ART_API_SERVER:'https://art-api-dev.app.cloud.gov', USE_CLIENT_EMAIL: true, ENVIRONMENT: 'dev', feature_flags: { diff --git a/src/environments/environment.local.ts b/src/environments/environment.local.ts index 2dceea9..c4cba32 100644 --- a/src/environments/environment.local.ts +++ b/src/environments/environment.local.ts @@ -9,7 +9,7 @@ export const environment = { SERVER_URL: 'http://localhost:3000/api', EMAIL_NOTIFICATION: true, FILE_UPLOAD_API: 'http://localhost:3000/file/upload', - ART_API_SERVER:'https://art-api.app.cloud.gov', + ART_API_SERVER:'https://art-api-dev.app.cloud.gov', needToken: false, USE_CLIENT_EMAIL: true, ENVIRONMENT: 'local', diff --git a/src/environments/environment.staging.ts b/src/environments/environment.staging.ts index 128b86c..6d94615 100644 --- a/src/environments/environment.staging.ts +++ b/src/environments/environment.staging.ts @@ -8,7 +8,7 @@ export const environment = { SERVER_URL: 'https://srt-server-staging.app.cloud.gov/api', EMAIL_NOTIFICATION: true, FILE_UPLOAD_API: 'http://srt-server-staging.app.cloud.gov/file/upload', - ART_API_SERVER:'https://art-api.app.cloud.gov', + ART_API_SERVER:'https://art-api-dev.app.cloud.gov', USE_CLIENT_EMAIL: true, ENVIRONMENT: 'staging', feature_flags: { From 8f4874094f4e0cf3b9b64d66b362f16dd0fba11a Mon Sep 17 00:00:00 2001 From: Adam Buckingham Date: Thu, 16 Jan 2025 10:14:15 -0500 Subject: [PATCH 2/3] clearing the art_body and testing --- .../art-modal/art-modal.component.spec.ts | 12 ++++++++++++ .../results-detail/art-modal/art-modal.component.ts | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/src/app/solicitation/summary/results-detail/art-modal/art-modal.component.spec.ts b/src/app/solicitation/summary/results-detail/art-modal/art-modal.component.spec.ts index df74d22..80c38f1 100644 --- a/src/app/solicitation/summary/results-detail/art-modal/art-modal.component.spec.ts +++ b/src/app/solicitation/summary/results-detail/art-modal/art-modal.component.spec.ts @@ -35,4 +35,16 @@ describe('ArtIframeDialogComponent', () => { it('should create', () => { expect(component).toBeTruthy(); }); + + it('should clear art_body on clearAll', () => { + component.art_body = { someKey: 'someValue' }; + component.clearAll(); + expect(component.art_body).toEqual({}); + }); + + it('should clear art_body on updateLanguage', () => { + component.art_body = { someKey: 'someValue' }; + component.updateLanguage(); + expect(component.art_body).toEqual({}); + }); }); diff --git a/src/app/solicitation/summary/results-detail/art-modal/art-modal.component.ts b/src/app/solicitation/summary/results-detail/art-modal/art-modal.component.ts index 4fabb23..d6a0df4 100644 --- a/src/app/solicitation/summary/results-detail/art-modal/art-modal.component.ts +++ b/src/app/solicitation/summary/results-detail/art-modal/art-modal.component.ts @@ -257,6 +257,8 @@ export class ArtIframeDialogComponent { } + this.art_body = {}; + }, error: error => { let errors: string[] = []; @@ -291,6 +293,7 @@ export class ArtIframeDialogComponent { this.selectedSubcategories = []; this.display = 'none'; this.art_language = null; + this.art_body = {}; this.categories.forEach(category => { category.isChecked = false @@ -371,6 +374,7 @@ export class ArtIframeDialogComponent { } this.art_language = []; // Remove art language + this.art_body = {}; // Remove art body this.display = 'none'; } From e3be687be81ed343547010ce39f785bac7438758 Mon Sep 17 00:00:00 2001 From: Adam Buckingham Date: Thu, 16 Jan 2025 10:20:23 -0500 Subject: [PATCH 3/3] Debug messages instead of console.log --- .../art-modal/art-modal.component.ts | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/app/solicitation/summary/results-detail/art-modal/art-modal.component.ts b/src/app/solicitation/summary/results-detail/art-modal/art-modal.component.ts index d6a0df4..edbc6a4 100644 --- a/src/app/solicitation/summary/results-detail/art-modal/art-modal.component.ts +++ b/src/app/solicitation/summary/results-detail/art-modal/art-modal.component.ts @@ -177,7 +177,7 @@ export class ArtIframeDialogComponent { } processCategory(category){ - console.log('category (processCategory):', category) + console.debug('category (processCategory):', category) let artBody = {} @@ -202,7 +202,7 @@ export class ArtIframeDialogComponent { artBody[category.art_api] = true } - console.log('Art Body (processCategory):', artBody) + console.debug('Art Body (processCategory):', artBody) return artBody @@ -210,8 +210,8 @@ export class ArtIframeDialogComponent { createARTBody(){ // Make ART JSON body in structure shown above - //console.log('selected Categories:', this.selectedCategories) - //console.log('selected SubCategories:', this.selectedSubcategories) + //console.debug('selected Categories:', this.selectedCategories) + //console.debug('selected SubCategories:', this.selectedSubcategories) this.categories.forEach(category => { @@ -226,8 +226,8 @@ export class ArtIframeDialogComponent { onSubmit(): void { // Process ART data here - console.log('Selected Categories:', this.selectedCategories) - console.log('Selected Subcategories:', this.selectedSubcategories) + console.debug('Selected Categories:', this.selectedCategories) + console.debug('Selected Subcategories:', this.selectedSubcategories) if (this.selectedCategories.length === 0 && this.selectedSubcategories.length === 0) { this.alert_display = 'inherit' @@ -239,19 +239,19 @@ export class ArtIframeDialogComponent { this.createARTBody() - console.log('Art Body:', this.art_body) + console.debug('Art Body:', this.art_body) this.artService.getArtLanguage(this.art_body) .subscribe({ next: data => { - console.log('Art Language Data:', data) + console.debug('Art Language Data:', data) this.art_language = data; if (data) { this.display = 'inherit' this.solicitationService.postSolicitationART(this.solicitationId, data).subscribe({ - next: (response) => console.log('Post Solicitation ART Response:', response), + next: (response) => console.debug('Post Solicitation ART Response:', response), error: (error) => console.error('Post Solicitation ART Error:', error) }) @@ -265,8 +265,8 @@ export class ArtIframeDialogComponent { const replaceFieldNames = (error: string, fieldNames: { [key: string]: string }): string => { return error.replace(/'([^']+)'/g, (match, p1) => { - console.log('Match:', match) - console.log('P1:', p1) + console.debug('Match:', match) + console.debug('P1:', p1) const parts = p1.split('.'); const art_api = parts[parts.length - 1]; return fieldNames[art_api] ? `'${fieldNames[art_api]}'` : match; @@ -285,7 +285,7 @@ export class ArtIframeDialogComponent { } }); - console.log('Art Language:', this.art_language) + console.debug('Art Language:', this.art_language) } clearAll() { @@ -322,7 +322,7 @@ export class ArtIframeDialogComponent { } onCategoryChange(selected) { - console.log('Selected:', selected) + console.debug('Selected:', selected) this.selectedCategories = selected.selectedCategories; let parent = selected.parent; @@ -335,13 +335,13 @@ export class ArtIframeDialogComponent { } - console.log('Selected Subcategories:', this.selectedSubcategories) + console.debug('Selected Subcategories:', this.selectedSubcategories) } copyToClipBoard(elem) { navigator.clipboard.writeText(elem.innerText) .then(() => { - console.log('Text copied to clipboard'); + console.debug('Text copied to clipboard'); // Additional code after copying to clipboard }) .catch((error) => {