Conversation
… with UX team's suggestions.
…edback - Implemented USWDS table and styling
BuckinghamAJ
left a comment
There was a problem hiding this comment.
Had the header and solicitation report, not sure if that was expected.
Requested a few changes, especially simplifying the component function a bit with a few tweaks to how you are structuring the code.
There was a problem hiding this comment.
Header component meant to be in here?
There was a problem hiding this comment.
Was this meant to be in this PR as well?
| element.formattedDate = moment(element.postedDate).format('L'); | ||
| }); | ||
| } else { | ||
| console.log('Error processing parse status for solicitation ' + data.solNum); |
There was a problem hiding this comment.
Do we want this data in console.log? Or maybe console.warning? Or console.error? Thoughts?
| }]; | ||
| } | ||
|
|
||
| this.step1 = data.history?.filter(e => |
There was a problem hiding this comment.
Instead of repeating the code multiple times, I would break out the code into a singular function to call.
| this.solicitationService.getSolicitation(this.solicitationID).subscribe( | ||
| {next: data => { | ||
| this.solicitationService.getSolicitation(this.solicitationID).subscribe({ | ||
| next: data => { |
There was a problem hiding this comment.
I would recommend figure out how you could get data be placed into a singular value by either subscribe or the extras.state and then pass that along so you don't have to rewrite the same code/same function calls.
Wrap that way of getting data into a try/catch then you can do a single write out a single error message.
Code Review Changes Documentation1. Error Logging ImprovementOriginal Comment:
Changes Made:
// Before
console.log('Error processing parse status for solicitation ' + data.solNum);
// After
console.error('Error processing parse status for solicitation ' + data.solNum);2. Code Duplication in Step ProcessingOriginal Comment:
Changes Made:
// Before
this.step1 = data.history?.filter(e =>
e['action'].indexOf('reviewed solicitation action requested summary') > -1
).length > 0;
// After
private readonly STEP_ACTIONS = {
REVIEW: 'reviewed solicitation action requested summary',
EMAIL: 'sent email to POC',
FEEDBACK: 'provided feedback on the solicitation prediction result'
};
private checkStepCompletion(history: any[], actionText: string): boolean {
return history?.filter(e => e['action'].indexOf(actionText) > -1).length > 0;
}
private processSteps(data: any): void {
this.step1 = this.checkStepCompletion(data.history, this.STEP_ACTIONS.REVIEW);
this.step2 = this.checkStepCompletion(data.history, this.STEP_ACTIONS.EMAIL);
this.step3 = this.checkStepCompletion(data.history, this.STEP_ACTIONS.FEEDBACK);
}3. Data Processing ConsolidationOriginal Comment:
Changes Made:
private processSolicitationData(data: any): void {
try {
this.processParseStatus(data);
this.processSteps(data);
this.setSolicitationData(data);
this.processDocuments();
} catch (error) {
console.error('Error processing solicitation data:', error);
}
}ResultsHoping the refactored code addresses all of Adam's improvement suggestions! |
Pull Request: Solicitation Details Page Enhancements
Overview
This PR improves the layout, styling, and user experience of the Solicitation Details page, aligning with USWDS guidelines and UI team feedback.
Key Changes
Layout and Structure:
feedback-containerandusa-layout-containerfor responsive layout.detaildiv.New Elements:
status-badgeto display compliance status (Compliant/Non-compliant) with USWDS styling.Historybutton for easy navigation to the solicitation's history.usa-alertto display when a solicitation is non-compliant.Styling:
Functionality:
onClickTabsfunction tracks user interactions with the History button.Accessibility:
Code Changes:
Testing:
Please review and provide feedback. Thanks!