Skip to content

Commit ed47709

Browse files
committed
chore(issuer): ensure that whitelist date is 4 digits
2 parents 6f71a39 + 650e11a commit ed47709

107 files changed

Lines changed: 17979 additions & 22079 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 67 additions & 341 deletions
Large diffs are not rendered by default.

config/changelog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ conventionalChangelogCore(
88
{ config: preset },
99
{},
1010
{
11-
from: 'v0.0.0',
11+
from: 'v0.1.0',
1212
}
1313
).pipe(wstream);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"@polymathnetwork/polymath-scripts/polymath-core"
1010
]
1111
},
12-
"version": "0.1.0",
12+
"version": "1.0.0-beta.0",
1313
"scripts": {
1414
"changelog": "node ./config/changelog.js",
1515
"commit": "commit",

packages/new-polymath-issuer/config/.env.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ POLYMATH_OFFCHAIN_URL=http://localhost:3001
22
PORT=3000
33
PUBLIC_URL=http://localhost:3000
44
POLYMATH_REGISTRY_ADDRESS_LOCAL=0x8f0483125fcb9aaaefa9209d8e9d7b9c8b9fb90f
5-
POLYMATH_REGISTRY_ADDRESS_KOVAN=0x4b98b05ebbf8f4c2021ac04debc2e2ee9d07b709
5+
POLYMATH_REGISTRY_ADDRESS_KOVAN=0x93e05e7b542b056bd9f49e7ddd623801a7f6ae18
66
NETWORK_WS_PROVIDER_LOCAL=ws://localhost:8545
77
DEPLOYMENT_STAGE=local

packages/new-polymath-issuer/src/components/DividendCard/DividendCard.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,19 @@ import {
1717
ButtonFluid,
1818
} from '@polymathnetwork/new-ui';
1919
import { DIVIDEND_PAYMENT_INVESTOR_BATCH_SIZE } from '~/constants';
20-
import BigNumber from 'bignumber.js';
20+
import * as sc from './styles';
2121

2222
interface Props {
2323
dividend: types.DividendEntity;
24+
checkpointIndex: number;
2425
securityTokenSymbol: string;
2526
}
2627

27-
export const DividendCard: FC<Props> = ({ dividend, securityTokenSymbol }) => {
28+
export const DividendCard: FC<Props> = ({
29+
dividend,
30+
securityTokenSymbol,
31+
checkpointIndex,
32+
}) => {
2833
const {
2934
investors,
3035
currency,
@@ -84,9 +89,9 @@ export const DividendCard: FC<Props> = ({ dividend, securityTokenSymbol }) => {
8489
{formatters.toTokens(dividend.amount)} {currencyLabel}
8590
</Paragraph>
8691
</CardPrimary>
87-
<Heading mt="m" mb={1}>
92+
<sc.DividendHeading mt="m" mb={1}>
8893
{dividend.name}
89-
</Heading>
94+
</sc.DividendHeading>
9095
<Label color={currencyColor} bg={currencyBgColor}>
9196
Issued in {currencyType}
9297
</Label>
@@ -123,7 +128,7 @@ export const DividendCard: FC<Props> = ({ dividend, securityTokenSymbol }) => {
123128
<Box mt="auto" minWidth="100%" textAlign="center">
124129
<ButtonFluid
125130
as={ButtonLink}
126-
href={`/securityTokens/${securityTokenSymbol}/dividends/${
131+
href={`/securityTokens/${securityTokenSymbol}/checkpoints/${checkpointIndex}/dividends/${
127132
dividend.index
128133
}`}
129134
variant="secondary"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { styled, Heading, ThemeInterface } from '@polymathnetwork/new-ui';
2+
import { StyledComponent } from 'styled-components';
3+
4+
export const DividendHeading: StyledComponent<
5+
typeof Heading,
6+
ThemeInterface,
7+
any,
8+
'variant'
9+
> = styled(Heading)`
10+
width: 100%;
11+
word-wrap: break-word;
12+
`;

packages/new-polymath-issuer/src/components/DividendList/Presenter.tsx

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
import { types } from '@polymathnetwork/new-shared';
1111
import { DividendCard } from '~/components/DividendCard';
1212
import * as sc from './styles';
13-
import { DIVIDEND_PAYMENT_INVESTOR_BATCH_SIZE } from '~/constants';
1413

1514
export interface Props {
1615
dividends: types.DividendEntity[];
@@ -36,16 +35,43 @@ export const DividendListPresenter: FC<Props> = ({
3635
<li key={dividend.uid}>
3736
<DividendCard
3837
dividend={dividend}
38+
checkpointIndex={checkpointIndex}
3939
securityTokenSymbol={securityTokenSymbol}
4040
/>
4141
</li>
4242
))}
43-
<sc.NewDividendButton
43+
<span>
44+
<sc.NewDividendButton
45+
as={allDividendsCompleted ? ButtonLink : Button}
46+
disabled={!allDividendsCompleted}
47+
href={newDividendUrl}
48+
variant="ghost"
49+
iconPosition="top"
50+
>
51+
<IconOutlined
52+
Asset={icons.SvgPlus}
53+
width={25}
54+
height={25}
55+
scale={0.8}
56+
/>
57+
Add new <br /> dividend <br /> distribution
58+
</sc.NewDividendButton>
59+
{!allDividendsCompleted && (
60+
<TooltipPrimary placement="top-start">
61+
You can add a new dividend distribution if the previous
62+
distribution has been completed/expired.
63+
</TooltipPrimary>
64+
)}
65+
</span>
66+
</Fragment>
67+
) : (
68+
<span>
69+
<sc.PlaceholderButton
4470
as={allDividendsCompleted ? ButtonLink : Button}
45-
disabled={!allDividendsCompleted}
4671
href={newDividendUrl}
4772
variant="ghost"
4873
iconPosition="top"
74+
disabled={!allDividendsCompleted}
4975
>
5076
<IconOutlined
5177
Asset={icons.SvgPlus}
@@ -54,28 +80,14 @@ export const DividendListPresenter: FC<Props> = ({
5480
scale={0.8}
5581
/>
5682
Add new <br /> dividend <br /> distribution
57-
{!allDividendsCompleted && (
58-
<TooltipPrimary placement="top-start">
59-
You can add a new dividend distribution if the previous
60-
distribution has been completed/expired.
61-
</TooltipPrimary>
62-
)}
63-
</sc.NewDividendButton>
64-
</Fragment>
65-
) : (
66-
<sc.PlaceholderButton
67-
href={newDividendUrl}
68-
variant="ghost"
69-
iconPosition="top"
70-
>
71-
<IconOutlined
72-
Asset={icons.SvgPlus}
73-
width={25}
74-
height={25}
75-
scale={0.8}
76-
/>
77-
Add new <br /> dividend <br /> distribution
78-
</sc.PlaceholderButton>
83+
</sc.PlaceholderButton>
84+
{!allDividendsCompleted && (
85+
<TooltipPrimary placement="top-start">
86+
You can add a new dividend distribution if the previous
87+
distribution has been completed/expired.
88+
</TooltipPrimary>
89+
)}
90+
</span>
7991
)}
8092
</List>
8193
);

packages/new-polymath-issuer/src/components/DividendList/styles.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ type NewDividendButtonType = StyledComponent<
1111
export const NewDividendButtonBase: NewDividendButtonType = styled(ButtonLink)`
1212
flex-direction: column;
1313
align-items: center;
14+
color: ${({ theme }) => theme.colors.primary};
15+
16+
&[disabled]:hover {
17+
color: ${({ theme }) => theme.colors.primary};
18+
}
1419
`;
1520

1621
export const NewDividendButton: NewDividendButtonType = Object.assign(
@@ -34,11 +39,13 @@ export const PlaceholderButtonBase: PlaceholderButtonType = styled(
3439
height: 370px;
3540
border: 1px dashed ${({ theme }) => theme.colors.primary};
3641
border-radius: 5px;
37-
color: ${({ theme }) => theme.colors.primary};
3842
3943
&:hover {
40-
background-color: transparent;
4144
color: ${({ theme }) => theme.colors.primary};
45+
}
46+
47+
&:not([disabled]):hover {
48+
background-color: transparent;
4249
border: 2px solid ${({ theme }) => theme.colors.primary};
4350
}
4451
`;

packages/new-polymath-issuer/src/components/enhancers/DataFetcher.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface OwnProps {
1818
renderLoading: () => ReactNode;
1919
renderError: (errors: string[]) => ReactNode;
2020
onDataFetched(data: FetchedData): void;
21-
render(props: FetchedData): ReactNode;
21+
render(props: FetchedData, loading: boolean): ReactNode;
2222
}
2323

2424
interface StateProps {
@@ -162,10 +162,10 @@ class DataFetcherBase extends Component<Props, State> {
162162
// the rendered children when dataToRender exists and loading is true
163163

164164
if (!dataToRender) {
165-
return render(fetchedData);
165+
return render(fetchedData, loading);
166166
}
167167

168-
return render(dataToRender);
168+
return render(dataToRender, loading);
169169
}
170170
}
171171

packages/new-polymath-issuer/src/pages/DividendDetails/Container.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import React, { Component } from 'react';
22
import { connect } from 'react-redux';
33
import { Dispatch } from 'redux';
4-
import { ActionType } from 'typesafe-actions/dist/types';
4+
import { ActionType } from 'typesafe-actions';
55
import { types, constants } from '@polymathnetwork/new-shared';
66
import { Page } from '@polymathnetwork/new-ui';
77
import { Presenter } from './Presenter';
88
import { DataFetcher } from '~/components/enhancers/DataFetcher';
99
import {
10-
createTaxWithholdingListBySymbolFetcher,
10+
createTaxWithholdingListBySymbolAndCheckpointFetcher,
1111
createDividendBySymbolAndIdFetcher,
1212
} from '~/state/fetchers';
1313
import { RootState } from '~/state/store';
14-
import { getSession, getApp } from '~/state/selectors';
14+
import { getApp } from '~/state/selectors';
1515
import {
1616
pushDividendPaymentStart,
1717
withdrawDividendTaxesStart,
@@ -27,6 +27,7 @@ export interface Props {
2727
dispatch: Dispatch<ActionType<typeof actions>>;
2828
securityTokenSymbol: string;
2929
dividendIndex: string;
30+
checkpointIndex: string;
3031
networkId?: number;
3132
}
3233

@@ -60,14 +61,20 @@ export class ContainerBase extends Component<Props> {
6061
};
6162

6263
public render() {
63-
const { securityTokenSymbol, dividendIndex, networkId } = this.props;
64+
const {
65+
securityTokenSymbol,
66+
dividendIndex,
67+
checkpointIndex,
68+
networkId,
69+
} = this.props;
6470
const subdomain = networkId ? constants.EtherscanSubdomains[networkId] : '';
6571
return (
6672
<Page title="Dividend Details">
6773
<DataFetcher
6874
fetchers={[
69-
createTaxWithholdingListBySymbolFetcher({
75+
createTaxWithholdingListBySymbolAndCheckpointFetcher({
7076
securityTokenSymbol,
77+
checkpointIndex: parseInt(checkpointIndex, 10),
7178
dividendType: DividendModuleTypes.Erc20,
7279
}),
7380
createDividendBySymbolAndIdFetcher({

0 commit comments

Comments
 (0)