diff --git a/pdf-ui/src/pages/BudgetDiscussion/SingleBudgetDiscussion/index.jsx b/pdf-ui/src/pages/BudgetDiscussion/SingleBudgetDiscussion/index.jsx
index be5b56e..5378ac5 100644
--- a/pdf-ui/src/pages/BudgetDiscussion/SingleBudgetDiscussion/index.jsx
+++ b/pdf-ui/src/pages/BudgetDiscussion/SingleBudgetDiscussion/index.jsx
@@ -20,6 +20,7 @@ import {
CardHeader,
Grid,
IconButton,
+ List,
Menu,
MenuItem,
Stack,
@@ -27,6 +28,7 @@ import {
Tooltip,
Typography,
alpha,
+ Link,
} from '@mui/material';
import { useEffect, useState, useRef } from 'react';
import { useNavigate, useLocation } from 'react-router-dom';
@@ -48,12 +50,18 @@ import {
} from '../../../lib/api';
import {
correctVoteAdaFormat,
+ decodeJWT,
formatIsoDate,
openInNewTab,
} from '../../../lib/utils';
import ProposalOwnModal from '../../../components/ProposalOwnModal';
import BudgetDiscussionReviewVersions from '../../../components/BudgetDiscussionReviewVersions';
import { useScrollToHashSection } from '../../../lib/hooks';
+import UserValidation from '../../../components/UserValidation/UserValidation';
+import {
+ checkIfDrepIsSignedIn,
+ checkShowValidation,
+} from '../../../lib/helpers';
const SECTIONS = [
'problem-statement',
@@ -233,10 +241,8 @@ const SingleBudgetDiscussion = ({ id }) => {
if (!response) return;
setProposal(response);
- }catch (error) {
- if (
- error?.response?.data?.error?.message ===
- 'Not Found' ) {
+ } catch (error) {
+ if (error?.response?.data?.error?.message === 'Not Found') {
return navigate('/budget_discussion');
}
} finally {
@@ -870,7 +876,7 @@ const SingleBudgetDiscussion = ({ id }) => {
mt={2}
display='flex'
alignItems='center'
- justifyContent='space-between'
+ gap={2}
>
{
)}`}
-
+
{
+
+
+ Poll of DRep sentiment
+
+
+
+ {activePoll &&
+ proposal?.attributes?.submitted_for_vote ===
+ null && (
+
+
+
+ )}
{
/>
-
- {activePoll &&
- proposal?.attributes?.submitted_for_vote ===
- null && (
-
-
-
- )}
-
{proposal?.attributes?.content?.attributes
?.prop_submitted ? null : (
@@ -1941,7 +1957,15 @@ const SingleBudgetDiscussion = ({ id }) => {
{
gap={2}
ref={targetRef}
>
+ {checkShowValidation(
+ true,
+ walletAPI,
+ user
+ ) && (
+
+ )}
))}
diff --git a/pdf-ui/src/pages/BudgetDiscussion/index.jsx b/pdf-ui/src/pages/BudgetDiscussion/index.jsx
index 4f3a4f0..aac9ec1 100644
--- a/pdf-ui/src/pages/BudgetDiscussion/index.jsx
+++ b/pdf-ui/src/pages/BudgetDiscussion/index.jsx
@@ -36,11 +36,19 @@ import {
SearchInput,
} from '../../components';
import { useAppContext } from '../../context/context';
-import { loginUserToApp } from '../../lib/helpers';
+import {
+ checkIfDrepIsSignedIn,
+ checkShowValidation,
+ loginUserToApp,
+} from '../../lib/helpers';
import { useLocation } from 'react-router-dom';
import { ScrollToTop, useDebounce } from '../../lib/hooks';
+import UserValidation from '../../components/UserValidation/UserValidation';
-let proposalsOwnersList = [{ id: 'all-proposals', label: 'All Proposals' }];
+let proposalsOwnersList = [
+ { id: 'all-proposals', label: 'All Proposals', disabled: false },
+ { id: 'my-proposals', label: 'My Proposals', disabled: true },
+];
let sortOptions = [
{ fieldId: 'createdAt', type: 'DESC', title: 'Newest' },
{ fieldId: 'createdAt', type: 'ASC', title: 'Oldest' },
@@ -224,20 +232,28 @@ const ProposedBudgetDiscussion = () => {
const showNoProposals = allEmptyMatchBudget || allFilteredAreEmpty;
useEffect(() => {
+ console.log(proposalsOwnersList);
if (user?.user?.id) {
- if (proposalsOwnersList?.find((f) => f?.id === 'my-proposals'))
+ const myProposals = proposalsOwnersList?.find(
+ (f) => f?.id === 'my-proposals'
+ );
+ if (myProposals) {
+ myProposals.disabled = false;
return;
+ }
proposalsOwnersList?.push({
id: 'my-proposals',
label: 'My Proposals',
+ disabled: false,
});
- } else {
- if (proposalsOwnersList?.find((f) => f?.id === 'my-proposals')) {
- proposalsOwnersList = proposalsOwnersList.filter(
- (f) => f?.id === 'my-proposals'
- );
- }
}
+ // else {
+ // if (proposalsOwnersList?.find((f) => f?.id === 'my-proposals')) {
+ // proposalsOwnersList = proposalsOwnersList.filter(
+ // (f) => f?.id === 'my-proposals'
+ // );
+ // }
+ // }
}, [user?.user?.id]);
return (
@@ -281,10 +297,26 @@ const ProposedBudgetDiscussion = () => {
)}
- {walletAPI && (
-
+
+
-
- )}
+ {checkShowValidation(
+ false,
+ walletAPI,
+ user
+ ) && (
+
+ )}
+
+
{
proposalsOwnerFilter?.id ===
ga?.id
}
+ disabled={
+ ga?.disabled
+ }
/>
}
id={`${ga?.label}-radio`}
diff --git a/pdf-ui/src/pages/IdentificationPage/index.jsx b/pdf-ui/src/pages/IdentificationPage/index.jsx
index 0024465..229b96c 100644
--- a/pdf-ui/src/pages/IdentificationPage/index.jsx
+++ b/pdf-ui/src/pages/IdentificationPage/index.jsx
@@ -8,7 +8,7 @@ const IdentificationPage = ({ handleLogin, isDRep = false }) => {
width={'100%'}
height={'70vh'}
display={'flex'}
- justifyContent={'centet'}
+ justifyContent={'center'}
alignItems={'center'}
>
diff --git a/pdf-ui/src/pages/ProposedGovernanceActions/SingleGovernanceAction/index.jsx b/pdf-ui/src/pages/ProposedGovernanceActions/SingleGovernanceAction/index.jsx
index dabba75..5d5ae5d 100644
--- a/pdf-ui/src/pages/ProposedGovernanceActions/SingleGovernanceAction/index.jsx
+++ b/pdf-ui/src/pages/ProposedGovernanceActions/SingleGovernanceAction/index.jsx
@@ -37,6 +37,7 @@ import {
DialogContent,
DialogContentText,
badgeClasses,
+ Link,
} from '@mui/material';
import { useEffect, useState, useRef } from 'react';
import { useNavigate } from 'react-router-dom';
@@ -62,13 +63,19 @@ import {
} from '../../../lib/api';
import {
correctVoteAdaFormat,
+ decodeJWT,
formatIsoDate,
openInNewTab,
} from '../../../lib/utils';
import ProposalOwnModal from '../../../components/ProposalOwnModal';
import ReactMarkdown from 'react-markdown';
-import { loginUserToApp } from '../../../lib/helpers';
+import {
+ checkIfDrepIsSignedIn,
+ checkShowValidation,
+ loginUserToApp,
+} from '../../../lib/helpers';
import MarkdownTypography from '../../../lib/markdownRenderer';
+import UserValidation from '../../../components/UserValidation/UserValidation';
const SingleGovernanceAction = ({ id }) => {
const MAX_COMMENT_LENGTH = 15000;
@@ -120,7 +127,6 @@ const SingleGovernanceAction = ({ id }) => {
});
}
};
-
useEffect(() => {
let domain = new URL(window.location.href);
let origin = domain.origin;
@@ -472,11 +478,11 @@ const SingleGovernanceAction = ({ id }) => {
}
onClick={() => navigate(`/proposal_discussion`)}
>
- Show all
+ Back
-
+ {/*
{
}
+ */}
+
+ {checkShowValidation(false, walletAPI, user) && (
+
+ )}
@@ -725,14 +740,61 @@ const SingleGovernanceAction = ({ id }) => {
}
-
- {/* SHARE BUTTON */}
+ >
+
+ {user &&
+ proposal?.attributes?.content?.attributes?.prop_submitted === false &&
+ //proposal?.attributes?.prop_submitted &&
+ user?.user?.id?.toString() ===
+ proposal?.attributes?.user_id?.toString() ? (
+
+ ) : null}
+
+ {/* SHARE BUTTON */}
+
{
}
-
-
- theme?.palette?.text?.grey,
- }}
- >
- {`Last Edit: ${formatIsoDate(
- proposal?.attributes?.content
- ?.attributes?.createdAt
- )}`}
-
+
+ {' '}
+
+ theme?.palette?.text?.grey,
+ }}
+ >
+ {proposal?.attributes?.content
+ ?.attributes?.prop_submitted
+ ? `Submitted on:`
+ : `Proposed on:`}
+
+
+ {proposal?.attributes?.content
+ ?.attributes?.prop_submitted
+ ? `${formatIsoDate(proposal?.attributes?.content?.attributes?.prop_submission_date)}`
+ : `${formatIsoDate(
+ proposal?.attributes
+ ?.createdAt
+ )}`}
+
+
+ {proposal?.attributes?.content?.attributes?.prop_submitted &&
+ (
+
+ navigate(
+ `/connected/governance_actions/${proposal?.attributes?.content?.attributes?.prop_submission_tx_hash}#0`
+ )}
+ sx={{ cursor: 'pointer' }}
+ >Vote
+
+ )
+ }
+
+
+
+ {' '}
+
+ theme?.palette?.text
+ ?.grey,
+ }}
+ >
+ Last Edit:
+
+
+ {formatIsoDate(
+ proposal?.attributes
+ ?.content?.attributes
+ ?.createdAt
+ )}
+
+
-
+
{
>
Abstract
-
-
- {/*
+
+ {/*
{showFullText || !maxLength
? AbstractMarkdownText
: truncatedText}
*/}
-
{!showFullText &&
totalCharLength > maxLength && (