Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bufferapp/analyze-shared-components

Package Overview
Dependencies
Maintainers
32
Versions
191
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bufferapp/analyze-shared-components - npm Package Compare versions

Comparing version 1.57.6 to 1.58.0

coverage/clover.xml

57

GraphQLWrapper/index.jsx

@@ -1,4 +0,4 @@

import React, { useEffect } from 'react';
import moment from 'moment-timezone';
import { useQuery } from '@apollo/client';
import React, { useEffect } from "react";
import moment from "moment-timezone";
import { useQuery } from "@apollo/client";
import {

@@ -8,7 +8,10 @@ EmptyState,

ChartCard,
} from '@bufferapp/analyze-shared-components';
ChartTitle,
ChartHeader,
Container,
} from "@bufferapp/analyze-shared-components";
const GraphQLWrapper = ({ graphQlProps, ...props }) => {
const {
dataParser = data => ({
dataParser = (data) => ({
metrics: data,

@@ -19,5 +22,6 @@ }),

variables,
title,
} = graphQlProps;
const fetchPolicy = process.env.NODE_ENV === 'test' ? 'no-cache' : undefined;
const fetchPolicy = process.env.NODE_ENV === "test" ? "no-cache" : undefined;
const { data, error, loading } = useQuery(query, {

@@ -37,8 +41,10 @@ fetchPolicy,

console.log(error);
return (<ChartCard>
<EmptyState
header="There was a problem loading the data"
description="If this persists, please contact us"
/>
</ChartCard>);
return (
<ChartCard>
<EmptyState
header="There was a problem loading the data"
description="If this persists, please contact us"
/>
</ChartCard>
);
} else if (data && graphQlProps.content) {

@@ -51,8 +57,23 @@ props = {

return (<React.Fragment>
{<graphQlProps.content {...props} />}
</React.Fragment>);
return (
<React.Fragment>{<graphQlProps.content {...props} />}</React.Fragment>
);
}
return <ChartCard><Loading active noBorder /></ChartCard>;
if (props.forReport) {
return <Loading active noBorder />;
}
return (
<ChartCard>
{title && (
<ChartHeader>
<ChartTitle>{title}</ChartTitle>
</ChartHeader>
)}
<Container>
<Loading active noBorder />
</Container>
</ChartCard>
);
};

@@ -65,4 +86,4 @@

...variables,
endDate: moment(new Date(variables.endDate)).format('Y-MM-DD'),
startDate: moment(new Date(variables.startDate)).format('Y-MM-DD'),
endDate: moment(new Date(variables.endDate)).format("Y-MM-DD"),
startDate: moment(new Date(variables.startDate)).format("Y-MM-DD"),
};

@@ -69,0 +90,0 @@ }

@@ -8,2 +8,4 @@ import { gql } from '@apollo/client';

EmptyState,
Container,
ChartCard
} from '@bufferapp/analyze-shared-components';

@@ -89,6 +91,7 @@ import GraphQLWrapper, { formatQueryVariables } from './index';

}}
save={() => {}}
/>
</MockedProvider>);
component.root.findByType(Loading);
component.root.find(Loading);
});

@@ -106,2 +109,3 @@

}}
save={() => {}}
/>

@@ -129,2 +133,3 @@ </MockedProvider>);

}}
save={() => {}}
/>

@@ -152,2 +157,3 @@ </MockedProvider>);

}}
save={() => {}}
/>

@@ -184,2 +190,3 @@ </MockedProvider>);

}}
save={() => {}}
/>

@@ -207,5 +214,5 @@ </MockedProvider>);

variables,
save,
content: Content,
}}
save={save}
/>

@@ -212,0 +219,0 @@ </MockedProvider>);

{
"name": "@bufferapp/analyze-shared-components",
"version": "1.57.6",
"version": "1.58.0",
"description": "Shared components for Analyze",

@@ -26,3 +26,3 @@ "main": "index.js",

},
"gitHead": "975cf467d03ca2ef0c494d7c77893343ca0b968c"
"gitHead": "3e053a785f2f639406ab394a33145792e98b5224"
}

@@ -54,3 +54,3 @@ import React from 'react';

SocialIcon.propTypes = {
service: PropTypes.oneOf(['twitter', 'facebook', 'instagram']).isRequired,
service: PropTypes.oneOf(['twitter', 'facebook', 'instagram', 'linkedin']).isRequired,
socialIconSize: PropTypes.number.isRequired,

@@ -57,0 +57,0 @@ avatarSize: PropTypes.number,

@@ -97,1 +97,20 @@ import React from "react";

};
export const calculateDifference = (value, previousValue) => {
if (previousValue === 0 && value === 0) return 0;
const difference = value - previousValue;
if (previousValue === 0) previousValue = 1; // can't divide by 0
return Math.ceil((difference / previousValue) * 100);
};
export const prettyPrintedMetrics = {
posts_count: "Posts",
clicks: "Clicks",
comments: "Comments",
engagements: "Engagements",
engagement_rate: "Eng. Rate",
impressions: "Impressions",
reach: "Reach",
likes: "Likes",
shares: "Shares",
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc