Skip to content

Commit

Permalink
Merge branch 'develop' into jl/balance-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
portuu3 committed Jan 30, 2025
2 parents 69b9488 + d1c0b58 commit 3cbac6c
Show file tree
Hide file tree
Showing 282 changed files with 2,351 additions and 1,397 deletions.
24 changes: 24 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Common file for apps that rely on root context
.git
.github
.husky
audits
docs
scripts
**/node_modules
**/build
**/dist

# Core package artifacts
# Hardhat files
**/abis
**/artifacts
**/cache
**/.deps
# TypeScript bindings output directory
**/typechain-types

# Docker-related
.dockerignore
**/Dockerfile*
**/docker-compose*
2 changes: 1 addition & 1 deletion .github/workflows/cd-subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18.20.1'
- name: Filter Networks
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ node_modules

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
.env.*.local

# Log files
npm-debug.log*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "MIT",
"scripts": {
"test": "concurrently \"yarn workspace @human-protocol/core test\" \"yarn workspace @human-protocol/sdk test\" \"yarn workspace @human-protocol/subgraph test\" \"yarn workspace @human-protocol/faucet-server test\" \"yarn workspace @human-protocol/job-launcher-server test\" \"yarn workspace @human-protocol/job-launcher-client test\" \"yarn workspace @human-protocol/human-app-frontend test\" \"yarn workspace @human-protocol/human-app-server test\" \"yarn workspace @human-protocol/reputation-oracle test\" \"yarn workspace @human-protocol/fortune-exchange-oracle-server test\" \"yarn workspace @human-protocol/fortune-recording-oracle test\"",
"lint": "concurrently \"yarn workspace @human-protocol/core lint\" \"yarn workspace @human-protocol/sdk lint\" \"yarn workspace @human-protocol/subgraph lint\" \"yarn workspace @human-protocol/faucet-client lint\" \"yarn workspace @human-protocol/faucet-server lint\" \"yarn workspace @human-protocol/job-launcher-server lint\" \"yarn workspace @human-protocol/job-launcher-client lint\" \"yarn workspace @human-protocol/human-app-frontend lint\" \"yarn workspace @human-protocol/human-app-server lint\" \"yarn workspace @human-protocol/reputation-oracle lint\" \"yarn workspace @human-protocol/fortune-exchange-oracle-server lint\" \"yarn workspace @human-protocol/fortune-recording-oracle lint\" \"yarn workspace @human-protocol/dashboard-ui-2024 lint\"",
"lint": "concurrently \"yarn workspace @human-protocol/core lint\" \"yarn workspace @human-protocol/sdk lint\" \"yarn workspace @human-protocol/subgraph lint\" \"yarn workspace @human-protocol/faucet-client lint\" \"yarn workspace @human-protocol/faucet-server lint\" \"yarn workspace @human-protocol/job-launcher-server lint\" \"yarn workspace @human-protocol/job-launcher-client lint\" \"yarn workspace @human-protocol/human-app-frontend lint\" \"yarn workspace @human-protocol/human-app-server lint\" \"yarn workspace @human-protocol/reputation-oracle lint\" \"yarn workspace @human-protocol/fortune-exchange-oracle-server lint\" \"yarn workspace @human-protocol/fortune-recording-oracle lint\" \"yarn workspace @human-protocol/dashboard-client lint\"",
"prepare": "husky",
"postinstall": "yarn workspace @human-protocol/sdk build"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
78 changes: 78 additions & 0 deletions packages/apps/dashboard/client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<p align="center">
<a href="https://www.humanprotocol.org/" target="blank"><img src="https://s2.coinmarketcap.com/static/img/coins/64x64/10347.png" width="100" alt="Human Protocol" /></a>
</p>

<h1 align="center">Dashboard Client</h1>
<p align="center">The Dashboard Client is a client application for managing operations on the Human Protocol. It provides a user-friendly interface for checking with the protocol activity.</p>

## 🚀 Getting Started

### Prerequisites

- Node.js
- Yarn (as a package manager)

### Installation

First, install the dependencies:

```bash
$ yarn install
```

### Environment Variables

The application requires environment variables to function correctly. Create a `.env` file, use the `.env.example` file as a template:

```bash
$ cp .env.example .env
```

### Running the Application

#### Development

To start the application in development mode:

```bash
$ yarn start
```

#### Production

To build and start the application in production mode:

```bash
$ yarn build
$ yarn start:prod
```

#### Preview

To preview the production build:

```bash
$ yarn preview
```

## 🔧 Commands

### Linting

To lint the codebase:

```bash
$ yarn lint
```

### Formatting

To format the codebase with Prettier and ESLint:

```bash
$ yarn format
```

## 📝 License

This project is licensed under the MIT License. See the LICENSE file for more details.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": "true",
"name": "@human-protocol/dashboard-ui-2024",
"name": "@human-protocol/dashboard-client",
"version": "1.0.0",
"description": "Human Protocol Dashboard",
"license": "MIT",
Expand All @@ -17,7 +17,7 @@
"@emotion/styled": "^11.11.5",
"@mui/icons-material": "^6.2.0",
"@mui/material": "^5.15.18",
"@mui/styled-engine-sc": "6.1.3",
"@mui/styled-engine-sc": "6.4.0",
"@mui/x-data-grid": "^7.23.2",
"@mui/x-date-pickers": "^7.23.6",
"@tanstack/react-query": "^5.48.0",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { z } from 'zod';
import { httpService } from '../http-service';
import { apiPaths } from '../api-paths';
import { useWalletSearch } from '@utils/hooks/use-wallet-search';
import { validateResponse } from '../../services/validate-response';
import { validateResponse } from '../validate-response';
import { reputationSchema } from '@services/api/use-leaderboard-details';

const transformOptionalTokenAmount = (
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/apps/dashboard/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@nestjs/config": "^3.2.3",
"@nestjs/core": "^10.2.8",
"@nestjs/mapped-types": "*",
"@nestjs/platform-express": "^10.3.10",
"@nestjs/platform-express": "^11.0.6",
"cache-manager": "^5.4.0",
"cache-manager-redis-yet": "^5.1.5",
"dayjs": "^1.11.12",
Expand Down
30 changes: 0 additions & 30 deletions packages/apps/dashboard/ui-2024/README.md

This file was deleted.

2 changes: 0 additions & 2 deletions packages/apps/human-app/frontend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ VITE_HUMAN_PROTOCOL_HELP_URL= #string
VITE_HUMAN_SUPPORT_EMAIL= #string
# link to human web page
VITE_HUMAN_PROTOCOL_URL= #string
# link to "Learn more" in wallet connect modal
VITE_WALLET_CONNECT_MODAL_LINK= #string
# link to human web page in main page navbar
VITE_NAVBAR__LINK__PROTOCOL_URL= #string
# link to human web page section in main page navbar
Expand Down
28 changes: 28 additions & 0 deletions packages/apps/human-app/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Using bullseye instead of slim because it needs Python and build tools for node-gyp
FROM node:18-bullseye
ARG APP_PATH=packages/apps/human-app/frontend

# Create app directory
WORKDIR /usr/src/app

# Copy expected yarn dist
COPY .yarn ./.yarn
COPY .yarnrc ./
# Copy files for deps installation
COPY package.json yarn.lock ./
COPY ${APP_PATH}/package.json ./${APP_PATH}/package.json
# Some deps are referenced as "*", so we need to build them
COPY tsconfig.json ./
COPY packages/core ./packages/core
COPY packages/sdk ./packages/sdk

RUN yarn install

# Copy everything else to ensure proper build process
COPY . .

WORKDIR ./${APP_PATH}
RUN yarn build

# Start the server using the build
CMD [ "yarn", "start:prod" ]
4 changes: 3 additions & 1 deletion packages/apps/human-app/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@human-protocol/sdk": "*",
"@mui/icons-material": "^6.2.0",
"@mui/material": "^5.16.7",
"@mui/x-date-pickers": "^7.23.6",
"@reown/appkit": "1.3.2",
"@reown/appkit-adapter-wagmi": "1.3.2",
"@synaps-io/verify-sdk": "^4.0.45",
Expand All @@ -32,7 +33,7 @@
"i18next": "^23.8.2",
"jwt-decode": "^4.0.0",
"lodash": "^4.17.21",
"material-react-table": "^3.0.1",
"material-react-table": "3.0.1",
"mui-image": "^1.0.7",
"notistack": "^3.0.1",
"query-string": "^9.0.0",
Expand All @@ -43,6 +44,7 @@
"react-imask": "^7.4.0",
"react-number-format": "^5.4.3",
"react-router-dom": "^6.22.0",
"serve": "^14.2.4",
"viem": "^2.21.44",
"vite-plugin-svgr": "^4.2.0",
"wagmi": "2.14.6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { t } from 'i18next';
import { Grid, Typography } from '@mui/material';
import { Trans } from 'react-i18next';
import { Link } from 'react-router-dom';
import { useEffect } from 'react';
import { Button } from '@/shared/components/ui/button';
import { ConnectWalletBtn } from '@/shared/components/ui/connect-wallet-btn';
import { useModalStore } from '@/shared/components/ui/modal/modal.store';
import { env } from '@/shared/env';
import { useWalletConnect } from '@/shared/hooks/use-wallet-connect';

export function WalletConnectModal() {
Expand Down Expand Up @@ -46,21 +44,7 @@ export function WalletConnectModal() {
}}
>
<Typography variant="body1">
<Trans
components={{
1: (
<Link
rel="noreferrer"
style={{
color: 'inherit',
}}
target="_blank"
to={env.VITE_WALLET_CONNECT_MODAL_LINK}
/>
),
}}
i18nKey="walletConnectModal.paragraph"
/>
<Trans i18nKey="walletConnectModal.paragraph" />
</Typography>
<ConnectWalletBtn fullWidth>
{t('walletConnectModal.connectBtn')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { routerPaths } from '@/router/router-paths';
import { PageCard } from '@/shared/components/ui/page-card';
import type { HomePageStageType } from '@/modules/homepage/views/home.page';
import { useColorMode } from '@/shared/hooks/use-color-mode';
import { useHomePageState } from '@/shared/contexts/homepage-state';
import { onlyDarkModeColor } from '@/shared/styles/dark-color-palette';
import { useHomePageState } from '@/shared/contexts/homepage-state';

interface ChooseSignUpAccountType {
setStage: (step: HomePageStageType) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { useIsMobile } from '@/shared/hooks/use-is-mobile';
import { OperatorSignIn } from '@/modules/homepage/hooks/use-operator-signin';
import { WorkerSignIn } from '@/modules/homepage/components/worker-signin';
import { useColorMode } from '@/shared/hooks/use-color-mode';
import { useHomePageState } from '@/shared/contexts/homepage-state';
import { useBackgroundColorStore } from '@/shared/hooks/use-background-store';
import { useHomePageState } from '@/shared/contexts/homepage-state';

export function Welcome() {
const { colorPalette, isDarkMode } = useColorMode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { useAuth } from '@/modules/auth/hooks/use-auth';
import { routerPaths } from '@/router/router-paths';
import { Button } from '@/shared/components/ui/button';
import { useColorMode } from '@/shared/hooks/use-color-mode';
import { useHomePageState } from '@/shared/contexts/homepage-state';
import { HomeContainer } from '@/modules/homepage/components/home-container';
import { useHomePageState } from '@/shared/contexts/homepage-state';

export type HomePageStageType = 'welcome' | 'chooseSignUpAccountType';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {
registrationInExchangeOracleDtoSchema,
useExchangeOracleRegistrationMutation,
} from '@/modules/worker/services/registration-in-exchange-oracles';
import { useRegisteredOracles } from '@/shared/contexts/registered-oracles';
import { useGetOracles } from '@/modules/worker/services/oracles';
import { routerPaths } from '@/router/router-paths';
import { useRegisteredOracles } from '@/shared/contexts/registered-oracles';

export function RegistrationPage() {
const navigate = useNavigate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { useIsMobile } from '@/shared/hooks/use-is-mobile';
import { Button } from '@/shared/components/ui/button';
import { breakpoints } from '@/shared/styles/breakpoints';
import { env } from '@/shared/env';
import { useHomePageState } from '@/shared/contexts/homepage-state';
import { DarkModeSwitch } from '@/shared/components/ui/dark-mode-switch';
import { useHandleMainNavIconClick } from '@/shared/hooks/use-handle-main-nav-icon-click';
import { useHomePageState } from '@/shared/contexts/homepage-state';

interface NavbarProps {
withNavigation: boolean;
Expand Down
Loading

0 comments on commit 3cbac6c

Please sign in to comment.