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

approval banner fix, and graphql dependabot update #832

Merged
merged 27 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6392c6f
0.11.5
b-pmcg Jul 25, 2023
42b4273
Feat: poll review link & no delegate migration for shadow delegates (…
hernandoagf Aug 9, 2023
6f54089
Feat: AVCs page (#815)
hernandoagf Aug 9, 2023
333a7c7
Bump version
adamgoth Aug 9, 2023
4954dec
Merge branch 'master' of https://github.com/makerdao/governance-porta…
adamgoth Aug 9, 2023
d614776
Disable AVC detail link on avatar
adamgoth Aug 9, 2023
0291161
Edit link titles
adamgoth Aug 9, 2023
16311ef
Hide view button if no delegates for AVC exist
adamgoth Aug 9, 2023
e993a9d
make test amount a variable
b-pmcg Aug 9, 2023
c48c2a8
Bump protobufjs from 6.11.3 to 6.11.4 (#819)
dependabot[bot] Aug 23, 2023
01d6126
Bump @adobe/css-tools from 4.2.0 to 4.3.1 (#820)
dependabot[bot] Sep 5, 2023
da4e3ea
show all avcs button, match button styles
inclinedmind Sep 7, 2023
e96cecc
Merge pull request #824 from makerdao/master
tyler17 Sep 8, 2023
806bdb7
Merge pull request #826 from makerdao/master
tyler17 Sep 8, 2023
dd1529b
Merge pull request #823 from makerdao/show-all-avcs
tyler17 Sep 8, 2023
450e81f
update vote proxy text and links
tyler17 Sep 12, 2023
ea0d6e0
remove available soon
tyler17 Sep 12, 2023
cf210bc
Merge pull request #827 from makerdao/update-vote-proxy-guide
tyler17 Sep 12, 2023
f0c2171
Bump version
adamgoth Sep 13, 2023
02f7fde
only one option when defaulting to default value
tyler17 Sep 15, 2023
4f29b23
Bump graphql from 16.6.0 to 16.8.1
dependabot[bot] Sep 21, 2023
a7bd6fc
Merge pull request #831 from makerdao/dependabot/npm_and_yarn/graphql…
tyler17 Sep 26, 2023
32c7559
Merge pull request #830 from makerdao/poll-banner-fix
tyler17 Sep 26, 2023
57ce9e6
Merge branch 'master' into develop
tyler17 Sep 26, 2023
dedccf6
Update package.json version number
tyler17 Sep 26, 2023
2174036
Fix gray matter issue
hernandoagf Sep 27, 2023
940ec8a
Merge pull request #833 from makerdao/gray-matter-fix
tyler17 Sep 27, 2023
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
13 changes: 7 additions & 6 deletions modules/polling/components/PollWinningOptionBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ export default function PollWinningOptionBox({
result.mkrSupport === tally.results[0].mkrSupport
).length;

// Winner will be null if the winning conditions are not met, but we want to display the leading option too
const leadingOption = typeof tally.winner === 'number' ? tally.winner : tally.results[0].optionId;
const leadingOptionName = `${
typeof tally.winner === 'number' ? tally.winningOptionName : tally.results[0].optionName
}${numberOfLeadingOptions > 1 ? ` & ${numberOfLeadingOptions - 1} more` : ''}`;

const winningVictoryCondition = tally.parameters.victoryConditions.find(
(v, index) => index === tally.victoryConditionMatched
);
Expand All @@ -66,6 +60,13 @@ export default function PollWinningOptionBox({
isDefault = true;
}

// Winner will be null if the winning conditions are not met, but we want to display the leading option too
const leadingOption = typeof tally.winner === 'number' ? tally.winner : tally.results[0].optionId;
const leadingOptionName = `${
typeof tally.winner === 'number' ? tally.winningOptionName : tally.results[0].optionName
//don't show "& n more" if isDefault since there's only ever 1 default option
}${!isDefault && numberOfLeadingOptions > 1 ? ` & ${numberOfLeadingOptions - 1} more` : ''}`;

return (
<Flex sx={{ py: 2, justifyContent: 'center' }}>
<ErrorBoundary componentName="Winning option">
Expand Down
15 changes: 14 additions & 1 deletion modules/polling/helpers/parsePollMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,20 @@ export async function parsePollMetadata(
[key: number]: string[];
}
): Promise<Poll> {
const { data: pollMeta, content } = matter(document || '');
const { data: pollMeta, content } = matter(document || '', {
engines: {
javascript: {
parse: function () {
console.log('Parsing JavaScript is not allowed');
return {};
},
stringify: function () {
console.log('Stringifying JavaScript is not allowed');
return '';
}
}
}
});
const summary = pollMeta?.summary || '';
const title = pollMeta?.title || '';
const options = pollMeta.options;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "governance-portal-v2",
"license": "AGPL-3.0-only",
"version": "0.11.7",
"version": "0.11.8",
"engines": {
"node": ">=16.0.0"
},
Expand Down Expand Up @@ -139,7 +139,7 @@
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-testing-library": "^5.10.2",
"glob": "^8.0.3",
"graphql": "^16.2.0",
"graphql": "^16.8.1",
"hardhat": "^2.12.1-unknown-txs.0",
"husky": "^6.0.0",
"istanbul-lib-coverage": "^3.2.0",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8660,10 +8660,10 @@ [email protected]:
resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.12.1.tgz#c62d5ac54dbd409cc6520b0b39de374b3d59d0dd"
integrity sha512-umt4f5NnMK46ChM2coO36PTFhHouBrK9stWWBczERguwYrGnPNxJ9dimU6IyOBfOkC6Izhkg4H8+F51W/8CYDg==

graphql@^16.2.0:
version "16.6.0"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.6.0.tgz#c2dcffa4649db149f6282af726c8c83f1c7c5fdb"
integrity sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw==
graphql@^16.8.1:
version "16.8.1"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.8.1.tgz#1930a965bef1170603702acdb68aedd3f3cf6f07"
integrity sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==

gray-matter@^4.0.2:
version "4.0.3"
Expand Down