Skip to content

Commit

Permalink
Merge branch 'main' into feature/events-bos-ws
Browse files Browse the repository at this point in the history
  • Loading branch information
Megha-Dev-19 authored Jul 11, 2024
2 parents d2cbcb4 + ac43daf commit d37852e
Show file tree
Hide file tree
Showing 13 changed files with 1,159 additions and 1,121 deletions.
11 changes: 10 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,17 @@ Feel free to specify a new placeholder if needed. The placeholder should have a

#### Deploying preview environments

Refer to [BOS-workspace deployment instructions](https://github.com/NEARBuilders/bos-workspace?tab=readme-ov-file#deployment) for deploying preview environments.
Creating a preview environment is often useful for reviewers to test the new features before deploying to production. Before we can deploy components, there are several replacements of global variables that needs to be made, which is handled by the BOS workspaces build command.

By running:

```bash
npm run bw:build:devhub
```

you will get a new folder `build/devhub.near` that contains a `src` folder with all the components ready for deployment. The replacements are made according to the settings in `instances/devhub.near/aliases.mainnet.json` so you should for example change `REPL_DEVHUB` to the account name you are using for your preview environment. Note that "BOS workspaces" has a built in connection to BOS CLI for deploying with one command, but since "BOS workspaces" will output to `src/widgets` instead of `src`, and that it requires the signing key as a command argument, we have chosen to split this process in two steps using `bw build ` for replacing and preparing the deployment folder, and using `bos components deploy` separately for the deployment.

From the `build/devhub.near` folder you can use `bos components deploy`.

#### Deploy for Production

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,12 @@ useEffect(() => {
},
}).then((result) => {
try {
if (
JSON.parse(result[communityAccount].blog[submittedBlogDeleted]) ===
null
) {
if (!result[communityAccount].blog[submittedBlogDeleted]) {
// Blog is deleted
setSubmittedBlogDeleted(null);
}
} catch (e) {}
setTimeout(() => checkForDeletedBlogInSocialDB(), 1000);
setTimeout(() => checkForDeletedBlogInSocialDB(), 500);
});
};
if (submittedBlogDeleted) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,7 @@ const Comment = ({ commentItem }) => {
blockHeight,
};
const content = JSON.parse(Social.get(item.path, blockHeight) ?? "null");
const link = getLinkUsingCurrentGateway(
`${REPL_DEVHUB}/widget/app?page=proposal&id=${props.id}&accountId=${accountId}&blockHeight=${blockHeight}`
);
const link = `https://${REPL_DEVHUB}.page/proposal/${proposalId}?accountId=${accountId}&blockHeight=${blockHeight}`;
const hightlightComment =
parseInt(props.blockHeight ?? "") === blockHeight &&
props.accountId === accountId;
Expand All @@ -178,6 +176,7 @@ const Comment = ({ commentItem }) => {
/>
</div>
<CommentContainer
id={`${accountId.replace(/[^a-z0-9]/g, "")}${blockHeight}`}
style={{ border: hightlightComment ? "2px solid black" : "" }}
className="rounded-2 flex-1"
>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"build": "npm run fmt",
"bw": "bos-workspace",
"bw:dev:devhub": "bw dev instances/devhub.near",
"bw:build:devhub": "bw build instances/devhub.near",
"bw:build:devhub": "bw build instances/devhub.near build/devhub.near && mv build/devhub.near/src/widget/* build/devhub.near/src/ && rm -Rf build/devhub.near/src/widget",
"gateway:devhub": "node scripts/dev-gateway.mjs devhub.near",
"bw:dev:infrastructure": "bw dev instances/infrastructure-committee.near",
"bw:build:infrastructure": "bw build instances/infrastructure-committee.near",
Expand Down
Loading

0 comments on commit d37852e

Please sign in to comment.