From c53561dd7e96dec9c5167658982417776d4175ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Tue, 2 May 2023 19:06:25 +0400 Subject: [PATCH 01/69] chore: Lint docs --- CONTRIBUTING.md | 21 +++++++++------------ README.md | 8 ++++---- docs/how-we-work.md | 6 +++--- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bbe0a467b..c24ae4d37 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,28 +1,26 @@ # Contributing to NEAR DevHub Components We appreciate community contributions! Before you start writing code, we recommend for developers to: -- Review the list of [good first issues](https://github.com/near/devgigsboard-widgets/contribute). You can pick any issues from the [Backlog column](https://github.com/orgs/near/projects/60) and indicate your interest by leaving comments. -- Get familiar with the [NEAR Social](https://thewiki.near.page/PastPresentAndFutureOfNearSocial) plaform, since the JSX files in this repository are NEAR Social widgets. +- Review the list of [good first issues](https://github.com/near/devgigsboard-widgets/contribute). You can pick any issues from the [Backlog column](https://github.com/orgs/near/projects/60) and indicate your interest by leaving comments. +- Get familiar with the [NEAR Social](https://thewiki.near.page/PastPresentAndFutureOfNearSocial) plaform, since the JSX files in this repository are NEAR Social widgets. ## Prerequisites We use `npm` and scripts in `package.json` to automate common developer tasks, so you will need NodeJS and then install project dependencies as usual: -``` +```shell npm install ``` - ## Code Style Before publishing, we use `prettier` to unify formatting: -``` +```shell npm run fmt ``` - ## Deployment ### Deploy for Testing @@ -31,19 +29,19 @@ Currently, there is no local development environment, so we use [testnet NEAR So To deploy the widgets, we use [`near-social` CLI](https://github.com/FroVolod/near-social). Start with this command and follow the interactive questionary: -``` +```shell near-social deploy ``` After successful deployment, you will see a full command that could be used to re-deploy the widgets without interactive questionary, like this: -``` +```shell near-social deploy gigs.frol14.testnet sign-as gigs.frol14.testnet network-config testnet sign-with-macos-keychain send ``` Once deployed, open `gigs-board.pages.Feed` widget on your account on testnet NEAR Social: -``` +```shell https://test.near.social/#/YOUR_ACCOUNT_ID/widget/gigs-board.pages.Feed?nearDevGovGigsContractAccountId=gigs.frol14.testnet ``` @@ -54,14 +52,13 @@ NOTE: If you have [devgigsboard contract](https://github.com/near/devgigsboard) There is GitHub Actions automation that deploys all the widgets to [`devgovgigs.near` account](https://near.social/#/mob.near/widget/MyPage?accountId=devgovgigs.near) on mainnet on every push to the main branch. Thus, once a PR is merged, you should see the new version of the widgets on [DevGov Gigs Board](https://devgovgigs.near.social) in less then 15 seconds. - ## Helpful Tips ### Making Changes to common.jsx `common.jsx` contains a set of shared utilities that is often reused in DevHub widgets. When you need to change it, just edit the file in the root of the project, and update the widgets with this one command: -``` +```shell npm run build ``` @@ -70,7 +67,7 @@ npm run build near-social CLI [has a limitation regarding accurate storage usage calculations](https://github.com/FroVolod/near-social/issues/18), so sometimes there is a need to deposit extra tokens to cover the widgets storage cost. You can do that with [`near-cli-rs`](https://near.cli.rs): -``` +```shell near-cli-rs contract call-function as-transaction social.near storage_deposit '{"account_id": "YOUR_ACCOUNT_ID"}' --prepaid-gas '100 TeraGas' --attached-deposit '1 NEAR' ``` diff --git a/README.md b/README.md index 0215a50aa..407641234 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# 👋 Welcome to the NEAR DevHub! +# 👋 Welcome to the NEAR DevHub [NEAR DevHub](http://devgovgigs.near.social) is a decentralized community platform for NEAR developers to contribute to the ecosystem and stay informed on the latest topics. It enables anyone to share ideas, match solutions, and access technical support and funding. The Developer DAO team is actively developing the DevHub and welcoming open contributions from the community. We strive to maintain a transparent and efficient process for all. -This repository holds [NEAR Social](https://near.social) widgets to interact with the [DevHub smart-contract](https://github.com/near/devgigsboard). +This repository holds [NEAR Social](https://near.social) widgets to interact with the [DevHub smart-contract](https://github.com/near/devgigsboard). ## How to contribute? @@ -16,10 +16,10 @@ We grant commit access to the Developer DAO team and any active developers who h ## How we work -We communicate primarily over GitHub. We recommend configuring your [notifications](https://docs.github.com/en/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/configuring-notifications) to ensure you get the latest updates. +We communicate primarily over GitHub. We recommend configuring your [notifications](https://docs.github.com/en/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/configuring-notifications) to ensure you get the latest updates. [Learn more](https://github.com/near/devgigsboard-widgets/blob/main/docs/how-we-work.md) about how we work asynchronously. -# Getting Help +## Getting Help If you are working on a specific issue, you can leave a comment. You can also drop a message on the [NEAR Dev](https://t.me/neardev) Telegram channel. diff --git a/docs/how-we-work.md b/docs/how-we-work.md index dee0fb2ec..45a060aab 100644 --- a/docs/how-we-work.md +++ b/docs/how-we-work.md @@ -1,6 +1,6 @@ # How we work -We use a lightweight asynchronous project management approach to enable collaboration between individuals from various time zones. +We use a lightweight asynchronous project management approach to enable collaboration between individuals from various time zones. ## Kanban Project Board @@ -15,10 +15,10 @@ We use a [Kanban board](https://github.com/orgs/near/projects/60/views/1) to tra ## Triaging -Triaging is the process of reviewing all new issues to ensure they are ready for development. Here's how we do it: +Triaging is the process of reviewing all new issues to ensure they are ready for development. Here's how we do it: 1. **Validation**: We review new issues in the triage column and determine if they are valid, actionable, and useful. We may update the title or description, verify the reproduction steps, remove duplicates, and apply the appropriate [labels](https://github.com/near/devgigsboard-widgets/labels). -2. **Prioritization**: We use a prioritization system with four levels: +2. **Prioritization**: We use a prioritization system with four levels: * **P0**: Critical issues that need immediate attention. * **P1**: High-priority issues to address next. * **P2**: Medium-priority issues to address in the coming weeks. From 1cd165957b073215d0000e7ea96e0552fd122264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Thu, 4 May 2023 02:59:07 +0400 Subject: [PATCH 02/69] Update package-lock --- package-lock.json | 100 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 80 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd04ac78d..05895f86a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "devgigsboard-widgets", "version": "1.0.0", "license": "ISC", - "dependencies": { + "devDependencies": { "prettier": "^2.8.4", "replace-in-files": "^3.0.0" } @@ -17,6 +17,7 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -29,6 +30,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, "engines": { "node": ">= 8" } @@ -37,6 +39,7 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -49,6 +52,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, "engines": { "node": ">=8" } @@ -57,6 +61,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -68,6 +73,7 @@ "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, "engines": { "iojs": ">= 1.0.0", "node": ">= 0.12.0" @@ -77,6 +83,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, "dependencies": { "path-type": "^4.0.0" }, @@ -87,12 +94,14 @@ "node_modules/es6-promisify": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.1.1.tgz", - "integrity": "sha512-HBL8I3mIki5C1Cc9QjKUenHtnG0A5/xA8Q/AllRcfiwl2CZFXGK7ddBiCoRwAix4i2KxcQfjtIVcrVbB3vbmwg==" + "integrity": "sha512-HBL8I3mIki5C1Cc9QjKUenHtnG0A5/xA8Q/AllRcfiwl2CZFXGK7ddBiCoRwAix4i2KxcQfjtIVcrVbB3vbmwg==", + "dev": true }, "node_modules/fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -108,6 +117,7 @@ "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, "dependencies": { "reusify": "^1.0.4" } @@ -116,6 +126,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -127,6 +138,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -138,6 +150,7 @@ "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -157,6 +170,7 @@ "version": "5.2.4", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, "engines": { "node": ">= 4" } @@ -164,12 +178,14 @@ "node_modules/is-binary": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-binary/-/is-binary-0.1.0.tgz", - "integrity": "sha512-S5p0zsv2XYP4dntIDW8Q7X7b0zd0Ew+xUb/12iQZ6R+JQyqmjl0V8d/D3cARjFAscJBXXQymUbk6t3J3wp+AbQ==" + "integrity": "sha512-S5p0zsv2XYP4dntIDW8Q7X7b0zd0Ew+xUb/12iQZ6R+JQyqmjl0V8d/D3cARjFAscJBXXQymUbk6t3J3wp+AbQ==", + "dev": true }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -178,6 +194,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -189,6 +206,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, "engines": { "node": ">=0.12.0" } @@ -196,12 +214,14 @@ "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, "engines": { "node": ">= 8" } @@ -210,6 +230,7 @@ "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -222,6 +243,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, "engines": { "node": ">=8" } @@ -230,6 +252,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, "engines": { "node": ">=8.6" }, @@ -241,6 +264,7 @@ "version": "2.8.4", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", + "dev": true, "bin": { "prettier": "bin-prettier.js" }, @@ -255,6 +279,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, "funding": [ { "type": "github", @@ -274,6 +299,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/replace-in-files/-/replace-in-files-3.0.0.tgz", "integrity": "sha512-f3lb8Fac0JZ56BrebGFoRaGvmSAF+M6Zcj0NZl3Qrd6L8HT2LA8/LObCjbTb4Sof/J/gg0tC9pUD/loW4X5u6w==", + "dev": true, "dependencies": { "co": "^4.6.0", "es6-promisify": "^6.1.1", @@ -289,6 +315,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -298,6 +325,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, "funding": [ { "type": "github", @@ -320,6 +348,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, "engines": { "node": ">=8" } @@ -328,6 +357,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -341,6 +371,7 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, "requires": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -349,12 +380,14 @@ "@nodelib/fs.stat": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true }, "@nodelib/fs.walk": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, "requires": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -363,12 +396,14 @@ "array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true }, "braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, "requires": { "fill-range": "^7.0.1" } @@ -376,12 +411,14 @@ "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==" + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true }, "dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, "requires": { "path-type": "^4.0.0" } @@ -389,12 +426,14 @@ "es6-promisify": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.1.1.tgz", - "integrity": "sha512-HBL8I3mIki5C1Cc9QjKUenHtnG0A5/xA8Q/AllRcfiwl2CZFXGK7ddBiCoRwAix4i2KxcQfjtIVcrVbB3vbmwg==" + "integrity": "sha512-HBL8I3mIki5C1Cc9QjKUenHtnG0A5/xA8Q/AllRcfiwl2CZFXGK7ddBiCoRwAix4i2KxcQfjtIVcrVbB3vbmwg==", + "dev": true }, "fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -407,6 +446,7 @@ "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, "requires": { "reusify": "^1.0.4" } @@ -415,6 +455,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, "requires": { "to-regex-range": "^5.0.1" } @@ -423,6 +464,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, "requires": { "is-glob": "^4.0.1" } @@ -431,6 +473,7 @@ "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, "requires": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -443,22 +486,26 @@ "ignore": { "version": "5.2.4", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==" + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true }, "is-binary": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-binary/-/is-binary-0.1.0.tgz", - "integrity": "sha512-S5p0zsv2XYP4dntIDW8Q7X7b0zd0Ew+xUb/12iQZ6R+JQyqmjl0V8d/D3cARjFAscJBXXQymUbk6t3J3wp+AbQ==" + "integrity": "sha512-S5p0zsv2XYP4dntIDW8Q7X7b0zd0Ew+xUb/12iQZ6R+JQyqmjl0V8d/D3cARjFAscJBXXQymUbk6t3J3wp+AbQ==", + "dev": true }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "requires": { "is-extglob": "^2.1.1" } @@ -466,22 +513,26 @@ "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true }, "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true }, "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true }, "micromatch": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, "requires": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -490,27 +541,32 @@ "path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true }, "picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true }, "prettier": { "version": "2.8.4", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", - "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==" + "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", + "dev": true }, "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true }, "replace-in-files": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/replace-in-files/-/replace-in-files-3.0.0.tgz", "integrity": "sha512-f3lb8Fac0JZ56BrebGFoRaGvmSAF+M6Zcj0NZl3Qrd6L8HT2LA8/LObCjbTb4Sof/J/gg0tC9pUD/loW4X5u6w==", + "dev": true, "requires": { "co": "^4.6.0", "es6-promisify": "^6.1.1", @@ -522,12 +578,14 @@ "reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true }, "run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, "requires": { "queue-microtask": "^1.2.2" } @@ -535,12 +593,14 @@ "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "requires": { "is-number": "^7.0.0" } From 972e967372e96394391cb125a397c44acd572f6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Fri, 5 May 2023 02:27:59 +0400 Subject: [PATCH 03/69] Update scripts --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 35b67e67a..d06de2c05 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,9 @@ "scripts": { "fmt": "prettier --write '**/*.{js,jsx,ts,tsx,json}'", "fmt:check": "prettier --check '**/*.{js,jsx,ts,tsx,json}'", - "build": "node build.js" + "build": "npm run fmt && node build.js", + "dev:discovery": "~/.cargo/bin/bos-loader devgovgigs.near --path src", + "dev:social": "echo No command for near.social gateway!" }, "repository": { "type": "git", From 8e3c375ea83422264e84e070aae35c7135287267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Sat, 6 May 2023 03:49:30 +0400 Subject: [PATCH 04/69] chore: Update spell checking dictionary --- .vscode/extensions.json | 3 +++ .vscode/settings.json | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000..ff1b97a2e --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["streetsidesoftware.code-spell-checker"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..290bb605f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "cSpell.words": ["devgigsboard", "devgovgigs", "kanban", "neardevgov"] +} From 119c592ce29be1ebfd7b23bb6bce02415e41ec32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Sat, 6 May 2023 03:50:16 +0400 Subject: [PATCH 05/69] wip: Create community GitHub activity tab --- .../components/community/CommunityHeader.jsx | 154 +++++++++--------- .../pages/community/GitHubActivity.jsx | 57 +++++++ 2 files changed, 133 insertions(+), 78 deletions(-) create mode 100644 src/gigs-board/pages/community/GitHubActivity.jsx diff --git a/src/gigs-board/components/community/CommunityHeader.jsx b/src/gigs-board/components/community/CommunityHeader.jsx index d7b007bcd..1057b05b8 100644 --- a/src/gigs-board/components/community/CommunityHeader.jsx +++ b/src/gigs-board/components/community/CommunityHeader.jsx @@ -74,93 +74,91 @@ const BreadcrumbLink = styled.a` text-decoration: none; } `; + const BreadcrumbBold = styled.b` { color: #3252a6; } `; +const { label, tab } = props; + +const topicTabs = [ + { + contentProps: { label }, + defaultActive: true, + iconClass: "bi-house-door", + path: "community.Overview", + title: "Overview", + }, + { + contentProps: { label }, + iconClass: "bi-chat-square-text", + path: "community.Discussions", + title: "Discussions", + }, + { + contentProps: { label }, + iconClass: "bi-kanban", + path: "community.Sponsorship", + title: "Sponsorship", + }, + { + contentProps: { label }, + iconClass: "bi-calendar", + path: "community.Events", + title: "Events", + }, + { + contentProps: { label }, + iconClass: "bi-github", + path: "community.GitHubActivity", + title: "Custom GH integration", + }, +]; + // TODO nav-underline is available in bootstrap: https://getbootstrap.com/docs/5.3/components/navs-tabs/#underline, // but it's not there in near social, need write such style here return ( - <> -
-
- -
-
- -
-
{props.title}
-
{props.desc}
-
-
+
+
+ +
+ +
+ +
- - - - - - +
{props.title}
+
{props.desc}
-
- + + +
+ + {topicTabs.map(({ contentProps, defaultActive, iconClass, path, title }, topicIdx) => + title ? ( + + ) : null + )} + +
+
); diff --git a/src/gigs-board/pages/community/GitHubActivity.jsx b/src/gigs-board/pages/community/GitHubActivity.jsx new file mode 100644 index 000000000..85f4922a2 --- /dev/null +++ b/src/gigs-board/pages/community/GitHubActivity.jsx @@ -0,0 +1,57 @@ +/* INCLUDE: "common.jsx" */ +const nearDevGovGigsContractAccountId = + props.nearDevGovGigsContractAccountId || + (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +const nearDevGovGigsWidgetsAccountId = + props.nearDevGovGigsWidgetsAccountId || + (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + +function widget(widgetName, widgetProps, key) { + widgetProps = { + ...widgetProps, + nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId, + nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, + referral: props.referral, + }; + return ( + + ); +} + +function href(widgetName, linkProps) { + linkProps = { ...linkProps }; + if (props.nearDevGovGigsContractAccountId) { + linkProps.nearDevGovGigsContractAccountId = + props.nearDevGovGigsContractAccountId; + } + if (props.nearDevGovGigsWidgetsAccountId) { + linkProps.nearDevGovGigsWidgetsAccountId = + props.nearDevGovGigsWidgetsAccountId; + } + if (props.referral) { + linkProps.referral = props.referral; + } + const linkPropsQuery = Object.entries(linkProps) + .map(([key, value]) => `${key}=${value}`) + .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ + linkPropsQuery ? "?" : "" + }${linkPropsQuery}`; +} +/* END_INCLUDE: "common.jsx" */ + +const pulls = []; + +const { label } = props; + +const TabContent =
GH integration placeholder
; + +return widget("components.community.Layout", { + label, + tab: "Custom GH integration", + children: TabContent, +}); From 8f7fd50f0ad933b6062f34b57f88bb4ff4a96be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Sat, 6 May 2023 04:13:04 +0400 Subject: [PATCH 06/69] wip: Update GH integration draft --- .../components/community/CommunityHeader.jsx | 37 ++++++++++--------- .../pages/community/GitHubActivity.jsx | 10 ++++- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/src/gigs-board/components/community/CommunityHeader.jsx b/src/gigs-board/components/community/CommunityHeader.jsx index 1057b05b8..82bfe8759 100644 --- a/src/gigs-board/components/community/CommunityHeader.jsx +++ b/src/gigs-board/components/community/CommunityHeader.jsx @@ -85,32 +85,32 @@ const { label, tab } = props; const topicTabs = [ { - contentProps: { label }, + contentProps: { label }, defaultActive: true, iconClass: "bi-house-door", path: "community.Overview", title: "Overview", }, { - contentProps: { label }, + contentProps: { label }, iconClass: "bi-chat-square-text", path: "community.Discussions", title: "Discussions", }, { - contentProps: { label }, + contentProps: { label }, iconClass: "bi-kanban", path: "community.Sponsorship", title: "Sponsorship", }, { - contentProps: { label }, + contentProps: { label }, iconClass: "bi-calendar", path: "community.Events", title: "Events", }, { - contentProps: { label }, + contentProps: { label }, iconClass: "bi-github", path: "community.GitHubActivity", title: "Custom GH integration", @@ -144,19 +144,20 @@ return (
- {topicTabs.map(({ contentProps, defaultActive, iconClass, path, title }, topicIdx) => - title ? ( - - ) : null + {topicTabs.map( + ({ contentProps, defaultActive, iconClass, path, title }, topicIdx) => + title ? ( + + ) : null )}
diff --git a/src/gigs-board/pages/community/GitHubActivity.jsx b/src/gigs-board/pages/community/GitHubActivity.jsx index 85f4922a2..e72ffdcef 100644 --- a/src/gigs-board/pages/community/GitHubActivity.jsx +++ b/src/gigs-board/pages/community/GitHubActivity.jsx @@ -44,11 +44,17 @@ function href(widgetName, linkProps) { } /* END_INCLUDE: "common.jsx" */ -const pulls = []; +const { body: pullRequests } = fetch("https://api.github.com/repos/near/NEPs/pulls"); const { label } = props; -const TabContent =
GH integration placeholder
; +const TabContent = ( +
+ {pullRequests.map((pullRequest, pullRequestIdx) => ( +

{JSON.stringify(pullRequest)}

+ ))} +
+); return widget("components.community.Layout", { label, From b75c63ec18c5e7526632c81579e49cc37bb3b35f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Sat, 6 May 2023 21:40:44 +0400 Subject: [PATCH 07/69] wip: Update GitHub activity page --- .../components/community/CommunityHeader.jsx | 18 ++++++++-- .../pages/community/GitHubActivity.jsx | 36 +++++++++++++++---- 2 files changed, 46 insertions(+), 8 deletions(-) diff --git a/src/gigs-board/components/community/CommunityHeader.jsx b/src/gigs-board/components/community/CommunityHeader.jsx index 82bfe8759..a002fd4af 100644 --- a/src/gigs-board/components/community/CommunityHeader.jsx +++ b/src/gigs-board/components/community/CommunityHeader.jsx @@ -110,10 +110,24 @@ const topicTabs = [ title: "Events", }, { - contentProps: { label }, + contentProps: { + /** + * Either "new" or "view" + **/ + action: "view", + + /** + * Probably UUIDv4 assigned to the board upon its creation. + * Boards are stored on SocialDB and indexed by those ids. + **/ + boardId: "probablyUUIDv4", + + label, + }, + iconClass: "bi-github", path: "community.GitHubActivity", - title: "Custom GH integration", + title: "Custom GitHub board title", }, ]; diff --git a/src/gigs-board/pages/community/GitHubActivity.jsx b/src/gigs-board/pages/community/GitHubActivity.jsx index e72ffdcef..de9873423 100644 --- a/src/gigs-board/pages/community/GitHubActivity.jsx +++ b/src/gigs-board/pages/community/GitHubActivity.jsx @@ -44,15 +44,39 @@ function href(widgetName, linkProps) { } /* END_INCLUDE: "common.jsx" */ -const { body: pullRequests } = fetch("https://api.github.com/repos/near/NEPs/pulls"); +const inputToBoard = ({ + name = "NEAR Protocol NEPs", + repoURL = "https://github.com/near/NEPs", +}) => { + const { body: pullRequests } = fetch( + `https://api.github.com/repos/${repoURL + .split("/") + .slice(-2, -1) + .join("/")}/pulls` + ); + + console.board(pullRequests); + + return { + boardId: "probablyUUIDv4", // uuid-v4() ? + + columns: [ + { label: "widget", title: "Widget" }, + { label: "integration", title: "Integration" }, + { label: "feature-request", title: "Feature Request" }, + ], + + excludedLabels: [], + name, + requiredLabels: ["near-social"], + }; +}; -const { label } = props; +const { action, boardId, label } = props; const TabContent = ( -
- {pullRequests.map((pullRequest, pullRequestIdx) => ( -

{JSON.stringify(pullRequest)}

- ))} +
+ {widget("components.boards.GitBoard", inputToBoard())}
); From 06eb98485f5e6aa5d62b23957852d5aa4a79bcae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Sat, 6 May 2023 21:41:12 +0400 Subject: [PATCH 08/69] wip: Create GitHub board component --- src/gigs-board/components/boards/GitBoard.jsx | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 src/gigs-board/components/boards/GitBoard.jsx diff --git a/src/gigs-board/components/boards/GitBoard.jsx b/src/gigs-board/components/boards/GitBoard.jsx new file mode 100644 index 000000000..40763e803 --- /dev/null +++ b/src/gigs-board/components/boards/GitBoard.jsx @@ -0,0 +1,152 @@ +/* INCLUDE: "common.jsx" */ +const nearDevGovGigsContractAccountId = + props.nearDevGovGigsContractAccountId || + (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +const nearDevGovGigsWidgetsAccountId = + props.nearDevGovGigsWidgetsAccountId || + (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + +function widget(widgetName, widgetProps, key) { + widgetProps = { + ...widgetProps, + nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId, + nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, + referral: props.referral, + }; + return ( + + ); +} + +function href(widgetName, linkProps) { + linkProps = { ...linkProps }; + if (props.nearDevGovGigsContractAccountId) { + linkProps.nearDevGovGigsContractAccountId = + props.nearDevGovGigsContractAccountId; + } + if (props.nearDevGovGigsWidgetsAccountId) { + linkProps.nearDevGovGigsWidgetsAccountId = + props.nearDevGovGigsWidgetsAccountId; + } + if (props.referral) { + linkProps.referral = props.referral; + } + const linkPropsQuery = Object.entries(linkProps) + .map(([key, value]) => `${key}=${value}`) + .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ + linkPropsQuery ? "?" : "" + }${linkPropsQuery}`; +} +/* END_INCLUDE: "common.jsx" */ + +const requiredLabels = props.requiredLabels ?? ["near-social"]; +const excludedLabels = props.excludedLabels ?? ["nft"]; +const columns = props.columns ?? [ + { label: "widget", title: "Widget" }, + { label: "integration", title: "Integration" }, + { label: "feature-request", title: "Feature Request" }, +]; + +const labelsToIdSet = (labels) => { + const ids = labels.map( + (label) => + Near.view(nearDevGovGigsContractAccountId, "get_posts_by_label", { + label, + }) ?? [] + ); + const idsFlat = ids.flat(1); + return new Set(idsFlat); +}; + +const requiredPostsSet = labelsToIdSet(requiredLabels); +const excludedPostsSet = labelsToIdSet(excludedLabels); + +const postsPerLabel = columns.map((column) => { + let allIds = ( + Near.view(nearDevGovGigsContractAccountId, "get_posts_by_label", { + label: column.label, + }) ?? [] + ).reverse(); + if (requiredLabels.length > 0) { + return { + ...column, + posts: allIds.filter( + (i) => requiredPostsSet.has(i) && !excludedPostsSet.has(i) + ), + }; + } else { + // No extra filtering is required. + return { ...column, posts: allIds }; + } +}); + +return ( +
+
+ {props.boardId ? ( + + ) : null} + + {requiredLabels.length > 0 ? ( +
+ + Required labels: + {requiredLabels.map((label) => ( + + {label} + + ))} + +
+ ) : null} + {excludedLabels.length > 0 ? ( +
+ + Excluded labels: + {excludedLabels.map((label) => ( + + {label} + + ))} + +
+ ) : null} +
+
+ {postsPerLabel.map((column) => ( +
+
+
+
+ {column.title}({column.posts.length}) +
+ {column.posts.map((postId) => + widget("components.posts.CompactPost", { id: postId }, postId) + )} +
+
+
+ ))} +
+
+); From b9b5206447d65275b03e658c4df2a00df6639ee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Sat, 6 May 2023 22:41:10 +0400 Subject: [PATCH 09/69] wip: Update components --- src/gigs-board/components/boards/GitBoard.jsx | 53 +++++---------- .../components/community/CommunityHeader.jsx | 6 +- .../pages/community/GitHubActivity.jsx | 66 ++++++++++++------- 3 files changed, 60 insertions(+), 65 deletions(-) diff --git a/src/gigs-board/components/boards/GitBoard.jsx b/src/gigs-board/components/boards/GitBoard.jsx index 40763e803..cefd9821d 100644 --- a/src/gigs-board/components/boards/GitBoard.jsx +++ b/src/gigs-board/components/boards/GitBoard.jsx @@ -44,46 +44,25 @@ function href(widgetName, linkProps) { } /* END_INCLUDE: "common.jsx" */ -const requiredLabels = props.requiredLabels ?? ["near-social"]; -const excludedLabels = props.excludedLabels ?? ["nft"]; -const columns = props.columns ?? [ - { label: "widget", title: "Widget" }, - { label: "integration", title: "Integration" }, - { label: "feature-request", title: "Feature Request" }, -]; +const { + boardId = null, + columns, + excludedLabels = [], + name, + repoURL = null, + requiredLabels = [], +} = props; -const labelsToIdSet = (labels) => { - const ids = labels.map( - (label) => - Near.view(nearDevGovGigsContractAccountId, "get_posts_by_label", { - label, - }) ?? [] +if (repoURL) { + const { body: pullRequests } = fetch( + `https://api.github.com/repos/${repoURL + .split("/") + .slice(-2, -1) + .join("/")}/pulls` ); - const idsFlat = ids.flat(1); - return new Set(idsFlat); -}; -const requiredPostsSet = labelsToIdSet(requiredLabels); -const excludedPostsSet = labelsToIdSet(excludedLabels); - -const postsPerLabel = columns.map((column) => { - let allIds = ( - Near.view(nearDevGovGigsContractAccountId, "get_posts_by_label", { - label: column.label, - }) ?? [] - ).reverse(); - if (requiredLabels.length > 0) { - return { - ...column, - posts: allIds.filter( - (i) => requiredPostsSet.has(i) && !excludedPostsSet.has(i) - ), - }; - } else { - // No extra filtering is required. - return { ...column, posts: allIds }; - } -}); + console.log(pullRequests); +} return (
diff --git a/src/gigs-board/components/community/CommunityHeader.jsx b/src/gigs-board/components/community/CommunityHeader.jsx index a002fd4af..c3908aba9 100644 --- a/src/gigs-board/components/community/CommunityHeader.jsx +++ b/src/gigs-board/components/community/CommunityHeader.jsx @@ -112,13 +112,13 @@ const topicTabs = [ { contentProps: { /** - * Either "new" or "view" + * Either "new" or "view". **/ - action: "view", + action: "new", /** * Probably UUIDv4 assigned to the board upon its creation. - * Boards are stored on SocialDB and indexed by those ids. + * The parameter is ignored if `action` is `"new"`. **/ boardId: "probablyUUIDv4", diff --git a/src/gigs-board/pages/community/GitHubActivity.jsx b/src/gigs-board/pages/community/GitHubActivity.jsx index de9873423..36f4e11ac 100644 --- a/src/gigs-board/pages/community/GitHubActivity.jsx +++ b/src/gigs-board/pages/community/GitHubActivity.jsx @@ -44,39 +44,55 @@ function href(widgetName, linkProps) { } /* END_INCLUDE: "common.jsx" */ -const inputToBoard = ({ - name = "NEAR Protocol NEPs", - repoURL = "https://github.com/near/NEPs", -}) => { - const { body: pullRequests } = fetch( - `https://api.github.com/repos/${repoURL - .split("/") - .slice(-2, -1) - .join("/")}/pulls` - ); - - console.board(pullRequests); +const { action, boardId, label } = props; - return { - boardId: "probablyUUIDv4", // uuid-v4() ? +const newBoardConfig = { + boardId: "probablyUUIDv4", // uuid-v4() ? - columns: [ - { label: "widget", title: "Widget" }, - { label: "integration", title: "Integration" }, - { label: "feature-request", title: "Feature Request" }, - ], + columns: [ + { label: "widget", title: "Widget" }, + { label: "integration", title: "Integration" }, + { label: "feature-request", title: "Feature Request" }, + ], - excludedLabels: [], - name, - requiredLabels: ["near-social"], - }; + excludedLabels: [], + name: "NEAR Protocol NEPs", + repoURL: "https://github.com/near/NEPs", + requiredLabels: ["near-social"], }; -const { action, boardId, label } = props; +/** + * Reads a board config from SocialDB. + * Currently a mock. + * + * Boards are stored on SocialDB and indexed by those ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + columns: [], + excludedLabels: [], + name: "sample board", + repoURL: "https://github.com/near/NEPs", + requiredLabels: [], + }, + }[boardId]; +}; const TabContent = (
- {widget("components.boards.GitBoard", inputToBoard())} + {action === "new" && ( +
+

New GitHub activity board

+ +
+
+ )} + + {action === "new" && widget("components.boards.GitBoard", newBoardConfig)} + + {action === "view" && + widget("components.boards.GitBoard", boardConfigByBoardId(boardId))}
); From 543d8be6295c680a337b4a112838e71c0552d529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Mon, 8 May 2023 20:30:08 +0400 Subject: [PATCH 10/69] wip: Update GitHub activity page & Format `common` --- .vscode/settings.json | 8 +- common.jsx | 7 ++ src/DevGov/Notification/Item/Left.jsx | 7 ++ src/DevGov/Notification/Item/Right.jsx | 7 ++ src/gigs-board/components/boards/GitBoard.jsx | 102 ++++++++++-------- .../components/boards/KanbanBoard.jsx | 7 ++ .../components/community/CommunityHeader.jsx | 11 +- .../community/FeaturedCommunity.jsx | 7 ++ .../components/community/FeedHeader.jsx | 7 ++ .../components/community/Layout.jsx | 7 ++ src/gigs-board/components/layout/Banner.jsx | 7 ++ src/gigs-board/components/layout/Controls.jsx | 7 ++ .../components/layout/LikeButton/Faces.jsx | 7 ++ src/gigs-board/components/layout/Navbar.jsx | 7 ++ src/gigs-board/components/layout/Page.jsx | 7 ++ .../components/layout/SearchByAuthor.jsx | 7 ++ .../components/layout/SearchByLabel.jsx | 7 ++ .../components/posts/CompactPost.jsx | 7 ++ src/gigs-board/components/posts/List.jsx | 7 ++ src/gigs-board/components/posts/Post.jsx | 7 ++ .../components/posts/PostEditor.jsx | 7 ++ src/gigs-board/components/posts/Search.jsx | 7 ++ .../components/teams/LabelsPermissions.jsx | 7 ++ src/gigs-board/components/teams/TeamInfo.jsx | 7 ++ src/gigs-board/pages/Boards.jsx | 7 ++ src/gigs-board/pages/Feed.jsx | 7 ++ src/gigs-board/pages/Post.jsx | 7 ++ src/gigs-board/pages/Teams.jsx | 7 ++ .../pages/community/Discussions.jsx | 7 ++ src/gigs-board/pages/community/Events.jsx | 7 ++ .../pages/community/GitHubActivity.jsx | 49 ++++++--- src/gigs-board/pages/community/Overview.jsx | 7 ++ .../pages/community/Sponsorship.jsx | 7 ++ 33 files changed, 310 insertions(+), 63 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 290bb605f..5d5f01ac0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,9 @@ { - "cSpell.words": ["devgigsboard", "devgovgigs", "kanban", "neardevgov"] + "cSpell.words": [ + "devgigsboard", + "devgovgigs", + "hstack", + "kanban", + "neardevgov" + ] } diff --git a/common.jsx b/common.jsx index d69722f00..4ad011218 100644 --- a/common.jsx +++ b/common.jsx @@ -1,6 +1,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -12,6 +13,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/DevGov/Notification/Item/Left.jsx b/src/DevGov/Notification/Item/Left.jsx index a64f95137..cb7fd4814 100644 --- a/src/DevGov/Notification/Item/Left.jsx +++ b/src/DevGov/Notification/Item/Left.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/DevGov/Notification/Item/Right.jsx b/src/DevGov/Notification/Item/Right.jsx index 3774c55aa..88a598162 100644 --- a/src/DevGov/Notification/Item/Right.jsx +++ b/src/DevGov/Notification/Item/Right.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/boards/GitBoard.jsx b/src/gigs-board/components/boards/GitBoard.jsx index cefd9821d..3390da118 100644 --- a/src/gigs-board/components/boards/GitBoard.jsx +++ b/src/gigs-board/components/boards/GitBoard.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; @@ -46,82 +53,89 @@ function href(widgetName, linkProps) { const { boardId = null, + contentTypes = { pullRequest: false, issue: false }, columns, excludedLabels = [], + linkedPage, name, repoURL = null, requiredLabels = [], } = props; +State.init({ + itemsByLabel: {}, +}); + if (repoURL) { - const { body: pullRequests } = fetch( - `https://api.github.com/repos/${repoURL - .split("/") - .slice(-2, -1) - .join("/")}/pulls` - ); + if (contentTypes.pullRequest) { + const response = fetch( + `https://api.github.com/repos/${repoURL + .split("/") + .slice(-2, -1) + .join("/")}/pulls` + ).catch(console.error); + + const pullRequestsByLabel = (response.body ?? []).reduce( + (registry, item) => ({ ...registry, [item.labels[0]]: [item] }), + {} + ); + + console.log(pullRequestsByLabel); + } + + if (contentTypes.issue) { + const response = fetch( + `https://api.github.com/repos/${repoURL + .split("/") + .slice(-2, -1) + .join("/")}/issues` + ).catch(console.error); + + const issuesByLabel = (response.body ?? []).reduce( + (registry, issue) => ({ ...registry, [issue.labels[0]]: issue }), + {} + ); - console.log(pullRequests); + console.log(issuesByLabel); + } } return (
- {props.boardId ? ( + {boardId ? ( ) : null} - - {requiredLabels.length > 0 ? ( -
- - Required labels: - {requiredLabels.map((label) => ( - - {label} - - ))} - -
- ) : null} - {excludedLabels.length > 0 ? ( -
- - Excluded labels: - {excludedLabels.map((label) => ( - - {label} - - ))} - -
- ) : null}
+
- {postsPerLabel.map((column) => ( -
+ {Object.entries(state.itemsByLabel).map(([label, items]) => ( +
- {column.title}({column.posts.length}) + {label}({items.length})
- {column.posts.map((postId) => - widget("components.posts.CompactPost", { id: postId }, postId) - )} + + {items.map((item) => { + // widget("components.posts.CompactPost", { id: postId }, postId) + return item; + })}
diff --git a/src/gigs-board/components/boards/KanbanBoard.jsx b/src/gigs-board/components/boards/KanbanBoard.jsx index 40763e803..81a3d90e1 100644 --- a/src/gigs-board/components/boards/KanbanBoard.jsx +++ b/src/gigs-board/components/boards/KanbanBoard.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/community/CommunityHeader.jsx b/src/gigs-board/components/community/CommunityHeader.jsx index c3908aba9..af9842eed 100644 --- a/src/gigs-board/components/community/CommunityHeader.jsx +++ b/src/gigs-board/components/community/CommunityHeader.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; @@ -118,11 +125,9 @@ const topicTabs = [ /** * Probably UUIDv4 assigned to the board upon its creation. - * The parameter is ignored if `action` is `"new"`. + * The parameter is ignored if `action` is `"new"`. **/ boardId: "probablyUUIDv4", - - label, }, iconClass: "bi-github", diff --git a/src/gigs-board/components/community/FeaturedCommunity.jsx b/src/gigs-board/components/community/FeaturedCommunity.jsx index 267527dfc..8b501d5a2 100644 --- a/src/gigs-board/components/community/FeaturedCommunity.jsx +++ b/src/gigs-board/components/community/FeaturedCommunity.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/community/FeedHeader.jsx b/src/gigs-board/components/community/FeedHeader.jsx index 11038f4fb..c6bf447f5 100644 --- a/src/gigs-board/components/community/FeedHeader.jsx +++ b/src/gigs-board/components/community/FeedHeader.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/community/Layout.jsx b/src/gigs-board/components/community/Layout.jsx index 7fc794e12..85fe2e264 100644 --- a/src/gigs-board/components/community/Layout.jsx +++ b/src/gigs-board/components/community/Layout.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/layout/Banner.jsx b/src/gigs-board/components/layout/Banner.jsx index c594cb0b4..e692f18e4 100644 --- a/src/gigs-board/components/layout/Banner.jsx +++ b/src/gigs-board/components/layout/Banner.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/layout/Controls.jsx b/src/gigs-board/components/layout/Controls.jsx index 074dd33c9..9887e44ee 100644 --- a/src/gigs-board/components/layout/Controls.jsx +++ b/src/gigs-board/components/layout/Controls.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/layout/LikeButton/Faces.jsx b/src/gigs-board/components/layout/LikeButton/Faces.jsx index 52d60c168..90bb30dcd 100644 --- a/src/gigs-board/components/layout/LikeButton/Faces.jsx +++ b/src/gigs-board/components/layout/LikeButton/Faces.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/layout/Navbar.jsx b/src/gigs-board/components/layout/Navbar.jsx index ae4ed40be..a69064ade 100644 --- a/src/gigs-board/components/layout/Navbar.jsx +++ b/src/gigs-board/components/layout/Navbar.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/layout/Page.jsx b/src/gigs-board/components/layout/Page.jsx index 5457389d0..5c484cf91 100644 --- a/src/gigs-board/components/layout/Page.jsx +++ b/src/gigs-board/components/layout/Page.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/layout/SearchByAuthor.jsx b/src/gigs-board/components/layout/SearchByAuthor.jsx index 93d548dde..24b7bd35d 100644 --- a/src/gigs-board/components/layout/SearchByAuthor.jsx +++ b/src/gigs-board/components/layout/SearchByAuthor.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/layout/SearchByLabel.jsx b/src/gigs-board/components/layout/SearchByLabel.jsx index d491a1f6a..aaaae2589 100644 --- a/src/gigs-board/components/layout/SearchByLabel.jsx +++ b/src/gigs-board/components/layout/SearchByLabel.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/posts/CompactPost.jsx b/src/gigs-board/components/posts/CompactPost.jsx index be60aa494..7df58340d 100644 --- a/src/gigs-board/components/posts/CompactPost.jsx +++ b/src/gigs-board/components/posts/CompactPost.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/posts/List.jsx b/src/gigs-board/components/posts/List.jsx index df0424851..df09e7ec6 100644 --- a/src/gigs-board/components/posts/List.jsx +++ b/src/gigs-board/components/posts/List.jsx @@ -7,6 +7,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -18,6 +19,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/posts/Post.jsx b/src/gigs-board/components/posts/Post.jsx index a5ddac008..118e924c3 100644 --- a/src/gigs-board/components/posts/Post.jsx +++ b/src/gigs-board/components/posts/Post.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/posts/PostEditor.jsx b/src/gigs-board/components/posts/PostEditor.jsx index d1ef4d650..546db5d83 100644 --- a/src/gigs-board/components/posts/PostEditor.jsx +++ b/src/gigs-board/components/posts/PostEditor.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/posts/Search.jsx b/src/gigs-board/components/posts/Search.jsx index 8d1051c4d..eda0fa140 100644 --- a/src/gigs-board/components/posts/Search.jsx +++ b/src/gigs-board/components/posts/Search.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/teams/LabelsPermissions.jsx b/src/gigs-board/components/teams/LabelsPermissions.jsx index 59111fc73..c0148a364 100644 --- a/src/gigs-board/components/teams/LabelsPermissions.jsx +++ b/src/gigs-board/components/teams/LabelsPermissions.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/teams/TeamInfo.jsx b/src/gigs-board/components/teams/TeamInfo.jsx index 8f4c4c07f..aa1e5b1be 100644 --- a/src/gigs-board/components/teams/TeamInfo.jsx +++ b/src/gigs-board/components/teams/TeamInfo.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/pages/Boards.jsx b/src/gigs-board/pages/Boards.jsx index 87ac7e3dc..a31a9606e 100644 --- a/src/gigs-board/pages/Boards.jsx +++ b/src/gigs-board/pages/Boards.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/pages/Feed.jsx b/src/gigs-board/pages/Feed.jsx index f48326a0e..806dc0df2 100644 --- a/src/gigs-board/pages/Feed.jsx +++ b/src/gigs-board/pages/Feed.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/pages/Post.jsx b/src/gigs-board/pages/Post.jsx index 343cd175d..5e4aa6dea 100644 --- a/src/gigs-board/pages/Post.jsx +++ b/src/gigs-board/pages/Post.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/pages/Teams.jsx b/src/gigs-board/pages/Teams.jsx index e4fff50bc..72bc125e9 100644 --- a/src/gigs-board/pages/Teams.jsx +++ b/src/gigs-board/pages/Teams.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/pages/community/Discussions.jsx b/src/gigs-board/pages/community/Discussions.jsx index 535ead483..d7efc5577 100644 --- a/src/gigs-board/pages/community/Discussions.jsx +++ b/src/gigs-board/pages/community/Discussions.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/pages/community/Events.jsx b/src/gigs-board/pages/community/Events.jsx index 0d2678d95..88e113fee 100644 --- a/src/gigs-board/pages/community/Events.jsx +++ b/src/gigs-board/pages/community/Events.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/pages/community/GitHubActivity.jsx b/src/gigs-board/pages/community/GitHubActivity.jsx index 36f4e11ac..803524714 100644 --- a/src/gigs-board/pages/community/GitHubActivity.jsx +++ b/src/gigs-board/pages/community/GitHubActivity.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; @@ -46,20 +53,27 @@ function href(widgetName, linkProps) { const { action, boardId, label } = props; -const newBoardConfig = { - boardId: "probablyUUIDv4", // uuid-v4() ? +State.init({ + newBoardConfig: { + boardId: "probablyUUIDv4", // uuid-v4() ? - columns: [ - { label: "widget", title: "Widget" }, - { label: "integration", title: "Integration" }, - { label: "feature-request", title: "Feature Request" }, - ], + columns: [ + { label: "widget", title: "Widget" }, + { label: "integration", title: "Integration" }, + { label: "feature-request", title: "Feature Request" }, + ], - excludedLabels: [], - name: "NEAR Protocol NEPs", - repoURL: "https://github.com/near/NEPs", - requiredLabels: ["near-social"], -}; + contentTypes: { + pullRequest: true, + issue: false, + }, + + excludedLabels: [], + name: "NEAR Protocol NEPs", + repoURL: "https://github.com/near/NEPs", + requiredLabels: ["A-NEP"], + }, +}); /** * Reads a board config from SocialDB. @@ -70,6 +84,7 @@ const newBoardConfig = { const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { + id: "probablyUUIDv4", columns: [], excludedLabels: [], name: "sample board", @@ -85,14 +100,18 @@ const TabContent = (

New GitHub activity board

-
+
)} - {action === "new" && widget("components.boards.GitBoard", newBoardConfig)} + {action === "new" && + widget("components.boards.GitBoard", state.newBoardConfig)} {action === "view" && - widget("components.boards.GitBoard", boardConfigByBoardId(boardId))} + widget("components.boards.GitBoard", { + ...boardConfigByBoardId(boardId), + linkedPage: "GitHubActivity", + })}
); diff --git a/src/gigs-board/pages/community/Overview.jsx b/src/gigs-board/pages/community/Overview.jsx index 777e555b5..607841cea 100644 --- a/src/gigs-board/pages/community/Overview.jsx +++ b/src/gigs-board/pages/community/Overview.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/pages/community/Sponsorship.jsx b/src/gigs-board/pages/community/Sponsorship.jsx index 382a16cd2..d8990a654 100644 --- a/src/gigs-board/pages/community/Sponsorship.jsx +++ b/src/gigs-board/pages/community/Sponsorship.jsx @@ -2,6 +2,7 @@ const nearDevGovGigsContractAccountId = props.nearDevGovGigsContractAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; @@ -13,6 +14,7 @@ function widget(widgetName, widgetProps, key) { nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, referral: props.referral, }; + return ( `${key}=${value}`) .join("&"); + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; From cc088dd1bdfab75318f9b23ca0bbfc0272108bc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Mon, 8 May 2023 20:54:47 +0400 Subject: [PATCH 11/69] wip: Update GitHub activity page --- src/gigs-board/components/boards/GitBoard.jsx | 8 +++++--- src/gigs-board/components/community/CommunityHeader.jsx | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gigs-board/components/boards/GitBoard.jsx b/src/gigs-board/components/boards/GitBoard.jsx index 3390da118..df449fa88 100644 --- a/src/gigs-board/components/boards/GitBoard.jsx +++ b/src/gigs-board/components/boards/GitBoard.jsx @@ -73,7 +73,9 @@ if (repoURL) { .split("/") .slice(-2, -1) .join("/")}/pulls` - ).catch(console.error); + ); + + console.log(response.body); const pullRequestsByLabel = (response.body ?? []).reduce( (registry, item) => ({ ...registry, [item.labels[0]]: [item] }), @@ -89,7 +91,7 @@ if (repoURL) { .split("/") .slice(-2, -1) .join("/")}/issues` - ).catch(console.error); + ); const issuesByLabel = (response.body ?? []).reduce( (registry, issue) => ({ ...registry, [issue.labels[0]]: issue }), @@ -129,7 +131,7 @@ return (
- {label}({items.length}) + {label} ({items.length})
{items.map((item) => { diff --git a/src/gigs-board/components/community/CommunityHeader.jsx b/src/gigs-board/components/community/CommunityHeader.jsx index af9842eed..831f9e800 100644 --- a/src/gigs-board/components/community/CommunityHeader.jsx +++ b/src/gigs-board/components/community/CommunityHeader.jsx @@ -128,6 +128,8 @@ const topicTabs = [ * The parameter is ignored if `action` is `"new"`. **/ boardId: "probablyUUIDv4", + + label }, iconClass: "bi-github", From 04c9d5c77a63d9f99ac85eef575c93c1ec4e2802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Mon, 8 May 2023 20:59:44 +0400 Subject: [PATCH 12/69] chore: Inspect the whole `response` --- src/gigs-board/components/boards/GitBoard.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gigs-board/components/boards/GitBoard.jsx b/src/gigs-board/components/boards/GitBoard.jsx index df449fa88..3d5382e41 100644 --- a/src/gigs-board/components/boards/GitBoard.jsx +++ b/src/gigs-board/components/boards/GitBoard.jsx @@ -75,7 +75,7 @@ if (repoURL) { .join("/")}/pulls` ); - console.log(response.body); + console.log(response); const pullRequestsByLabel = (response.body ?? []).reduce( (registry, item) => ({ ...registry, [item.labels[0]]: [item] }), From 327a5899162eceb48b56713638847714b557d0b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Mon, 8 May 2023 22:41:27 +0400 Subject: [PATCH 13/69] wip: Update Git Board components --- src/gigs-board/components/boards/GitBoard.jsx | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/gigs-board/components/boards/GitBoard.jsx b/src/gigs-board/components/boards/GitBoard.jsx index 3d5382e41..b2eb6f3c9 100644 --- a/src/gigs-board/components/boards/GitBoard.jsx +++ b/src/gigs-board/components/boards/GitBoard.jsx @@ -52,14 +52,14 @@ function href(widgetName, linkProps) { /* END_INCLUDE: "common.jsx" */ const { - boardId = null, - contentTypes = { pullRequest: false, issue: false }, + boardId, + contentTypes, columns, - excludedLabels = [], + excludedLabels, linkedPage, name, - repoURL = null, - requiredLabels = [], + repoURL, + requiredLabels, } = props; State.init({ @@ -71,28 +71,30 @@ if (repoURL) { const response = fetch( `https://api.github.com/repos/${repoURL .split("/") - .slice(-2, -1) + .slice(-2) .join("/")}/pulls` ); - console.log(response); - const pullRequestsByLabel = (response.body ?? []).reduce( - (registry, item) => ({ ...registry, [item.labels[0]]: [item] }), + (registry, item) => ({ ...registry, [item.labels[0].name]: [item] }), {} ); console.log(pullRequestsByLabel); + + State.update({ itemsByLabel: pullRequestsByLabel }) } if (contentTypes.issue) { const response = fetch( `https://api.github.com/repos/${repoURL .split("/") - .slice(-2, -1) + .slice(-2) .join("/")}/issues` ); + console.log(response.body) + const issuesByLabel = (response.body ?? []).reduce( (registry, issue) => ({ ...registry, [issue.labels[0]]: issue }), {} @@ -136,7 +138,7 @@ return ( {items.map((item) => { // widget("components.posts.CompactPost", { id: postId }, postId) - return item; + return
{item.title}
; })}
From d1525ae1c213eb03f70f2a2030d4eb699d0a46fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Wed, 10 May 2023 01:52:38 +0400 Subject: [PATCH 14/69] wip: Create GitHub ticket card component & Combine GitHub integration components into single entity --- .../components/community/CommunityHeader.jsx | 4 +- .../GithubRepo/Board.jsx} | 30 ++-- .../entities/GithubRepo/TicketCard.jsx | 133 ++++++++++++++++++ .../pages/community/GitHubActivity.jsx | 10 +- 4 files changed, 157 insertions(+), 20 deletions(-) rename src/gigs-board/{components/boards/GitBoard.jsx => entities/GithubRepo/Board.jsx} (82%) create mode 100644 src/gigs-board/entities/GithubRepo/TicketCard.jsx diff --git a/src/gigs-board/components/community/CommunityHeader.jsx b/src/gigs-board/components/community/CommunityHeader.jsx index 831f9e800..e7dccf380 100644 --- a/src/gigs-board/components/community/CommunityHeader.jsx +++ b/src/gigs-board/components/community/CommunityHeader.jsx @@ -129,11 +129,11 @@ const topicTabs = [ **/ boardId: "probablyUUIDv4", - label + label, }, iconClass: "bi-github", - path: "community.GitHubActivity", + path: "community.GithubActivity", title: "Custom GitHub board title", }, ]; diff --git a/src/gigs-board/components/boards/GitBoard.jsx b/src/gigs-board/entities/GithubRepo/Board.jsx similarity index 82% rename from src/gigs-board/components/boards/GitBoard.jsx rename to src/gigs-board/entities/GithubRepo/Board.jsx index b2eb6f3c9..35f2f8ccb 100644 --- a/src/gigs-board/components/boards/GitBoard.jsx +++ b/src/gigs-board/entities/GithubRepo/Board.jsx @@ -67,7 +67,7 @@ State.init({ }); if (repoURL) { - if (contentTypes.pullRequest) { + if (contentTypes.PullRequest) { const response = fetch( `https://api.github.com/repos/${repoURL .split("/") @@ -76,16 +76,20 @@ if (repoURL) { ); const pullRequestsByLabel = (response.body ?? []).reduce( - (registry, item) => ({ ...registry, [item.labels[0].name]: [item] }), + (registry, item) => { + const itemWithType = { ...item, type: "PullRequest" }; + + return { ...registry, [item.labels[0].name]: [itemWithType] }; + }, {} ); console.log(pullRequestsByLabel); - State.update({ itemsByLabel: pullRequestsByLabel }) + State.update({ itemsByLabel: pullRequestsByLabel }); } - if (contentTypes.issue) { + if (contentTypes.Issue) { const response = fetch( `https://api.github.com/repos/${repoURL .split("/") @@ -93,12 +97,13 @@ if (repoURL) { .join("/")}/issues` ); - console.log(response.body) + console.log(response.body); - const issuesByLabel = (response.body ?? []).reduce( - (registry, issue) => ({ ...registry, [issue.labels[0]]: issue }), - {} - ); + const issuesByLabel = (response.body ?? []).reduce((registry, issue) => { + const itemWithType = { ...item, type: "Issue" }; + + return { ...registry, [issue.labels[0]]: [itemWithType] }; + }, {}); console.log(issuesByLabel); } @@ -136,10 +141,9 @@ return ( {label} ({items.length}) - {items.map((item) => { - // widget("components.posts.CompactPost", { id: postId }, postId) - return
{item.title}
; - })} + {items.map((data) => + widget("entities.GithubRepo.TicketCard", { data }, data.id) + )}
diff --git a/src/gigs-board/entities/GithubRepo/TicketCard.jsx b/src/gigs-board/entities/GithubRepo/TicketCard.jsx new file mode 100644 index 000000000..251e85193 --- /dev/null +++ b/src/gigs-board/entities/GithubRepo/TicketCard.jsx @@ -0,0 +1,133 @@ +/* INCLUDE: "common.jsx" */ +const nearDevGovGigsContractAccountId = + props.nearDevGovGigsContractAccountId || + (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + +const nearDevGovGigsWidgetsAccountId = + props.nearDevGovGigsWidgetsAccountId || + (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; + +function widget(widgetName, widgetProps, key) { + widgetProps = { + ...widgetProps, + nearDevGovGigsContractAccountId: props.nearDevGovGigsContractAccountId, + nearDevGovGigsWidgetsAccountId: props.nearDevGovGigsWidgetsAccountId, + referral: props.referral, + }; + + return ( + + ); +} + +function href(widgetName, linkProps) { + linkProps = { ...linkProps }; + + if (props.nearDevGovGigsContractAccountId) { + linkProps.nearDevGovGigsContractAccountId = + props.nearDevGovGigsContractAccountId; + } + + if (props.nearDevGovGigsWidgetsAccountId) { + linkProps.nearDevGovGigsWidgetsAccountId = + props.nearDevGovGigsWidgetsAccountId; + } + + if (props.referral) { + linkProps.referral = props.referral; + } + + const linkPropsQuery = Object.entries(linkProps) + .map(([key, value]) => `${key}=${value}`) + .join("&"); + + return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ + linkPropsQuery ? "?" : "" + }${linkPropsQuery}`; +} +/* END_INCLUDE: "common.jsx" */ + +const Card = styled.div` + &:hover { + box-shadow: rgba(3, 102, 214, 0.3) 0px 0px 0px 3px; + } +`; + +const LimitedMarkdown = styled.div` + max-height: 6em; +`; + +const ticketIcons = { + Issue: "bi-lightbulb", + PullRequest: "bi-git", +}; + +const { + data: { id, _links, description, labels, number, title, type, user }, +} = props; + +const header = ( +
+ +
+ + +
+
+ +
+
+
+
+
+
+
+); + +return ( + + {header} + +
+
+
+
+ + {type}: {title} +
+
+
+ + + + + +
+ {labels.map((label) => ( + + {label} + + ))} +
+
+
+); diff --git a/src/gigs-board/pages/community/GitHubActivity.jsx b/src/gigs-board/pages/community/GitHubActivity.jsx index 803524714..637180bfc 100644 --- a/src/gigs-board/pages/community/GitHubActivity.jsx +++ b/src/gigs-board/pages/community/GitHubActivity.jsx @@ -64,8 +64,8 @@ State.init({ ], contentTypes: { - pullRequest: true, - issue: false, + PullRequest: true, + Issue: false, }, excludedLabels: [], @@ -105,12 +105,12 @@ const TabContent = ( )} {action === "new" && - widget("components.boards.GitBoard", state.newBoardConfig)} + widget("entities.GithubRepo.Board", state.newBoardConfig)} {action === "view" && - widget("components.boards.GitBoard", { + widget("entities.GithubRepo.Board", { ...boardConfigByBoardId(boardId), - linkedPage: "GitHubActivity", + linkedPage: "GithubActivity", })}
); From 42b4b272bc49fb94e8014d8aaefefc74a2c0d2bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Wed, 10 May 2023 21:29:07 +0400 Subject: [PATCH 15/69] wip: Update GitHub integration components --- src/gigs-board/entities/GithubRepo/Board.jsx | 183 ++++++++++-------- .../entities/GithubRepo/TicketCard.jsx | 86 ++++---- .../pages/community/GitHubActivity.jsx | 135 ++++++------- 3 files changed, 218 insertions(+), 186 deletions(-) diff --git a/src/gigs-board/entities/GithubRepo/Board.jsx b/src/gigs-board/entities/GithubRepo/Board.jsx index 35f2f8ccb..35a5de7e4 100644 --- a/src/gigs-board/entities/GithubRepo/Board.jsx +++ b/src/gigs-board/entities/GithubRepo/Board.jsx @@ -51,103 +51,128 @@ function href(widgetName, linkProps) { } /* END_INCLUDE: "common.jsx" */ -const { +const GithubRepoBoard = ({ boardId, contentTypes, columns, - excludedLabels, linkedPage, name, repoURL, - requiredLabels, -} = props; - -State.init({ - itemsByLabel: {}, -}); - -if (repoURL) { - if (contentTypes.PullRequest) { - const response = fetch( - `https://api.github.com/repos/${repoURL - .split("/") - .slice(-2) - .join("/")}/pulls` - ); - - const pullRequestsByLabel = (response.body ?? []).reduce( - (registry, item) => { +}) => { + State.init({ + ticketByColumn: columns.reduce( + (registry, { title }) => ({ ...registry, [title]: [] }), + {} + ), + }); + + if (repoURL) { + if (contentTypes.PullRequest) { + const pullRequests = + fetch( + `https://api.github.com/repos/${repoURL + .split("/") + .slice(-2) + .join("/")}/pulls` + ).body ?? []; + + const pullRequestByLabel = pullRequests.reduce((registry, item) => { const itemWithType = { ...item, type: "PullRequest" }; return { ...registry, [item.labels[0].name]: [itemWithType] }; - }, - {} - ); + }, {}); - console.log(pullRequestsByLabel); + console.log(pullRequestByLabel); - State.update({ itemsByLabel: pullRequestsByLabel }); - } + State.update(({ ticketByColumn }) => ({ + ticketByColumn: Object.keys(ticketByColumn).reduce( + (registry, columnTitle) => ({ + ...registry, - if (contentTypes.Issue) { - const response = fetch( - `https://api.github.com/repos/${repoURL - .split("/") - .slice(-2) - .join("/")}/issues` - ); + [columnTitle]: [ + ...registry.columnTitle, - console.log(response.body); + ...pullRequests.filter((pullRequest) => + pullRequest.labels.some((label) => + columns[columnTitle].labelFilters.some(label.includes) + ) + ), + ], + }), - const issuesByLabel = (response.body ?? []).reduce((registry, issue) => { - const itemWithType = { ...item, type: "Issue" }; + ticketByColumn + ), + })); - return { ...registry, [issue.labels[0]]: [itemWithType] }; - }, {}); + console.log(state.ticketByColumn); + } - console.log(issuesByLabel); - } -} + if (contentTypes.Issue) { + const issues = + fetch( + `https://api.github.com/repos/${repoURL + .split("/") + .slice(-2) + .join("/")}/issues` + ).body ?? []; -return ( -
-
- {boardId ? ( - - ) : null} -
+ console.log(response.body); + + const issuesByLabel = issues.reduce((registry, issue) => { + const itemWithType = { ...item, type: "Issue" }; + + return { ...registry, [issue.labels[0]]: [itemWithType] }; + }, {}); -
- {Object.entries(state.itemsByLabel).map(([label, items]) => ( -
-
-
-
- {label} ({items.length}) -
- - {items.map((data) => - widget("entities.GithubRepo.TicketCard", { data }, data.id) - )} + console.log(issuesByLabel); + + State.update(({ ticketByColumn }) => ({ ticketByColumn: issuesByLabel })); + } + } + + return ( +
+
+ {boardId ? ( + + ) : null} +
+ +
+ {columns.map((column) => ( +
+
+
+
+ {label} ({items.length}) +
+ + {state.ticketByColumn[column.title].map((data) => + widget("entities.GithubRepo.TicketCard", { data }, data.id) + )} +
-
- ))} + ))} +
-
-); + ); +}; + +return GithubRepoBoard(props); diff --git a/src/gigs-board/entities/GithubRepo/TicketCard.jsx b/src/gigs-board/entities/GithubRepo/TicketCard.jsx index 251e85193..29708a7c2 100644 --- a/src/gigs-board/entities/GithubRepo/TicketCard.jsx +++ b/src/gigs-board/entities/GithubRepo/TicketCard.jsx @@ -66,68 +66,70 @@ const ticketIcons = { PullRequest: "bi-git", }; -const { - data: { id, _links, description, labels, number, title, type, user }, -} = props; - -const header = ( -
- -
- - -
-
+const GithubRepoTicketCard = ({ + data: { _links, labels, number, title, type, user }, +}) => ( + + - -
-); -return ( - - {header} +
+
+ + + +
+
+
+
+
- - {type}: {title} + + {type} #{number}: {title}
- - - -
{labels.map((label) => ( - - {label} + + + {label.name} + ))}
); + +return GithubRepoTicketCard(props); diff --git a/src/gigs-board/pages/community/GitHubActivity.jsx b/src/gigs-board/pages/community/GitHubActivity.jsx index 637180bfc..6893a07c3 100644 --- a/src/gigs-board/pages/community/GitHubActivity.jsx +++ b/src/gigs-board/pages/community/GitHubActivity.jsx @@ -51,72 +51,77 @@ function href(widgetName, linkProps) { } /* END_INCLUDE: "common.jsx" */ -const { action, boardId, label } = props; - -State.init({ - newBoardConfig: { - boardId: "probablyUUIDv4", // uuid-v4() ? - - columns: [ - { label: "widget", title: "Widget" }, - { label: "integration", title: "Integration" }, - { label: "feature-request", title: "Feature Request" }, - ], - - contentTypes: { - PullRequest: true, - Issue: false, - }, - - excludedLabels: [], - name: "NEAR Protocol NEPs", - repoURL: "https://github.com/near/NEPs", - requiredLabels: ["A-NEP"], - }, -}); - -/** - * Reads a board config from SocialDB. - * Currently a mock. - * - * Boards are stored on SocialDB and indexed by those ids. - */ -const boardConfigByBoardId = ({ boardId }) => { - return { - probablyUUIDv4: { - id: "probablyUUIDv4", - columns: [], - excludedLabels: [], - name: "sample board", +const GithubActivityPage = ({ action, boardId, label }) => { + State.init({ + newBoardConfig: { + boardId: "probablyUUIDv4", // uuid-v4() ? + + columns: [ + { + title: "DRAFT", + labelFilters: ["S-draft"], + }, + { + title: "REVIEW", + labelFilters: ["S-review"], + }, + ], + + contentTypes: { + PullRequest: true, + Issue: false, + }, + + name: "NEAR Protocol NEPs", repoURL: "https://github.com/near/NEPs", - requiredLabels: [], }, - }[boardId]; + }); + + /** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ + const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + columns: [], + excludedLabels: [], + name: "sample board", + repoURL: "https://github.com/near/NEPs", + requiredLabels: [], + }, + }[boardId]; + }; + + const TabContent = ( +
+ {action === "new" && ( +
+

New GitHub activity board

+ +
+
+ )} + + {action === "new" && + widget("entities.GithubRepo.Board", state.newBoardConfig)} + + {action === "view" && + widget("entities.GithubRepo.Board", { + ...boardConfigByBoardId(boardId), + linkedPage: "GithubActivity", + })} +
+ ); + + return widget("components.community.Layout", { + label, + tab: "Custom GH integration", + children: TabContent, + }); }; -const TabContent = ( -
- {action === "new" && ( -
-

New GitHub activity board

- -
-
- )} - - {action === "new" && - widget("entities.GithubRepo.Board", state.newBoardConfig)} - - {action === "view" && - widget("entities.GithubRepo.Board", { - ...boardConfigByBoardId(boardId), - linkedPage: "GithubActivity", - })} -
-); - -return widget("components.community.Layout", { - label, - tab: "Custom GH integration", - children: TabContent, -}); +return GithubActivityPage(props); From fcd04cede88bf0f5e1cd3dd9945eb17636e8e7ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Wed, 10 May 2023 22:08:04 +0400 Subject: [PATCH 16/69] wip: Rename bos-loader script --- package-lock.json | 1214 ++++++++++++++++++++++----------------------- package.json | 50 +- 2 files changed, 632 insertions(+), 632 deletions(-) diff --git a/package-lock.json b/package-lock.json index 05895f86a..350ef484d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,609 +1,609 @@ { - "name": "devgigsboard-widgets", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "devgigsboard-widgets", - "version": "1.0.0", - "license": "ISC", - "devDependencies": { - "prettier": "^2.8.4", - "replace-in-files": "^3.0.0" - } - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", - "dev": true, - "engines": { - "iojs": ">= 1.0.0", - "node": ">= 0.12.0" - } - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/es6-promisify": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.1.1.tgz", - "integrity": "sha512-HBL8I3mIki5C1Cc9QjKUenHtnG0A5/xA8Q/AllRcfiwl2CZFXGK7ddBiCoRwAix4i2KxcQfjtIVcrVbB3vbmwg==", - "dev": true - }, - "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/is-binary": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-binary/-/is-binary-0.1.0.tgz", - "integrity": "sha512-S5p0zsv2XYP4dntIDW8Q7X7b0zd0Ew+xUb/12iQZ6R+JQyqmjl0V8d/D3cARjFAscJBXXQymUbk6t3J3wp+AbQ==", - "dev": true - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/prettier": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", - "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", - "dev": true, - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/replace-in-files": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/replace-in-files/-/replace-in-files-3.0.0.tgz", - "integrity": "sha512-f3lb8Fac0JZ56BrebGFoRaGvmSAF+M6Zcj0NZl3Qrd6L8HT2LA8/LObCjbTb4Sof/J/gg0tC9pUD/loW4X5u6w==", - "dev": true, - "dependencies": { - "co": "^4.6.0", - "es6-promisify": "^6.1.1", - "globby": "^11.0.1", - "is-binary": "^0.1.0", - "lodash": "^4.17.20" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - } - }, - "dependencies": { - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", - "dev": true - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "es6-promisify": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.1.1.tgz", - "integrity": "sha512-HBL8I3mIki5C1Cc9QjKUenHtnG0A5/xA8Q/AllRcfiwl2CZFXGK7ddBiCoRwAix4i2KxcQfjtIVcrVbB3vbmwg==", - "dev": true - }, - "fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - } - }, - "fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - } - }, - "ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true - }, - "is-binary": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-binary/-/is-binary-0.1.0.tgz", - "integrity": "sha512-S5p0zsv2XYP4dntIDW8Q7X7b0zd0Ew+xUb/12iQZ6R+JQyqmjl0V8d/D3cARjFAscJBXXQymUbk6t3J3wp+AbQ==", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, - "prettier": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", - "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", - "dev": true - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, - "replace-in-files": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/replace-in-files/-/replace-in-files-3.0.0.tgz", - "integrity": "sha512-f3lb8Fac0JZ56BrebGFoRaGvmSAF+M6Zcj0NZl3Qrd6L8HT2LA8/LObCjbTb4Sof/J/gg0tC9pUD/loW4X5u6w==", - "dev": true, - "requires": { - "co": "^4.6.0", - "es6-promisify": "^6.1.1", - "globby": "^11.0.1", - "is-binary": "^0.1.0", - "lodash": "^4.17.20" - } - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - } - } + "name": "devgigsboard-widgets", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "devgigsboard-widgets", + "version": "1.0.0", + "license": "ISC", + "devDependencies": { + "prettier": "^2.8.4", + "replace-in-files": "^3.0.0" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/es6-promisify": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.1.1.tgz", + "integrity": "sha512-HBL8I3mIki5C1Cc9QjKUenHtnG0A5/xA8Q/AllRcfiwl2CZFXGK7ddBiCoRwAix4i2KxcQfjtIVcrVbB3vbmwg==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/is-binary": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-binary/-/is-binary-0.1.0.tgz", + "integrity": "sha512-S5p0zsv2XYP4dntIDW8Q7X7b0zd0Ew+xUb/12iQZ6R+JQyqmjl0V8d/D3cARjFAscJBXXQymUbk6t3J3wp+AbQ==", + "dev": true + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prettier": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", + "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/replace-in-files": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/replace-in-files/-/replace-in-files-3.0.0.tgz", + "integrity": "sha512-f3lb8Fac0JZ56BrebGFoRaGvmSAF+M6Zcj0NZl3Qrd6L8HT2LA8/LObCjbTb4Sof/J/gg0tC9pUD/loW4X5u6w==", + "dev": true, + "dependencies": { + "co": "^4.6.0", + "es6-promisify": "^6.1.1", + "globby": "^11.0.1", + "is-binary": "^0.1.0", + "lodash": "^4.17.20" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + } + }, + "dependencies": { + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "es6-promisify": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.1.1.tgz", + "integrity": "sha512-HBL8I3mIki5C1Cc9QjKUenHtnG0A5/xA8Q/AllRcfiwl2CZFXGK7ddBiCoRwAix4i2KxcQfjtIVcrVbB3vbmwg==", + "dev": true + }, + "fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + } + }, + "fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + } + }, + "ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true + }, + "is-binary": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-binary/-/is-binary-0.1.0.tgz", + "integrity": "sha512-S5p0zsv2XYP4dntIDW8Q7X7b0zd0Ew+xUb/12iQZ6R+JQyqmjl0V8d/D3cARjFAscJBXXQymUbk6t3J3wp+AbQ==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + }, + "prettier": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", + "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", + "dev": true + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, + "replace-in-files": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/replace-in-files/-/replace-in-files-3.0.0.tgz", + "integrity": "sha512-f3lb8Fac0JZ56BrebGFoRaGvmSAF+M6Zcj0NZl3Qrd6L8HT2LA8/LObCjbTb4Sof/J/gg0tC9pUD/loW4X5u6w==", + "dev": true, + "requires": { + "co": "^4.6.0", + "es6-promisify": "^6.1.1", + "globby": "^11.0.1", + "is-binary": "^0.1.0", + "lodash": "^4.17.20" + } + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } } diff --git a/package.json b/package.json index d06de2c05..a894ba13f 100644 --- a/package.json +++ b/package.json @@ -1,26 +1,26 @@ { - "name": "devgigsboard-widgets", - "version": "1.0.0", - "description": "NEAR Developer Governance Gigs Board widgets for NEAR Social", - "devDependencies": { - "prettier": "^2.8.4", - "replace-in-files": "^3.0.0" - }, - "scripts": { - "fmt": "prettier --write '**/*.{js,jsx,ts,tsx,json}'", - "fmt:check": "prettier --check '**/*.{js,jsx,ts,tsx,json}'", - "build": "npm run fmt && node build.js", - "dev:discovery": "~/.cargo/bin/bos-loader devgovgigs.near --path src", - "dev:social": "echo No command for near.social gateway!" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/near/devgigsboard-widgets.git" - }, - "author": "Near Inc ", - "license": "ISC", - "bugs": { - "url": "https://github.com/near/devgigsboard-widgets/issues" - }, - "homepage": "https://github.com/near/devgigsboard-widgets#readme" -} + "name": "devgigsboard-widgets", + "version": "1.0.0", + "description": "NEAR Developer Governance Gigs Board widgets for NEAR Social", + "devDependencies": { + "prettier": "^2.8.4", + "replace-in-files": "^3.0.0" + }, + "scripts": { + "fmt": "prettier --write '**/*.{js,jsx,ts,tsx,json}'", + "fmt:check": "prettier --check '**/*.{js,jsx,ts,tsx,json}'", + "build": "npm run fmt && node build.js", + "dev:loader": "~/.cargo/bin/bos-loader devgovgigs.near --path src", + "dev:social": "echo No command for near.social gateway!" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/near/devgigsboard-widgets.git" + }, + "author": "Near Inc ", + "license": "ISC", + "bugs": { + "url": "https://github.com/near/devgigsboard-widgets/issues" + }, + "homepage": "https://github.com/near/devgigsboard-widgets#readme" +} \ No newline at end of file From b5cd80669c1fa081c9d3a01f79c4fca552280777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Fri, 12 May 2023 05:14:59 +0400 Subject: [PATCH 17/69] chore: Update package-lock --- package-lock.json | 1214 ++++++++++++++++++++++----------------------- package.json | 50 +- 2 files changed, 632 insertions(+), 632 deletions(-) diff --git a/package-lock.json b/package-lock.json index 350ef484d..05895f86a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,609 +1,609 @@ { - "name": "devgigsboard-widgets", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "devgigsboard-widgets", - "version": "1.0.0", - "license": "ISC", - "devDependencies": { - "prettier": "^2.8.4", - "replace-in-files": "^3.0.0" - } - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", - "dev": true, - "engines": { - "iojs": ">= 1.0.0", - "node": ">= 0.12.0" - } - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/es6-promisify": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.1.1.tgz", - "integrity": "sha512-HBL8I3mIki5C1Cc9QjKUenHtnG0A5/xA8Q/AllRcfiwl2CZFXGK7ddBiCoRwAix4i2KxcQfjtIVcrVbB3vbmwg==", - "dev": true - }, - "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/is-binary": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-binary/-/is-binary-0.1.0.tgz", - "integrity": "sha512-S5p0zsv2XYP4dntIDW8Q7X7b0zd0Ew+xUb/12iQZ6R+JQyqmjl0V8d/D3cARjFAscJBXXQymUbk6t3J3wp+AbQ==", - "dev": true - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/prettier": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", - "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", - "dev": true, - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/replace-in-files": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/replace-in-files/-/replace-in-files-3.0.0.tgz", - "integrity": "sha512-f3lb8Fac0JZ56BrebGFoRaGvmSAF+M6Zcj0NZl3Qrd6L8HT2LA8/LObCjbTb4Sof/J/gg0tC9pUD/loW4X5u6w==", - "dev": true, - "dependencies": { - "co": "^4.6.0", - "es6-promisify": "^6.1.1", - "globby": "^11.0.1", - "is-binary": "^0.1.0", - "lodash": "^4.17.20" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - } - }, - "dependencies": { - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", - "dev": true - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "es6-promisify": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.1.1.tgz", - "integrity": "sha512-HBL8I3mIki5C1Cc9QjKUenHtnG0A5/xA8Q/AllRcfiwl2CZFXGK7ddBiCoRwAix4i2KxcQfjtIVcrVbB3vbmwg==", - "dev": true - }, - "fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - } - }, - "fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - } - }, - "ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true - }, - "is-binary": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-binary/-/is-binary-0.1.0.tgz", - "integrity": "sha512-S5p0zsv2XYP4dntIDW8Q7X7b0zd0Ew+xUb/12iQZ6R+JQyqmjl0V8d/D3cARjFAscJBXXQymUbk6t3J3wp+AbQ==", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, - "prettier": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", - "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", - "dev": true - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, - "replace-in-files": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/replace-in-files/-/replace-in-files-3.0.0.tgz", - "integrity": "sha512-f3lb8Fac0JZ56BrebGFoRaGvmSAF+M6Zcj0NZl3Qrd6L8HT2LA8/LObCjbTb4Sof/J/gg0tC9pUD/loW4X5u6w==", - "dev": true, - "requires": { - "co": "^4.6.0", - "es6-promisify": "^6.1.1", - "globby": "^11.0.1", - "is-binary": "^0.1.0", - "lodash": "^4.17.20" - } - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - } - } + "name": "devgigsboard-widgets", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "devgigsboard-widgets", + "version": "1.0.0", + "license": "ISC", + "devDependencies": { + "prettier": "^2.8.4", + "replace-in-files": "^3.0.0" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/es6-promisify": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.1.1.tgz", + "integrity": "sha512-HBL8I3mIki5C1Cc9QjKUenHtnG0A5/xA8Q/AllRcfiwl2CZFXGK7ddBiCoRwAix4i2KxcQfjtIVcrVbB3vbmwg==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/is-binary": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-binary/-/is-binary-0.1.0.tgz", + "integrity": "sha512-S5p0zsv2XYP4dntIDW8Q7X7b0zd0Ew+xUb/12iQZ6R+JQyqmjl0V8d/D3cARjFAscJBXXQymUbk6t3J3wp+AbQ==", + "dev": true + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prettier": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", + "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/replace-in-files": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/replace-in-files/-/replace-in-files-3.0.0.tgz", + "integrity": "sha512-f3lb8Fac0JZ56BrebGFoRaGvmSAF+M6Zcj0NZl3Qrd6L8HT2LA8/LObCjbTb4Sof/J/gg0tC9pUD/loW4X5u6w==", + "dev": true, + "dependencies": { + "co": "^4.6.0", + "es6-promisify": "^6.1.1", + "globby": "^11.0.1", + "is-binary": "^0.1.0", + "lodash": "^4.17.20" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + } + }, + "dependencies": { + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "es6-promisify": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.1.1.tgz", + "integrity": "sha512-HBL8I3mIki5C1Cc9QjKUenHtnG0A5/xA8Q/AllRcfiwl2CZFXGK7ddBiCoRwAix4i2KxcQfjtIVcrVbB3vbmwg==", + "dev": true + }, + "fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + } + }, + "fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + } + }, + "ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true + }, + "is-binary": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-binary/-/is-binary-0.1.0.tgz", + "integrity": "sha512-S5p0zsv2XYP4dntIDW8Q7X7b0zd0Ew+xUb/12iQZ6R+JQyqmjl0V8d/D3cARjFAscJBXXQymUbk6t3J3wp+AbQ==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + }, + "prettier": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", + "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", + "dev": true + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, + "replace-in-files": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/replace-in-files/-/replace-in-files-3.0.0.tgz", + "integrity": "sha512-f3lb8Fac0JZ56BrebGFoRaGvmSAF+M6Zcj0NZl3Qrd6L8HT2LA8/LObCjbTb4Sof/J/gg0tC9pUD/loW4X5u6w==", + "dev": true, + "requires": { + "co": "^4.6.0", + "es6-promisify": "^6.1.1", + "globby": "^11.0.1", + "is-binary": "^0.1.0", + "lodash": "^4.17.20" + } + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } } diff --git a/package.json b/package.json index a894ba13f..e73c81b7f 100644 --- a/package.json +++ b/package.json @@ -1,26 +1,26 @@ { - "name": "devgigsboard-widgets", - "version": "1.0.0", - "description": "NEAR Developer Governance Gigs Board widgets for NEAR Social", - "devDependencies": { - "prettier": "^2.8.4", - "replace-in-files": "^3.0.0" - }, - "scripts": { - "fmt": "prettier --write '**/*.{js,jsx,ts,tsx,json}'", - "fmt:check": "prettier --check '**/*.{js,jsx,ts,tsx,json}'", - "build": "npm run fmt && node build.js", - "dev:loader": "~/.cargo/bin/bos-loader devgovgigs.near --path src", - "dev:social": "echo No command for near.social gateway!" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/near/devgigsboard-widgets.git" - }, - "author": "Near Inc ", - "license": "ISC", - "bugs": { - "url": "https://github.com/near/devgigsboard-widgets/issues" - }, - "homepage": "https://github.com/near/devgigsboard-widgets#readme" -} \ No newline at end of file + "name": "devgigsboard-widgets", + "version": "1.0.0", + "description": "NEAR Developer Governance Gigs Board widgets for NEAR Social", + "devDependencies": { + "prettier": "^2.8.4", + "replace-in-files": "^3.0.0" + }, + "scripts": { + "fmt": "prettier --write '**/*.{js,jsx,ts,tsx,json}'", + "fmt:check": "prettier --check '**/*.{js,jsx,ts,tsx,json}'", + "build": "npm run fmt && node build.js", + "dev:loader": "~/.cargo/bin/bos-loader devgovgigs.near --path src", + "dev:social": "echo No command for near.social gateway!" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/near/devgigsboard-widgets.git" + }, + "author": "Near Inc ", + "license": "ISC", + "bugs": { + "url": "https://github.com/near/devgigsboard-widgets/issues" + }, + "homepage": "https://github.com/near/devgigsboard-widgets#readme" +} From 0b82a8e8b2effe7a1935df14d9744377bf2538aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Fri, 12 May 2023 05:15:40 +0400 Subject: [PATCH 18/69] wip: Update GitHub integration components & Fix errors --- src/gigs-board/entities/GithubRepo/Board.jsx | 32 ++++++++----------- .../pages/community/GitHubActivity.jsx | 30 +++++++---------- 2 files changed, 25 insertions(+), 37 deletions(-) diff --git a/src/gigs-board/entities/GithubRepo/Board.jsx b/src/gigs-board/entities/GithubRepo/Board.jsx index 35a5de7e4..97982135d 100644 --- a/src/gigs-board/entities/GithubRepo/Board.jsx +++ b/src/gigs-board/entities/GithubRepo/Board.jsx @@ -76,25 +76,19 @@ const GithubRepoBoard = ({ .join("/")}/pulls` ).body ?? []; - const pullRequestByLabel = pullRequests.reduce((registry, item) => { - const itemWithType = { ...item, type: "PullRequest" }; - - return { ...registry, [item.labels[0].name]: [itemWithType] }; - }, {}); - - console.log(pullRequestByLabel); - - State.update(({ ticketByColumn }) => ({ - ticketByColumn: Object.keys(ticketByColumn).reduce( - (registry, columnTitle) => ({ + State.update({ + ticketByColumn: columns.reduce( + (registry, column) => ({ ...registry, - [columnTitle]: [ - ...registry.columnTitle, + [column.title]: [ + ...(registry[column.title] ?? []), ...pullRequests.filter((pullRequest) => pullRequest.labels.some((label) => - columns[columnTitle].labelFilters.some(label.includes) + column?.labelFilters.some((searchTerm) => + label.name.includes(searchTerm) + ) ) ), ], @@ -102,11 +96,11 @@ const GithubRepoBoard = ({ ticketByColumn ), - })); - - console.log(state.ticketByColumn); + }); } + console.log(state.ticketByColumn); + if (contentTypes.Issue) { const issues = fetch( @@ -160,10 +154,10 @@ const GithubRepoBoard = ({
- {label} ({items.length}) + {column.title} ({state.ticketByColumn[column.title].length})
- {state.ticketByColumn[column.title].map((data) => + {(state.ticketByColumn[column.title] ?? []).map((data) => widget("entities.GithubRepo.TicketCard", { data }, data.id) )}
diff --git a/src/gigs-board/pages/community/GitHubActivity.jsx b/src/gigs-board/pages/community/GitHubActivity.jsx index 6893a07c3..9dd0945cd 100644 --- a/src/gigs-board/pages/community/GitHubActivity.jsx +++ b/src/gigs-board/pages/community/GitHubActivity.jsx @@ -54,24 +54,14 @@ function href(widgetName, linkProps) { const GithubActivityPage = ({ action, boardId, label }) => { State.init({ newBoardConfig: { - boardId: "probablyUUIDv4", // uuid-v4() ? + id: "probablyUUIDv4", columns: [ - { - title: "DRAFT", - labelFilters: ["S-draft"], - }, - { - title: "REVIEW", - labelFilters: ["S-review"], - }, + { title: "DRAFT", labelFilters: ["S-draft"] }, + { title: "REVIEW", labelFilters: ["S-review"] }, ], - contentTypes: { - PullRequest: true, - Issue: false, - }, - + contentTypes: { Issue: false, PullRequest: true }, name: "NEAR Protocol NEPs", repoURL: "https://github.com/near/NEPs", }, @@ -87,11 +77,15 @@ const GithubActivityPage = ({ action, boardId, label }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [], - excludedLabels: [], - name: "sample board", + + columns: [ + { title: "DRAFT", labelFilters: ["S-draft"] }, + { title: "REVIEW", labelFilters: ["S-review"] }, + ], + + contentTypes: { Issue: false, PullRequest: true }, + name: "NEAR Protocol NEPs", repoURL: "https://github.com/near/NEPs", - requiredLabels: [], }, }[boardId]; }; From 301efc5ce280d46acbcdf39b4833184b24c641c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Fri, 12 May 2023 06:14:21 +0400 Subject: [PATCH 19/69] wip: Fix errors in GH repo ticket card --- src/gigs-board/entities/GithubRepo/Board.jsx | 30 ++++++++----------- .../entities/GithubRepo/TicketCard.jsx | 29 ++++++++++-------- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/src/gigs-board/entities/GithubRepo/Board.jsx b/src/gigs-board/entities/GithubRepo/Board.jsx index 97982135d..653260b9a 100644 --- a/src/gigs-board/entities/GithubRepo/Board.jsx +++ b/src/gigs-board/entities/GithubRepo/Board.jsx @@ -68,13 +68,14 @@ const GithubRepoBoard = ({ if (repoURL) { if (contentTypes.PullRequest) { - const pullRequests = + const pullRequests = ( fetch( `https://api.github.com/repos/${repoURL .split("/") .slice(-2) .join("/")}/pulls` - ).body ?? []; + ).body ?? [] + ).map((pullRequest) => ({ ...pullRequest, type: "PullRequest" })); State.update({ ticketByColumn: columns.reduce( @@ -102,25 +103,14 @@ const GithubRepoBoard = ({ console.log(state.ticketByColumn); if (contentTypes.Issue) { - const issues = + const issues = ( fetch( `https://api.github.com/repos/${repoURL .split("/") .slice(-2) .join("/")}/issues` - ).body ?? []; - - console.log(response.body); - - const issuesByLabel = issues.reduce((registry, issue) => { - const itemWithType = { ...item, type: "Issue" }; - - return { ...registry, [issue.labels[0]]: [itemWithType] }; - }, {}); - - console.log(issuesByLabel); - - State.update(({ ticketByColumn }) => ({ ticketByColumn: issuesByLabel })); + ).body ?? [] + ).map((issue) => ({ ...issue, type: "Issue" })); } } @@ -153,8 +143,12 @@ const GithubRepoBoard = ({
-
- {column.title} ({state.ticketByColumn[column.title].length}) +
+ {column.title} + + + {state.ticketByColumn[column.title].length} +
{(state.ticketByColumn[column.title] ?? []).map((data) => diff --git a/src/gigs-board/entities/GithubRepo/TicketCard.jsx b/src/gigs-board/entities/GithubRepo/TicketCard.jsx index 29708a7c2..f3a0b7607 100644 --- a/src/gigs-board/entities/GithubRepo/TicketCard.jsx +++ b/src/gigs-board/entities/GithubRepo/TicketCard.jsx @@ -61,9 +61,9 @@ const LimitedMarkdown = styled.div` max-height: 6em; `; -const ticketIcons = { - Issue: "bi-lightbulb", - PullRequest: "bi-git", +const ticketTypes = { + Issue: { displayName: "Issue", icon: "bi-lightbulb" }, + PullRequest: { displayName: "Pull request", icon: "bi-git" }, }; const GithubRepoTicketCard = ({ @@ -72,19 +72,20 @@ const GithubRepoTicketCard = ({
-
+
@@ -92,7 +93,7 @@ const GithubRepoTicketCard = ({
{labels.map((label) => ( - + {label.name} From 1822c6871bb4f15aa25b6e8c0f84309e412c9ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Fri, 12 May 2023 06:36:14 +0400 Subject: [PATCH 20/69] wip: Enable active page indicator for GH activity page --- src/gigs-board/pages/community/GitHubActivity.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gigs-board/pages/community/GitHubActivity.jsx b/src/gigs-board/pages/community/GitHubActivity.jsx index 9dd0945cd..369a64b17 100644 --- a/src/gigs-board/pages/community/GitHubActivity.jsx +++ b/src/gigs-board/pages/community/GitHubActivity.jsx @@ -113,7 +113,7 @@ const GithubActivityPage = ({ action, boardId, label }) => { return widget("components.community.Layout", { label, - tab: "Custom GH integration", + tab: "Custom GitHub board title", children: TabContent, }); }; From d3603679b5951b011b1e86cba9a5958435dd1a23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Sat, 13 May 2023 06:50:11 +0400 Subject: [PATCH 21/69] wip: Update GH integration UI & Create common components --- .vscode/settings.json | 1 + common.jsx | 9 + src/DevGov/Notification/Item/Left.jsx | 9 + src/DevGov/Notification/Item/Right.jsx | 9 + .../components/boards/KanbanBoard.jsx | 9 + .../components/community/CommunityHeader.jsx | 9 + .../community/FeaturedCommunity.jsx | 9 + .../components/community/FeedHeader.jsx | 9 + .../components/community/Layout.jsx | 9 + src/gigs-board/components/layout/Banner.jsx | 9 + src/gigs-board/components/layout/Controls.jsx | 9 + .../components/layout/LikeButton/Faces.jsx | 9 + src/gigs-board/components/layout/Navbar.jsx | 9 + src/gigs-board/components/layout/Page.jsx | 9 + .../components/layout/SearchByAuthor.jsx | 9 + .../components/layout/SearchByLabel.jsx | 9 + .../components/posts/CompactPost.jsx | 9 + src/gigs-board/components/posts/List.jsx | 9 + src/gigs-board/components/posts/Post.jsx | 9 + .../components/posts/PostEditor.jsx | 9 + src/gigs-board/components/posts/Search.jsx | 9 + .../components/teams/LabelsPermissions.jsx | 9 + src/gigs-board/components/teams/TeamInfo.jsx | 9 + src/gigs-board/entities/GithubRepo/Board.jsx | 70 +++++--- .../entities/GithubRepo/TicketCard.jsx | 69 ++++---- src/gigs-board/pages/Boards.jsx | 9 + src/gigs-board/pages/Feed.jsx | 9 + src/gigs-board/pages/Post.jsx | 9 + src/gigs-board/pages/Teams.jsx | 9 + .../pages/community/Discussions.jsx | 9 + src/gigs-board/pages/community/Events.jsx | 9 + .../pages/community/GitHubActivity.jsx | 160 +++++++++++++----- src/gigs-board/pages/community/Overview.jsx | 9 + .../pages/community/Sponsorship.jsx | 9 + 34 files changed, 462 insertions(+), 108 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 5d5f01ac0..963b88a43 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "cSpell.words": [ + "describedby", "devgigsboard", "devgovgigs", "hstack", diff --git a/common.jsx b/common.jsx index 4ad011218..cb4006fe8 100644 --- a/common.jsx +++ b/common.jsx @@ -48,3 +48,12 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; diff --git a/src/DevGov/Notification/Item/Left.jsx b/src/DevGov/Notification/Item/Left.jsx index cb7fd4814..80940e61f 100644 --- a/src/DevGov/Notification/Item/Left.jsx +++ b/src/DevGov/Notification/Item/Left.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ if (!props.type) { diff --git a/src/DevGov/Notification/Item/Right.jsx b/src/DevGov/Notification/Item/Right.jsx index 88a598162..598ac1276 100644 --- a/src/DevGov/Notification/Item/Right.jsx +++ b/src/DevGov/Notification/Item/Right.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ return props.post === undefined ? ( diff --git a/src/gigs-board/components/boards/KanbanBoard.jsx b/src/gigs-board/components/boards/KanbanBoard.jsx index 81a3d90e1..e63a8bbb4 100644 --- a/src/gigs-board/components/boards/KanbanBoard.jsx +++ b/src/gigs-board/components/boards/KanbanBoard.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ const requiredLabels = props.requiredLabels ?? ["near-social"]; diff --git a/src/gigs-board/components/community/CommunityHeader.jsx b/src/gigs-board/components/community/CommunityHeader.jsx index e7dccf380..40bf3bab6 100644 --- a/src/gigs-board/components/community/CommunityHeader.jsx +++ b/src/gigs-board/components/community/CommunityHeader.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ const Header = styled.div` diff --git a/src/gigs-board/components/community/FeaturedCommunity.jsx b/src/gigs-board/components/community/FeaturedCommunity.jsx index 8b501d5a2..336830980 100644 --- a/src/gigs-board/components/community/FeaturedCommunity.jsx +++ b/src/gigs-board/components/community/FeaturedCommunity.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ const Hover = styled.div` diff --git a/src/gigs-board/components/community/FeedHeader.jsx b/src/gigs-board/components/community/FeedHeader.jsx index c6bf447f5..5fffbe810 100644 --- a/src/gigs-board/components/community/FeedHeader.jsx +++ b/src/gigs-board/components/community/FeedHeader.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ /* INCLUDE: "communities.jsx" */ diff --git a/src/gigs-board/components/community/Layout.jsx b/src/gigs-board/components/community/Layout.jsx index 85fe2e264..4ecd6a4a8 100644 --- a/src/gigs-board/components/community/Layout.jsx +++ b/src/gigs-board/components/community/Layout.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ /* INCLUDE: "communities.jsx" */ diff --git a/src/gigs-board/components/layout/Banner.jsx b/src/gigs-board/components/layout/Banner.jsx index e692f18e4..47d0ef120 100644 --- a/src/gigs-board/components/layout/Banner.jsx +++ b/src/gigs-board/components/layout/Banner.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ const Banner = styled.div` diff --git a/src/gigs-board/components/layout/Controls.jsx b/src/gigs-board/components/layout/Controls.jsx index 9887e44ee..803528685 100644 --- a/src/gigs-board/components/layout/Controls.jsx +++ b/src/gigs-board/components/layout/Controls.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ return ( diff --git a/src/gigs-board/components/layout/LikeButton/Faces.jsx b/src/gigs-board/components/layout/LikeButton/Faces.jsx index 90bb30dcd..b598bc12e 100644 --- a/src/gigs-board/components/layout/LikeButton/Faces.jsx +++ b/src/gigs-board/components/layout/LikeButton/Faces.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ const accountId = context.accountId; diff --git a/src/gigs-board/components/layout/Navbar.jsx b/src/gigs-board/components/layout/Navbar.jsx index a69064ade..bbc214464 100644 --- a/src/gigs-board/components/layout/Navbar.jsx +++ b/src/gigs-board/components/layout/Navbar.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ return ( diff --git a/src/gigs-board/components/layout/Page.jsx b/src/gigs-board/components/layout/Page.jsx index 5c484cf91..f3addefdf 100644 --- a/src/gigs-board/components/layout/Page.jsx +++ b/src/gigs-board/components/layout/Page.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ return ( diff --git a/src/gigs-board/components/layout/SearchByAuthor.jsx b/src/gigs-board/components/layout/SearchByAuthor.jsx index 24b7bd35d..27f886521 100644 --- a/src/gigs-board/components/layout/SearchByAuthor.jsx +++ b/src/gigs-board/components/layout/SearchByAuthor.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ const onSearchAuthor = props.onSearchAuthor; diff --git a/src/gigs-board/components/layout/SearchByLabel.jsx b/src/gigs-board/components/layout/SearchByLabel.jsx index aaaae2589..07ad0182e 100644 --- a/src/gigs-board/components/layout/SearchByLabel.jsx +++ b/src/gigs-board/components/layout/SearchByLabel.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ const onSearchLabel = props.onSearchLabel; diff --git a/src/gigs-board/components/posts/CompactPost.jsx b/src/gigs-board/components/posts/CompactPost.jsx index 7df58340d..75327b04d 100644 --- a/src/gigs-board/components/posts/CompactPost.jsx +++ b/src/gigs-board/components/posts/CompactPost.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ const postId = props.post.id ?? (props.id ? parseInt(props.id) : 0); diff --git a/src/gigs-board/components/posts/List.jsx b/src/gigs-board/components/posts/List.jsx index df09e7ec6..b319a04e0 100644 --- a/src/gigs-board/components/posts/List.jsx +++ b/src/gigs-board/components/posts/List.jsx @@ -54,6 +54,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ initState({ diff --git a/src/gigs-board/components/posts/Post.jsx b/src/gigs-board/components/posts/Post.jsx index 118e924c3..5a5af5fb6 100644 --- a/src/gigs-board/components/posts/Post.jsx +++ b/src/gigs-board/components/posts/Post.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ const postId = props.post.id ?? (props.id ? parseInt(props.id) : 0); diff --git a/src/gigs-board/components/posts/PostEditor.jsx b/src/gigs-board/components/posts/PostEditor.jsx index 546db5d83..015fe0d2b 100644 --- a/src/gigs-board/components/posts/PostEditor.jsx +++ b/src/gigs-board/components/posts/PostEditor.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ const postType = props.postType ?? "Sponsorship"; diff --git a/src/gigs-board/components/posts/Search.jsx b/src/gigs-board/components/posts/Search.jsx index eda0fa140..1b9c360ea 100644 --- a/src/gigs-board/components/posts/Search.jsx +++ b/src/gigs-board/components/posts/Search.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ ////////////////////////////////////////////////////////////////////// diff --git a/src/gigs-board/components/teams/LabelsPermissions.jsx b/src/gigs-board/components/teams/LabelsPermissions.jsx index c0148a364..9b25375dd 100644 --- a/src/gigs-board/components/teams/LabelsPermissions.jsx +++ b/src/gigs-board/components/teams/LabelsPermissions.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ const access_info = diff --git a/src/gigs-board/components/teams/TeamInfo.jsx b/src/gigs-board/components/teams/TeamInfo.jsx index aa1e5b1be..49a5fd129 100644 --- a/src/gigs-board/components/teams/TeamInfo.jsx +++ b/src/gigs-board/components/teams/TeamInfo.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ const Card = styled.div` diff --git a/src/gigs-board/entities/GithubRepo/Board.jsx b/src/gigs-board/entities/GithubRepo/Board.jsx index 653260b9a..fa38da120 100644 --- a/src/gigs-board/entities/GithubRepo/Board.jsx +++ b/src/gigs-board/entities/GithubRepo/Board.jsx @@ -49,25 +49,39 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ const GithubRepoBoard = ({ boardId, - contentTypes, + dataTypes, columns, linkedPage, name, repoURL, }) => { State.init({ - ticketByColumn: columns.reduce( + pullRequestByColumn: columns.reduce( + (registry, { title }) => ({ ...registry, [title]: [] }), + {} + ), + + issueByColumn: columns.reduce( (registry, { title }) => ({ ...registry, [title]: [] }), {} ), }); if (repoURL) { - if (contentTypes.PullRequest) { + if (dataTypes.PullRequest) { const pullRequests = ( fetch( `https://api.github.com/repos/${repoURL @@ -78,7 +92,7 @@ const GithubRepoBoard = ({ ).map((pullRequest) => ({ ...pullRequest, type: "PullRequest" })); State.update({ - ticketByColumn: columns.reduce( + pullRequestByColumn: columns.reduce( (registry, column) => ({ ...registry, @@ -95,14 +109,14 @@ const GithubRepoBoard = ({ ], }), - ticketByColumn + {} ), }); } - console.log(state.ticketByColumn); + console.log(state.pullRequestByColumn); - if (contentTypes.Issue) { + if (dataTypes.Issue) { const issues = ( fetch( `https://api.github.com/repos/${repoURL @@ -115,47 +129,47 @@ const GithubRepoBoard = ({ } return ( -
-
- {boardId ? ( -
- + + ) : null} -
+
{columns.map((column) => ( -
-
-
-
+
+ + +
{column.title} - - {state.ticketByColumn[column.title].length} - + + {state.pullRequestByColumn[column.title].length} +
- {(state.ticketByColumn[column.title] ?? []).map((data) => + {(state.pullRequestByColumn[column.title] ?? []).map((data) => widget("entities.GithubRepo.TicketCard", { data }, data.id) )} -
-
+ +
))}
diff --git a/src/gigs-board/entities/GithubRepo/TicketCard.jsx b/src/gigs-board/entities/GithubRepo/TicketCard.jsx index f3a0b7607..3f109d727 100644 --- a/src/gigs-board/entities/GithubRepo/TicketCard.jsx +++ b/src/gigs-board/entities/GithubRepo/TicketCard.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ const Card = styled.div` @@ -69,11 +78,11 @@ const ticketTypes = { const GithubRepoTicketCard = ({ data: { _links, labels, number, title, type, user }, }) => ( - +
- -
-
+ + -
-
-
-
- - {ticketTypes[type].displayName} #{number}: {title} -
-
+
+
+ + + {`${ticketTypes[type].displayName} #${number}`} + + + {title}
-
+
{labels.map((label) => ( - + {label.name} diff --git a/src/gigs-board/pages/Boards.jsx b/src/gigs-board/pages/Boards.jsx index a31a9606e..b114c0526 100644 --- a/src/gigs-board/pages/Boards.jsx +++ b/src/gigs-board/pages/Boards.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ const selectedBoardId = props.selectedBoardId ?? "mnwtransition"; diff --git a/src/gigs-board/pages/Feed.jsx b/src/gigs-board/pages/Feed.jsx index 806dc0df2..01ccacb25 100644 --- a/src/gigs-board/pages/Feed.jsx +++ b/src/gigs-board/pages/Feed.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ State.init({ diff --git a/src/gigs-board/pages/Post.jsx b/src/gigs-board/pages/Post.jsx index 5e4aa6dea..a3929131b 100644 --- a/src/gigs-board/pages/Post.jsx +++ b/src/gigs-board/pages/Post.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ return widget("components.layout.Page", { diff --git a/src/gigs-board/pages/Teams.jsx b/src/gigs-board/pages/Teams.jsx index 72bc125e9..bcedae392 100644 --- a/src/gigs-board/pages/Teams.jsx +++ b/src/gigs-board/pages/Teams.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ const access_info = diff --git a/src/gigs-board/pages/community/Discussions.jsx b/src/gigs-board/pages/community/Discussions.jsx index d7efc5577..7e44ea22c 100644 --- a/src/gigs-board/pages/community/Discussions.jsx +++ b/src/gigs-board/pages/community/Discussions.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ /* INCLUDE: "communities.jsx" */ diff --git a/src/gigs-board/pages/community/Events.jsx b/src/gigs-board/pages/community/Events.jsx index 88e113fee..df520d0ad 100644 --- a/src/gigs-board/pages/community/Events.jsx +++ b/src/gigs-board/pages/community/Events.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ /* INCLUDE: "communities.jsx" */ diff --git a/src/gigs-board/pages/community/GitHubActivity.jsx b/src/gigs-board/pages/community/GitHubActivity.jsx index 369a64b17..c8bef197d 100644 --- a/src/gigs-board/pages/community/GitHubActivity.jsx +++ b/src/gigs-board/pages/community/GitHubActivity.jsx @@ -49,11 +49,43 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "DRAFT", labelFilters: ["S-draft"] }, + { title: "REVIEW", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: false, PullRequest: true }, + name: "NEAR Protocol NEPs", + repoURL: "https://github.com/near/NEPs", + }, + }[boardId]; +}; + const GithubActivityPage = ({ action, boardId, label }) => { State.init({ - newBoardConfig: { + boardConfig: { id: "probablyUUIDv4", columns: [ @@ -61,60 +93,94 @@ const GithubActivityPage = ({ action, boardId, label }) => { { title: "REVIEW", labelFilters: ["S-review"] }, ], - contentTypes: { Issue: false, PullRequest: true }, + dataTypes: { Issue: false, PullRequest: true }, name: "NEAR Protocol NEPs", repoURL: "https://github.com/near/NEPs", }, }); - /** - * Reads a board config from DevHub contract storage. - * Currently a mock. - * - * Boards are indexed by their ids. - */ - const boardConfigByBoardId = ({ boardId }) => { - return { - probablyUUIDv4: { - id: "probablyUUIDv4", - - columns: [ - { title: "DRAFT", labelFilters: ["S-draft"] }, - { title: "REVIEW", labelFilters: ["S-review"] }, - ], - - contentTypes: { Issue: false, PullRequest: true }, - name: "NEAR Protocol NEPs", - repoURL: "https://github.com/near/NEPs", - }, - }[boardId]; - }; - - const TabContent = ( -
- {action === "new" && ( -
-

New GitHub activity board

- -
-
- )} - - {action === "new" && - widget("entities.GithubRepo.Board", state.newBoardConfig)} - - {action === "view" && - widget("entities.GithubRepo.Board", { - ...boardConfigByBoardId(boardId), - linkedPage: "GithubActivity", - })} -
- ); - return widget("components.community.Layout", { label, tab: "Custom GitHub board title", - children: TabContent, + children: ( +
+ {action === "new" && ( +
+

New GitHub activity board

+ +
+
+ + Repository URL + + + + State.update({ boardConfig: { repoURL } }) + } + placeholder="https://github.com/example-org/example-repo" + type="text" + /> +
+ + + + Tracked data + + + + + + + + Pull requests + + + + + + + + Issues + + + + +
+
+ )} + + {action === "new" && + widget("entities.GithubRepo.Board", state.boardConfig)} + + {action === "view" && + widget("entities.GithubRepo.Board", { + ...boardConfigByBoardId(boardId), + linkedPage: "GithubActivity", + })} +
+ ), }); }; diff --git a/src/gigs-board/pages/community/Overview.jsx b/src/gigs-board/pages/community/Overview.jsx index 607841cea..4a1de36bd 100644 --- a/src/gigs-board/pages/community/Overview.jsx +++ b/src/gigs-board/pages/community/Overview.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ /* INCLUDE: "communities.jsx" */ diff --git a/src/gigs-board/pages/community/Sponsorship.jsx b/src/gigs-board/pages/community/Sponsorship.jsx index d8990a654..010e6b806 100644 --- a/src/gigs-board/pages/community/Sponsorship.jsx +++ b/src/gigs-board/pages/community/Sponsorship.jsx @@ -49,6 +49,15 @@ function href(widgetName, linkProps) { linkPropsQuery ? "?" : "" }${linkPropsQuery}`; } + +const CompactContainer = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const FormCheckLabel = styled.label` + white-space: nowrap; +`; /* END_INCLUDE: "common.jsx" */ /* INCLUDE: "communities.jsx" */ From f87451be397b5a7d3e3fb80133e52610d1012219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Sat, 13 May 2023 23:26:32 +0400 Subject: [PATCH 22/69] wip: Update GH integration UI & Make board config fetch function shared --- common.jsx | 27 +- src/DevGov/Notification/Item/Left.jsx | 27 +- src/DevGov/Notification/Item/Right.jsx | 27 +- .../components/boards/KanbanBoard.jsx | 27 +- .../components/community/CommunityHeader.jsx | 43 ++- .../community/FeaturedCommunity.jsx | 27 +- .../components/community/FeedHeader.jsx | 27 +- .../components/community/Layout.jsx | 27 +- src/gigs-board/components/layout/Banner.jsx | 27 +- src/gigs-board/components/layout/Controls.jsx | 27 +- .../components/layout/LikeButton/Faces.jsx | 27 +- src/gigs-board/components/layout/Navbar.jsx | 27 +- src/gigs-board/components/layout/Page.jsx | 27 +- .../components/layout/SearchByAuthor.jsx | 27 +- .../components/layout/SearchByLabel.jsx | 27 +- .../components/posts/CompactPost.jsx | 27 +- src/gigs-board/components/posts/List.jsx | 27 +- src/gigs-board/components/posts/Post.jsx | 27 +- .../components/posts/PostEditor.jsx | 27 +- src/gigs-board/components/posts/Search.jsx | 27 +- .../components/teams/LabelsPermissions.jsx | 27 +- src/gigs-board/components/teams/TeamInfo.jsx | 27 +- src/gigs-board/entities/GithubRepo/Board.jsx | 27 +- .../entities/GithubRepo/TicketCard.jsx | 28 +- src/gigs-board/pages/Boards.jsx | 27 +- src/gigs-board/pages/Feed.jsx | 27 +- src/gigs-board/pages/Post.jsx | 27 +- src/gigs-board/pages/Teams.jsx | 27 +- .../pages/community/Discussions.jsx | 27 +- src/gigs-board/pages/community/Events.jsx | 27 +- .../pages/community/GitHubActivity.jsx | 252 +++++++++++------- src/gigs-board/pages/community/Overview.jsx | 27 +- .../pages/community/Sponsorship.jsx | 27 +- 33 files changed, 998 insertions(+), 135 deletions(-) diff --git a/common.jsx b/common.jsx index cb4006fe8..3c14f88d1 100644 --- a/common.jsx +++ b/common.jsx @@ -6,6 +6,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "Latest NEAR Enhancement Proposals by status", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -41,7 +65,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/DevGov/Notification/Item/Left.jsx b/src/DevGov/Notification/Item/Left.jsx index 80940e61f..28682c5e5 100644 --- a/src/DevGov/Notification/Item/Left.jsx +++ b/src/DevGov/Notification/Item/Left.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/DevGov/Notification/Item/Right.jsx b/src/DevGov/Notification/Item/Right.jsx index 598ac1276..b54963517 100644 --- a/src/DevGov/Notification/Item/Right.jsx +++ b/src/DevGov/Notification/Item/Right.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/boards/KanbanBoard.jsx b/src/gigs-board/components/boards/KanbanBoard.jsx index e63a8bbb4..e20c31b8a 100644 --- a/src/gigs-board/components/boards/KanbanBoard.jsx +++ b/src/gigs-board/components/boards/KanbanBoard.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/community/CommunityHeader.jsx b/src/gigs-board/components/community/CommunityHeader.jsx index 40bf3bab6..86a576884 100644 --- a/src/gigs-board/components/community/CommunityHeader.jsx +++ b/src/gigs-board/components/community/CommunityHeader.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ @@ -127,23 +152,13 @@ const topicTabs = [ }, { contentProps: { - /** - * Either "new" or "view". - **/ - action: "new", - - /** - * Probably UUIDv4 assigned to the board upon its creation. - * The parameter is ignored if `action` is `"new"`. - **/ - boardId: "probablyUUIDv4", - - label, + boardId: null, // communityById("communityId").boards[0].id + label, // communities["communityId"].name }, iconClass: "bi-github", path: "community.GithubActivity", - title: "Custom GitHub board title", + title: "GitHub board", // communityById("communityId").boards[0].title }, ]; diff --git a/src/gigs-board/components/community/FeaturedCommunity.jsx b/src/gigs-board/components/community/FeaturedCommunity.jsx index 336830980..e98f16ba3 100644 --- a/src/gigs-board/components/community/FeaturedCommunity.jsx +++ b/src/gigs-board/components/community/FeaturedCommunity.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/community/FeedHeader.jsx b/src/gigs-board/components/community/FeedHeader.jsx index 5fffbe810..9488545b8 100644 --- a/src/gigs-board/components/community/FeedHeader.jsx +++ b/src/gigs-board/components/community/FeedHeader.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/community/Layout.jsx b/src/gigs-board/components/community/Layout.jsx index 4ecd6a4a8..4db7233de 100644 --- a/src/gigs-board/components/community/Layout.jsx +++ b/src/gigs-board/components/community/Layout.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/layout/Banner.jsx b/src/gigs-board/components/layout/Banner.jsx index 47d0ef120..c26f302cd 100644 --- a/src/gigs-board/components/layout/Banner.jsx +++ b/src/gigs-board/components/layout/Banner.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/layout/Controls.jsx b/src/gigs-board/components/layout/Controls.jsx index 803528685..0cad9c9f3 100644 --- a/src/gigs-board/components/layout/Controls.jsx +++ b/src/gigs-board/components/layout/Controls.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/layout/LikeButton/Faces.jsx b/src/gigs-board/components/layout/LikeButton/Faces.jsx index b598bc12e..b8ea2258a 100644 --- a/src/gigs-board/components/layout/LikeButton/Faces.jsx +++ b/src/gigs-board/components/layout/LikeButton/Faces.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/layout/Navbar.jsx b/src/gigs-board/components/layout/Navbar.jsx index bbc214464..617a28127 100644 --- a/src/gigs-board/components/layout/Navbar.jsx +++ b/src/gigs-board/components/layout/Navbar.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/layout/Page.jsx b/src/gigs-board/components/layout/Page.jsx index f3addefdf..7220b12f9 100644 --- a/src/gigs-board/components/layout/Page.jsx +++ b/src/gigs-board/components/layout/Page.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/layout/SearchByAuthor.jsx b/src/gigs-board/components/layout/SearchByAuthor.jsx index 27f886521..83e498f87 100644 --- a/src/gigs-board/components/layout/SearchByAuthor.jsx +++ b/src/gigs-board/components/layout/SearchByAuthor.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/layout/SearchByLabel.jsx b/src/gigs-board/components/layout/SearchByLabel.jsx index 07ad0182e..6e6a1a54c 100644 --- a/src/gigs-board/components/layout/SearchByLabel.jsx +++ b/src/gigs-board/components/layout/SearchByLabel.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/posts/CompactPost.jsx b/src/gigs-board/components/posts/CompactPost.jsx index 75327b04d..937f67659 100644 --- a/src/gigs-board/components/posts/CompactPost.jsx +++ b/src/gigs-board/components/posts/CompactPost.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/posts/List.jsx b/src/gigs-board/components/posts/List.jsx index b319a04e0..15c42a781 100644 --- a/src/gigs-board/components/posts/List.jsx +++ b/src/gigs-board/components/posts/List.jsx @@ -12,6 +12,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -47,7 +71,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/posts/Post.jsx b/src/gigs-board/components/posts/Post.jsx index 5a5af5fb6..0869a8cf3 100644 --- a/src/gigs-board/components/posts/Post.jsx +++ b/src/gigs-board/components/posts/Post.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/posts/PostEditor.jsx b/src/gigs-board/components/posts/PostEditor.jsx index 015fe0d2b..40efc8b2b 100644 --- a/src/gigs-board/components/posts/PostEditor.jsx +++ b/src/gigs-board/components/posts/PostEditor.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/posts/Search.jsx b/src/gigs-board/components/posts/Search.jsx index 1b9c360ea..3d2067365 100644 --- a/src/gigs-board/components/posts/Search.jsx +++ b/src/gigs-board/components/posts/Search.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/teams/LabelsPermissions.jsx b/src/gigs-board/components/teams/LabelsPermissions.jsx index 9b25375dd..1668af8ea 100644 --- a/src/gigs-board/components/teams/LabelsPermissions.jsx +++ b/src/gigs-board/components/teams/LabelsPermissions.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/teams/TeamInfo.jsx b/src/gigs-board/components/teams/TeamInfo.jsx index 49a5fd129..48b7a224d 100644 --- a/src/gigs-board/components/teams/TeamInfo.jsx +++ b/src/gigs-board/components/teams/TeamInfo.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/entities/GithubRepo/Board.jsx b/src/gigs-board/entities/GithubRepo/Board.jsx index fa38da120..3edfa08c8 100644 --- a/src/gigs-board/entities/GithubRepo/Board.jsx +++ b/src/gigs-board/entities/GithubRepo/Board.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/entities/GithubRepo/TicketCard.jsx b/src/gigs-board/entities/GithubRepo/TicketCard.jsx index 3f109d727..4f8544634 100644 --- a/src/gigs-board/entities/GithubRepo/TicketCard.jsx +++ b/src/gigs-board/entities/GithubRepo/TicketCard.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ @@ -94,6 +119,7 @@ const GithubRepoTicketCard = ({ className="img-fluid rounded" src={user.avatar_url} /> + @{user.login}
diff --git a/src/gigs-board/pages/Boards.jsx b/src/gigs-board/pages/Boards.jsx index b114c0526..911dec4df 100644 --- a/src/gigs-board/pages/Boards.jsx +++ b/src/gigs-board/pages/Boards.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/pages/Feed.jsx b/src/gigs-board/pages/Feed.jsx index 01ccacb25..4c48fd55f 100644 --- a/src/gigs-board/pages/Feed.jsx +++ b/src/gigs-board/pages/Feed.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/pages/Post.jsx b/src/gigs-board/pages/Post.jsx index a3929131b..47731d466 100644 --- a/src/gigs-board/pages/Post.jsx +++ b/src/gigs-board/pages/Post.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/pages/Teams.jsx b/src/gigs-board/pages/Teams.jsx index bcedae392..e687d9a02 100644 --- a/src/gigs-board/pages/Teams.jsx +++ b/src/gigs-board/pages/Teams.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/pages/community/Discussions.jsx b/src/gigs-board/pages/community/Discussions.jsx index 7e44ea22c..23777d59e 100644 --- a/src/gigs-board/pages/community/Discussions.jsx +++ b/src/gigs-board/pages/community/Discussions.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/pages/community/Events.jsx b/src/gigs-board/pages/community/Events.jsx index df520d0ad..98f3b4279 100644 --- a/src/gigs-board/pages/community/Events.jsx +++ b/src/gigs-board/pages/community/Events.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/pages/community/GitHubActivity.jsx b/src/gigs-board/pages/community/GitHubActivity.jsx index c8bef197d..db8d12b04 100644 --- a/src/gigs-board/pages/community/GitHubActivity.jsx +++ b/src/gigs-board/pages/community/GitHubActivity.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ @@ -60,121 +85,168 @@ const FormCheckLabel = styled.label` `; /* END_INCLUDE: "common.jsx" */ -/** - * Reads a board config from DevHub contract storage. - * Currently a mock. - * - * Boards are indexed by their ids. - */ -const boardConfigByBoardId = ({ boardId }) => { - return { - probablyUUIDv4: { - id: "probablyUUIDv4", - - columns: [ - { title: "DRAFT", labelFilters: ["S-draft"] }, - { title: "REVIEW", labelFilters: ["S-review"] }, - ], - - dataTypes: { Issue: false, PullRequest: true }, - name: "NEAR Protocol NEPs", - repoURL: "https://github.com/near/NEPs", - }, - }[boardId]; -}; - -const GithubActivityPage = ({ action, boardId, label }) => { +const GithubActivityPage = ({ boardId, label }) => { State.init({ boardConfig: { id: "probablyUUIDv4", columns: [ - { title: "DRAFT", labelFilters: ["S-draft"] }, - { title: "REVIEW", labelFilters: ["S-review"] }, + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, ], dataTypes: { Issue: false, PullRequest: true }, - name: "NEAR Protocol NEPs", + description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", }, }); + console.log(state.boardConfig) + + const onRepoURLChange = ({ target: { value: repoURL } }) => + State.update({ boardConfig: { repoURL } }); + + const onColumnStatusTitleChange = + ({ columnIdx }) => + ({ target: { value: title } }) => + State.update(({ boardConfig }) => ({ + boardConfig: { + columns: boardConfig.columns.map((column, idx) => + idx === columnIdx ? { ...column, title } : column + ), + }, + })); + + const onColumnLabelFiltersChange = + ({ columnIdx }) => + ({ target: { value } }) => + State.update(({ boardConfig }) => ({ + boardConfig: { + columns: boardConfig.columns.map((column, idx) => + idx === columnIdx + ? { ...column, labelFilters: value.split(",") } + : column + ), + }, + })); + return widget("components.community.Layout", { label, - tab: "Custom GitHub board title", + tab: state.boardConfig.title, children: (
- {action === "new" && ( -
-

New GitHub activity board

- -
-
- - Repository URL - - - - State.update({ boardConfig: { repoURL } }) - } - placeholder="https://github.com/example-org/example-repo" - type="text" - /> -
- - - - Tracked data - - - - +
+

Board title

+ +
+
+ + Repository URL + + + +
+ + + + Tracked data + + + + + + + + Pull requests + + + + + + + + Issues + + + + +
+ +

Columns

+ +
+ {state.boardConfig.columns.map( + ({ title, labelFilters }, columnIdx) => ( +
+ + + Status title + + + - + - Pull requests - - + Search terms for included labels, comma-separated + - - - - Issues - - - - -
+ +
+ ) + )}
- )} +
- {action === "new" && - widget("entities.GithubRepo.Board", state.boardConfig)} + {!boardId && widget("entities.GithubRepo.Board", state.boardConfig)} - {action === "view" && + {boardId && widget("entities.GithubRepo.Board", { ...boardConfigByBoardId(boardId), linkedPage: "GithubActivity", diff --git a/src/gigs-board/pages/community/Overview.jsx b/src/gigs-board/pages/community/Overview.jsx index 4a1de36bd..8d95921bd 100644 --- a/src/gigs-board/pages/community/Overview.jsx +++ b/src/gigs-board/pages/community/Overview.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/pages/community/Sponsorship.jsx b/src/gigs-board/pages/community/Sponsorship.jsx index 010e6b806..6a6bc554b 100644 --- a/src/gigs-board/pages/community/Sponsorship.jsx +++ b/src/gigs-board/pages/community/Sponsorship.jsx @@ -7,6 +7,30 @@ const nearDevGovGigsWidgetsAccountId = props.nearDevGovGigsWidgetsAccountId || (context.widgetSrc ?? "devgovgigs.near").split("/", 1)[0]; +/** + * Reads a board config from DevHub contract storage. + * Currently a mock. + * + * Boards are indexed by their ids. + */ +const boardConfigByBoardId = ({ boardId }) => { + return { + probablyUUIDv4: { + id: "probablyUUIDv4", + + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + ], + + dataTypes: { Issue: true, PullRequest: true }, + description: "", + repoURL: "https://github.com/near/NEPs", + title: "NEAR Protocol NEPs", + }, + }[boardId]; +}; + function widget(widgetName, widgetProps, key) { widgetProps = { ...widgetProps, @@ -42,7 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => `${key}=${value}`) + .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .filter((nullable) => nullable !== null) .join("&"); return `#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ From bf93b49cf20cd21cef508a4bd3967648309452ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Mon, 15 May 2023 17:54:22 +0400 Subject: [PATCH 23/69] chore: Use JSON strings for log --- src/gigs-board/pages/community/GitHubActivity.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gigs-board/pages/community/GitHubActivity.jsx b/src/gigs-board/pages/community/GitHubActivity.jsx index db8d12b04..c6a85ffe7 100644 --- a/src/gigs-board/pages/community/GitHubActivity.jsx +++ b/src/gigs-board/pages/community/GitHubActivity.jsx @@ -102,7 +102,7 @@ const GithubActivityPage = ({ boardId, label }) => { }, }); - console.log(state.boardConfig) + console.log("Board config columns", JSON.stringify(state.boardConfig.columns)); const onRepoURLChange = ({ target: { value: repoURL } }) => State.update({ boardConfig: { repoURL } }); @@ -125,7 +125,7 @@ const GithubActivityPage = ({ boardId, label }) => { boardConfig: { columns: boardConfig.columns.map((column, idx) => idx === columnIdx - ? { ...column, labelFilters: value.split(",") } + ? { ...column, labelFilters: value.split(",").map((string) => string.trim()) } : column ), }, @@ -233,7 +233,7 @@ const GithubActivityPage = ({ boardId, label }) => { aria-label="Search terms for included labels" className="form-control" onChange={onColumnLabelFiltersChange({ columnIdx })} - placeholder="S-draft, S-review, proposal, ..." + placeholder="draft, review, proposal, ..." type="text" value={labelFilters.join(", ")} /> From 7ddd62cca67d24637a9e2d721f762c3d370a8fd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Tue, 16 May 2023 00:34:57 +0400 Subject: [PATCH 24/69] fix: Handle nullable props in a simpler way --- common.jsx | 3 ++- src/DevGov/Notification/Item/Left.jsx | 3 ++- src/DevGov/Notification/Item/Right.jsx | 3 ++- src/gigs-board/components/boards/KanbanBoard.jsx | 3 ++- src/gigs-board/components/community/CommunityHeader.jsx | 3 ++- src/gigs-board/components/community/FeaturedCommunity.jsx | 3 ++- src/gigs-board/components/community/FeedHeader.jsx | 3 ++- src/gigs-board/components/community/Layout.jsx | 3 ++- src/gigs-board/components/layout/Banner.jsx | 3 ++- src/gigs-board/components/layout/Controls.jsx | 3 ++- src/gigs-board/components/layout/LikeButton/Faces.jsx | 3 ++- src/gigs-board/components/layout/Navbar.jsx | 3 ++- src/gigs-board/components/layout/Page.jsx | 3 ++- src/gigs-board/components/layout/SearchByAuthor.jsx | 3 ++- src/gigs-board/components/layout/SearchByLabel.jsx | 3 ++- src/gigs-board/components/posts/CompactPost.jsx | 3 ++- src/gigs-board/components/posts/List.jsx | 3 ++- src/gigs-board/components/posts/Post.jsx | 3 ++- src/gigs-board/components/posts/PostEditor.jsx | 3 ++- src/gigs-board/components/posts/Search.jsx | 3 ++- src/gigs-board/components/teams/LabelsPermissions.jsx | 3 ++- src/gigs-board/components/teams/TeamInfo.jsx | 3 ++- src/gigs-board/entities/GithubRepo/Board.jsx | 3 ++- src/gigs-board/entities/GithubRepo/TicketCard.jsx | 3 ++- src/gigs-board/pages/Boards.jsx | 3 ++- src/gigs-board/pages/Feed.jsx | 3 ++- src/gigs-board/pages/Post.jsx | 3 ++- src/gigs-board/pages/Teams.jsx | 3 ++- src/gigs-board/pages/community/Discussions.jsx | 3 ++- src/gigs-board/pages/community/Events.jsx | 3 ++- src/gigs-board/pages/community/GitHubActivity.jsx | 3 ++- src/gigs-board/pages/community/Overview.jsx | 3 ++- src/gigs-board/pages/community/Sponsorship.jsx | 3 ++- 33 files changed, 66 insertions(+), 33 deletions(-) diff --git a/common.jsx b/common.jsx index 26319217a..ef8b50fbc 100644 --- a/common.jsx +++ b/common.jsx @@ -65,9 +65,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/DevGov/Notification/Item/Left.jsx b/src/DevGov/Notification/Item/Left.jsx index a5639a5fd..5411a52a5 100644 --- a/src/DevGov/Notification/Item/Left.jsx +++ b/src/DevGov/Notification/Item/Left.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/DevGov/Notification/Item/Right.jsx b/src/DevGov/Notification/Item/Right.jsx index cca43b51a..17db7eb1f 100644 --- a/src/DevGov/Notification/Item/Right.jsx +++ b/src/DevGov/Notification/Item/Right.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/boards/KanbanBoard.jsx b/src/gigs-board/components/boards/KanbanBoard.jsx index ce5cc1676..bd57ca92d 100644 --- a/src/gigs-board/components/boards/KanbanBoard.jsx +++ b/src/gigs-board/components/boards/KanbanBoard.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/community/CommunityHeader.jsx b/src/gigs-board/components/community/CommunityHeader.jsx index 69e9d5c95..d9c623d78 100644 --- a/src/gigs-board/components/community/CommunityHeader.jsx +++ b/src/gigs-board/components/community/CommunityHeader.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/community/FeaturedCommunity.jsx b/src/gigs-board/components/community/FeaturedCommunity.jsx index 9502a6d05..f4b9d59d0 100644 --- a/src/gigs-board/components/community/FeaturedCommunity.jsx +++ b/src/gigs-board/components/community/FeaturedCommunity.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/community/FeedHeader.jsx b/src/gigs-board/components/community/FeedHeader.jsx index 0bb4c83e0..ab9225e34 100644 --- a/src/gigs-board/components/community/FeedHeader.jsx +++ b/src/gigs-board/components/community/FeedHeader.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/community/Layout.jsx b/src/gigs-board/components/community/Layout.jsx index 710a2a166..a91ab4216 100644 --- a/src/gigs-board/components/community/Layout.jsx +++ b/src/gigs-board/components/community/Layout.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/layout/Banner.jsx b/src/gigs-board/components/layout/Banner.jsx index 5be184370..2b2fe7880 100644 --- a/src/gigs-board/components/layout/Banner.jsx +++ b/src/gigs-board/components/layout/Banner.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/layout/Controls.jsx b/src/gigs-board/components/layout/Controls.jsx index 2a0676086..d9f0dfe48 100644 --- a/src/gigs-board/components/layout/Controls.jsx +++ b/src/gigs-board/components/layout/Controls.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/layout/LikeButton/Faces.jsx b/src/gigs-board/components/layout/LikeButton/Faces.jsx index 19cd545c1..0a39280cc 100644 --- a/src/gigs-board/components/layout/LikeButton/Faces.jsx +++ b/src/gigs-board/components/layout/LikeButton/Faces.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/layout/Navbar.jsx b/src/gigs-board/components/layout/Navbar.jsx index 88f35b9a4..cdb10d576 100644 --- a/src/gigs-board/components/layout/Navbar.jsx +++ b/src/gigs-board/components/layout/Navbar.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/layout/Page.jsx b/src/gigs-board/components/layout/Page.jsx index 498a887b2..7ba190912 100644 --- a/src/gigs-board/components/layout/Page.jsx +++ b/src/gigs-board/components/layout/Page.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/layout/SearchByAuthor.jsx b/src/gigs-board/components/layout/SearchByAuthor.jsx index 78b8b80aa..c2851bb57 100644 --- a/src/gigs-board/components/layout/SearchByAuthor.jsx +++ b/src/gigs-board/components/layout/SearchByAuthor.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/layout/SearchByLabel.jsx b/src/gigs-board/components/layout/SearchByLabel.jsx index e106749b9..ba278d4d4 100644 --- a/src/gigs-board/components/layout/SearchByLabel.jsx +++ b/src/gigs-board/components/layout/SearchByLabel.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/posts/CompactPost.jsx b/src/gigs-board/components/posts/CompactPost.jsx index ed261efeb..a99597c73 100644 --- a/src/gigs-board/components/posts/CompactPost.jsx +++ b/src/gigs-board/components/posts/CompactPost.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/posts/List.jsx b/src/gigs-board/components/posts/List.jsx index cb2458049..3676eb8d0 100644 --- a/src/gigs-board/components/posts/List.jsx +++ b/src/gigs-board/components/posts/List.jsx @@ -71,9 +71,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/posts/Post.jsx b/src/gigs-board/components/posts/Post.jsx index 27bb14227..9b0e3eae8 100644 --- a/src/gigs-board/components/posts/Post.jsx +++ b/src/gigs-board/components/posts/Post.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/posts/PostEditor.jsx b/src/gigs-board/components/posts/PostEditor.jsx index 28da1c51a..8c8af8783 100644 --- a/src/gigs-board/components/posts/PostEditor.jsx +++ b/src/gigs-board/components/posts/PostEditor.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/posts/Search.jsx b/src/gigs-board/components/posts/Search.jsx index 9702028e8..ece5d7b2a 100644 --- a/src/gigs-board/components/posts/Search.jsx +++ b/src/gigs-board/components/posts/Search.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/teams/LabelsPermissions.jsx b/src/gigs-board/components/teams/LabelsPermissions.jsx index acba96e70..c033cd327 100644 --- a/src/gigs-board/components/teams/LabelsPermissions.jsx +++ b/src/gigs-board/components/teams/LabelsPermissions.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/components/teams/TeamInfo.jsx b/src/gigs-board/components/teams/TeamInfo.jsx index e8fc070ca..b0b773066 100644 --- a/src/gigs-board/components/teams/TeamInfo.jsx +++ b/src/gigs-board/components/teams/TeamInfo.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/entities/GithubRepo/Board.jsx b/src/gigs-board/entities/GithubRepo/Board.jsx index 4913d8e9d..3a5b2f5da 100644 --- a/src/gigs-board/entities/GithubRepo/Board.jsx +++ b/src/gigs-board/entities/GithubRepo/Board.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/entities/GithubRepo/TicketCard.jsx b/src/gigs-board/entities/GithubRepo/TicketCard.jsx index 352729d01..bb0220bd4 100644 --- a/src/gigs-board/entities/GithubRepo/TicketCard.jsx +++ b/src/gigs-board/entities/GithubRepo/TicketCard.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/pages/Boards.jsx b/src/gigs-board/pages/Boards.jsx index 67bc10d8a..678232c10 100644 --- a/src/gigs-board/pages/Boards.jsx +++ b/src/gigs-board/pages/Boards.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/pages/Feed.jsx b/src/gigs-board/pages/Feed.jsx index d24303877..ee60afe26 100644 --- a/src/gigs-board/pages/Feed.jsx +++ b/src/gigs-board/pages/Feed.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/pages/Post.jsx b/src/gigs-board/pages/Post.jsx index f4efcc813..c7c458ace 100644 --- a/src/gigs-board/pages/Post.jsx +++ b/src/gigs-board/pages/Post.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/pages/Teams.jsx b/src/gigs-board/pages/Teams.jsx index 218d928a2..df8ab290b 100644 --- a/src/gigs-board/pages/Teams.jsx +++ b/src/gigs-board/pages/Teams.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/pages/community/Discussions.jsx b/src/gigs-board/pages/community/Discussions.jsx index 6c90807fc..1610b0567 100644 --- a/src/gigs-board/pages/community/Discussions.jsx +++ b/src/gigs-board/pages/community/Discussions.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/pages/community/Events.jsx b/src/gigs-board/pages/community/Events.jsx index cfc0d87a7..f65ce8f98 100644 --- a/src/gigs-board/pages/community/Events.jsx +++ b/src/gigs-board/pages/community/Events.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/pages/community/GitHubActivity.jsx b/src/gigs-board/pages/community/GitHubActivity.jsx index 518bce7ea..5187fe4e8 100644 --- a/src/gigs-board/pages/community/GitHubActivity.jsx +++ b/src/gigs-board/pages/community/GitHubActivity.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/pages/community/Overview.jsx b/src/gigs-board/pages/community/Overview.jsx index fca6ff4d6..6657ba29c 100644 --- a/src/gigs-board/pages/community/Overview.jsx +++ b/src/gigs-board/pages/community/Overview.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; diff --git a/src/gigs-board/pages/community/Sponsorship.jsx b/src/gigs-board/pages/community/Sponsorship.jsx index ab7bcd775..8da508ef8 100644 --- a/src/gigs-board/pages/community/Sponsorship.jsx +++ b/src/gigs-board/pages/community/Sponsorship.jsx @@ -66,9 +66,10 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value ?? null === null ? null : `${key}=${value}`)) + .map(([key, value]) => (value === null ? null : `${key}=${value}`)) .filter((nullable) => nullable !== null) .join("&"); + return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ linkPropsQuery ? "?" : "" }${linkPropsQuery}`; From 1e0c2f1622543f8ee4dc5206a3807a4160353b52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Thu, 18 May 2023 01:15:48 +0400 Subject: [PATCH 25/69] fix: Resolve https://github.com/near/neardevhub-widgets/pull/123#discussion_r1196379070 --- common.jsx | 4 +- src/DevGov/Notification/Item/Left.jsx | 4 +- src/DevGov/Notification/Item/Right.jsx | 4 +- .../components/boards/KanbanBoard.jsx | 4 +- .../components/community/CommunityHeader.jsx | 4 +- .../community/FeaturedCommunity.jsx | 4 +- .../components/community/FeedHeader.jsx | 4 +- .../components/community/Layout.jsx | 4 +- src/gigs-board/components/layout/Banner.jsx | 4 +- src/gigs-board/components/layout/Controls.jsx | 4 +- .../components/layout/LikeButton/Faces.jsx | 4 +- src/gigs-board/components/layout/Navbar.jsx | 4 +- src/gigs-board/components/layout/Page.jsx | 4 +- .../components/layout/SearchByAuthor.jsx | 4 +- .../components/layout/SearchByLabel.jsx | 4 +- .../components/posts/CompactPost.jsx | 4 +- src/gigs-board/components/posts/List.jsx | 4 +- src/gigs-board/components/posts/Post.jsx | 4 +- .../components/posts/PostEditor.jsx | 4 +- src/gigs-board/components/posts/Search.jsx | 4 +- .../components/teams/LabelsPermissions.jsx | 4 +- src/gigs-board/components/teams/TeamInfo.jsx | 4 +- src/gigs-board/entities/GithubRepo/Board.jsx | 62 +++++----- .../entities/GithubRepo/TicketCard.jsx | 4 +- src/gigs-board/pages/Boards.jsx | 4 +- src/gigs-board/pages/Feed.jsx | 4 +- src/gigs-board/pages/Post.jsx | 4 +- src/gigs-board/pages/Teams.jsx | 4 +- .../pages/community/Discussions.jsx | 4 +- src/gigs-board/pages/community/Events.jsx | 4 +- .../pages/community/GitHubActivity.jsx | 109 +++++++++++------- src/gigs-board/pages/community/Overview.jsx | 4 +- .../pages/community/Sponsorship.jsx | 4 +- 33 files changed, 164 insertions(+), 131 deletions(-) diff --git a/common.jsx b/common.jsx index ef8b50fbc..8bc9fad37 100644 --- a/common.jsx +++ b/common.jsx @@ -65,8 +65,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/DevGov/Notification/Item/Left.jsx b/src/DevGov/Notification/Item/Left.jsx index 5411a52a5..eb5a4664d 100644 --- a/src/DevGov/Notification/Item/Left.jsx +++ b/src/DevGov/Notification/Item/Left.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/DevGov/Notification/Item/Right.jsx b/src/DevGov/Notification/Item/Right.jsx index 17db7eb1f..206d6b36d 100644 --- a/src/DevGov/Notification/Item/Right.jsx +++ b/src/DevGov/Notification/Item/Right.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/boards/KanbanBoard.jsx b/src/gigs-board/components/boards/KanbanBoard.jsx index bd57ca92d..8d2490577 100644 --- a/src/gigs-board/components/boards/KanbanBoard.jsx +++ b/src/gigs-board/components/boards/KanbanBoard.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/community/CommunityHeader.jsx b/src/gigs-board/components/community/CommunityHeader.jsx index d9c623d78..90200084d 100644 --- a/src/gigs-board/components/community/CommunityHeader.jsx +++ b/src/gigs-board/components/community/CommunityHeader.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/community/FeaturedCommunity.jsx b/src/gigs-board/components/community/FeaturedCommunity.jsx index f4b9d59d0..fa2f0f3d6 100644 --- a/src/gigs-board/components/community/FeaturedCommunity.jsx +++ b/src/gigs-board/components/community/FeaturedCommunity.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/community/FeedHeader.jsx b/src/gigs-board/components/community/FeedHeader.jsx index ab9225e34..d9cf958e4 100644 --- a/src/gigs-board/components/community/FeedHeader.jsx +++ b/src/gigs-board/components/community/FeedHeader.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/community/Layout.jsx b/src/gigs-board/components/community/Layout.jsx index a91ab4216..c68eb7512 100644 --- a/src/gigs-board/components/community/Layout.jsx +++ b/src/gigs-board/components/community/Layout.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/layout/Banner.jsx b/src/gigs-board/components/layout/Banner.jsx index 2b2fe7880..086e6cfb1 100644 --- a/src/gigs-board/components/layout/Banner.jsx +++ b/src/gigs-board/components/layout/Banner.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/layout/Controls.jsx b/src/gigs-board/components/layout/Controls.jsx index d9f0dfe48..4de9f6078 100644 --- a/src/gigs-board/components/layout/Controls.jsx +++ b/src/gigs-board/components/layout/Controls.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/layout/LikeButton/Faces.jsx b/src/gigs-board/components/layout/LikeButton/Faces.jsx index 0a39280cc..45e1b41aa 100644 --- a/src/gigs-board/components/layout/LikeButton/Faces.jsx +++ b/src/gigs-board/components/layout/LikeButton/Faces.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/layout/Navbar.jsx b/src/gigs-board/components/layout/Navbar.jsx index cdb10d576..25628af23 100644 --- a/src/gigs-board/components/layout/Navbar.jsx +++ b/src/gigs-board/components/layout/Navbar.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/layout/Page.jsx b/src/gigs-board/components/layout/Page.jsx index 7ba190912..8e5293ee7 100644 --- a/src/gigs-board/components/layout/Page.jsx +++ b/src/gigs-board/components/layout/Page.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/layout/SearchByAuthor.jsx b/src/gigs-board/components/layout/SearchByAuthor.jsx index c2851bb57..acfd36100 100644 --- a/src/gigs-board/components/layout/SearchByAuthor.jsx +++ b/src/gigs-board/components/layout/SearchByAuthor.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/layout/SearchByLabel.jsx b/src/gigs-board/components/layout/SearchByLabel.jsx index ba278d4d4..12ac516d4 100644 --- a/src/gigs-board/components/layout/SearchByLabel.jsx +++ b/src/gigs-board/components/layout/SearchByLabel.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/posts/CompactPost.jsx b/src/gigs-board/components/posts/CompactPost.jsx index a99597c73..4d3f6bbad 100644 --- a/src/gigs-board/components/posts/CompactPost.jsx +++ b/src/gigs-board/components/posts/CompactPost.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/posts/List.jsx b/src/gigs-board/components/posts/List.jsx index 3676eb8d0..1a35a5926 100644 --- a/src/gigs-board/components/posts/List.jsx +++ b/src/gigs-board/components/posts/List.jsx @@ -71,8 +71,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/posts/Post.jsx b/src/gigs-board/components/posts/Post.jsx index 9b0e3eae8..f1f7d1fa7 100644 --- a/src/gigs-board/components/posts/Post.jsx +++ b/src/gigs-board/components/posts/Post.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/posts/PostEditor.jsx b/src/gigs-board/components/posts/PostEditor.jsx index 8c8af8783..c50d44444 100644 --- a/src/gigs-board/components/posts/PostEditor.jsx +++ b/src/gigs-board/components/posts/PostEditor.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/posts/Search.jsx b/src/gigs-board/components/posts/Search.jsx index ece5d7b2a..a642738c9 100644 --- a/src/gigs-board/components/posts/Search.jsx +++ b/src/gigs-board/components/posts/Search.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/teams/LabelsPermissions.jsx b/src/gigs-board/components/teams/LabelsPermissions.jsx index c033cd327..bc3e8d11e 100644 --- a/src/gigs-board/components/teams/LabelsPermissions.jsx +++ b/src/gigs-board/components/teams/LabelsPermissions.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/components/teams/TeamInfo.jsx b/src/gigs-board/components/teams/TeamInfo.jsx index b0b773066..7f5621ffa 100644 --- a/src/gigs-board/components/teams/TeamInfo.jsx +++ b/src/gigs-board/components/teams/TeamInfo.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/entities/GithubRepo/Board.jsx b/src/gigs-board/entities/GithubRepo/Board.jsx index 3a5b2f5da..3e2ce16cb 100644 --- a/src/gigs-board/entities/GithubRepo/Board.jsx +++ b/src/gigs-board/entities/GithubRepo/Board.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ @@ -94,16 +94,30 @@ const GithubRepoBoard = ({ repoURL, }) => { State.init({ - pullRequestByColumn: columns.reduce( - (registry, { title }) => ({ ...registry, [title]: [] }), - {} - ), + pullRequestByColumn: {}, + issueByColumn: {}, + }); + + const dataToColumns = (data) => + columns.reduce( + (registry, column) => ({ + ...registry, + + [column.title]: [ + ...(registry[column.title] ?? []), + + ...data.filter((pullRequest) => + pullRequest.labels.some((label) => + column?.labelFilters.some((searchTerm) => + label.name.includes(searchTerm) + ) + ) + ), + ], + }), - issueByColumn: columns.reduce( - (registry, { title }) => ({ ...registry, [title]: [] }), {} - ), - }); + ); if (repoURL) { if (dataTypes.PullRequest) { @@ -117,25 +131,7 @@ const GithubRepoBoard = ({ ).map((pullRequest) => ({ ...pullRequest, type: "PullRequest" })); State.update({ - pullRequestByColumn: columns.reduce( - (registry, column) => ({ - ...registry, - - [column.title]: [ - ...(registry[column.title] ?? []), - - ...pullRequests.filter((pullRequest) => - pullRequest.labels.some((label) => - column?.labelFilters.some((searchTerm) => - label.name.includes(searchTerm) - ) - ) - ), - ], - }), - - {} - ), + pullRequestByColumn: dataToColumns(pullRequests), }); } @@ -150,7 +146,13 @@ const GithubRepoBoard = ({ .join("/")}/issues` ).body ?? [] ).map((issue) => ({ ...issue, type: "Issue" })); + + State.update({ + issueByColumn: dataToColumns(issues), + }); } + + console.log(state.issueByColumn); } return ( @@ -186,7 +188,7 @@ const GithubRepoBoard = ({ {column.title} - {state.pullRequestByColumn[column.title].length} + {(state.pullRequestByColumn[column.title] ?? []).length} diff --git a/src/gigs-board/entities/GithubRepo/TicketCard.jsx b/src/gigs-board/entities/GithubRepo/TicketCard.jsx index bb0220bd4..44931adb9 100644 --- a/src/gigs-board/entities/GithubRepo/TicketCard.jsx +++ b/src/gigs-board/entities/GithubRepo/TicketCard.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/pages/Boards.jsx b/src/gigs-board/pages/Boards.jsx index 678232c10..0e5cc52ff 100644 --- a/src/gigs-board/pages/Boards.jsx +++ b/src/gigs-board/pages/Boards.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/pages/Feed.jsx b/src/gigs-board/pages/Feed.jsx index ee60afe26..89e6d1799 100644 --- a/src/gigs-board/pages/Feed.jsx +++ b/src/gigs-board/pages/Feed.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/pages/Post.jsx b/src/gigs-board/pages/Post.jsx index c7c458ace..31476728e 100644 --- a/src/gigs-board/pages/Post.jsx +++ b/src/gigs-board/pages/Post.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/pages/Teams.jsx b/src/gigs-board/pages/Teams.jsx index df8ab290b..8f509aa81 100644 --- a/src/gigs-board/pages/Teams.jsx +++ b/src/gigs-board/pages/Teams.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/pages/community/Discussions.jsx b/src/gigs-board/pages/community/Discussions.jsx index 1610b0567..8d805ab64 100644 --- a/src/gigs-board/pages/community/Discussions.jsx +++ b/src/gigs-board/pages/community/Discussions.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/pages/community/Events.jsx b/src/gigs-board/pages/community/Events.jsx index f65ce8f98..ab8ba4062 100644 --- a/src/gigs-board/pages/community/Events.jsx +++ b/src/gigs-board/pages/community/Events.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/pages/community/GitHubActivity.jsx b/src/gigs-board/pages/community/GitHubActivity.jsx index 5187fe4e8..dfed6dcfa 100644 --- a/src/gigs-board/pages/community/GitHubActivity.jsx +++ b/src/gigs-board/pages/community/GitHubActivity.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ @@ -107,9 +107,22 @@ const GithubActivityPage = ({ boardId, label }) => { JSON.stringify(state.boardConfig.columns) ); + const onBoardTitleChange = ({ target: { value: title } }) => + State.update({ boardConfig: { title } }); + const onRepoURLChange = ({ target: { value: repoURL } }) => State.update({ boardConfig: { repoURL } }); + const onColumnCreate = () => + State.update(({ boardConfig }) => ({ + boardConfig: { + columns: [ + ...boardConfig.columns, + { title: "New status", labelFilters: [] }, + ], + }, + })); + const onColumnStatusTitleChange = ({ columnIdx }) => ({ target: { value: title } }) => @@ -142,8 +155,23 @@ const GithubActivityPage = ({ boardId, label }) => { tab: state.boardConfig.title, children: (
-
-

Board title

+
+ + Board title + + +
@@ -168,46 +196,43 @@ const GithubActivityPage = ({ boardId, label }) => { - - - - - Pull requests - - - - - - - - Issues - - + {Object.entries(state.boardConfig.dataTypes).map( + ([dataTypeKey, dataTypeIncluded]) => ( + + + State.update({ + boardConfig: { + dataTypes: { + [dataTypeKey]: !dataTypeIncluded, + }, + }, + }) + } + role="switch" + type="checkbox" + /> + + + {dataTypeKey} + + + ) + )}

Columns

-
+
{state.boardConfig.columns.map( ({ title, labelFilters }, columnIdx) => (
@@ -231,7 +256,8 @@ const GithubActivityPage = ({ boardId, label }) => { - Search terms for included labels, comma-separated + Search terms for labels to attach to the status, + comma-separated {
) )} + +
diff --git a/src/gigs-board/pages/community/Overview.jsx b/src/gigs-board/pages/community/Overview.jsx index 6657ba29c..ab0496587 100644 --- a/src/gigs-board/pages/community/Overview.jsx +++ b/src/gigs-board/pages/community/Overview.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ diff --git a/src/gigs-board/pages/community/Sponsorship.jsx b/src/gigs-board/pages/community/Sponsorship.jsx index 8da508ef8..b6790ec40 100644 --- a/src/gigs-board/pages/community/Sponsorship.jsx +++ b/src/gigs-board/pages/community/Sponsorship.jsx @@ -66,8 +66,8 @@ function href(widgetName, linkProps) { } const linkPropsQuery = Object.entries(linkProps) - .map(([key, value]) => (value === null ? null : `${key}=${value}`)) - .filter((nullable) => nullable !== null) + .filter(([_key, nullable]) => (nullable ?? null) !== null) + .map(([key, value]) => `${key}=${value}`) .join("&"); return `/#/${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.pages.${widgetName}${ From c1373d4dfa5c078ccb684ca037c4c2e67ada58d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Sat, 20 May 2023 04:55:34 +0400 Subject: [PATCH 26/69] wip: Add global editor toggle & Update styles --- .../components/community/CommunityHeader.jsx | 103 +++++++++++------- 1 file changed, 63 insertions(+), 40 deletions(-) diff --git a/src/gigs-board/components/community/CommunityHeader.jsx b/src/gigs-board/components/community/CommunityHeader.jsx index 90200084d..b86925ad3 100644 --- a/src/gigs-board/components/community/CommunityHeader.jsx +++ b/src/gigs-board/components/community/CommunityHeader.jsx @@ -86,15 +86,10 @@ const FormCheckLabel = styled.label` /* END_INCLUDE: "common.jsx" */ const Header = styled.div` - { - height: 204px; - overflow: hidden; - background: #f3f3f3; - padding: 10px 0; - margin-top: -25px; - margin-bottom: 25px; - padding-left: 32px; - } + overflow: hidden; + background: #f3f3f3; + margin-top: -25px; + margin-bottom: 25px; `; const NavUnderline = styled.ul` @@ -122,30 +117,24 @@ const BreadcrumbBold = styled.b` } `; -const { label, tab } = props; - const topicTabs = [ { - contentProps: { label }, defaultActive: true, iconClass: "bi-house-door", path: "community.Overview", title: "Overview", }, { - contentProps: { label }, iconClass: "bi-chat-square-text", path: "community.Discussions", title: "Discussions", }, { - contentProps: { label }, iconClass: "bi-kanban", path: "community.Sponsorship", title: "Sponsorship", }, { - contentProps: { label }, iconClass: "bi-calendar", path: "community.Events", title: "Events", @@ -153,7 +142,6 @@ const topicTabs = [ { contentProps: { boardId: null, // communityById("communityId").boards[0].id - label, // communities["communityId"].name }, iconClass: "bi-github", @@ -162,49 +150,84 @@ const topicTabs = [ }, ]; -// TODO nav-underline is available in bootstrap: https://getbootstrap.com/docs/5.3/components/navs-tabs/#underline, -// but it's not there in near social, need write such style here -return ( -
-
-
- -
- -
-
{props.title}
-
{props.desc}
+
+
+ + +
+
{props.title}
+
{props.desc}
+
+
+ + + + + + Editor mode + +
-
-
{topicTabs.map( - ({ contentProps, defaultActive, iconClass, path, title }, topicIdx) => + ({ contentProps, defaultActive, iconClass, path, title }) => title ? ( -
  • - {iconClass && } + {iconClass && } {title}
  • ) : null )}
    -
    -
    -); + + ); +}; + +return CommunityHeader(props); From 7f0c65ee4d302c331efa6f57087f1f6c5b2ade6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Sat, 20 May 2023 04:57:04 +0400 Subject: [PATCH 27/69] wip: Update GH integration components --- src/gigs-board/entities/GithubRepo/Board.jsx | 44 ++- .../pages/community/GitHubActivity.jsx | 263 +++++++++++------- 2 files changed, 177 insertions(+), 130 deletions(-) diff --git a/src/gigs-board/entities/GithubRepo/Board.jsx b/src/gigs-board/entities/GithubRepo/Board.jsx index 3e2ce16cb..dafa61e88 100644 --- a/src/gigs-board/entities/GithubRepo/Board.jsx +++ b/src/gigs-board/entities/GithubRepo/Board.jsx @@ -90,8 +90,8 @@ const GithubRepoBoard = ({ dataTypes, columns, linkedPage, - name, repoURL, + title, }) => { State.init({ pullRequestByColumn: {}, @@ -156,28 +156,26 @@ const GithubRepoBoard = ({ } return ( -
    - {boardId ? ( - - ) : null} +
    +
    +

    {title}

    + + {true ? ( + + + + Link to this board + + + ) : null} +
    {columns.map((column) => ( diff --git a/src/gigs-board/pages/community/GitHubActivity.jsx b/src/gigs-board/pages/community/GitHubActivity.jsx index dfed6dcfa..ee64c6af3 100644 --- a/src/gigs-board/pages/community/GitHubActivity.jsx +++ b/src/gigs-board/pages/community/GitHubActivity.jsx @@ -86,6 +86,14 @@ const FormCheckLabel = styled.label` /* END_INCLUDE: "common.jsx" */ const GithubActivityPage = ({ boardId, label }) => { + console.log( + "CommunityHeader state requested from GithubActivity page", + Storage.get( + "state", + `${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.components.community.CommunityHeader` + ) + ); + State.init({ boardConfig: { id: "probablyUUIDv4", @@ -100,6 +108,12 @@ const GithubActivityPage = ({ boardId, label }) => { repoURL: "https://github.com/near/NEPs", title: "NEAR Protocol NEPs", }, + + isEditorEnabled: false, + ...Storage.get( + "state", + `${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.components.community.CommunityHeader` + ), }); console.log( @@ -107,6 +121,26 @@ const GithubActivityPage = ({ boardId, label }) => { JSON.stringify(state.boardConfig.columns) ); + const onEditorToggle = () => + State.update((lastState) => ({ + ...lastState, + isEditorEnabled: !lastState.isEditorEnabled, + })); + + const onDataTypeToggle = + ({ typeName, isIncluded }) => + () => + State.update((lastState) => ({ + ...lastState, + boardConfig: { + ...lastState.boardConfig, + dataTypes: { + ...lastState.boardConfig.dataTypes, + [typeName]: !isIncluded, + }, + }, + })); + const onBoardTitleChange = ({ target: { value: title } }) => State.update({ boardConfig: { title } }); @@ -155,131 +189,146 @@ const GithubActivityPage = ({ boardId, label }) => { tab: state.boardConfig.title, children: (
    -
    - - Board title - +
    + - -
    -
    - - Repository URL - + + Editor mode + + +
    + + {state.isEditorEnabled ? ( +
    + + Board title + + +
    +
    + + Repository URL + + + +
    + + + + Tracked data + + + + {Object.entries(state.boardConfig.dataTypes).map( + ([typeName, isIncluded]) => ( + + + + + {typeName} + + + ) + )} + +
    - - - Tracked data - +
    +

    Columns

    + + +
    + +
    + {state.boardConfig.columns.map( + ({ title, labelFilters }, columnIdx) => ( +
    + + + Status title + - - {Object.entries(state.boardConfig.dataTypes).map( - ([dataTypeKey, dataTypeIncluded]) => ( - - State.update({ - boardConfig: { - dataTypes: { - [dataTypeKey]: !dataTypeIncluded, - }, - }, - }) - } - role="switch" - type="checkbox" + aria-describedby={`newGithubBoardColumnStatus-${title}`} + aria-label="Status title" + className="form-control" + onChange={onColumnStatusTitleChange({ columnIdx })} + placeholder="👀 Review" + type="text" + value={title} /> + - + - {dataTypeKey} - - - ) - )} - - -
    - -

    Columns

    + Search terms for labels to attach to the status, + comma-separated + -
    - {state.boardConfig.columns.map( - ({ title, labelFilters }, columnIdx) => ( -
    - - - Status title - - - - - - - - Search terms for labels to attach to the status, - comma-separated + - - - -
    - ) - )} - - +
    + ) + )} +
    -
    + ) : null} {!boardId && widget("entities.GithubRepo.Board", state.boardConfig)} From f19e6a0df354b584f5ab29e2e3b898b8aef74da8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Sat, 20 May 2023 05:01:52 +0400 Subject: [PATCH 28/69] fix: Use correct reference path --- src/gigs-board/components/community/CommunityHeader.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gigs-board/components/community/CommunityHeader.jsx b/src/gigs-board/components/community/CommunityHeader.jsx index b86925ad3..7c7c569d6 100644 --- a/src/gigs-board/components/community/CommunityHeader.jsx +++ b/src/gigs-board/components/community/CommunityHeader.jsx @@ -163,7 +163,7 @@ const CommunityHeader = ({ label, tab }) => { State.update((lastState) => ({ ...lastState, shared: { - ...lastState, + ...lastState.shared, shared: { isEditorEnabled: !lastState.shared.isEditorEnabled }, }, })); From 163980527ce555117d124c451cbfa5e5e5d68ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Sat, 20 May 2023 05:19:51 +0400 Subject: [PATCH 29/69] fix: Update state correctly --- .../pages/community/GitHubActivity.jsx | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/gigs-board/pages/community/GitHubActivity.jsx b/src/gigs-board/pages/community/GitHubActivity.jsx index ee64c6af3..e2f679b0d 100644 --- a/src/gigs-board/pages/community/GitHubActivity.jsx +++ b/src/gigs-board/pages/community/GitHubActivity.jsx @@ -148,10 +148,14 @@ const GithubActivityPage = ({ boardId, label }) => { State.update({ boardConfig: { repoURL } }); const onColumnCreate = () => - State.update(({ boardConfig }) => ({ + State.update((lastState) => ({ + ...lastState, + boardConfig: { + ...lastState.boardConfig, + columns: [ - ...boardConfig.columns, + ...lastState.boardConfig.columns, { title: "New status", labelFilters: [] }, ], }, @@ -160,8 +164,12 @@ const GithubActivityPage = ({ boardId, label }) => { const onColumnStatusTitleChange = ({ columnIdx }) => ({ target: { value: title } }) => - State.update(({ boardConfig }) => ({ + State.update((lastState) => ({ + ...lastState, + boardConfig: { + ...lastState.boardConfig, + columns: boardConfig.columns.map((column, idx) => idx === columnIdx ? { ...column, title } : column ), @@ -171,9 +179,13 @@ const GithubActivityPage = ({ boardId, label }) => { const onColumnLabelFiltersChange = ({ columnIdx }) => ({ target: { value } }) => - State.update(({ boardConfig }) => ({ + State.update((lastState) => ({ + ...lastState, + boardConfig: { - columns: boardConfig.columns.map((column, idx) => + ...lastState.boardConfig, + + columns: lastState.boardConfig.columns.map((column, idx) => idx === columnIdx ? { ...column, From 9fc5b863ae42c56268e706639241087bdf54b83b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Sat, 20 May 2023 05:38:01 +0400 Subject: [PATCH 30/69] wip: Add WIP label to the global editor toggle --- src/gigs-board/components/community/CommunityHeader.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gigs-board/components/community/CommunityHeader.jsx b/src/gigs-board/components/community/CommunityHeader.jsx index 7c7c569d6..09b197cc4 100644 --- a/src/gigs-board/components/community/CommunityHeader.jsx +++ b/src/gigs-board/components/community/CommunityHeader.jsx @@ -204,7 +204,7 @@ const CommunityHeader = ({ label, tab }) => { className="form-check-label" for="CommunityEditModeToggle" > - Editor mode + Editor mode ( WIP )
    From 0c48b06e4b64c3381fe74cd3e04d65366e151069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Sat, 20 May 2023 05:40:17 +0400 Subject: [PATCH 31/69] fix: Broken column title update --- src/gigs-board/pages/community/GitHubActivity.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gigs-board/pages/community/GitHubActivity.jsx b/src/gigs-board/pages/community/GitHubActivity.jsx index e2f679b0d..0afa5da9e 100644 --- a/src/gigs-board/pages/community/GitHubActivity.jsx +++ b/src/gigs-board/pages/community/GitHubActivity.jsx @@ -170,7 +170,7 @@ const GithubActivityPage = ({ boardId, label }) => { boardConfig: { ...lastState.boardConfig, - columns: boardConfig.columns.map((column, idx) => + columns: lastState.boardConfig.columns.map((column, idx) => idx === columnIdx ? { ...column, title } : column ), }, From 52556097f0227132bd50a13492e69f76da93094f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Sat, 20 May 2023 05:43:23 +0400 Subject: [PATCH 32/69] wip: Use only 1 column in GH board config mock --- common.jsx | 7 +---- src/DevGov/Notification/Item/Left.jsx | 7 +---- src/DevGov/Notification/Item/Right.jsx | 7 +---- .../components/boards/KanbanBoard.jsx | 7 +---- .../components/community/CommunityHeader.jsx | 7 +---- .../community/FeaturedCommunity.jsx | 7 +---- .../components/community/FeedHeader.jsx | 7 +---- .../components/community/Layout.jsx | 7 +---- src/gigs-board/components/layout/Banner.jsx | 7 +---- src/gigs-board/components/layout/Controls.jsx | 7 +---- .../components/layout/LikeButton/Faces.jsx | 7 +---- src/gigs-board/components/layout/Navbar.jsx | 7 +---- src/gigs-board/components/layout/Page.jsx | 7 +---- .../components/layout/SearchByAuthor.jsx | 7 +---- .../components/layout/SearchByLabel.jsx | 7 +---- .../components/posts/CompactPost.jsx | 7 +---- src/gigs-board/components/posts/List.jsx | 7 +---- src/gigs-board/components/posts/Post.jsx | 7 +---- .../components/posts/PostEditor.jsx | 7 +---- src/gigs-board/components/posts/Search.jsx | 7 +---- .../components/teams/LabelsPermissions.jsx | 7 +---- src/gigs-board/components/teams/TeamInfo.jsx | 7 +---- src/gigs-board/entities/GithubRepo/Board.jsx | 7 +---- .../entities/GithubRepo/TicketCard.jsx | 7 +---- src/gigs-board/pages/Boards.jsx | 7 +---- src/gigs-board/pages/Feed.jsx | 7 +---- src/gigs-board/pages/Post.jsx | 7 +---- src/gigs-board/pages/Teams.jsx | 7 +---- .../pages/community/Discussions.jsx | 7 +---- src/gigs-board/pages/community/Events.jsx | 7 +---- .../pages/community/GitHubActivity.jsx | 26 ++++++------------- src/gigs-board/pages/community/Overview.jsx | 7 +---- .../pages/community/Sponsorship.jsx | 7 +---- 33 files changed, 40 insertions(+), 210 deletions(-) diff --git a/common.jsx b/common.jsx index 8bc9fad37..411721abe 100644 --- a/common.jsx +++ b/common.jsx @@ -16,12 +16,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/DevGov/Notification/Item/Left.jsx b/src/DevGov/Notification/Item/Left.jsx index eb5a4664d..e96f099d6 100644 --- a/src/DevGov/Notification/Item/Left.jsx +++ b/src/DevGov/Notification/Item/Left.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/DevGov/Notification/Item/Right.jsx b/src/DevGov/Notification/Item/Right.jsx index 206d6b36d..e3d284f59 100644 --- a/src/DevGov/Notification/Item/Right.jsx +++ b/src/DevGov/Notification/Item/Right.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/boards/KanbanBoard.jsx b/src/gigs-board/components/boards/KanbanBoard.jsx index 8d2490577..f8581f2bd 100644 --- a/src/gigs-board/components/boards/KanbanBoard.jsx +++ b/src/gigs-board/components/boards/KanbanBoard.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/community/CommunityHeader.jsx b/src/gigs-board/components/community/CommunityHeader.jsx index 09b197cc4..88825df34 100644 --- a/src/gigs-board/components/community/CommunityHeader.jsx +++ b/src/gigs-board/components/community/CommunityHeader.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/community/FeaturedCommunity.jsx b/src/gigs-board/components/community/FeaturedCommunity.jsx index fa2f0f3d6..ef434eeef 100644 --- a/src/gigs-board/components/community/FeaturedCommunity.jsx +++ b/src/gigs-board/components/community/FeaturedCommunity.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/community/FeedHeader.jsx b/src/gigs-board/components/community/FeedHeader.jsx index d9cf958e4..ca9670f63 100644 --- a/src/gigs-board/components/community/FeedHeader.jsx +++ b/src/gigs-board/components/community/FeedHeader.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/community/Layout.jsx b/src/gigs-board/components/community/Layout.jsx index c68eb7512..02c253028 100644 --- a/src/gigs-board/components/community/Layout.jsx +++ b/src/gigs-board/components/community/Layout.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/layout/Banner.jsx b/src/gigs-board/components/layout/Banner.jsx index 086e6cfb1..1c58316e2 100644 --- a/src/gigs-board/components/layout/Banner.jsx +++ b/src/gigs-board/components/layout/Banner.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/layout/Controls.jsx b/src/gigs-board/components/layout/Controls.jsx index 4de9f6078..ae9e0e28c 100644 --- a/src/gigs-board/components/layout/Controls.jsx +++ b/src/gigs-board/components/layout/Controls.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/layout/LikeButton/Faces.jsx b/src/gigs-board/components/layout/LikeButton/Faces.jsx index 45e1b41aa..68995bcee 100644 --- a/src/gigs-board/components/layout/LikeButton/Faces.jsx +++ b/src/gigs-board/components/layout/LikeButton/Faces.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/layout/Navbar.jsx b/src/gigs-board/components/layout/Navbar.jsx index 25628af23..fe295782d 100644 --- a/src/gigs-board/components/layout/Navbar.jsx +++ b/src/gigs-board/components/layout/Navbar.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/layout/Page.jsx b/src/gigs-board/components/layout/Page.jsx index 8e5293ee7..8fa69029f 100644 --- a/src/gigs-board/components/layout/Page.jsx +++ b/src/gigs-board/components/layout/Page.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/layout/SearchByAuthor.jsx b/src/gigs-board/components/layout/SearchByAuthor.jsx index acfd36100..019352260 100644 --- a/src/gigs-board/components/layout/SearchByAuthor.jsx +++ b/src/gigs-board/components/layout/SearchByAuthor.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/layout/SearchByLabel.jsx b/src/gigs-board/components/layout/SearchByLabel.jsx index 12ac516d4..f708c5f86 100644 --- a/src/gigs-board/components/layout/SearchByLabel.jsx +++ b/src/gigs-board/components/layout/SearchByLabel.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/posts/CompactPost.jsx b/src/gigs-board/components/posts/CompactPost.jsx index 4d3f6bbad..8af37e0e6 100644 --- a/src/gigs-board/components/posts/CompactPost.jsx +++ b/src/gigs-board/components/posts/CompactPost.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/posts/List.jsx b/src/gigs-board/components/posts/List.jsx index 1a35a5926..a51c36a32 100644 --- a/src/gigs-board/components/posts/List.jsx +++ b/src/gigs-board/components/posts/List.jsx @@ -22,12 +22,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/posts/Post.jsx b/src/gigs-board/components/posts/Post.jsx index f1f7d1fa7..e8527c2a2 100644 --- a/src/gigs-board/components/posts/Post.jsx +++ b/src/gigs-board/components/posts/Post.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/posts/PostEditor.jsx b/src/gigs-board/components/posts/PostEditor.jsx index c50d44444..a54450d18 100644 --- a/src/gigs-board/components/posts/PostEditor.jsx +++ b/src/gigs-board/components/posts/PostEditor.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/posts/Search.jsx b/src/gigs-board/components/posts/Search.jsx index a642738c9..c5653baa2 100644 --- a/src/gigs-board/components/posts/Search.jsx +++ b/src/gigs-board/components/posts/Search.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/teams/LabelsPermissions.jsx b/src/gigs-board/components/teams/LabelsPermissions.jsx index bc3e8d11e..b29e46bb6 100644 --- a/src/gigs-board/components/teams/LabelsPermissions.jsx +++ b/src/gigs-board/components/teams/LabelsPermissions.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/teams/TeamInfo.jsx b/src/gigs-board/components/teams/TeamInfo.jsx index 7f5621ffa..10e12f524 100644 --- a/src/gigs-board/components/teams/TeamInfo.jsx +++ b/src/gigs-board/components/teams/TeamInfo.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/entities/GithubRepo/Board.jsx b/src/gigs-board/entities/GithubRepo/Board.jsx index dafa61e88..e7cdfc95c 100644 --- a/src/gigs-board/entities/GithubRepo/Board.jsx +++ b/src/gigs-board/entities/GithubRepo/Board.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/entities/GithubRepo/TicketCard.jsx b/src/gigs-board/entities/GithubRepo/TicketCard.jsx index 44931adb9..c654ed56b 100644 --- a/src/gigs-board/entities/GithubRepo/TicketCard.jsx +++ b/src/gigs-board/entities/GithubRepo/TicketCard.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/pages/Boards.jsx b/src/gigs-board/pages/Boards.jsx index 0e5cc52ff..82133368f 100644 --- a/src/gigs-board/pages/Boards.jsx +++ b/src/gigs-board/pages/Boards.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/pages/Feed.jsx b/src/gigs-board/pages/Feed.jsx index 89e6d1799..392dd33a2 100644 --- a/src/gigs-board/pages/Feed.jsx +++ b/src/gigs-board/pages/Feed.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/pages/Post.jsx b/src/gigs-board/pages/Post.jsx index 31476728e..02886ae09 100644 --- a/src/gigs-board/pages/Post.jsx +++ b/src/gigs-board/pages/Post.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/pages/Teams.jsx b/src/gigs-board/pages/Teams.jsx index 8f509aa81..6738ac0d8 100644 --- a/src/gigs-board/pages/Teams.jsx +++ b/src/gigs-board/pages/Teams.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/pages/community/Discussions.jsx b/src/gigs-board/pages/community/Discussions.jsx index 8d805ab64..b70efc28f 100644 --- a/src/gigs-board/pages/community/Discussions.jsx +++ b/src/gigs-board/pages/community/Discussions.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/pages/community/Events.jsx b/src/gigs-board/pages/community/Events.jsx index ab8ba4062..a5fbe642a 100644 --- a/src/gigs-board/pages/community/Events.jsx +++ b/src/gigs-board/pages/community/Events.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/pages/community/GitHubActivity.jsx b/src/gigs-board/pages/community/GitHubActivity.jsx index 0afa5da9e..677ab848f 100644 --- a/src/gigs-board/pages/community/GitHubActivity.jsx +++ b/src/gigs-board/pages/community/GitHubActivity.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", @@ -97,12 +92,7 @@ const GithubActivityPage = ({ boardId, label }) => { State.init({ boardConfig: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: false, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", @@ -149,10 +139,10 @@ const GithubActivityPage = ({ boardId, label }) => { const onColumnCreate = () => State.update((lastState) => ({ - ...lastState, + ...lastState, boardConfig: { - ...lastState.boardConfig, + ...lastState.boardConfig, columns: [ ...lastState.boardConfig.columns, @@ -165,10 +155,10 @@ const GithubActivityPage = ({ boardId, label }) => { ({ columnIdx }) => ({ target: { value: title } }) => State.update((lastState) => ({ - ...lastState, + ...lastState, boardConfig: { - ...lastState.boardConfig, + ...lastState.boardConfig, columns: lastState.boardConfig.columns.map((column, idx) => idx === columnIdx ? { ...column, title } : column @@ -180,10 +170,10 @@ const GithubActivityPage = ({ boardId, label }) => { ({ columnIdx }) => ({ target: { value } }) => State.update((lastState) => ({ - ...lastState, + ...lastState, boardConfig: { - ...lastState.boardConfig, + ...lastState.boardConfig, columns: lastState.boardConfig.columns.map((column, idx) => idx === columnIdx diff --git a/src/gigs-board/pages/community/Overview.jsx b/src/gigs-board/pages/community/Overview.jsx index ab0496587..0a07d879b 100644 --- a/src/gigs-board/pages/community/Overview.jsx +++ b/src/gigs-board/pages/community/Overview.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/pages/community/Sponsorship.jsx b/src/gigs-board/pages/community/Sponsorship.jsx index b6790ec40..795103173 100644 --- a/src/gigs-board/pages/community/Sponsorship.jsx +++ b/src/gigs-board/pages/community/Sponsorship.jsx @@ -17,12 +17,7 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - - columns: [ - { title: "Draft", labelFilters: ["S-draft"] }, - { title: "Review", labelFilters: ["S-review"] }, - ], - + columns: [{ title: "Draft", labelFilters: ["S-draft"] }], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", From 9552248d14eba9f0411311c57b786388ba87f608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Sat, 20 May 2023 05:47:16 +0400 Subject: [PATCH 33/69] chore: Remove TODO --- package.json | 49 ++++++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index e73c81b7f..155120fcd 100644 --- a/package.json +++ b/package.json @@ -1,26 +1,25 @@ { - "name": "devgigsboard-widgets", - "version": "1.0.0", - "description": "NEAR Developer Governance Gigs Board widgets for NEAR Social", - "devDependencies": { - "prettier": "^2.8.4", - "replace-in-files": "^3.0.0" - }, - "scripts": { - "fmt": "prettier --write '**/*.{js,jsx,ts,tsx,json}'", - "fmt:check": "prettier --check '**/*.{js,jsx,ts,tsx,json}'", - "build": "npm run fmt && node build.js", - "dev:loader": "~/.cargo/bin/bos-loader devgovgigs.near --path src", - "dev:social": "echo No command for near.social gateway!" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/near/devgigsboard-widgets.git" - }, - "author": "Near Inc ", - "license": "ISC", - "bugs": { - "url": "https://github.com/near/devgigsboard-widgets/issues" - }, - "homepage": "https://github.com/near/devgigsboard-widgets#readme" -} + "name": "devgigsboard-widgets", + "version": "1.0.0", + "description": "NEAR Developer Governance Gigs Board widgets for NEAR Social", + "devDependencies": { + "prettier": "^2.8.4", + "replace-in-files": "^3.0.0" + }, + "scripts": { + "fmt": "prettier --write '**/*.{js,jsx,ts,tsx,json}'", + "fmt:check": "prettier --check '**/*.{js,jsx,ts,tsx,json}'", + "build": "npm run fmt && node build.js", + "dev:loader": "~/.cargo/bin/bos-loader devgovgigs.near --path src" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/near/devgigsboard-widgets.git" + }, + "author": "Near Inc ", + "license": "ISC", + "bugs": { + "url": "https://github.com/near/devgigsboard-widgets/issues" + }, + "homepage": "https://github.com/near/devgigsboard-widgets#readme" +} \ No newline at end of file From 85f8812c8fa839ceacce17ce769739b326924d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Sat, 20 May 2023 05:56:14 +0400 Subject: [PATCH 34/69] wip: Update page name & Remove redundant code --- .../components/community/CommunityHeader.jsx | 4 ++-- src/gigs-board/entities/GithubRepo/Board.jsx | 5 ++--- .../pages/community/{GitHubActivity.jsx => github.jsx} | 10 +++++----- 3 files changed, 9 insertions(+), 10 deletions(-) rename src/gigs-board/pages/community/{GitHubActivity.jsx => github.jsx} (97%) diff --git a/src/gigs-board/components/community/CommunityHeader.jsx b/src/gigs-board/components/community/CommunityHeader.jsx index 88825df34..b2c9be899 100644 --- a/src/gigs-board/components/community/CommunityHeader.jsx +++ b/src/gigs-board/components/community/CommunityHeader.jsx @@ -140,8 +140,8 @@ const topicTabs = [ }, iconClass: "bi-github", - path: "community.GithubActivity", - title: "GitHub board", // communityById("communityId").boards[0].title + path: "community.github", + title: "GitHub", // communityById("communityId").boards[0].title }, ]; diff --git a/src/gigs-board/entities/GithubRepo/Board.jsx b/src/gigs-board/entities/GithubRepo/Board.jsx index e7cdfc95c..15575c329 100644 --- a/src/gigs-board/entities/GithubRepo/Board.jsx +++ b/src/gigs-board/entities/GithubRepo/Board.jsx @@ -81,10 +81,9 @@ const FormCheckLabel = styled.label` /* END_INCLUDE: "common.jsx" */ const GithubRepoBoard = ({ - boardId, dataTypes, columns, - linkedPage, + pageURL, repoURL, title, }) => { @@ -158,7 +157,7 @@ const GithubRepoBoard = ({ {true ? ( { +const GithubPage = ({ boardId, label }) => { console.log( - "CommunityHeader state requested from GithubActivity page", + "CommunityHeader state requested from Github page", Storage.get( "state", `${nearDevGovGigsWidgetsAccountId}/widget/gigs-board.components.community.CommunityHeader` @@ -188,7 +188,7 @@ const GithubActivityPage = ({ boardId, label }) => { return widget("components.community.Layout", { label, - tab: state.boardConfig.title, + tab: "GitHub", children: (
    @@ -337,11 +337,11 @@ const GithubActivityPage = ({ boardId, label }) => { {boardId && widget("entities.GithubRepo.Board", { ...boardConfigByBoardId(boardId), - linkedPage: "GithubActivity", + pageLink: href("community.github", { boardId }), })}
    ), }); }; -return GithubActivityPage(props); +return GithubPage(props); From 6e575cf7cef4e31481e291afcc55abb8b95f14d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Sat, 20 May 2023 06:47:45 +0400 Subject: [PATCH 35/69] chore: Ger rid of clunky names --- package.json | 48 +++---- .../github-repo/board.jsx} | 14 +- .../github-repo/ticket.jsx} | 128 ++++++++++-------- src/gigs-board/pages/community/github.jsx | 4 +- 4 files changed, 100 insertions(+), 94 deletions(-) rename src/gigs-board/{entities/GithubRepo/Board.jsx => entity/github-repo/board.jsx} (95%) rename src/gigs-board/{entities/GithubRepo/TicketCard.jsx => entity/github-repo/ticket.jsx} (55%) diff --git a/package.json b/package.json index 155120fcd..e228edba3 100644 --- a/package.json +++ b/package.json @@ -1,25 +1,25 @@ { - "name": "devgigsboard-widgets", - "version": "1.0.0", - "description": "NEAR Developer Governance Gigs Board widgets for NEAR Social", - "devDependencies": { - "prettier": "^2.8.4", - "replace-in-files": "^3.0.0" - }, - "scripts": { - "fmt": "prettier --write '**/*.{js,jsx,ts,tsx,json}'", - "fmt:check": "prettier --check '**/*.{js,jsx,ts,tsx,json}'", - "build": "npm run fmt && node build.js", - "dev:loader": "~/.cargo/bin/bos-loader devgovgigs.near --path src" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/near/devgigsboard-widgets.git" - }, - "author": "Near Inc ", - "license": "ISC", - "bugs": { - "url": "https://github.com/near/devgigsboard-widgets/issues" - }, - "homepage": "https://github.com/near/devgigsboard-widgets#readme" -} \ No newline at end of file + "name": "devgigsboard-widgets", + "version": "1.0.0", + "description": "NEAR Developer Governance Gigs Board widgets for NEAR Social", + "devDependencies": { + "prettier": "^2.8.4", + "replace-in-files": "^3.0.0" + }, + "scripts": { + "fmt": "prettier --write '**/*.{js,jsx,ts,tsx,json}'", + "fmt:check": "prettier --check '**/*.{js,jsx,ts,tsx,json}'", + "build": "npm run fmt && node build.js", + "dev:loader": "~/.cargo/bin/bos-loader devgovgigs.near --path src" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/near/devgigsboard-widgets.git" + }, + "author": "Near Inc ", + "license": "ISC", + "bugs": { + "url": "https://github.com/near/devgigsboard-widgets/issues" + }, + "homepage": "https://github.com/near/devgigsboard-widgets#readme" +} diff --git a/src/gigs-board/entities/GithubRepo/Board.jsx b/src/gigs-board/entity/github-repo/board.jsx similarity index 95% rename from src/gigs-board/entities/GithubRepo/Board.jsx rename to src/gigs-board/entity/github-repo/board.jsx index 15575c329..2804a3f05 100644 --- a/src/gigs-board/entities/GithubRepo/Board.jsx +++ b/src/gigs-board/entity/github-repo/board.jsx @@ -80,13 +80,7 @@ const FormCheckLabel = styled.label` `; /* END_INCLUDE: "common.jsx" */ -const GithubRepoBoard = ({ - dataTypes, - columns, - pageURL, - repoURL, - title, -}) => { +const GithubRepoBoard = ({ dataTypes, columns, pageURL, repoURL, title }) => { State.init({ pullRequestByColumn: {}, issueByColumn: {}, @@ -185,7 +179,11 @@ const GithubRepoBoard = ({ {(state.pullRequestByColumn[column.title] ?? []).map((data) => - widget("entities.GithubRepo.TicketCard", { data }, data.id) + widget( + "entity.github-repo.ticket", + { data, format: "card" }, + data.id + ) )} diff --git a/src/gigs-board/entities/GithubRepo/TicketCard.jsx b/src/gigs-board/entity/github-repo/ticket.jsx similarity index 55% rename from src/gigs-board/entities/GithubRepo/TicketCard.jsx rename to src/gigs-board/entity/github-repo/ticket.jsx index c654ed56b..c4cc11ae6 100644 --- a/src/gigs-board/entities/GithubRepo/TicketCard.jsx +++ b/src/gigs-board/entity/github-repo/ticket.jsx @@ -95,70 +95,78 @@ const ticketTypes = { PullRequest: { displayName: "Pull request", icon: "bi-git" }, }; -const GithubRepoTicketCard = ({ - data: { _links, labels, number, title, type, user }, -}) => ( - -
    - -
    -
    - - {`${user.login}'s - - @{user.login} - +const GithubRepoTicket = ({ + data: { _links, format, labels, number, title, type, user }, +}) => { + const cardFormat = ( + +
    + + + +
    -
    - - - -
    -
    -
    -
    +
    +
    + + + {`${ticketTypes[type].displayName} #${number}`} + -
    -
    - - - {`${ticketTypes[type].displayName} #${number}`} - + {title} +
    - {title} +
    + {labels.map((label) => ( + + + {label.name} + + + ))} +
    + + ); -
    - {labels.map((label) => ( - - - {label.name} - - - ))} -
    -
    - -); + return ( + { + card: cardFormat, + }[format] ?? cardFormat + ); +}; -return GithubRepoTicketCard(props); +return GithubRepoTicket(props); diff --git a/src/gigs-board/pages/community/github.jsx b/src/gigs-board/pages/community/github.jsx index 82c5e8d74..f0df112ca 100644 --- a/src/gigs-board/pages/community/github.jsx +++ b/src/gigs-board/pages/community/github.jsx @@ -332,10 +332,10 @@ const GithubPage = ({ boardId, label }) => {
    ) : null} - {!boardId && widget("entities.GithubRepo.Board", state.boardConfig)} + {!boardId && widget("entity.github-repo.board", state.boardConfig)} {boardId && - widget("entities.GithubRepo.Board", { + widget("entity.github-repo.board", { ...boardConfigByBoardId(boardId), pageLink: href("community.github", { boardId }), })} From a8291ea1a3586ef86fd0c65d35ffd46824dc8af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Sat, 20 May 2023 10:22:41 +0400 Subject: [PATCH 36/69] wip: Create generic form handler & shared toggle GUI --- common.jsx | 24 ++- src/DevGov/Notification/Item/Left.jsx | 24 ++- src/DevGov/Notification/Item/Right.jsx | 24 ++- .../components/boards/KanbanBoard.jsx | 24 ++- .../components/community/CommunityHeader.jsx | 50 +++--- .../community/FeaturedCommunity.jsx | 24 ++- .../components/community/FeedHeader.jsx | 24 ++- .../components/community/Layout.jsx | 24 ++- src/gigs-board/components/layout/Banner.jsx | 24 ++- src/gigs-board/components/layout/Controls.jsx | 24 ++- .../components/layout/LikeButton/Faces.jsx | 24 ++- src/gigs-board/components/layout/Navbar.jsx | 24 ++- src/gigs-board/components/layout/Page.jsx | 24 ++- .../components/layout/SearchByAuthor.jsx | 24 ++- .../components/layout/SearchByLabel.jsx | 24 ++- .../components/posts/CompactPost.jsx | 24 ++- src/gigs-board/components/posts/List.jsx | 24 ++- src/gigs-board/components/posts/Post.jsx | 24 ++- .../components/posts/PostEditor.jsx | 24 ++- src/gigs-board/components/posts/Search.jsx | 24 ++- .../components/teams/LabelsPermissions.jsx | 24 ++- src/gigs-board/components/teams/TeamInfo.jsx | 24 ++- src/gigs-board/components/toggle.jsx | 57 ++++++ src/gigs-board/entity/github-repo/board.jsx | 24 ++- src/gigs-board/entity/github-repo/ticket.jsx | 24 ++- src/gigs-board/pages/Boards.jsx | 24 ++- src/gigs-board/pages/Feed.jsx | 24 ++- src/gigs-board/pages/Post.jsx | 24 ++- src/gigs-board/pages/Teams.jsx | 24 ++- .../pages/community/Discussions.jsx | 24 ++- src/gigs-board/pages/community/Events.jsx | 24 ++- src/gigs-board/pages/community/Overview.jsx | 24 ++- .../pages/community/Sponsorship.jsx | 24 ++- src/gigs-board/pages/community/github.jsx | 163 +++++++++--------- 34 files changed, 790 insertions(+), 224 deletions(-) create mode 100644 src/gigs-board/components/toggle.jsx diff --git a/common.jsx b/common.jsx index 411721abe..0b9ecb32d 100644 --- a/common.jsx +++ b/common.jsx @@ -69,11 +69,27 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; diff --git a/src/DevGov/Notification/Item/Left.jsx b/src/DevGov/Notification/Item/Left.jsx index e96f099d6..93a4de152 100644 --- a/src/DevGov/Notification/Item/Left.jsx +++ b/src/DevGov/Notification/Item/Left.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ if (!props.type) { diff --git a/src/DevGov/Notification/Item/Right.jsx b/src/DevGov/Notification/Item/Right.jsx index e3d284f59..ad7435f22 100644 --- a/src/DevGov/Notification/Item/Right.jsx +++ b/src/DevGov/Notification/Item/Right.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ return props.post === undefined ? ( diff --git a/src/gigs-board/components/boards/KanbanBoard.jsx b/src/gigs-board/components/boards/KanbanBoard.jsx index f8581f2bd..3dd75a503 100644 --- a/src/gigs-board/components/boards/KanbanBoard.jsx +++ b/src/gigs-board/components/boards/KanbanBoard.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ const requiredLabels = props.requiredLabels ?? ["near-social"]; diff --git a/src/gigs-board/components/community/CommunityHeader.jsx b/src/gigs-board/components/community/CommunityHeader.jsx index b2c9be899..7385666d5 100644 --- a/src/gigs-board/components/community/CommunityHeader.jsx +++ b/src/gigs-board/components/community/CommunityHeader.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ const Header = styled.div` @@ -157,9 +173,10 @@ const CommunityHeader = ({ label, tab }) => { const onEditorToggle = () => State.update((lastState) => ({ ...lastState, + shared: { ...lastState.shared, - shared: { isEditorEnabled: !lastState.shared.isEditorEnabled }, + isEditorEnabled: !lastState.shared.isEditorEnabled, }, })); @@ -185,23 +202,12 @@ const CommunityHeader = ({ label, tab }) => {
    - - - - - Editor mode ( WIP ) - - + {widget("components.toggle", { + active: state.shared.isEditorEnabled, + key: "community-editor-toggle", + label: "Editor mode ( WIP )", + onSwitch: onEditorToggle, + })}
    diff --git a/src/gigs-board/components/community/FeaturedCommunity.jsx b/src/gigs-board/components/community/FeaturedCommunity.jsx index ef434eeef..b403cc688 100644 --- a/src/gigs-board/components/community/FeaturedCommunity.jsx +++ b/src/gigs-board/components/community/FeaturedCommunity.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ const Hover = styled.div` diff --git a/src/gigs-board/components/community/FeedHeader.jsx b/src/gigs-board/components/community/FeedHeader.jsx index ca9670f63..918237164 100644 --- a/src/gigs-board/components/community/FeedHeader.jsx +++ b/src/gigs-board/components/community/FeedHeader.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ /* INCLUDE: "communities.jsx" */ diff --git a/src/gigs-board/components/community/Layout.jsx b/src/gigs-board/components/community/Layout.jsx index 02c253028..860dc3ecf 100644 --- a/src/gigs-board/components/community/Layout.jsx +++ b/src/gigs-board/components/community/Layout.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ /* INCLUDE: "communities.jsx" */ diff --git a/src/gigs-board/components/layout/Banner.jsx b/src/gigs-board/components/layout/Banner.jsx index 1c58316e2..5d71d3333 100644 --- a/src/gigs-board/components/layout/Banner.jsx +++ b/src/gigs-board/components/layout/Banner.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ const Banner = styled.div` diff --git a/src/gigs-board/components/layout/Controls.jsx b/src/gigs-board/components/layout/Controls.jsx index ae9e0e28c..f169757ed 100644 --- a/src/gigs-board/components/layout/Controls.jsx +++ b/src/gigs-board/components/layout/Controls.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ return ( diff --git a/src/gigs-board/components/layout/LikeButton/Faces.jsx b/src/gigs-board/components/layout/LikeButton/Faces.jsx index 68995bcee..0b9c32d37 100644 --- a/src/gigs-board/components/layout/LikeButton/Faces.jsx +++ b/src/gigs-board/components/layout/LikeButton/Faces.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ const accountId = context.accountId; diff --git a/src/gigs-board/components/layout/Navbar.jsx b/src/gigs-board/components/layout/Navbar.jsx index fe295782d..277e3cfff 100644 --- a/src/gigs-board/components/layout/Navbar.jsx +++ b/src/gigs-board/components/layout/Navbar.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ return ( diff --git a/src/gigs-board/components/layout/Page.jsx b/src/gigs-board/components/layout/Page.jsx index 8fa69029f..46b056a21 100644 --- a/src/gigs-board/components/layout/Page.jsx +++ b/src/gigs-board/components/layout/Page.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ return ( diff --git a/src/gigs-board/components/layout/SearchByAuthor.jsx b/src/gigs-board/components/layout/SearchByAuthor.jsx index 019352260..67dcf02b4 100644 --- a/src/gigs-board/components/layout/SearchByAuthor.jsx +++ b/src/gigs-board/components/layout/SearchByAuthor.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ const onSearchAuthor = props.onSearchAuthor; diff --git a/src/gigs-board/components/layout/SearchByLabel.jsx b/src/gigs-board/components/layout/SearchByLabel.jsx index f708c5f86..04272e93f 100644 --- a/src/gigs-board/components/layout/SearchByLabel.jsx +++ b/src/gigs-board/components/layout/SearchByLabel.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ const onSearchLabel = props.onSearchLabel; diff --git a/src/gigs-board/components/posts/CompactPost.jsx b/src/gigs-board/components/posts/CompactPost.jsx index 8af37e0e6..0d2a949f1 100644 --- a/src/gigs-board/components/posts/CompactPost.jsx +++ b/src/gigs-board/components/posts/CompactPost.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ const postId = props.post.id ?? (props.id ? parseInt(props.id) : 0); diff --git a/src/gigs-board/components/posts/List.jsx b/src/gigs-board/components/posts/List.jsx index a51c36a32..89fd13a5d 100644 --- a/src/gigs-board/components/posts/List.jsx +++ b/src/gigs-board/components/posts/List.jsx @@ -75,14 +75,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ initState({ diff --git a/src/gigs-board/components/posts/Post.jsx b/src/gigs-board/components/posts/Post.jsx index e8527c2a2..fb09d87e2 100644 --- a/src/gigs-board/components/posts/Post.jsx +++ b/src/gigs-board/components/posts/Post.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ const postId = props.post.id ?? (props.id ? parseInt(props.id) : 0); diff --git a/src/gigs-board/components/posts/PostEditor.jsx b/src/gigs-board/components/posts/PostEditor.jsx index a54450d18..b39db2f5c 100644 --- a/src/gigs-board/components/posts/PostEditor.jsx +++ b/src/gigs-board/components/posts/PostEditor.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ const postType = props.postType ?? "Sponsorship"; diff --git a/src/gigs-board/components/posts/Search.jsx b/src/gigs-board/components/posts/Search.jsx index c5653baa2..0dfcb9e48 100644 --- a/src/gigs-board/components/posts/Search.jsx +++ b/src/gigs-board/components/posts/Search.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ ////////////////////////////////////////////////////////////////////// diff --git a/src/gigs-board/components/teams/LabelsPermissions.jsx b/src/gigs-board/components/teams/LabelsPermissions.jsx index b29e46bb6..cbb50834d 100644 --- a/src/gigs-board/components/teams/LabelsPermissions.jsx +++ b/src/gigs-board/components/teams/LabelsPermissions.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ const access_info = diff --git a/src/gigs-board/components/teams/TeamInfo.jsx b/src/gigs-board/components/teams/TeamInfo.jsx index 10e12f524..0fdc8a13f 100644 --- a/src/gigs-board/components/teams/TeamInfo.jsx +++ b/src/gigs-board/components/teams/TeamInfo.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ const Card = styled.div` diff --git a/src/gigs-board/components/toggle.jsx b/src/gigs-board/components/toggle.jsx new file mode 100644 index 000000000..64c050dd0 --- /dev/null +++ b/src/gigs-board/components/toggle.jsx @@ -0,0 +1,57 @@ +const ToggleRoot = styled.div` + width: fit-content !important; + max-width: 100%; +`; + +const ToggleSwitchRoot = styled("Switch.Root")` + all: unset; + display: block; + width: 42px; + height: 25px; + background-color: #d1d1d1; + border-radius: 9999px; + position: relative; + box-shadow: 0 2px 10px var(--blackA7); + + &[data-state="checked"] { + background-color: #00d084; + } +`; + +const ToggleSwitchThumb = styled("Switch.Thumb")` + all: unset; + display: block; + width: 21px; + height: 21px; + border-radius: 9999px; + box-shadow: 0 2px 2px var(--blackA7); + transition: transform 100ms; + transform: translateX(2px); + will-change: transform; + + &[data-state="checked"] { + transform: translateX(19px); + } +`; + +const ToggleLabel = styled.label` + white-space: nowrap; +`; + +const Toggle = ({ active, key, label, onSwitch }) => ( + + + + + + + {label} + + +); + +return Toggle(props); diff --git a/src/gigs-board/entity/github-repo/board.jsx b/src/gigs-board/entity/github-repo/board.jsx index 2804a3f05..936b0a2ce 100644 --- a/src/gigs-board/entity/github-repo/board.jsx +++ b/src/gigs-board/entity/github-repo/board.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ const GithubRepoBoard = ({ dataTypes, columns, pageURL, repoURL, title }) => { diff --git a/src/gigs-board/entity/github-repo/ticket.jsx b/src/gigs-board/entity/github-repo/ticket.jsx index c4cc11ae6..64e2a7d9c 100644 --- a/src/gigs-board/entity/github-repo/ticket.jsx +++ b/src/gigs-board/entity/github-repo/ticket.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ const Card = styled.div` diff --git a/src/gigs-board/pages/Boards.jsx b/src/gigs-board/pages/Boards.jsx index 82133368f..461950052 100644 --- a/src/gigs-board/pages/Boards.jsx +++ b/src/gigs-board/pages/Boards.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ const selectedBoardId = props.selectedBoardId ?? "mnwtransition"; diff --git a/src/gigs-board/pages/Feed.jsx b/src/gigs-board/pages/Feed.jsx index 392dd33a2..34e42b6ff 100644 --- a/src/gigs-board/pages/Feed.jsx +++ b/src/gigs-board/pages/Feed.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ State.init({ diff --git a/src/gigs-board/pages/Post.jsx b/src/gigs-board/pages/Post.jsx index 02886ae09..c51cd72ab 100644 --- a/src/gigs-board/pages/Post.jsx +++ b/src/gigs-board/pages/Post.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ return widget("components.layout.Page", { diff --git a/src/gigs-board/pages/Teams.jsx b/src/gigs-board/pages/Teams.jsx index 6738ac0d8..5f87e30b1 100644 --- a/src/gigs-board/pages/Teams.jsx +++ b/src/gigs-board/pages/Teams.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ const access_info = diff --git a/src/gigs-board/pages/community/Discussions.jsx b/src/gigs-board/pages/community/Discussions.jsx index b70efc28f..d4943f979 100644 --- a/src/gigs-board/pages/community/Discussions.jsx +++ b/src/gigs-board/pages/community/Discussions.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ /* INCLUDE: "communities.jsx" */ diff --git a/src/gigs-board/pages/community/Events.jsx b/src/gigs-board/pages/community/Events.jsx index a5fbe642a..42afd0d7c 100644 --- a/src/gigs-board/pages/community/Events.jsx +++ b/src/gigs-board/pages/community/Events.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ /* INCLUDE: "communities.jsx" */ diff --git a/src/gigs-board/pages/community/Overview.jsx b/src/gigs-board/pages/community/Overview.jsx index 0a07d879b..3d47a7e94 100644 --- a/src/gigs-board/pages/community/Overview.jsx +++ b/src/gigs-board/pages/community/Overview.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ /* INCLUDE: "communities.jsx" */ diff --git a/src/gigs-board/pages/community/Sponsorship.jsx b/src/gigs-board/pages/community/Sponsorship.jsx index 795103173..06eb2cebf 100644 --- a/src/gigs-board/pages/community/Sponsorship.jsx +++ b/src/gigs-board/pages/community/Sponsorship.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ /* INCLUDE: "communities.jsx" */ diff --git a/src/gigs-board/pages/community/github.jsx b/src/gigs-board/pages/community/github.jsx index f0df112ca..60e80e9b8 100644 --- a/src/gigs-board/pages/community/github.jsx +++ b/src/gigs-board/pages/community/github.jsx @@ -70,14 +70,30 @@ function href(widgetName, linkProps) { }${linkPropsQuery}`; } +const formHandler = + ({ formStateKey }) => + ({ fieldName, updateHandler }) => + (input) => + State.update((lastState) => ({ + ...lastState, + + [formStateKey]: { + ...lastState[formStateKey], + + [fieldName]: + typeof updateHandler === "function" + ? updateHandler({ + input: input?.target?.value ?? input ?? null, + lastState, + }) + : input?.target?.value ?? input ?? null, + }, + })); + const CompactContainer = styled.div` width: fit-content !important; max-width: 100%; `; - -const FormCheckLabel = styled.label` - white-space: nowrap; -`; /* END_INCLUDE: "common.jsx" */ const GithubPage = ({ boardId, label }) => { @@ -106,6 +122,12 @@ const GithubPage = ({ boardId, label }) => { ), }); + const onBoardConfigChange = formHandler({ + formStateKey: "boardConfig", + }); + + console.log(state); + console.log( "Board config columns", JSON.stringify(state.boardConfig.columns) @@ -117,25 +139,12 @@ const GithubPage = ({ boardId, label }) => { isEditorEnabled: !lastState.isEditorEnabled, })); - const onDataTypeToggle = - ({ typeName, isIncluded }) => - () => - State.update((lastState) => ({ - ...lastState, - boardConfig: { - ...lastState.boardConfig, - dataTypes: { - ...lastState.boardConfig.dataTypes, - [typeName]: !isIncluded, - }, - }, - })); - - const onBoardTitleChange = ({ target: { value: title } }) => - State.update({ boardConfig: { title } }); - - const onRepoURLChange = ({ target: { value: repoURL } }) => - State.update({ boardConfig: { repoURL } }); + const dataTypeToggle = + ({ typeName }) => + ({ lastState }) => ({ + ...lastState.boardConfig.dataTypes, + [typeName]: !lastState.boardConfig.dataTypes[typeName], + }); const onColumnCreate = () => State.update((lastState) => ({ @@ -192,43 +201,45 @@ const GithubPage = ({ boardId, label }) => { children: (
    - - - - - Editor mode - - + {widget("components.toggle", { + active: state.isEditorEnabled, + key: "editor-toggle", + label: "Editor mode", + onSwitch: onEditorToggle, + })}
    {state.isEditorEnabled ? ( -
    - - Board title - - - +
    +
    +
    + Board title + + +
    + +
    + Description + + +
    +
    @@ -240,7 +251,7 @@ const GithubPage = ({ boardId, label }) => { aria-describedby="basic-addon1" aria-label="Repository URL" className="form-control" - onChange={onRepoURLChange} + onChange={onBoardConfigChange({ fieldName: "repoURL" })} placeholder="https://github.com/example-org/example-repo" type="text" value={state.boardConfig.repoURL} @@ -252,27 +263,23 @@ const GithubPage = ({ boardId, label }) => { Tracked data - + {Object.entries(state.boardConfig.dataTypes).map( - ([typeName, isIncluded]) => ( - - - - - {typeName} - - - ) + ([key, active]) => + widget( + "components.toggle", + { + active, + key, + label: key, + + onSwitch: onBoardConfigChange({ + fieldName: "dataTypes", + updateHandler: dataTypeToggle({ typeName }), + }), + }, + key + ) )} From 383dde7354b099de5f3156a083a188c504536173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akaia=20Carina=20=F0=9F=A6=BE=F0=9F=A6=8A=F0=9F=AA=90?= =?UTF-8?q?=F0=9F=9A=80=20root=2Eakaia=28=20=2Enear=20=7C=20=2Eeth=20=29?= Date: Sat, 20 May 2023 13:31:29 +0400 Subject: [PATCH 37/69] wip: Update mocks & GUI & Fix errors --- common.jsx | 6 +- src/DevGov/Notification/Item/Left.jsx | 6 +- src/DevGov/Notification/Item/Right.jsx | 6 +- .../components/boards/KanbanBoard.jsx | 6 +- .../components/community/CommunityHeader.jsx | 23 ++- .../community/FeaturedCommunity.jsx | 6 +- .../components/community/FeedHeader.jsx | 6 +- .../components/community/Layout.jsx | 6 +- src/gigs-board/components/layout/Banner.jsx | 6 +- src/gigs-board/components/layout/Controls.jsx | 6 +- .../components/layout/LikeButton/Faces.jsx | 6 +- src/gigs-board/components/layout/Navbar.jsx | 6 +- src/gigs-board/components/layout/Page.jsx | 6 +- .../components/layout/SearchByAuthor.jsx | 6 +- .../components/layout/SearchByLabel.jsx | 6 +- .../components/posts/CompactPost.jsx | 6 +- src/gigs-board/components/posts/List.jsx | 6 +- src/gigs-board/components/posts/Post.jsx | 6 +- .../components/posts/PostEditor.jsx | 6 +- src/gigs-board/components/posts/Search.jsx | 6 +- .../components/teams/LabelsPermissions.jsx | 6 +- src/gigs-board/components/teams/TeamInfo.jsx | 6 +- src/gigs-board/components/toggle.jsx | 7 +- src/gigs-board/entity/github-repo/board.jsx | 142 +++++++------ src/gigs-board/entity/github-repo/ticket.jsx | 8 +- src/gigs-board/pages/Boards.jsx | 6 +- src/gigs-board/pages/Feed.jsx | 6 +- src/gigs-board/pages/Post.jsx | 6 +- src/gigs-board/pages/Teams.jsx | 6 +- .../pages/community/Discussions.jsx | 6 +- src/gigs-board/pages/community/Events.jsx | 6 +- src/gigs-board/pages/community/Overview.jsx | 6 +- .../pages/community/Sponsorship.jsx | 6 +- src/gigs-board/pages/community/github.jsx | 192 +++++++++++------- 34 files changed, 372 insertions(+), 174 deletions(-) diff --git a/common.jsx b/common.jsx index 0b9ecb32d..12d3cf00a 100644 --- a/common.jsx +++ b/common.jsx @@ -16,7 +16,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/DevGov/Notification/Item/Left.jsx b/src/DevGov/Notification/Item/Left.jsx index 93a4de152..0b9bef2d9 100644 --- a/src/DevGov/Notification/Item/Left.jsx +++ b/src/DevGov/Notification/Item/Left.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/DevGov/Notification/Item/Right.jsx b/src/DevGov/Notification/Item/Right.jsx index ad7435f22..a559a9f4a 100644 --- a/src/DevGov/Notification/Item/Right.jsx +++ b/src/DevGov/Notification/Item/Right.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/boards/KanbanBoard.jsx b/src/gigs-board/components/boards/KanbanBoard.jsx index 3dd75a503..905d2e659 100644 --- a/src/gigs-board/components/boards/KanbanBoard.jsx +++ b/src/gigs-board/components/boards/KanbanBoard.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/community/CommunityHeader.jsx b/src/gigs-board/components/community/CommunityHeader.jsx index 7385666d5..0f722954c 100644 --- a/src/gigs-board/components/community/CommunityHeader.jsx +++ b/src/gigs-board/components/community/CommunityHeader.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", @@ -131,22 +135,22 @@ const BreadcrumbBold = styled.b` const topicTabs = [ { defaultActive: true, - iconClass: "bi-house-door", + iconClass: "bi bi-house-door", path: "community.Overview", title: "Overview", }, { - iconClass: "bi-chat-square-text", + iconClass: "bi bi-chat-square-text", path: "community.Discussions", title: "Discussions", }, { - iconClass: "bi-kanban", + iconClass: "bi bi-coin", path: "community.Sponsorship", title: "Sponsorship", }, { - iconClass: "bi-calendar", + iconClass: "bi bi-calendar", path: "community.Events", title: "Events", }, @@ -155,7 +159,7 @@ const topicTabs = [ boardId: null, // communityById("communityId").boards[0].id }, - iconClass: "bi-github", + iconClass: "bi bi-github", path: "community.github", title: "GitHub", // communityById("communityId").boards[0].title }, @@ -217,11 +221,14 @@ const CommunityHeader = ({ label, tab }) => {
  • {iconClass && } - {title} + {title}
  • ) : null diff --git a/src/gigs-board/components/community/FeaturedCommunity.jsx b/src/gigs-board/components/community/FeaturedCommunity.jsx index b403cc688..ea3c84140 100644 --- a/src/gigs-board/components/community/FeaturedCommunity.jsx +++ b/src/gigs-board/components/community/FeaturedCommunity.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/community/FeedHeader.jsx b/src/gigs-board/components/community/FeedHeader.jsx index 918237164..cfda66d2e 100644 --- a/src/gigs-board/components/community/FeedHeader.jsx +++ b/src/gigs-board/components/community/FeedHeader.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/community/Layout.jsx b/src/gigs-board/components/community/Layout.jsx index 860dc3ecf..ccf6a9b8b 100644 --- a/src/gigs-board/components/community/Layout.jsx +++ b/src/gigs-board/components/community/Layout.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/layout/Banner.jsx b/src/gigs-board/components/layout/Banner.jsx index 5d71d3333..5f761b09e 100644 --- a/src/gigs-board/components/layout/Banner.jsx +++ b/src/gigs-board/components/layout/Banner.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/layout/Controls.jsx b/src/gigs-board/components/layout/Controls.jsx index f169757ed..d800eaf10 100644 --- a/src/gigs-board/components/layout/Controls.jsx +++ b/src/gigs-board/components/layout/Controls.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/layout/LikeButton/Faces.jsx b/src/gigs-board/components/layout/LikeButton/Faces.jsx index 0b9c32d37..0f1c5699c 100644 --- a/src/gigs-board/components/layout/LikeButton/Faces.jsx +++ b/src/gigs-board/components/layout/LikeButton/Faces.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/layout/Navbar.jsx b/src/gigs-board/components/layout/Navbar.jsx index 277e3cfff..121304b50 100644 --- a/src/gigs-board/components/layout/Navbar.jsx +++ b/src/gigs-board/components/layout/Navbar.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/layout/Page.jsx b/src/gigs-board/components/layout/Page.jsx index 46b056a21..0108411e7 100644 --- a/src/gigs-board/components/layout/Page.jsx +++ b/src/gigs-board/components/layout/Page.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/layout/SearchByAuthor.jsx b/src/gigs-board/components/layout/SearchByAuthor.jsx index 67dcf02b4..8fcb410c4 100644 --- a/src/gigs-board/components/layout/SearchByAuthor.jsx +++ b/src/gigs-board/components/layout/SearchByAuthor.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/layout/SearchByLabel.jsx b/src/gigs-board/components/layout/SearchByLabel.jsx index 04272e93f..d0ed980ef 100644 --- a/src/gigs-board/components/layout/SearchByLabel.jsx +++ b/src/gigs-board/components/layout/SearchByLabel.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/posts/CompactPost.jsx b/src/gigs-board/components/posts/CompactPost.jsx index 0d2a949f1..91df2b36d 100644 --- a/src/gigs-board/components/posts/CompactPost.jsx +++ b/src/gigs-board/components/posts/CompactPost.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/posts/List.jsx b/src/gigs-board/components/posts/List.jsx index 89fd13a5d..853f796fc 100644 --- a/src/gigs-board/components/posts/List.jsx +++ b/src/gigs-board/components/posts/List.jsx @@ -22,7 +22,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/posts/Post.jsx b/src/gigs-board/components/posts/Post.jsx index fb09d87e2..2bd21431c 100644 --- a/src/gigs-board/components/posts/Post.jsx +++ b/src/gigs-board/components/posts/Post.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/posts/PostEditor.jsx b/src/gigs-board/components/posts/PostEditor.jsx index b39db2f5c..773148cfa 100644 --- a/src/gigs-board/components/posts/PostEditor.jsx +++ b/src/gigs-board/components/posts/PostEditor.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/posts/Search.jsx b/src/gigs-board/components/posts/Search.jsx index 0dfcb9e48..cc79e73fe 100644 --- a/src/gigs-board/components/posts/Search.jsx +++ b/src/gigs-board/components/posts/Search.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/teams/LabelsPermissions.jsx b/src/gigs-board/components/teams/LabelsPermissions.jsx index cbb50834d..ec7de0757 100644 --- a/src/gigs-board/components/teams/LabelsPermissions.jsx +++ b/src/gigs-board/components/teams/LabelsPermissions.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/teams/TeamInfo.jsx b/src/gigs-board/components/teams/TeamInfo.jsx index 0fdc8a13f..eff1d8226 100644 --- a/src/gigs-board/components/teams/TeamInfo.jsx +++ b/src/gigs-board/components/teams/TeamInfo.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/components/toggle.jsx b/src/gigs-board/components/toggle.jsx index 64c050dd0..45a0325c4 100644 --- a/src/gigs-board/components/toggle.jsx +++ b/src/gigs-board/components/toggle.jsx @@ -38,8 +38,11 @@ const ToggleLabel = styled.label` white-space: nowrap; `; -const Toggle = ({ active, key, label, onSwitch }) => ( - +const Toggle = ({ active, className, key, label, onSwitch, ...rest }) => ( + { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", @@ -96,10 +100,18 @@ const CompactContainer = styled.div` `; /* END_INCLUDE: "common.jsx" */ -const GithubRepoBoard = ({ dataTypes, columns, pageURL, repoURL, title }) => { +const GithubRepoBoard = ({ + columns, + dataTypes, + description, + pageURL, + repoURL, + title, +}) => { State.init({ pullRequestByColumn: {}, issueByColumn: {}, + ticketByColumn: {}, }); const dataToColumns = (data) => @@ -124,47 +136,44 @@ const GithubRepoBoard = ({ dataTypes, columns, pageURL, repoURL, title }) => { ); if (repoURL) { - if (dataTypes.PullRequest) { - const pullRequests = ( - fetch( - `https://api.github.com/repos/${repoURL - .split("/") - .slice(-2) - .join("/")}/pulls` - ).body ?? [] - ).map((pullRequest) => ({ ...pullRequest, type: "PullRequest" })); - - State.update({ - pullRequestByColumn: dataToColumns(pullRequests), - }); - } - - console.log(state.pullRequestByColumn); - - if (dataTypes.Issue) { - const issues = ( - fetch( - `https://api.github.com/repos/${repoURL - .split("/") - .slice(-2) - .join("/")}/issues` - ).body ?? [] - ).map((issue) => ({ ...issue, type: "Issue" })); - - State.update({ - issueByColumn: dataToColumns(issues), - }); - } - - console.log(state.issueByColumn); + const pullRequests = dataTypes.PullRequest + ? ( + fetch( + `https://api.github.com/repos/${repoURL + .split("/") + .slice(-2) + .join("/")}/pulls` + ).body ?? [] + ).map((pullRequest) => ({ ...pullRequest, type: "PullRequest" })) + : []; + + const issues = dataTypes.Issue + ? ( + fetch( + `https://api.github.com/repos/${repoURL + .split("/") + .slice(-2) + .join("/")}/issues` + ).body ?? [] + ).map((issue) => ({ ...issue, type: "Issue" })) + : []; + + State.update({ + ticketByColumn: dataToColumns([...issues, ...pullRequests]), + }); } return (
    -

    {title}

    + - {true ? ( +
    + + {title} board +
    + + {pageURL ? ( { Link to this board - ) : null} + ) : ( + + )}
    -
    - {columns.map((column) => ( -
    - - -
    - {column.title} - - - {(state.pullRequestByColumn[column.title] ?? []).length} - -
    - - {(state.pullRequestByColumn[column.title] ?? []).map((data) => - widget( - "entity.github-repo.ticket", - { data, format: "card" }, - data.id - ) - )} +
    {description}
    + +
    + {columns.length > 0 ? ( + columns.map((column) => ( +
    + + +
    + {column.title} + + + {(state.ticketByColumn[column.title] ?? []).length} + +
    + + {(state.ticketByColumn[column.title] ?? []).map((data) => + widget( + "entity.github-repo.ticket", + { data, format: "card" }, + data.id + ) + )} +
    - +
    + )) + ) : ( +
    + No columns were created so far.
    - ))} + )}
    ); diff --git a/src/gigs-board/entity/github-repo/ticket.jsx b/src/gigs-board/entity/github-repo/ticket.jsx index 64e2a7d9c..3c3b77828 100644 --- a/src/gigs-board/entity/github-repo/ticket.jsx +++ b/src/gigs-board/entity/github-repo/ticket.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", @@ -166,7 +170,7 @@ const GithubRepoTicket = ({ {labels.map((label) => ( {label.name} diff --git a/src/gigs-board/pages/Boards.jsx b/src/gigs-board/pages/Boards.jsx index 461950052..cecd74abe 100644 --- a/src/gigs-board/pages/Boards.jsx +++ b/src/gigs-board/pages/Boards.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/pages/Feed.jsx b/src/gigs-board/pages/Feed.jsx index 34e42b6ff..63326a487 100644 --- a/src/gigs-board/pages/Feed.jsx +++ b/src/gigs-board/pages/Feed.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/pages/Post.jsx b/src/gigs-board/pages/Post.jsx index c51cd72ab..27047caaa 100644 --- a/src/gigs-board/pages/Post.jsx +++ b/src/gigs-board/pages/Post.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/pages/Teams.jsx b/src/gigs-board/pages/Teams.jsx index 5f87e30b1..ee95684a5 100644 --- a/src/gigs-board/pages/Teams.jsx +++ b/src/gigs-board/pages/Teams.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/pages/community/Discussions.jsx b/src/gigs-board/pages/community/Discussions.jsx index d4943f979..a9194975a 100644 --- a/src/gigs-board/pages/community/Discussions.jsx +++ b/src/gigs-board/pages/community/Discussions.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/pages/community/Events.jsx b/src/gigs-board/pages/community/Events.jsx index 42afd0d7c..a03c8bd22 100644 --- a/src/gigs-board/pages/community/Events.jsx +++ b/src/gigs-board/pages/community/Events.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/pages/community/Overview.jsx b/src/gigs-board/pages/community/Overview.jsx index 3d47a7e94..fbce36493 100644 --- a/src/gigs-board/pages/community/Overview.jsx +++ b/src/gigs-board/pages/community/Overview.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/pages/community/Sponsorship.jsx b/src/gigs-board/pages/community/Sponsorship.jsx index 06eb2cebf..3bc10713d 100644 --- a/src/gigs-board/pages/community/Sponsorship.jsx +++ b/src/gigs-board/pages/community/Sponsorship.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", diff --git a/src/gigs-board/pages/community/github.jsx b/src/gigs-board/pages/community/github.jsx index 60e80e9b8..95394fefd 100644 --- a/src/gigs-board/pages/community/github.jsx +++ b/src/gigs-board/pages/community/github.jsx @@ -17,7 +17,11 @@ const boardConfigByBoardId = ({ boardId }) => { return { probablyUUIDv4: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], + columns: [ + { title: "Draft", labelFilters: ["S-draft"] }, + { title: "Review", labelFilters: ["S-review"] }, + { title: "HALP!", labelFilters: ["help"] }, + ], dataTypes: { Issue: true, PullRequest: true }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", @@ -108,8 +112,8 @@ const GithubPage = ({ boardId, label }) => { State.init({ boardConfig: { id: "probablyUUIDv4", - columns: [{ title: "Draft", labelFilters: ["S-draft"] }], - dataTypes: { Issue: false, PullRequest: true }, + columns: [], + dataTypes: { Issue: true, PullRequest: false }, description: "Latest NEAR Enhancement Proposals by status", repoURL: "https://github.com/near/NEPs", title: "NEAR Protocol NEPs", @@ -140,10 +144,10 @@ const GithubPage = ({ boardId, label }) => { })); const dataTypeToggle = - ({ typeName }) => + ({ key }) => ({ lastState }) => ({ ...lastState.boardConfig.dataTypes, - [typeName]: !lastState.boardConfig.dataTypes[typeName], + [key]: !lastState.boardConfig.dataTypes[key], }); const onColumnCreate = () => @@ -160,7 +164,7 @@ const GithubPage = ({ boardId, label }) => { }, })); - const onColumnStatusTitleChange = + const onColumnTitleChange = ({ columnIdx }) => ({ target: { value: title } }) => State.update((lastState) => ({ @@ -199,21 +203,38 @@ const GithubPage = ({ boardId, label }) => { label, tab: "GitHub", children: ( -
    -
    - {widget("components.toggle", { - active: state.isEditorEnabled, - key: "editor-toggle", - label: "Editor mode", - onSwitch: onEditorToggle, - })} -
    +
    + {widget("components.toggle", { + active: state.isEditorEnabled, + + className: [ + "position-fixed", + "d-flex justify-content-center align-items-center", + "shadow-md rounded-pill p-4", + ].join(" "), + + key: "editor-toggle", + label: "Editor mode", + onSwitch: onEditorToggle, + + style: { + zIndex: 99, + right: 24, + bottom: 24, + backgroundColor: "#f3f3f3", + }, + })} {state.isEditorEnabled ? (
    -
    +
    + + {state.boardConfig.title} board configuration +
    + +
    - Board title + Title { />
    -
    - Description - - -
    -
    - -
    -
    - - Repository URL - +
    + Repository URL { value={state.boardConfig.repoURL} />
    +
    - - - Tracked data +
    + + + + Tracked data - - {Object.entries(state.boardConfig.dataTypes).map( - ([key, active]) => - widget( - "components.toggle", - { - active, - key, - label: key, - - onSwitch: onBoardConfigChange({ - fieldName: "dataTypes", - updateHandler: dataTypeToggle({ typeName }), - }), - }, - key - ) - )} - + {Object.entries(state.boardConfig.dataTypes).map( + ([key, active]) => + widget( + "components.toggle", + { + active, + key, + label: key, + + onSwitch: onBoardConfigChange({ + fieldName: "dataTypes", + updateHandler: dataTypeToggle({ key }), + }), + }, + key + ) + )} + +
    + Description + +