Skip to content

Commit

Permalink
fix: Registry changes (#83)
Browse files Browse the repository at this point in the history
* refactor: add 'safe contract address' as link

* refactor: add new routes for my bonds

* fix: test-cases for services

* refactor: update table layout in 4thStepDeployed component to 100%

* fix: minor updates
  • Loading branch information
mohandast52 authored Aug 27, 2024
1 parent e34eae4 commit ba978bd
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ export const IpfsHashGenerationModal = ({
<span>
{/* TODO: fetch from middleware constant */}
<ul style={{ margin: 0 }}>
<li>{'ipfs://{IPFS_HASH}'}</li>
<li>https://gateway.autonolas.tech/ipfs/*</li>
<li>https://gateway.pinata.cloud/ipfs/*</li>
<li>https://*.arweave.net/</li>
Expand All @@ -236,7 +237,7 @@ export const IpfsHashGenerationModal = ({
</Flex>
}
>
<Input />
<Input placeholder="ipfs://" />
</Form.Item>
</Form>
</CustomModal>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export const FinishedRegistration = ({
className="mt-8"
>
{options.map((multisigAddress) => (
<div className="mb-12" key={`mutisig-${multisigAddress}`}>
<div className="mb-12" key={`multisig-${multisigAddress}`}>
<RadioLabel disabled={btnProps.disabled}>
{multisigAddress === isMultiSig && OPTION_1}
{multisigAddress !== isMultiSig && OPTION_2}
Expand Down Expand Up @@ -377,6 +377,7 @@ export const FinishedRegistration = ({
console.error(error);
} finally {
setIsSubmitting(false);
notifyError('Error occurred while updating multisig. Please try again.');
}
}}
{...getOtherBtnProps(STEP, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { useEffect, useMemo, useState } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { Space, Table } from 'antd';
import PropTypes from 'prop-types';
import { Table, Space } from 'antd';
import { useEffect, useMemo, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';

import { AddressLink } from '@autonolas/frontend-library';

import { setAgentInstancesAndOperators } from '../../../../store/service';
import { useScreen } from 'common-util/hooks/useScreen';
import { useHelpers } from 'common-util/hooks/useHelpers';
import { SendTransactionButton } from 'common-util/TransactionHelpers/SendTransactionButton';
import { useHelpers } from 'common-util/hooks/useHelpers';
import { useScreen } from 'common-util/hooks/useScreen';

import { setAgentInstancesAndOperators } from '../../../../store/service';
import { useAgentInstanceAndOperator } from '../../hooks/useSvmService';
import { getAgentInstanceAndOperator } from '../utils';

Expand All @@ -24,9 +26,7 @@ export const Deployed = ({
const dispatch = useDispatch();
const { account, chainId, isSvm, chainName } = useHelpers();
const { isMobile } = useScreen();
const data = useSelector(
(state) => state?.service?.agentInstancesAndOperators,
);
const data = useSelector((state) => state?.service?.agentInstancesAndOperators);
const [isTerminating, setIsTerminating] = useState(false);
const { getSvmAgentInstanceAndOperator } = useAgentInstanceAndOperator();

Expand All @@ -47,14 +47,7 @@ export const Deployed = ({
return () => {
isMounted = false;
};
}, [
serviceId,
chainId,
isSvm,
currentStep,
dispatch,
getSvmAgentInstanceAndOperator,
]);
}, [serviceId, chainId, isSvm, currentStep, dispatch, getSvmAgentInstanceAndOperator]);

const onTerminate = async () => {
try {
Expand All @@ -78,7 +71,7 @@ export const Deployed = ({

return (
<div className="step-4-deployed" data-testid="step-deployed">
<Space direction="vertical" size={10}>
<Space direction="vertical" size={10} className="full-width">
{isShowAgentInstanceVisible && (
<Table
dataSource={data}
Expand All @@ -90,23 +83,22 @@ export const Deployed = ({
title: 'Agent Instances',
dataIndex: 'agentInstance',
key: 'agentInstance',
render: (text) => (
<AddressLink text={text} {...addressLinkProps} />
),
render: (text) => <AddressLink text={text} {...addressLinkProps} />,
width: '50%',
},
{
title: 'Operators',
dataIndex: 'operatorAddress',
key: 'operatorAddress',
render: (text) => (
<AddressLink text={text} {...addressLinkProps} />
),
render: (text) => <AddressLink text={text} {...addressLinkProps} />,
width: '50%',
},
]}
/>
)}
<div>
{`${isSvm ? 'Squads' : 'Safe'} contract address: ${multisig}`}
{`${isSvm ? 'Squads' : 'Safe'} contract address:`}
<AddressLink text={multisig} {...addressLinkProps} />
</div>
{getButton(
<SendTransactionButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ jest.mock('wagmi', () => ({
},
}));

jest.mock('libs/common-contract-functions/src', () => ({
useClaimableIncentives: jest.fn().mockReturnValue({
reward: '0.25',
topUp: '111,555.70',
}),
getPendingIncentives: jest.fn().mockResolvedValue({
reward: '0.5',
topUp: '100,800.25',
}),
}));

jest.mock('common-util/List/IpfsHashGenerationModal/helpers', () => ({
getIpfsHashHelper: jest.fn(() => mockV1Hash),
}));
Expand Down
5 changes: 5 additions & 0 deletions apps/tokenomics/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ const nextConfig = {
source: '/manage-solana-liquidity',
destination: 'https://bond.olas.network/manage-solana-liquidity',
permanent: true,
},
{
source: '/my-bonds',
destination: 'https://bond.olas.network/my-bonds',
permanent: true,
}
];
},
Expand Down

0 comments on commit ba978bd

Please sign in to comment.