From 7b1d85958c6a932619a714377c5fd00cc165e807 Mon Sep 17 00:00:00 2001 From: mstfash Date: Mon, 25 Jan 2021 11:08:08 +0200 Subject: [PATCH 1/5] hiding transferred safes --- src/utils/queries/safe.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/queries/safe.ts b/src/utils/queries/safe.ts index 87f2af2a..78fac164 100644 --- a/src/utils/queries/safe.ts +++ b/src/utils/queries/safe.ts @@ -42,7 +42,7 @@ export const getUserSafesListQuery = (address: string) => `{ }`; export const getSafeByIdQuery = (safeId: string, address: string) => `{ - safes(where: { safeId: "${safeId}" }) { + safes(where: { safeId: "${safeId}" , proxy_not: null, safeId_not: null}) { safeId collateral createdAt From 7f65a44a8f77385a01be4a602ac56764cf9640fa Mon Sep 17 00:00:00 2001 From: mstfash Date: Mon, 25 Jan 2021 11:11:08 +0200 Subject: [PATCH 2/5] hiding transferred safes --- src/utils/queries/safe.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/queries/safe.ts b/src/utils/queries/safe.ts index 78fac164..3a86693b 100644 --- a/src/utils/queries/safe.ts +++ b/src/utils/queries/safe.ts @@ -28,7 +28,7 @@ systemState(id: "current") { }`; export const getUserSafesListQuery = (address: string) => `{ - safes(where: { owner: "${address}" }) { + safes(where: { owner: "${address}", proxy_not: null, safeId_not: null }) { safeId safeHandler collateral From da69b576438676d8eb0fdd4eff2b529f141aa9f2 Mon Sep 17 00:00:00 2001 From: mstfash Date: Tue, 26 Jan 2021 12:40:34 +0200 Subject: [PATCH 3/5] adding shutdown alert box --- src/containers/Shared.tsx | 12 +++++++++++- src/utils/constants.ts | 3 +++ src/utils/i18n/en.json | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/containers/Shared.tsx b/src/containers/Shared.tsx index 18a96cbb..4e009520 100644 --- a/src/containers/Shared.tsx +++ b/src/containers/Shared.tsx @@ -11,7 +11,7 @@ import BalanceUpdater from '../services/BalanceUpdater'; import { capitalizeName, timeout } from '../utils/helper'; import WalletModal from '../components/WalletModal'; import { ChainId } from '@uniswap/sdk'; -import { ETHERSCAN_PREFIXES } from '../utils/constants'; +import { ETHERSCAN_PREFIXES, SYSTEM_STATUS } from '../utils/constants'; import { useActiveWeb3React } from '../hooks'; import LoadingModal from '../components/Modals/LoadingModal'; import styled from 'styled-components'; @@ -25,6 +25,7 @@ import TransactionUpdater from '../services/TransactionUpdater'; import usePrevious from '../hooks/usePrevious'; import { useHistory } from 'react-router-dom'; import ImagePreloader from '../components/ImagePreloader'; +import AlertLabel from '../components/AlertLabel'; interface Props { children: ReactNode; @@ -174,6 +175,11 @@ const Shared = ({ children }: Props) => { + {SYSTEM_STATUS && SYSTEM_STATUS.toLowerCase() === 'shutdown' ? ( + + + + ) : null} {children} @@ -225,3 +231,7 @@ const Container = styled.div` const Content = styled.div``; const EmptyDiv = styled.div``; + +const AlertContainer = styled.div` + padding: 0 20px; +`; diff --git a/src/utils/constants.ts b/src/utils/constants.ts index d749a0db..ab161d9a 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -8,6 +8,7 @@ const { REACT_APP_NETWORK_ID, REACT_APP_COIN_TICKER_PRODUCTION, REACT_APP_COIN_TICKER_KOVAN, + REACT_APP_SYSTEM_STATUS, } = process.env; export enum Network { @@ -27,6 +28,8 @@ export const COIN_TICKER = export const COLLATERAL_TYPE_ID = 'ETH-A'; +export const SYSTEM_STATUS = REACT_APP_SYSTEM_STATUS || ''; + export const GRAPH_API_URLS = REACT_APP_GRAPH_API_URLS ? REACT_APP_GRAPH_API_URLS.split(',') : [ diff --git a/src/utils/i18n/en.json b/src/utils/i18n/en.json index bcfa1aee..a0d143ec 100644 --- a/src/utils/i18n/en.json +++ b/src/utils/i18n/en.json @@ -104,5 +104,6 @@ "annual_redemption_tip": "Rate at which RAI is devalued or revalued over 8 hours.", "liquidation_price_tip": "ETH price under which this Safe can get liquidated.", "liquidation_penalty_tip": "This is a fee you pay in case your Safe gets liquidated. The fee is added on top of your Safe's debt during liquidation, resulting in more Safe collateral being sold.", - "app": "App" + "app": "App", + "shutdown_text": "The global settlement procedure was triggered for this system. You can't manage your Safes from this application anymore. If you still had positions open, follow [this procedure](https://www.youtube.com/watch?v=2ViUFhFROVA) to retrieve your collateral and redeem you PRAI." } From cc4dbfa2df76747d3fb81d51456e26c0e6e7e76b Mon Sep 17 00:00:00 2001 From: mstfash Date: Tue, 26 Jan 2021 12:42:29 +0200 Subject: [PATCH 4/5] adding alert box and fixing workflow --- .github/workflows/release.yml | 1 + .github/workflows/staging.yml | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index db30f1e9..893f258c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,6 +17,7 @@ jobs: REACT_APP_NETWORK_ID: ${{ secrets.REACT_APP_NETWORK_ID_PRODUCTION }} REACT_APP_NETWORK_URL: ${{ secrets.REACT_APP_NETWORK_URL_PRODUCTION }} REACT_APP_COIN_TICKER_PRODUCTION: ${{ secrets.REACT_APP_COIN_TICKER_PRODUCTION }} + REACT_APP_SYSTEM_STATUS: ${{ secrets.REACT_APP_SYSTEM_STATUS }} steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 59b17028..638396ba 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -17,22 +17,23 @@ jobs: REACT_APP_GRAPH_API_URLS: ${{ secrets.REACT_APP_GRAPH_API_URLS_STAGING }} REACT_APP_NETWORK_ID: ${{ secrets.REACT_APP_NETWORK_ID_STAGING }} REACT_APP_NETWORK_URL: ${{ secrets.REACT_APP_NETWORK_URL_STAGING }} + REACT_APP_SYSTEM_STATUS: ${{ secrets.REACT_APP_SYSTEM_STATUS_STAGING }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: Use Node.js 12.18.0 - uses: actions/setup-node@v1 - with: - node-version: '12.18.0' + - name: Use Node.js 12.18.0 + uses: actions/setup-node@v1 + with: + node-version: '12.18.0' - - name: Install dependencies - run: yarn + - name: Install dependencies + run: yarn - - name: Build static site - run: yarn build + - name: Build static site + run: yarn build - - name: Deploy staging - uses: jakejarvis/s3-sync-action@v0.5.0 - with: - args: --acl public-read --follow-symlinks --delete \ No newline at end of file + - name: Deploy staging + uses: jakejarvis/s3-sync-action@v0.5.0 + with: + args: --acl public-read --follow-symlinks --delete From fc1a5ac6b7a4d6144009f1cd6ab969fe3d9a0a9b Mon Sep 17 00:00:00 2001 From: mstfash Date: Tue, 26 Jan 2021 13:03:35 +0200 Subject: [PATCH 5/5] alert message --- src/utils/i18n/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/i18n/en.json b/src/utils/i18n/en.json index a0d143ec..56523c3d 100644 --- a/src/utils/i18n/en.json +++ b/src/utils/i18n/en.json @@ -105,5 +105,5 @@ "liquidation_price_tip": "ETH price under which this Safe can get liquidated.", "liquidation_penalty_tip": "This is a fee you pay in case your Safe gets liquidated. The fee is added on top of your Safe's debt during liquidation, resulting in more Safe collateral being sold.", "app": "App", - "shutdown_text": "The global settlement procedure was triggered for this system. You can't manage your Safes from this application anymore. If you still had positions open, follow [this procedure](https://www.youtube.com/watch?v=2ViUFhFROVA) to retrieve your collateral and redeem you PRAI." + "shutdown_text": "The global settlement procedure was triggered for this system. You can't manage your Safes from this application anymore." }