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

Make Safari happy #146

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Make Safari happy #146

wants to merge 4 commits into from

Conversation

freshteapot
Copy link
Contributor

Summary

Making copy to clipboard work in Safari

@freshteapot
Copy link
Contributor Author

@pavsaund pavsaund self-requested a review April 13, 2022 11:55
@pavsaund pavsaund force-pushed the copy-to-clipboard-why-so-hard branch from 8187808 to c4848bc Compare May 11, 2022 06:37
@@ -33,18 +34,18 @@ export const ViewConfiguration: React.FunctionComponent<Props> = (props) => {
const webhookPoLine = 'm3/poline';
const msName = ms.name;

const copyPOHeadUrl = async (event: React.MouseEvent<HTMLElement>) => {
const copyPOHeadUrl = (event: React.MouseEvent<HTMLElement>) => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 4 locations. Consider refactoring.

enqueueSnackbar('POHEAD URL copied to clipboard.');
} catch {
enqueueSnackbar('Failed to copy POHEAD URL to clipboard.', { variant: 'error' });
}
};

const copyPOLineUrl = async (event: React.MouseEvent<HTMLElement>) => {
const copyPOLineUrl = (event: React.MouseEvent<HTMLElement>) => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 4 locations. Consider refactoring.

@@ -99,18 +100,18 @@ export const Configuration: React.FunctionComponent<Props> = (props) => {
const webhookPoHead = 'm3/pohead';
const webhookPoLine = 'm3/poline';

const copyPOHeadUrl = async (event: React.MouseEvent<HTMLElement>) => {
const copyPOHeadUrl = (event: React.MouseEvent<HTMLElement>) => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 4 locations. Consider refactoring.

enqueueSnackbar('POHEAD URL copied to clipboard.');
} catch {
enqueueSnackbar('Failed to copy POHEAD URL to clipboard.', { variant: 'error' });
}
};

const copyPOLineUrl = async (event: React.MouseEvent<HTMLElement>) => {
const copyPOLineUrl = (event: React.MouseEvent<HTMLElement>) => {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 4 locations. Consider refactoring.

@codeclimate
Copy link

codeclimate bot commented May 11, 2022

Code Climate has analyzed commit c4848bc and detected 4 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 4

View more on Code Climate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants