Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fab for announcements #109

Merged
merged 17 commits into from
Aug 19, 2024
Merged

Add fab for announcements #109

merged 17 commits into from
Aug 19, 2024

Conversation

mattystank
Copy link
Contributor

Includes

  • Notification Panel
  • Update content for Communication FAB ( due to other ticket on the board)
  • Notification History page/timeline
  • Notification Service to hold notifications

@mattystank mattystank requested a review from drbgfc August 12, 2024 15:08
]
}

export const fetchMarkdownData = async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code looks familiar to somethign I wrote so I'm just wondering - are we duplicating it vs referencing it or did we just move it here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically, if we can externalize it to one function, or, at least, externalize the constants so they aren't defined 2x, that'd be best. Of course, I haven't verified that this wasn't just moved and everything references this now. So, just a note.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or that this is unique. I see it's really just some setters, so might be appropriate. And may even be the only place these constants are now

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I see now that both CommunicationFab and Notifications use the release version and date so they both duplicate the same code essentially and have their own states for it. Instead, we should have that done in one location and imported into the two componenents. That way, they are synchronized, simplified, shared code, and it improves performance. I just intended a quick scan since Anusha is reviewing so feel free to correct me if I'm wrong.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Dan's comments, if we can call this code one time instead of duplicate that would be optimal. May be having a server component, make a call there and pass on the data to Communication and Notifications components so you avoid the multiple fetch calls. Just an idea!


export default function NotificationHistory() {
const [notifications, setNotifications] = useState<Announcement[]>([]) // TypeScript type for notifications
const [loading, setLoading] = useState<boolean>(true) // TypeScript type for loading state
Copy link
Contributor

@drbgfc drbgfc Aug 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The notifications comment makes sense, although maybe not needed, as Announcement looks like a custom type. However, the loading and error state comments should be removed because the types are generic types so I'm not sure what the comments are trying to imply?

Copy link
Contributor

@drbgfc drbgfc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just scanned it, so, we will wait for Anusha to do a real review, but, you knocked out a lot of work man, thanks!

}

export const fetchMarkdownData = async () => {
const releaseVersionURL = 'https://raw.githubusercontent.com/onc-healthit/site-content/master/site-ui-4/version.md'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These can be moved to env variables and defined in .env file as there can used during build time. So, you dont have define them twice and just reference the variables.

Copy link
Contributor

@akanuri9 akanuri9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added my comments, please review and make change to add env variables for the mentioned consts.

Copy link
Contributor

@akanuri9 akanuri9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thanks for making the changes.

@akanuri9 akanuri9 merged commit 51d2d78 into dev Aug 19, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants