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

Added timeline and data to timeline, and created timeline.test.js file #9

Merged
merged 9 commits into from
Dec 14, 2020

Conversation

jstewart8053
Copy link
Contributor

@jstewart8053 jstewart8053 commented Dec 14, 2020

Description

Created Timeline, and populated it with the 5 most recent timeline events. Added nanoid library to give unique keys to items, and created a function to replace the 'source' link with names to the actual websites (and made websites open in new tab). Also added CSS to center header and display timeline event details according to mock-up. Replaced Moment with luxon to parse dates.
Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Change Status

  • Complete, tested, ready to review and merge
  • Complete, but not tested (may need new tests)
  • Incomplete/work-in-progress, PR is for discussion/feedback

How Has This Been Tested?

  • Test A Timeline.test.js was created to test component rendering. Will add more tests once the modal is added.

  • Test B

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My code has been reviewed by at least one peer
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • There are no merge conflicts

Note: this is one error message that is appearing in console that is being caused by an internal issue with the Timeline library. This is a known issue and is currently documented here joshwnj/react-visibility-sensor#178.
This error does not affect the rendering of this component, nor will it affect any other components or cause any breaking changes. This error should not appear in production.
findDomNode

Copy link
Contributor

@mrockingham mrockingham left a comment

Choose a reason for hiding this comment

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

Code looks clean and easy to understand

src/state/query_hooks/useTimeline.js Show resolved Hide resolved
@@ -0,0 +1,7 @@
import React from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

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

What else can we test about this component? Think about the different states that it can be in and how you might test that it is or isn't in one of those states.

import { Timeline, TimelineItem } from 'vertical-timeline-component-for-react';
import Moment from 'react-moment';
Copy link
Contributor

Choose a reason for hiding this comment

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

Was moment removed in this pull request?

Copy link
Contributor

Choose a reason for hiding this comment

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

Confirm, Moment was removed.

src/components/timeline/RecentTimeline.js Show resolved Hide resolved
<Timeline lineColor={'#</Timeline>ddd'}>
{timelineQuery.data.map(details => {
return (
<TimelineItem
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should consider moving this TimeLineItem component to its own file. It has a few moving pieces and I think digesting it on its own will be simpler for an unfamiliar dev. It also increases the maintainability of the component because now someone can work on changes to the list item while someone does other changes to the list itself.

Non-critical

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So we can save this for the second release? So the PR can be merged after the testing is finished?

Copy link
Contributor

@mrockingham mrockingham left a comment

Choose a reason for hiding this comment

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

Code looks clean and working

@jlong5795 jlong5795 merged commit b495656 into main Dec 14, 2020
@jlong5795 jlong5795 deleted the feature/timeline branch December 14, 2020 22:50
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.

None yet

3 participants