Skip to content

Commit

Permalink
Refactor: similar files between portals (#916)
Browse files Browse the repository at this point in the history
* refactor: remove duplicate components and core files from events-committee and refer to devhub

* fix: DropDownWithSearch path

* fix: another broken link

* refactor: similar events molecules

* fmt

---------

Co-authored-by: Peter Salomonsen <[email protected]>
  • Loading branch information
Tguntenaar and petersalomonsen authored Oct 27, 2024
1 parent fe9ecec commit 223d0c8
Show file tree
Hide file tree
Showing 17 changed files with 15 additions and 293 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ const showAccountAutoComplete = props.showAutoComplete ?? false;
const showProposalIdAutoComplete = props.showProposalIdAutoComplete ?? false;
const autoFocus = props.autoFocus ?? false;

const queryName =
"polyprogrammist_near_devhub_prod_v1_proposals_with_latest_snapshot";
const queryName = "${REPL_PROPOSAL_FEED_INDEXER_QUERY_NAME}";
const query = `query GetLatestSnapshot($offset: Int = 0, $limit: Int = 10, $where: ${queryName}_bool_exp = {}) {
${queryName}(
offset: $offset
Expand Down Expand Up @@ -236,7 +235,7 @@ async function getSuggestedProposals(id) {
}
await asyncFetch("https://near-queryapi.api.pagoda.co/v1/graphql", {
method: "POST",
headers: { "x-hasura-role": "polyprogrammist_near" },
headers: { "x-hasura-role": "${REPL_INDEXER_HASURA_ROLE}" },
body: JSON.stringify({
query: query,
variables: variables,
Expand All @@ -246,7 +245,7 @@ async function getSuggestedProposals(id) {
.then((res) => {
const proposals =
res?.data?.[
"polyprogrammist_near_devhub_prod_v1_proposals_with_latest_snapshot"
"${REPL_PROPOSAL_FEED_INDEXER_QUERY_NAME}"
];
results = proposals;
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const ContentEditor = ({ content, setContent }) => {
<div>
<h5>Content</h5>
<Widget
src="${REPL_DEVHUB}/widget/devhub.components.molecule.MarkdownEditor"
src="${REPL_DEVHUB}/widget/devhub.components.molecule.SimpleMDE"
props={{ data: { content }, onChange: setContent }}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ return (
/>
</div>
<Widget
src="${REPL_DEVHUB}/widget/devhub.components.molecule.MarkdownEditor"
src="${REPL_DEVHUB}/widget/devhub.components.molecule.SimpleMDE"
props={{ data: { content }, onChange: setContent }}
/>
</FormContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ const callDescriptionDiv = () => {
Description
</label>
<Widget
src={"${REPL_DEVHUB}/widget/devhub.components.molecule.MarkdownEditor"}
src={"${REPL_DEVHUB}/widget/devhub.components.molecule.SimpleMDE"}
props={{
data: { handler: state.handler, content: state.description },
onChange: (content) => {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const ProfileIcon = () => {
})}
>
<Widget
src="${REPL_EVENTS}/widget/devhub.components.molecule.ProfileCard"
src="${REPL_DEVHUB}/widget/devhub.components.molecule.ProfileCard"
props={{ iconOnly: true, accountId: context.accountId || null }}
/>
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ const AmountComponent = useMemo(() => {
const CurrencyComponent = useMemo(() => {
return (
<Widget
src="${REPL_EVENTS}/widget/devhub.components.molecule.DropDown"
src="${REPL_DEVHUB}/widget/devhub.components.molecule.DropDown"
props={{
options: tokensOptions,
selectedValue: requestedSponsorshipToken,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ return (
<div className="mt-2 d-flex flex-column gap-2">
<h6 className="mb-0">Proposal Status</h6>
<Widget
src="${REPL_EVENTS}/widget/devhub.components.molecule.DropDown"
src="${REPL_DEVHUB}/widget/devhub.components.molecule.DropDown"
props={{
options: proposalStatusOptions,
selectedValue: updatedProposalStatus,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ return (
moderators.map((child) => (
<Tile className="w-25 p-3 m-1" minHeight={10}>
<Widget
src={`${REPL_EVENTS}/widget/devhub.components.molecule.ProfileLine`}
src="${REPL_DEVHUB}/widget/devhub.components.molecule.ProfileLine"
props={{ accountId: child }}
/>
</Tile>
Expand Down
3 changes: 2 additions & 1 deletion instances/infrastructure-committee.near/aliases.mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"REPL_RFP_FEED_INDEXER_QUERY_NAME": "polyprogrammist_near_devhub_ic_v1_rfps_with_latest_snapshot",
"REPL_RFP_INDEXER_QUERY_NAME": "polyprogrammist_near_devhub_ic_v1_rfp_snapshots",
"REPL_PROPOSAL_FEED_INDEXER_QUERY_NAME": "polyprogrammist_near_devhub_ic_v1_proposals_with_latest_snapshot",
"REPL_PROPOSAL_QUERY_NAME": "polyprogrammist_near_devhub_ic_v1_proposal_snapshots"
"REPL_PROPOSAL_QUERY_NAME": "polyprogrammist_near_devhub_ic_v1_proposal_snapshots",
"REPL_INDEXER_HASURA_ROLE": "polyprogrammist_near"
}
Loading

0 comments on commit 223d0c8

Please sign in to comment.