Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5906eec
chore(web): code maintenace and consensus
kemuru Aug 21, 2023
bd0802b
feat: small cosmetic change to the court breadcrumbs
jaybuidl Aug 22, 2023
5734bd4
chore: vscode ts lib setting
jaybuidl Aug 22, 2023
f0b1ea8
chore: getting the actions/dependency-review workflow to play well wi…
jaybuidl Aug 22, 2023
ce4bb60
chore: adding support for merge queues to the CodeQL workflow
jaybuidl Aug 22, 2023
2764cad
chore: workflow name
jaybuidl Aug 22, 2023
2a9c08f
fix(web): round-ongoing-info
nhestrompia Aug 18, 2023
1bb89da
chore: netlify script
jaybuidl Aug 22, 2023
35a6d7f
chore(deps): bump github/codeql-action from 2.21.3 to 2.21.4
dependabot[bot] Aug 21, 2023
f3893c4
chore(deps): update actions/upload-artifact digest to 65d8626
renovate[bot] Aug 22, 2023
f95b4bf
chore(deps): update actions/checkout digest to 7739b9b
renovate[bot] Aug 22, 2023
6c0803d
chore(deps): update actions/setup-node digest to 5e21ff4
renovate[bot] Aug 22, 2023
6bd9e25
chore(deps): update aws-actions/configure-aws-credentials digest to 1…
renovate[bot] Aug 22, 2023
1a42737
chore(deps): bump actions/dependency-review-action from 3.0.7 to 3.0.8
dependabot[bot] Aug 22, 2023
510528e
chore(deps): bump actions/cache
dependabot[bot] Aug 22, 2023
789e4e4
Merge branch 'dev' into chore(web)/code-maintenance-and-consensus
jaybuidl Aug 22, 2023
f588174
chore: keeping the linters happy
jaybuidl Aug 22, 2023
88d40d2
chore: minor tweaks
jaybuidl Aug 22, 2023
0631781
Merge branch 'chore(web)/code-maintenance-and-consensus' into dev
jaybuidl Aug 22, 2023
14dff15
chore: skip contracts testing when unrelated workspaces are modified
jaybuidl Aug 22, 2023
5d348d6
feat(web): improve court policy display
kemuru Aug 21, 2023
3252a4f
chore: open the court description in the same tab
jaybuidl Aug 22, 2023
53bc949
chore(deps-dev): bump typechain from 8.2.0 to 8.3.1
dependabot[bot] Aug 18, 2023
e9e0773
fix(web): round decimals in stats
kemuru Aug 23, 2023
330a6ea
refactor(web): switch to tofixed function -S
kemuru Aug 23, 2023
05e8b49
refactor: moved some formatting functions to utils
jaybuidl Aug 24, 2023
7d5c8ec
feat(web): add skeletons to improve UX, modularize code
kemuru Aug 22, 2023
06c58f9
fix(web): merge conflicts
kemuru Aug 22, 2023
fb3a6a7
Merge branch 'dev' into feat(web)/skeletons-placeholder-while-loading
kemuru Aug 22, 2023
3bc7d00
fix(web): few fixable code smells
kemuru Aug 22, 2023
5c68726
fix: inconsistent vertical alignment of the breadcrumbs when the Clai…
jaybuidl Aug 25, 2023
3510cf4
refactor: no more hardcoded contract address nor network config, rely…
jaybuidl Aug 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: "CodeQL Advanced"

on:
merge_group:
branches:
- master
- dev
push:
branches:
- master
- dev
pull_request:
# The branches below must be a subset of the branches above
branches:
- master
- dev
schedule:
- cron: '26 1 * * 6'

permissions:
actions: read

jobs:
codeql-advanced-analysis:
name: Analyze
runs-on: ubuntu-latest
timeout-minutes: 360
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language:
- javascript

steps:
- name: Harden Runner
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3
with:
category: "/language:${{matrix.language}}"
19 changes: 15 additions & 4 deletions .github/workflows/contracts-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,20 @@ on:
push:
branches:
- master
- dev
paths-ignore:
- "kleros-sdk/**"
- "services/**"
- "subgraph/**"
- "web/**"
pull_request:
branches:
- "*"
paths-ignore:
- "kleros-sdk/**"
- "services/**"
- "subgraph/**"
- "web/**"

permissions: # added using https://github.com/step-security/secure-workflows
contents: read
Expand All @@ -34,14 +45,14 @@ jobs:
54.185.253.63:443

- name: Setup Node.js environment
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 16.x

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- uses: actions/checkout@7739b9ba2efcda9dde65ad1e3c2dbe65b41dfba7

- name: Cache node modules
uses: actions/cache@67b839edb68371cc5014f6cea11c9aa77238de78
uses: actions/cache@f7ebb81a3f195b4fb88dab7c14e2f7aff52045aa
env:
cache-name: cache-node-modules
with:
Expand Down Expand Up @@ -72,7 +83,7 @@ jobs:
working-directory: contracts

- name: Upload a build artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05
with:
name: code-coverage-report
path: contracts/coverage
6 changes: 5 additions & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,9 @@ jobs:

- name: 'Checkout Repository'
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: 'Dependency Review'
uses: actions/dependency-review-action@7d90b4f05fea31dde1c4a1fb3fa787e197ea93ab # v3.0.7
uses: actions/dependency-review-action@f6fff72a3217f580d5afd49a46826795305b63c7 # v3.0.8
with:
base-ref: ${{ github.event.pull_request.base.sha || 'dev' }}
head-ref: ${{ github.event.pull_request.head.sha || github.ref }}
4 changes: 2 additions & 2 deletions .github/workflows/deploy-bots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- uses: actions/checkout@7739b9ba2efcda9dde65ad1e3c2dbe65b41dfba7
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1
- uses: aws-actions/setup-sam@12a6719db503425e98edcc798b6779590a450e8f
- uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355
- uses: aws-actions/configure-aws-credentials@131c7b6fd10c0d7f36e1e49650b241d91ee327b9
with:
aws-access-key-id: ${{ secrets.STAGING_AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.STAGING_AWS_SECRET_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@5b6282e01c62d02e720b81eb8a51204f527c3624 # v2.21.3
uses: github/codeql-action/upload-sarif@a09933a12a80f87b87005513f0abb1494c27a716 # v2.21.4
with:
sarif_file: results.sarif
6 changes: 3 additions & 3 deletions .github/workflows/sentry-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
sentry.io:443
54.185.253.63:443

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- uses: actions/checkout@7739b9ba2efcda9dde65ad1e3c2dbe65b41dfba7

- name: Cache node modules
uses: actions/cache@67b839edb68371cc5014f6cea11c9aa77238de78
uses: actions/cache@f7ebb81a3f195b4fb88dab7c14e2f7aff52045aa
env:
cache-name: cache-node-modules
with:
Expand All @@ -45,7 +45,7 @@ jobs:
${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-

- name: Set up Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 16

Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
},
"solidity-va.test.defaultUnittestTemplate": "hardhat",
"solidity-language-server.trace.server.verbosity": "message",
"typescript.tsdk": "node_modules/typescript/lib",
"eslint.packageManager": "yarn",
"prettier.useEditorConfig": true,
"prettier.configPath": "prettier-config/.prettierrc.js"
Expand Down
2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"solhint-plugin-prettier": "^0.0.5",
"solidity-coverage": "0.8.2",
"ts-node": "^10.9.1",
"typechain": "^8.2.0",
"typechain": "^8.3.1",
"typescript": "^4.9.5"
},
"dependencies": {
Expand Down
3 changes: 3 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"arbitrum",
"autorestart",
"codegen",
"commify",
"commitlint",
"consts",
"COOLDOWN",
"datetime",
"devnet",
Expand All @@ -32,6 +34,7 @@
"solhint",
"typechain",
"Unslashed",
"viem",
"wagmi"
],
"ignoreWords": [],
Expand Down
24 changes: 24 additions & 0 deletions scripts/cancel-all-netlify-builds.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

function cancelSiteDeploy() #sideId
{
local sideId=$1
readarray -t builds < <(netlify api listSiteDeploys -d '{ "site_id": "'$sideId'", "state": "new"}' | jq --compact-output '.[]')
for build in "${builds[@]}"
do
local name=$(jq -r .name <<< $build)
local branch=$(jq -r .branch <<< $build)
if [[ "$branch" == "dev" || "$branch" == "master" ]]; then
continue;
fi
echo "Cancelling build for $name $branch"
netlify api cancelSiteDeploy -d '{ "deploy_id": "'$(jq -r .id <<< $build)'"}' > /dev/null
done
}

# netlify api listSites | jq '. | map([.name, .id])'
v2Site="86d94ae8-f655-46a4-a859-d68696173f3a"
v2ContractsSite="dd8bc215-e054-407f-92ef-d61511720928"

cancelSiteDeploy $v2Site
cancelSiteDeploy $v2ContractsSite
9 changes: 1 addition & 8 deletions web/src/components/CasesDisplay/CasesGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const Container = styled.div`
gap: 8px;
`;

// 24px as margin-top since we already have 8px from the flex gap
const StyledPagination = styled(StandardPagination)`
margin-top: 24px;
margin-left: auto;
Expand All @@ -26,13 +25,7 @@ export interface ICasesGrid {
casesPerPage: number;
}

const CasesGrid: React.FC<ICasesGrid> = ({
disputes,
currentPage,
setCurrentPage,
numberDisputes,
casesPerPage,
}) => {
const CasesGrid: React.FC<ICasesGrid> = ({ disputes, currentPage, setCurrentPage, numberDisputes, casesPerPage }) => {
return (
<>
<Container>
Expand Down
10 changes: 5 additions & 5 deletions web/src/components/CasesDisplay/Stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ const FieldWrapper = styled.div`
gap: 8px;
`;

const SeparatorLabel = styled.label`
margin-left: 8px;
margin-right: 8px;
`;

const Field: React.FC<{ label: string; value: string }> = ({ label, value }) => (
<FieldWrapper>
<label>{label}</label>
<small>{value}</small>
</FieldWrapper>
);

const SeparatorLabel = styled.label`
margin-left: 8px;
margin-right: 8px;
`;

const Separator: React.FC = () => <SeparatorLabel>|</SeparatorLabel>;

const Stats: React.FC = () => {
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/ConnectWallet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const SwitchChainButton: React.FC = () => {
<Button
isLoading={isLoading}
disabled={isLoading}
text={`Switch to ${SUPPORTED_CHAINS[DEFAULT_CHAIN].chainName}`}
text={`Switch to ${SUPPORTED_CHAINS[DEFAULT_CHAIN].name}`}
onClick={handleSwitch}
/>
);
Expand Down
32 changes: 16 additions & 16 deletions web/src/components/DisputeCard/PeriodBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@ import React from "react";
import styled, { Theme } from "styled-components";
import { Periods } from "consts/periods";

export interface IPeriodBanner {
id: number;
period: Periods;
}

const getPeriodColors = (period: Periods, theme: Theme): [string, string] => {
switch (period) {
case Periods.appeal:
return [theme.tint, theme.tintMedium];
case Periods.execution:
return [theme.secondaryPurple, theme.mediumPurple];
default:
return [theme.primaryBlue, theme.mediumBlue];
}
};

const Container = styled.div<Omit<IPeriodBanner, "id">>`
height: 45px;
width: auto;
Expand Down Expand Up @@ -54,6 +38,22 @@ const Container = styled.div<Omit<IPeriodBanner, "id">>`
}};
`;

export interface IPeriodBanner {
id: number;
period: Periods;
}

const getPeriodColors = (period: Periods, theme: Theme): [string, string] => {
switch (period) {
case Periods.appeal:
return [theme.tint, theme.tintMedium];
case Periods.execution:
return [theme.secondaryPurple, theme.mediumPurple];
default:
return [theme.primaryBlue, theme.mediumBlue];
}
};

const getPeriodLabel = (period: Periods): string => {
switch (period) {
case Periods.appeal:
Expand Down
8 changes: 2 additions & 6 deletions web/src/components/DisputeCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import styled from "styled-components";
import { useNavigate } from "react-router-dom";
import { formatEther } from "viem";
import Skeleton from "react-loading-skeleton";
import { StyledSkeleton } from "components/StyledSkeleton";
import { Card } from "@kleros/ui-components-library";
import { Periods } from "consts/periods";
import { CasesPageQuery } from "queries/useCasesQuery";
Expand All @@ -17,10 +17,6 @@ const StyledCard = styled(Card)`
min-width: 312px;
width: auto;
height: 260px;

.react-loading-skeleton {
z-index: 0;
}
`;

const Container = styled.div`
Expand Down Expand Up @@ -58,7 +54,7 @@ const DisputeCard: React.FC<CasesPageQuery["disputes"][number]> = ({
: getPeriodEndTimestamp(lastPeriodChange, currentPeriodIndex, court.timesPerPeriod);
const { data: disputeTemplate } = useDisputeTemplate(id, arbitrated.id as `0x${string}`);
const title = isUndefined(disputeTemplate) ? (
<Skeleton />
<StyledSkeleton />
) : (
disputeTemplate?.title ?? "The dispute's template is not correct please vote refuse to arbitrate"
);
Expand Down
Loading