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

chore: add pdf enable toggle to every deployment workflow #1245

Merged
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
11 changes: 10 additions & 1 deletion .github/workflows/build-and-deploy-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ run-name: Deploy by @${{ github.actor }}
# That should be executed on create: tag event
on:
workflow_dispatch:
inputs:
isProposalDiscussionForumEnabled:
description: "Enable proposal discussion forum"
required: true
type: choice
default: "disabled"
options:
- "enabled"
- "disabled"

env:
ENVIRONMENT: "beta"
Expand Down Expand Up @@ -38,7 +47,7 @@ jobs:
SENTRY_IGNORE_API_RESOLUTION_ERROR: "1"
TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com"
USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }}
IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: "false"
IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{ inputs.isProposalDiscussionForumEnabled == 'enabled' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/build-and-deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ on:
push:
branches:
- staging
workflow_dispatch:
inputs:
isProposalDiscussionForumEnabled:
description: "Enable proposal discussion forum"
required: true
type: choice
default: "disabled"
options:
- "enabled"
- "disabled"

env:
ENVIRONMENT: "staging"
Expand Down Expand Up @@ -40,7 +50,7 @@ jobs:
SENTRY_IGNORE_API_RESOLUTION_ERROR: "1"
TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com"
USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }}
IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: "false"
IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{github.event_name == 'push' && 'false' || inputs.isProposalDiscussionForumEnabled == 'enabled'}}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/build-and-deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ on:
push:
branches:
- test
workflow_dispatch:
inputs:
isProposalDiscussionForumEnabled:
description: "Enable proposal discussion forum"
required: true
type: choice
default: "disabled"
options:
- "enabled"
- "disabled"

env:
ENVIRONMENT: "test"
Expand Down Expand Up @@ -40,7 +50,7 @@ jobs:
SENTRY_IGNORE_API_RESOLUTION_ERROR: "1"
TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com"
USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }}
IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: "false"
IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{github.event_name == 'push' && 'false' || inputs.isProposalDiscussionForumEnabled == 'enabled'}}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ export const DashboardTopNav = ({
) : null}
</Box>
<Box display="flex">
{!isVotingPowerHidden && <VotingPowerChips />}
{!isVotingPowerHidden && !isProposalDiscussion && (
<VotingPowerChips />
)}
{isMobile && (
<IconButton
data-testid="open-drawer-button"
Expand Down
30 changes: 24 additions & 6 deletions govtool/frontend/src/components/organisms/PDFWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Box } from "@mui/material";
import PDF from "@intersect.mbo/pdf-ui/cjs";
import React, { Suspense } from "react";
import { Box, CircularProgress } from "@mui/material";
import "@intersect.mbo/pdf-ui/style";
import { useCardano, useGovernanceActions } from "@/context";

const PDF = React.lazy(() => import("@intersect.mbo/pdf-ui/cjs"));

export const PDFWrapper = () => {
const walletAPI = useCardano();
const { createGovernanceActionJsonLD, createHash } = useGovernanceActions();
Expand All @@ -14,10 +16,26 @@ export const PDFWrapper = () => {
py: 3,
}}
>
<PDF
walletAPI={{ ...walletAPI, createGovernanceActionJsonLD, createHash }}
pathname={window.location.pathname}
/>
<Suspense
fallback={
<Box
sx={{
display: "flex",
flex: 1,
height: "100vw",
alignItems: "center",
justifyContent: "center",
}}
>
<CircularProgress />
</Box>
}
>
<PDF
walletAPI={{ ...walletAPI, createGovernanceActionJsonLD, createHash }}
pathname={window.location.pathname}
/>
</Suspense>
</Box>
);
};
Loading