Skip to content

Commit

Permalink
Feature/883 extra replacements variables events committee (#884)
Browse files Browse the repository at this point in the history
* feat: Add two replacements

* feat: change references to this aliases in all of events-committee.near
  • Loading branch information
Tguntenaar authored Jul 18, 2024
1 parent ead12b3 commit b48b7ac
Show file tree
Hide file tree
Showing 112 changed files with 494 additions and 492 deletions.
6 changes: 4 additions & 2 deletions instances/events-committee.near/aliases.mainnet.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"REPL_DEVHUB": "events-committee.near",
"REPL_DEVHUB": "devhub.near",
"REPL_EVENTS": "events-committee.near",
"REPL_DEVHUB_LEGACY": "devgovgigs.near",
"REPL_DEVHUB_CONTRACT": "events-committee.near",
"REPL_DEVHUB_CONTRACT": "devhub.near",
"REPL_EVENTS_CONTRACT": "events-committee.near",
"REPL_NEAR": "near",
"REPL_MOB": "mob.near",
"REPL_EFIZ": "efiz.near",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { href } = VM.require("${REPL_DEVHUB}/widget/core.lib.url") || (() => {});
const { href } = VM.require("${REPL_EVENTS}/widget/core.lib.url") || (() => {});

if (!props.type) {
return "Loading ...";
Expand All @@ -19,7 +19,7 @@ return props.type ? (
<a
className="fw-bold text-muted"
href={href({
widgetSrc: "${REPL_DEVHUB}/widget/app",
widgetSrc: "${REPL_EVENTS}/widget/app",
params: {
page: "post",
id: props.post,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { href } = VM.require("${REPL_DEVHUB}/widget/core.lib.url") || (() => {});
const { href } = VM.require("${REPL_EVENTS}/widget/core.lib.url") || (() => {});

return props.post === undefined ? (
"Loading ..."
Expand All @@ -7,7 +7,7 @@ return props.post === undefined ? (
<a
className="btn btn-outline-dark"
href={href({
widgetSrc: "${REPL_DEVHUB}/widget/app",
widgetSrc: "${REPL_EVENTS}/widget/app",
params: {
page: "post",
id: props.post,
Expand Down
16 changes: 8 additions & 8 deletions instances/events-committee.near/widget/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
*/

const { onDraftStateChange } = VM.require(
"${REPL_DEVHUB}/widget/devhub.entity.post.draft"
"${REPL_EVENTS}/widget/devhub.entity.post.draft"
);

const { page, ...passProps } = props;

// Import our modules
const { AppLayout } = VM.require(
"${REPL_DEVHUB}/widget/devhub.components.templates.AppLayout"
"${REPL_EVENTS}/widget/devhub.components.templates.AppLayout"
);

if (!AppLayout) {
Expand Down Expand Up @@ -47,7 +47,7 @@ function Page() {
case "create-proposal": {
return (
<Widget
src={"${REPL_DEVHUB}/widget/devhub.entity.proposal.Editor"}
src={"${REPL_EVENTS}/widget/devhub.entity.proposal.Editor"}
props={{ ...passProps }}
/>
);
Expand All @@ -56,15 +56,15 @@ function Page() {
case "proposals": {
return (
<Widget
src={"${REPL_DEVHUB}/widget/devhub.page.proposals"}
src={"${REPL_EVENTS}/widget/devhub.page.proposals"}
props={passProps}
/>
);
}
case "proposal": {
return (
<Widget
src={"${REPL_DEVHUB}/widget/devhub.entity.proposal.Proposal"}
src={"${REPL_EVENTS}/widget/devhub.entity.proposal.Proposal"}
props={passProps}
/>
);
Expand All @@ -73,23 +73,23 @@ function Page() {
case "about": {
return (
<Widget
src={"${REPL_DEVHUB}/widget/devhub.page.about"}
src={"${REPL_EVENTS}/widget/devhub.page.about"}
props={passProps}
/>
);
}
case "admin": {
return (
<Widget
src={"${REPL_DEVHUB}/widget/devhub.page.admin.index"}
src={"${REPL_EVENTS}/widget/devhub.page.admin.index"}
props={passProps}
/>
);
}
default: {
return (
<Widget
src={"${REPL_DEVHUB}/widget/devhub.page.proposals"}
src={"${REPL_EVENTS}/widget/devhub.page.proposals"}
props={passProps}
/>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
function getRootMembers() {
return Near.view("${REPL_DEVHUB_CONTRACT}", "get_root_members") ?? null;
return Near.view("${REPL_EVENTS_CONTRACT}", "get_root_members") ?? null;
}

function removeMember(member) {
return Near.call("${REPL_DEVHUB_CONTRACT}", "remove_member", { member });
return Near.call("${REPL_EVENTS_CONTRACT}", "remove_member", { member });
}

function hasModerator({ account_id }) {
return (
Near.view("${REPL_DEVHUB_CONTRACT}", "has_moderator", { account_id }) ??
Near.view("${REPL_EVENTS_CONTRACT}", "has_moderator", { account_id }) ??
null
);
}

function createCommunity({ inputs }) {
return Near.call(
"${REPL_DEVHUB_CONTRACT}",
"${REPL_EVENTS_CONTRACT}",
"create_community",
{ inputs },
250000000000000, // gas (250Tgas)
Expand All @@ -25,7 +25,7 @@ function createCommunity({ inputs }) {

function getCommunity({ handle }) {
return (
Near.view("${REPL_DEVHUB_CONTRACT}", "get_community", { handle }) ?? null
Near.view("${REPL_EVENTS_CONTRACT}", "get_community", { handle }) ?? null
);
}

Expand All @@ -34,36 +34,36 @@ function getFeaturedCommunities() {
}

function setFeaturedCommunities({ handles }) {
return Near.call("${REPL_DEVHUB_CONTRACT}", "set_featured_communities", {
return Near.call("${REPL_EVENTS_CONTRACT}", "set_featured_communities", {
handles,
});
}

function getAccountCommunityPermissions({ account_id, community_handle }) {
return (
Near.view("${REPL_DEVHUB_CONTRACT}", "get_account_community_permissions", {
Near.view("${REPL_EVENTS_CONTRACT}", "get_account_community_permissions", {
account_id,
community_handle,
}) ?? null
);
}

function updateCommunity({ handle, community }) {
return Near.call("${REPL_DEVHUB_CONTRACT}", "update_community", {
return Near.call("${REPL_EVENTS_CONTRACT}", "update_community", {
handle,
community,
});
}

function deleteCommunity({ handle }) {
return Near.call("${REPL_DEVHUB_CONTRACT}", "delete_community", { handle });
return Near.call("${REPL_EVENTS_CONTRACT}", "delete_community", { handle });
}

/**
* Sets all addons, for configurating tabs
*/
function setCommunityAddons({ handle, addons }) {
return Near.call("${REPL_DEVHUB_CONTRACT}", "set_community_addons", {
return Near.call("${REPL_EVENTS_CONTRACT}", "set_community_addons", {
handle,
addons,
});
Expand All @@ -73,7 +73,7 @@ function setCommunityAddons({ handle, addons }) {
* Sets specific addon, for configuring params
*/
function setCommunityAddon({ handle, addon }) {
return Near.call("${REPL_DEVHUB_CONTRACT}", "set_community_addon", {
return Near.call("${REPL_EVENTS_CONTRACT}", "set_community_addon", {
handle,
community_addon: addon,
});
Expand All @@ -83,12 +83,12 @@ function setCommunityAddon({ handle, addon }) {
* Gets all available addons, these are controlled by devhub moderators
*/
function getAllAddons() {
return Near.view("${REPL_DEVHUB_CONTRACT}", "get_all_addons") ?? null;
return Near.view("${REPL_EVENTS_CONTRACT}", "get_all_addons") ?? null;
}

function getAccessControlInfo() {
return (
Near.view("${REPL_DEVHUB_CONTRACT}", "get_access_control_info") ?? null
Near.view("${REPL_EVENTS_CONTRACT}", "get_access_control_info") ?? null
);
}

Expand All @@ -98,7 +98,7 @@ function getAllAuthors() {

function getAllCommunitiesMetadata() {
return (
Near.view("${REPL_DEVHUB_CONTRACT}", "get_all_communities_metadata") ?? null
Near.view("${REPL_EVENTS_CONTRACT}", "get_all_communities_metadata") ?? null
);
}

Expand Down Expand Up @@ -131,7 +131,7 @@ function getPostsByLabel({ label }) {

function setCommunitySocialDB({ handle, data }) {
return (
Near.call("${REPL_DEVHUB_CONTRACT}", "set_community_socialdb", {
Near.call("${REPL_EVENTS_CONTRACT}", "set_community_socialdb", {
handle,
data,
}) ?? null
Expand All @@ -140,7 +140,7 @@ function setCommunitySocialDB({ handle, data }) {

function createDiscussion({ handle, data }) {
return (
Near.call("${REPL_DEVHUB_CONTRACT}", "create_discussion", {
Near.call("${REPL_EVENTS_CONTRACT}", "create_discussion", {
handle,
data,
}) ?? null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const renderItem = (item) =>
item.action === "post" ? renderPost(item) : renderRepost(item);
return (
<Widget
src="${REPL_DEVHUB}/widget/devhub.components.feed.MergedIndexFeed"
src="${REPL_EVENTS}/widget/devhub.components.feed.MergedIndexFeed"
props={{
index,
renderItem,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { getFeaturedCommunities } = VM.require(
"${REPL_DEVHUB}/widget/core.adapter.devhub-contract"
"${REPL_EVENTS}/widget/core.adapter.devhub-contract"
);

if (!getFeaturedCommunities) {
Expand Down Expand Up @@ -106,7 +106,7 @@ const Cards = communities.map((com) => {
return {
title: com.name,
description: com.description,
href: "/${REPL_DEVHUB}/widget/app?page=community&handle=" + com.handle,
href: "/${REPL_EVENTS}/widget/app?page=community&handle=" + com.handle,
};
});

Expand Down Expand Up @@ -313,7 +313,7 @@ const Content = (
))}
</MobileCards>
<CTAContainer>
<CTA href="/${REPL_DEVHUB}/widget/app?page=communities">
<CTA href="/${REPL_EVENTS}/widget/app?page=communities">
Explore all communities →
</CTA>
</CTAContainer>
Expand All @@ -322,7 +322,7 @@ const Content = (

return (
<Widget
src="${REPL_DEVHUB}/widget/devhub.components.island.home-section"
src="${REPL_EVENTS}/widget/devhub.components.island.home-section"
props={{
title: "/connect",
children: Content,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ const Content = (

return (
<Widget
src="${REPL_DEVHUB}/widget/devhub.components.island.home-section"
src="${REPL_EVENTS}/widget/devhub.components.island.home-section"
props={{
title: "/explore",
titleColor: "#555555",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { href } = VM.require("${REPL_DEVHUB}/widget/core.lib.url");
const { href } = VM.require("${REPL_EVENTS}/widget/core.lib.url");

href || (href = () => {});

Expand Down Expand Up @@ -181,7 +181,7 @@ return (
</Lead>
<Link
to={href({
widgetSrc: "${REPL_DEVHUB}/widget/app",
widgetSrc: "${REPL_EVENTS}/widget/app",
params: {
page: "about",
},
Expand All @@ -199,7 +199,7 @@ return (
<Lead>Join a vibrant community of innovators shaping the open web.</Lead>
<Link
to={href({
widgetSrc: "${REPL_DEVHUB}/widget/app",
widgetSrc: "${REPL_EVENTS}/widget/app",
params: {
page: "about",
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { href } = VM.require("${REPL_DEVHUB}/widget/core.lib.url");
const { href } = VM.require("${REPL_EVENTS}/widget/core.lib.url");

href || (href = () => {});

Expand Down Expand Up @@ -183,7 +183,7 @@ const Content = (

<Link
to={href({
widgetSrc: "${REPL_DEVHUB}/widget/app",
widgetSrc: "${REPL_EVENTS}/widget/app",
params: { page: "contribute" },
})}
style={{ textDecoration: "none" }}
Expand All @@ -195,7 +195,7 @@ const Content = (

return (
<Widget
src="${REPL_DEVHUB}/widget/devhub.components.island.home-section"
src="${REPL_EVENTS}/widget/devhub.components.island.home-section"
props={{
title: "/participate",
titleColor: "#555555",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const Content = (

return (
<Widget
src="${REPL_DEVHUB}/widget/devhub.components.island.home-section"
src="${REPL_EVENTS}/widget/devhub.components.island.home-section"
props={{
title: "/get support",
children: Content,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { href } = VM.require("${REPL_DEVHUB}/widget/core.lib.url") || (() => {});
const { href } = VM.require("${REPL_EVENTS}/widget/core.lib.url") || (() => {});

const nearDevGovBadgesContractId = "neardevgov.near";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const Button = ({
typeof iconProps === "object" &&
!Array.isArray(iconProps) && (
<Widget
src={"${REPL_DEVHUB}/widget/devhub.components.atom.Icon"}
src={"${REPL_EVENTS}/widget/devhub.components.atom.Icon"}
props={iconProps}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const Compose = ({
{state.selectedTab === "editor" ? (
<>
<Widget
src={"${REPL_DEVHUB}/widget/devhub.components.molecule.SimpleMDE"}
src={"${REPL_EVENTS}/widget/devhub.components.molecule.SimpleMDE"}
props={{
data: { handler: state.handler, content: state.data },
onChange: (content) => {
Expand All @@ -104,7 +104,7 @@ const Compose = ({
<div className="card-body">
<Widget
src={
"${REPL_DEVHUB}/widget/devhub.components.molecule.MarkdownViewer"
"${REPL_EVENTS}/widget/devhub.components.molecule.MarkdownViewer"
}
props={{
text: state.data,
Expand Down
Loading

0 comments on commit b48b7ac

Please sign in to comment.