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

Feature/incorporate promo types lib #62

Merged
merged 4 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Campaign.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { useState, useEffect, MouseEvent, ReactNode } from 'react';
import { IsActivePill } from './IsActivePill';
import { IsPaidPill } from './IsPaidPill';
import { CampaignData, CampaignDummyData } from '../lib/types';
import { CampaignData, CampaignDummyData } from '@tincre/promo-types';
import { CampaignRepeatButton } from './CampaignRepeatButton';
import { CampaignSupportButton } from './CampaignSupportButton';
import { CampaignDeleteButton } from './CampaignDeleteButton';
Expand Down
2 changes: 1 addition & 1 deletion src/components/CampaignDeleteButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { MouseEvent } from 'react';
import { CampaignData, CampaignDummyData } from '../lib/types';
import { CampaignData, CampaignDummyData } from '@tincre/promo-types';
import { XCircleIcon } from '@heroicons/react/20/solid';

export function CampaignDeleteButton({
Expand Down
2 changes: 1 addition & 1 deletion src/components/CampaignDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
CampaignDummyData,
CampaignStatsData,
CampaignMetrics,
} from '../lib/types';
} from '@tincre/promo-types';
import { StatsHighlights } from './StatsHighlights';
import { CampaignImageChart } from './CampaignImageChart';
import { DownloadCampaignButton } from './DownloadButton';
Expand Down
2 changes: 1 addition & 1 deletion src/components/CampaignImageChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
CampaignData,
CampaignDummyData,
CampaignStatsData,
} from '../lib/types';
} from '@tincre/promo-types';

export function CampaignImageChart({
data,
Expand Down
2 changes: 1 addition & 1 deletion src/components/CampaignList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
CampaignData,
CampaignDummyData,
DashboardOptions,
} from '../lib/types';
} from '@tincre/promo-types';

export function CampaignList({
data,
Expand Down
2 changes: 1 addition & 1 deletion src/components/CampaignPaymentButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { MouseEvent, ReactNode } from 'react';
import { CampaignData, CampaignDummyData } from '../lib/types';
import { CampaignData, CampaignDummyData } from '@tincre/promo-types';
import { CreditCardIcon } from '@heroicons/react/20/solid';

export function CampaignPaymentButton({
Expand Down
2 changes: 1 addition & 1 deletion src/components/CampaignRepeatButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { MouseEvent, ReactNode } from 'react';
import { CampaignData, CampaignDummyData } from '../lib/types';
import { CampaignData, CampaignDummyData } from '@tincre/promo-types';
import { ArrowPathIcon } from '@heroicons/react/20/solid';

export function CampaignRepeatButton({
Expand Down
2 changes: 1 addition & 1 deletion src/components/CampaignsChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { MouseEvent } from 'react';
import { CampaignsLineChart } from './CampaignsLineChart';
import { ChartButton } from './ChartButton';
import { CampaignStatsData } from '../lib/types';
import { CampaignStatsData } from '@tincre/promo-types';

export function CampaignsChart({
timePeriods,
Expand Down
1 change: 0 additions & 1 deletion src/components/CampaignsLineChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/
import { useState, useEffect } from 'react';
import { Line } from 'react-chartjs-2';
//import { CampaignData } from '../lib/types';
import {
Chart as ChartJS,
LineElement,
Expand Down
2 changes: 1 addition & 1 deletion src/components/CampaignsStatsHighlights.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { ArrowDownIcon, ArrowUpIcon } from '@heroicons/react/20/solid';
import { CampaignStatsData } from '../lib/types';
import { CampaignStatsData } from '@tincre/promo-types';
/* @ts-ignore */
function classNames(...classes) {
return classes.filter(Boolean).join(' ');
Expand Down
2 changes: 1 addition & 1 deletion src/components/CampaignsSummaryStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
CampaignStatsData,
CampaignData,
CampaignDummyData,
} from '../lib/types';
} from '@tincre/promo-types';
import { CampaignsStatsHighlights } from './CampaignsStatsHighlights';
import { CampaignsChart } from './CampaignsChart';
import { merge } from '../lib/merge';
Expand Down
4 changes: 2 additions & 2 deletions src/components/CampaignsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState, MouseEvent, Fragment } from 'react';
import { CampaignDummyData, CampaignData } from '../lib/types';
import { useState, MouseEvent } from 'react';
import { CampaignDummyData, CampaignData } from '@tincre/promo-types';
import { Transition } from '@headlessui/react';

export function CampaignsTable({
Expand Down
2 changes: 1 addition & 1 deletion src/components/DownloadButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
CampaignDummyData,
DownloadableCampaignStatsSample,
DownloadableCampaignMetadataSample,
} from '../lib/types';
} from '@tincre/promo-types';
import { useState, useEffect } from 'react';
import CsvDownload from 'react-json-to-csv';
import { now } from '../lib/date';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
import { useEffect, useState, Dispatch, MouseEvent, ChangeEvent } from 'react';
import { settingsDetailSchema } from '../lib/yup';
import { Settings } from '../lib/types';
import { Settings } from '@tincre/promo-types';
import { Button } from '../components/Button';

export function Profile({
Expand Down
2 changes: 1 addition & 1 deletion src/components/StatsHighlights.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { CampaignStatsData } from '../lib/types';
import { CampaignStatsData } from '@tincre/promo-types';
import { ArrowDownIcon, ArrowUpIcon } from '@heroicons/react/20/solid';

/* @ts-ignore */
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
CampaignDummyData,
CampaignMetrics,
CampaignSortedData,
} from './lib/types';
} from '@tincre/promo-types';
import { CampaignsSummaryStats } from './components/CampaignsSummaryStats';
import { Spinner } from './components/Spinner';
import { CampaignList } from './components/CampaignList';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/coerce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
CampaignDummyData,
CampaignSortedData,
CampaignMetrics,
} from './types';
} from '@tincre/promo-types';

function generateEmptyPromoApiDataForChartJs(): {
updatedTime: (string | null)[];
Expand Down
2 changes: 1 addition & 1 deletion src/lib/compareDates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { CampaignData, CampaignDummyData } from './types';
import { CampaignData, CampaignDummyData } from '@tincre/promo-types';

/*
* Given data packages compare their dates.
Expand Down
2 changes: 1 addition & 1 deletion src/lib/metricsDisplay.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CampaignMetrics, HeroiconIcon } from '../lib/types';
import { CampaignMetrics, HeroiconIcon } from '@tincre/promo-types';
import {
CursorArrowRaysIcon,
EnvelopeOpenIcon,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/sort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { CampaignData, CampaignDummyData } from './types';
import { CampaignData, CampaignDummyData } from '@tincre/promo-types';
import { compareDates } from './compareDates';
export function sortCampaignDataOnIsActive(
data: CampaignData[] | CampaignDummyData[]
Expand Down
2 changes: 1 addition & 1 deletion src/lib/support.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CampaignData, CampaignDummyData } from './types';
import { CampaignData, CampaignDummyData } from '@tincre/promo-types';

const EMAILDOMAIN = 'tincre.dev';
const EMAILLOCALPART = 'team';
Expand Down
143 changes: 0 additions & 143 deletions src/lib/types.ts

This file was deleted.

2 changes: 1 addition & 1 deletion test/components/CampaignDeleteButton.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { MouseEvent } from 'react';
import { render, screen, fireEvent } from '@testing-library/react';
import { CampaignDeleteButton } from '../../src/components/CampaignDeleteButton';
import { campaignStubData } from '../cms.data';
import { CampaignData, CampaignDummyData } from '../../src/lib/types';
import { CampaignData, CampaignDummyData } from '@tincre/promo-types';

describe('CampaignDeleteButton', () => {
let testData = campaignStubData[0];
Expand Down
2 changes: 1 addition & 1 deletion test/components/CampaignPaymentButton.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { MouseEvent } from 'react';
import { render, screen, fireEvent } from '@testing-library/react';
import { CampaignPaymentButton } from '../../src/components/CampaignPaymentButton';
import { campaignStubData } from '../cms.data';
import { CampaignData, CampaignDummyData } from '../../src/lib/types';
import { CampaignData, CampaignDummyData } from '@tincre/promo-types';

describe('CampaignPaymentButton', () => {
let testData = campaignStubData[0];
Expand Down
2 changes: 1 addition & 1 deletion test/components/CampaignRepeatButton.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { MouseEvent } from 'react';
import { render, screen, fireEvent } from '@testing-library/react';
import { CampaignRepeatButton } from '../../src/components/CampaignRepeatButton';
import { testPromoApiCampaignData, campaignStubData } from '../cms.data';
import { CampaignData, CampaignDummyData } from '../../src/lib/types';
import { CampaignData, CampaignDummyData } from '@tincre/promo-types';

describe('CampaignRepeatButton', () => {
it('renders without crashing', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { screen, render, fireEvent } from '@testing-library/react';
import { PromoDashboard } from '../src/index';
import { PromoChat } from '@tincre/promo-chat';
import { campaignStubData } from './cms.data';
import { CampaignData, CampaignDummyData, Settings } from '../src/lib/types';
import { CampaignData, CampaignDummyData, Settings } from '@tincre/promo-types';
import {
mockAllIsIntersecting,
setupIntersectionMocking,
Expand Down