Skip to content

Commit

Permalink
Community Announcements (#603)
Browse files Browse the repository at this point in the history
* feat: Community Announcements Page (#567)

* fix solution action

* added community announcements UI

* added compose field

* minor css updates

* use community data instead of dummy data

* minor UI updates

* add mentions notifications

* remove unecessary code

* remove hover effect

* sets up for contract, adds admin check

* fix: Fixed deposit error for grant_write_permissions call to social.near (#563)

* add elliot and thomas to CODEOWNERS (#570)

* Fix telegram string and array issue (#571)

* fix solution action

* fix telegram string and array issue

* update telegram_handle

* fix handle and URL

* fix tests

* prettier update

* fix tests

* prettier update

* Bugfix/559 error flashes (#569)

* fix: flash on home screen

* fix: error flash on addon tabs

* fix: telegram bug

* test fix Tile error flash

* fix: catch Tile error flash in every component it is used

* remove console.log

* Playwright test for input validatiojn (#577)

* feature: Added input validation when creating and editing a community (#172)

* feature: Added input validation when creating and editing a community

* feature: Added input validation when creating and editing a community

* feature: Added input validation when creating and editing a community

* test: Added test for input validation

* fix CI (#581)

* fix the test case

* Improve robustness of admin moderator tests

* Clear draft changes after txn is approved (#588)

* remove `onDraftStateChange` from editor

* updated changes

* move txn hash as props

* update draft change

---------

Co-authored-by: Elliot Braem <[email protected]>
Co-authored-by: T guntenaar <[email protected]>
Co-authored-by: Espen Simensen <[email protected]>

* replacements for testnet

* allow no communities found

* attach 2N when creating a community

* configures with updated function call

* updated announcements UI (#606)

Co-authored-by: Elliot Braem <[email protected]>

* updates feed

* working feed

* show preview

* fix testnet

* Revert "initial typescript support  (#468)"

This reverts commit 8f28dbb.

* Move community Github and Board widgets from devgogigs to devhub (#561)

* fix solution action

* added required components

* remove unnecessary code

* add hidden btn

* update github configurator

* prettier update

* fix flash error issue

* more improvements

* prettier update

* refactor code

* add comment

* added state for when no configurations exists

* fix pagination error

* handle error

* fix map error

* fix amount issue

* updated UI

* decoupled state

* remove replace fn

* remove title on new column

---------

Co-authored-by: T guntenaar <[email protected]>

* Kanban board UI enhancement (#620)

* fix solution action

* added required components

* remove unnecessary code

* add hidden btn

* update github configurator

* prettier update

* fix flash error issue

* more improvements

* prettier update

* refactor code

* add comment

* added state for when no configurations exists

* fix pagination error

* handle error

* fix map error

* fix amount issue

* updated UI

* decoupled state

* added styling

* added table view

* updated UI for github

* more style updates

* added border to table

* refactor code

* cleaned UI

* refactor code

* added sorting mechanism

* prettier update

* reduce border size

* remove table and few style updates

* fix normalize error and suggestive UI changes

* fix .map error

* remove table view data

* update to devhub.near

* fix posts for devgovgigs.near

* Points tests to devhub.near rather than devgovgigs.near (#595)

* converts devgovgigs to devhub

* fix: type

* fix feeds

* Announcements tests (#639)

* added few announcements tests

* hide card when no posts exists

* add more tests and fix announcements UI

* add feed tests

* fixed UI

* fix community tests

* tests

* format

* working test

* format

* posts legacy

---------

Co-authored-by: Megha-Dev-19 <[email protected]>
Co-authored-by: T guntenaar <[email protected]>
Co-authored-by: Espen Simensen <[email protected]>
  • Loading branch information
4 people authored Jan 18, 2024
1 parent 04bb672 commit 43f4646
Show file tree
Hide file tree
Showing 47 changed files with 6,628 additions and 621 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/deploy-dev-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,24 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up node
uses: actions/setup-node@v3
- name: Set replacements
id: set_replacements
run: |
echo "replacements=$(jq -r '[to_entries[] | .["find"] = "${" + .key + "}" | .["replace"] = .value | del(.key, .value)]' replacements.dev.json | tr -d "\n\r")" >> $GITHUB_OUTPUT
- name: Replace placeholders
uses: flcdrg/replace-multiple-action@v1
with:
node-version: 20
cache: "npm"
- run: |
npm install
npm run build
files: '**/*.jsx'
find: '${{ steps.set_replacements.outputs.replacements }}'
prefix: '(^|.*)'
suffix: '($|.*)'

- name: Install bos CLI
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/FroVolod/bos-cli-rs/releases/download/v0.3.2/bos-cli-installer.sh | sh
- name: Deploy widgets
working-directory: ./build
run: |
which bos
echo $PATH
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/deploy-prod-mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,23 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up node
uses: actions/setup-node@v3
- name: Set replacements
id: set_replacements
run: |
echo "replacements=$(jq -r '[to_entries[] | .["find"] = "${" + .key + "}" | .["replace"] = .value | del(.key, .value)]' replacements.mainnet.json | tr -d "\n\r")" >> $GITHUB_OUTPUT
- name: Replace placeholders
uses: flcdrg/replace-multiple-action@v1
with:
node-version: 20
cache: "npm"
- run: |
npm install
npm run build
files: "**/*.jsx"
find: "${{ steps.set_replacements.outputs.replacements }}"
prefix: "(^|.*)"
suffix: "($|.*)"

- name: Install bos CLI
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/FroVolod/bos-cli-rs/releases/download/v0.3.6/bos-cli-installer.sh | sh
- name: Deploy widgets
working-directory: ./build
run: |
bos components deploy "$NEAR_SOCIAL_DEPLOY_ID" sign-as "$NEAR_SOCIAL_ACCOUNT_ID" network-config mainnet sign-with-plaintext-private-key --signer-public-key "$NEAR_SOCIAL_ACCOUNT_PUBLIC_KEY" --signer-private-key "$NEAR_SOCIAL_ACCOUNT_PRIVATE_KEY" send
54 changes: 11 additions & 43 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Contribution Guidelines for DevHub Repos

## Introduction

At DevHub, we value the contributions of each individual. This document provides an overview of the developer setup and deployment process to help you contribute to our project. We also recommend familiarizing yourself with [how we work](https://github.com/near/devgigsboard-widgets/blob/main/docs/how-we-work.md) to learn about our development process and enhance your contribution experience.

## Developer Setup
Expand Down Expand Up @@ -43,26 +42,12 @@ npm install

#### Run the dev script

To initiate the development environment, you can use the following script. This script will first check if bos-loader is installed and, if not, install it. Then, it will serve the default development environment and watch for changes inside `./src`.
To initiate the development environment, you can use the following script. This script will first check if bos-loader is installed and, if not, install it. Then, it will serve the default development environment.

```sh
npm run dev
```

This runs the bos-loader and the watcher together. You can also run testnet by running:

```sh
npm run dev:testnet
```

While testing the testnet, it's necessary to manually execute the watch script yourself to ensure that changes to files trigger the rebuilding process.

Open another terminal and run:

```sh
npm run watch
```

#### Customizing Creator ID, Contract ID, or Network

If you need to customize the account ID, override the contract ID, or specify a different network for your development environment, you can use the following flags:
Expand All @@ -73,26 +58,24 @@ If you need to customize the account ID, override the contract ID, or specify a

Here's how you can use these flags:

> [!IMPORTANT]
> You will have to change the replace script flags in package.json in order for the watch script to keep using the right flags.
```sh
npm run replace -a your_account_id -c your_contract_id -n your_network
npm run dev -a your_account_id -c your_contract_id -n your_network
```

For example:

```sh
npm run replace -a bob.near -c contract.bobs.near -n mainnet
npm run dev -a bob.near -c contract.bobs.near -n mainnet
```

By using these flags, you have the flexibility to customize the development environment according to your specific needs.


#### Developing across multiple environments

When referencing a component or any parameter that depends on the network, please use the placeholders defined in replacements.\*.json. There are three such files that correspond to different environments:
When referencing a component or any parameter that depends on the network, please use the placeholders defined in replacements.*.json. There are three such files that correspond to different environments:

`replacements.dev.json` - deploys the develop branch, to testnet @ test.beta.near.org
`replacements.dev.json` - deploys the develop branch, to testnet @ test.beta.near.org

`replacements.testnet.json` - deploys main branch, to testnet @ test.near.org

Expand All @@ -116,39 +99,25 @@ Currently, there is no local development environment, so we use [testnet NEAR So

Before deploying the widgets you need to make the needed replacements with references to the account that will host the widgets:

Edit the line in package.json that looks like this:

```json
"replace": "node ./scripts/replace.js -a devhub.near -c devgovgigs.near -n mainnet",
```

to something like this:

```json
"replace": "node ./scripts/replace.js -a devgovgigs.petersalomonsen.near -c devgovgigs.near -n mainnet",
```

Run:

```sh
npm run build
npm run build:preview -- -a devgovgigs.petersalomonsen.near -c devgovgigs.near
```

Then make sure you stay in the `build` directory when deploying

```sh
```
cd build
```

To deploy the widgets, we use [`bos` CLI](https://github.com/FroVolod/bos-cli-rs). Start with this command and follow the interactive questionnaire:

```sh
```
bos components deploy
```

After successful deployment, you will see a full command that could be used to re-deploy the widgets without interactive questionnaire, like this:

```sh
```
bos components deploy gigs.frol14.testnet sign-as gigs.frol14.testnet network-config testnet sign-with-macos-keychain send
```

Expand All @@ -168,7 +137,6 @@ There is GitHub Actions automation that deploys all the widgets to [`devgovgigs.
Thus, once a PR is merged, you should see the new version of the widgets on [DevHub](https://neardevhub.org) in less than 15 seconds.

### Before Publishing

Before publishing, make sure that you’ve go through this section.

#### Code Style and Formatting
Expand Down Expand Up @@ -205,4 +173,4 @@ Sometimes there is a need to deposit extra tokens to cover the widgets’ storag
bos social-db prepaid-storage deposit
```

NOTE: `bos` CLI will interactively ask all the rest of the details to prepare the transaction.
NOTE: `bos` CLI will interactively ask all the rest of the details to prepare the transaction.
21 changes: 0 additions & 21 deletions global.d.ts

This file was deleted.

Loading

0 comments on commit 43f4646

Please sign in to comment.