Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

feature: implement mention link #65

Merged
merged 14 commits into from
Oct 19, 2018
Merged

Conversation

johnanisere
Copy link
Contributor

Linked issue

User description's clickable GitHub mentions. As mentioned in issue #59.

@johnanisere johnanisere changed the title Implement mention link feature: implement mention link Oct 18, 2018
@johnanisere
Copy link
Contributor Author

@byCedric Have you seen this? what do you think?

@byCedric
Copy link
Owner

Hi @johnanisere! I like it, thanks! I'll take care of some small code styling adjustments. I've also added 2 comments, it's nothing big 😄 Thanks a lot ❤️

FYI, I might move the highlight decorators to the organisms/github-user component. This way we have a better separation of concerns and no references to github whatsoever in moluecules/user component. 😄

key={key}
href={mentionLink(segment)}
target="_blank"
rel="noopener noreferrer"
Copy link
Owner

Choose a reason for hiding this comment

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

I always forget the rel attributes on these things 😄 Thanks! I think the noopener is a safe one, but I'm not sure about the noreferrer. Do you have any thoughts in this one?

"@": (segment, match, key) => (
<UserDescriptionHighlight
key={key}
href={mentionLink(segment)}
Copy link
Owner

Choose a reason for hiding this comment

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

I must add a bit more documentation to the highlighter atom I think. In the mentionLink you separate the special character @ from the text right? Luckily I thought about this use case when I built the highlighter, it's the match parameter 😄 But again, this is fully my fault for lack of documentation.


TL;DR; The match parameter is the value you can use here, without having to separate the character from text yourself 😄


The decorator is invoked with the segment, match and key. Take this text for example:

Something something @abc somehting @qwe

This will result in 2x method invocations with the @ decorator with the following arguments:

invocation segment match key
# 0 @abc abc 0
# 1 @qwe qwe 1

@codecov
Copy link

codecov bot commented Oct 19, 2018

Codecov Report

Merging #65 into develop will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop      #65   +/-   ##
========================================
  Coverage    11.01%   11.01%           
========================================
  Files           22       22           
  Lines          118      118           
  Branches        12       12           
========================================
  Hits            13       13           
  Misses          95       95           
  Partials        10       10
Impacted Files Coverage Δ
src/molecules/user/elements.js 0% <0%> (ø) ⬆️
src/molecules/user/user.js 0% <0%> (ø) ⬆️

@byCedric byCedric merged commit 0a0cb92 into byCedric:develop Oct 19, 2018
byCedric pushed a commit that referenced this pull request Dec 1, 2018
# [0.4.0](0.3.1...0.4.0) (2018-12-01)

### Code refactors

* move user description highlights to github user organism ([#68](#68)) ([2575cec](2575cec))
* remove superseded github mentions ([#84](#84)) ([5e9e513](5e9e513))
* upgrade now to version 12.0.0 ([#74](#74)) ([3878702](3878702))
* upgrade react-scripts to version 2.1.0 ([#73](#73)) ([74e8974](74e8974))
* user molecule layout to allow other content ([#63](#63)) ([d1ad708](d1ad708))

### Documentation changes

* add notice about deployments with now v2 ([#83](#83)) ([167a5f3](167a5f3))

### New features

* implement mention link in user molecule ([#65](#65)) ([0a0cb92](0a0cb92))
* prototype github mentions support as a component ([#56](#56)) ([1788b32](1788b32))
* upgrade to now version 2 ([#79](#79)) ([f97f7ab](f97f7ab))

### Pipeline changes

* escape stylelint file glob ([#64](#64)) ([0cc473f](0cc473f))
* limit node versions because of unexpected fetch behaviour ([#82](#82)) ([eb50a5f](eb50a5f))
* test full build in travis to detect feature issues with cra ([#85](#85)) ([5592f94](5592f94))
* upgrade travis with auto-release and security checks ([#81](#81)) ([da79f78](da79f78))

### Testing updates

* add extra tests to atom components ([#67](#67)) ([41d746c](41d746c))
* add extra tests to github provider ([#66](#66)) ([14d6efa](14d6efa))
* add unit tests for github user organism ([#70](#70)) ([4023dc1](4023dc1))
* add unit tests for user molecule ([#69](#69)) ([84eb513](84eb513))
* clean up dirty tests and add app page component test ([#71](#71)) ([addb123](addb123))
byCedric pushed a commit that referenced this pull request Dec 1, 2018
# [0.4.0](0.3.1...0.4.0) (2018-12-01)

### Code refactors

* move user description highlights to github user organism ([#68](#68)) ([2575cec](2575cec))
* remove superseded github mentions ([#84](#84)) ([5e9e513](5e9e513))
* upgrade now to version 12.0.0 ([#74](#74)) ([3878702](3878702))
* upgrade react-scripts to version 2.1.0 ([#73](#73)) ([74e8974](74e8974))
* user molecule layout to allow other content ([#63](#63)) ([d1ad708](d1ad708))

### Documentation changes

* add notice about deployments with now v2 ([#83](#83)) ([167a5f3](167a5f3))

### New features

* implement mention link in user molecule ([#65](#65)) ([0a0cb92](0a0cb92))
* prototype github mentions support as a component ([#56](#56)) ([1788b32](1788b32))
* upgrade to now version 2 ([#79](#79)) ([f97f7ab](f97f7ab))

### Pipeline changes

* escape stylelint file glob ([#64](#64)) ([0cc473f](0cc473f))
* limit node versions because of unexpected fetch behaviour ([#82](#82)) ([eb50a5f](eb50a5f))
* test full build in travis to detect feature issues with cra ([#85](#85)) ([5592f94](5592f94))
* upgrade travis with auto-release and security checks ([#81](#81)) ([da79f78](da79f78))

### Testing updates

* add extra tests to atom components ([#67](#67)) ([41d746c](41d746c))
* add extra tests to github provider ([#66](#66)) ([14d6efa](14d6efa))
* add unit tests for github user organism ([#70](#70)) ([4023dc1](4023dc1))
* add unit tests for user molecule ([#69](#69)) ([84eb513](84eb513))
* clean up dirty tests and add app page component test ([#71](#71)) ([addb123](addb123))
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants