Improved Comment URL Handling (#1860)

* feat: replaces PR 1819

- fixes #1851

* fix: set query using new syntax

* review: fixes for missed framework changes

* fix: linting
This commit is contained in:
Wyatt Johnson
2018-09-11 22:44:23 +00:00
committed by GitHub
parent 13cc80bd35
commit c19d4a433a
14 changed files with 246 additions and 38 deletions
@@ -2,6 +2,7 @@ import React from 'react';
import cn from 'classnames';
import styles from './styles.css';
import { t } from 'plugin-api/beta/client/services';
import { buildCommentURL } from 'plugin-api/beta/client/utils';
import { ClickOutside } from 'plugin-api/beta/client/components';
import { Icon, Button } from 'plugin-api/beta/client/components/ui';
@@ -90,7 +91,7 @@ export default class PermalinkButton extends React.Component {
className={cn(styles.input, `${name}-copy-field`)}
type="text"
ref={input => (this.permalinkInput = input)}
defaultValue={`${asset.url}?commentId=${comment.id}`}
defaultValue={buildCommentURL(asset.url, comment.id)}
readOnly
/>