-
Notifications
You must be signed in to change notification settings - Fork 295
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
[DDW-796] Implement catalyst state snapshot phase #2771
Merged
danielmain
merged 22 commits into
develop
from
feature/ddw-796-Implement-catalyst-state-snapshot-phase
Dec 8, 2021
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
145c774
[DDW-796] Refactor and voting phases
d770712
[DDW-796] Remove closed voting logic
cd26d6a
[DDW-796] Exclude js/ts files from nix-build glob
0376de6
[DDW-796] Fund phase logic
6d12ff3
[DDW-796] Fund phase components
8883376
[DDW-796] Fix lint issues
c39e24f
[DDW-796] Fix flow issues
1a72281
[DDW-796] Style fix
1432543
[DDW-796] Add observer
dc9e1c7
[DDW-796] Remove unused
81192f5
[DDW-796] Lazy validation
bcaf138
[DDW-796] Update text
b065f49
[DDW-858] Fix eslint warnings
renanvalentin b30e1fc
[DDW-796] Add jp translations
454c7e1
[DDW-796] Enable voting in all env for testing only
754d5e4
[DDW-796] Add function for external link
919aa78
[DDW-796] Review changes
3d6948f
[DDW-796] VotingStore unit test
a9bf930
[DDW-796] Update story
b9e4c8c
[DDW-796] Test only
ad1734a
Revert "[DDW-796] Test only"
8303429
Revert "[DDW-796] Enable voting in all env for testing only"
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
140 changes: 19 additions & 121 deletions
140
source/renderer/app/components/voting/VotingUnavailable.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,132 +1,30 @@ | ||
// @flow | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the voting registration is always open now, the voting closed logic was removed. |
||
import React, { Component } from 'react'; | ||
import React from 'react'; | ||
import { observer } from 'mobx-react'; | ||
import { | ||
defineMessages, | ||
intlShape, | ||
FormattedMessage, | ||
FormattedHTMLMessage, | ||
} from 'react-intl'; | ||
import BigNumber from 'bignumber.js'; | ||
import { Link } from 'react-polymorph/lib/components/Link'; | ||
import { FormattedHTMLMessage } from 'react-intl'; | ||
import globalMessages from '../../i18n/global-messages'; | ||
import LoadingSpinner from '../widgets/LoadingSpinner'; | ||
import { | ||
CURRENT_VOTING_FUND_NUMBER, | ||
NEXT_VOTING_FUND_NUMBER, | ||
} from '../../config/votingConfig'; | ||
import styles from './VotingUnavailable.scss'; | ||
|
||
const messages = defineMessages({ | ||
heading: { | ||
id: 'voting.unavailable.heading', | ||
defaultMessage: '!!!Project Catalyst voting registration', | ||
description: 'Headline for the "Voting unavailable" screen', | ||
}, | ||
paragraph1: { | ||
id: 'voting.unavailable.paragraph1', | ||
defaultMessage: | ||
'!!!Project Catalyst Fund{currentVotingFundNumber} has now ended. Fund{nextVotingFundNumber} is currently in preparation, voting registration is not available yet.', | ||
description: 'First paragraph on the "Voting unavailable" screen', | ||
}, | ||
paragraph2: { | ||
id: 'voting.unavailable.paragraph2', | ||
defaultMessage: | ||
'!!!Join our {link1} and {link2} Telegram channels for the latest updates (English language only).', | ||
description: 'Second paragraph on the "Voting unavailable" screen', | ||
}, | ||
link1Text: { | ||
id: 'voting.unavailable.link1Text', | ||
defaultMessage: '!!!Catalyst Announcements', | ||
description: 'First link text on the "Voting unavailable" screen', | ||
}, | ||
link2Text: { | ||
id: 'voting.unavailable.link2Text', | ||
defaultMessage: '!!!Project Catalyst Chat', | ||
description: 'Second link text on the "Voting unavailable" screen', | ||
}, | ||
link1Url: { | ||
id: 'voting.unavailable.link1Url', | ||
defaultMessage: '!!!https://t.me/cardanocatalyst', | ||
description: 'First link URL on the "Voting unavailable" screen', | ||
}, | ||
link2Url: { | ||
id: 'voting.unavailable.link2Url', | ||
defaultMessage: '!!!https://t.me/ProjectCatalystChat', | ||
description: 'Second link URL on the "Voting unavailable" screen', | ||
}, | ||
}); | ||
import { formattedNumber } from '../../utils/formatters'; | ||
|
||
type Props = { | ||
syncPercentage: number, | ||
isVotingRegistrationAvailable: boolean, | ||
onExternalLinkClick: Function, | ||
}; | ||
|
||
@observer | ||
export default class VotingUnavailable extends Component<Props> { | ||
static contextTypes = { | ||
intl: intlShape.isRequired, | ||
}; | ||
|
||
render() { | ||
const { intl } = this.context; | ||
const { | ||
syncPercentage, | ||
isVotingRegistrationAvailable, | ||
onExternalLinkClick, | ||
} = this.props; | ||
|
||
const heading = intl.formatMessage(messages.heading); | ||
const paragraph1 = intl.formatMessage(messages.paragraph1, { | ||
currentFundNumber: CURRENT_VOTING_FUND_NUMBER, | ||
nextVotingFundNumber: NEXT_VOTING_FUND_NUMBER, | ||
}); | ||
const link1 = ( | ||
<Link | ||
className={styles.link} | ||
label={intl.formatMessage(messages.link1Text)} | ||
onClick={() => | ||
onExternalLinkClick(intl.formatMessage(messages.link1Url)) | ||
} | ||
/> | ||
); | ||
const link2 = ( | ||
<Link | ||
className={styles.link} | ||
label={intl.formatMessage(messages.link2Text)} | ||
onClick={() => | ||
onExternalLinkClick(intl.formatMessage(messages.link2Url)) | ||
} | ||
/> | ||
); | ||
|
||
return ( | ||
<div className={styles.component}> | ||
{isVotingRegistrationAvailable ? ( | ||
<> | ||
<LoadingSpinner big /> | ||
<div className={styles.description}> | ||
<FormattedHTMLMessage | ||
{...globalMessages.featureUnavailableWhileSyncing} | ||
values={{ | ||
syncPercentage: new BigNumber(syncPercentage).toFormat(2), | ||
}} | ||
/> | ||
</div> | ||
</> | ||
) : ( | ||
<> | ||
<h1>{heading}</h1> | ||
<p>{paragraph1}</p> | ||
<FormattedMessage | ||
{...messages.paragraph2} | ||
values={{ link1, link2 }} | ||
tagName="p" | ||
/> | ||
</> | ||
)} | ||
const VotingUnavailable = ({ syncPercentage }: Props) => { | ||
return ( | ||
<div className={styles.component}> | ||
<LoadingSpinner big /> | ||
<div className={styles.description}> | ||
<FormattedHTMLMessage | ||
{...globalMessages.featureUnavailableWhileSyncing} | ||
values={{ | ||
syncPercentage: formattedNumber(syncPercentage, 2), | ||
}} | ||
/> | ||
</div> | ||
); | ||
} | ||
} | ||
</div> | ||
); | ||
}; | ||
|
||
export default observer(VotingUnavailable); |
70 changes: 0 additions & 70 deletions
70
source/renderer/app/components/voting/voting-info/CurrentFund.js
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
source/renderer/app/components/voting/voting-info/CurrentFund.messages.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
result*
was ignoring any files that start withresult
(ResultsPhase.js).The following file globs are excluding js/ts files