Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Layer5-Leaderboard] Transfer of the Leaderboard Code to the discuss-board repo #29

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
remove files and add sorting
Signed-off-by: Ananya Gautam <[email protected]>
Boombag0607 committed Aug 15, 2023
commit dc452feafdbf6475f5ddb714dfd2a59b67377533
2 changes: 1 addition & 1 deletion CONTRIBUTING-gitflow.md
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ While this isn't an absolutely necessary step, if you plan on doing anything mor

## Add 'upstream' repo to list of remotes
```
git remote add upstream https://github.com/layer5io/meshery.git
git remote add upstream https://github.com/layer5io/discuss-board.git
```
("meshery" is used as the example repo. Be sure to reference the _actual_ repo you're contributing to e.g. "meshery-linkerd").

19 changes: 5 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -55,30 +55,21 @@ Please contribute! Layer5 documentation uses Jekyll and GitHub Pages to host doc

1. Create a fork, if you have not already, by following the steps described [here](./CONTRIBUTING-gitflow.md)
1. In the local copy of your fork, navigate to the docs folder.
`cd docs`
`cd leaderboard`
1. Create and checkout a new branch to make changes within
`git checkout -b <my-changes>`
1. Edit/add documentation.
`vi <specific page>.md`
1. Run site locally to preview changes.
`make site`
`npm start`
1. Commit, [sign-off](#commit-signing), and push changes to your remote branch.
`git push origin <my-changes>`
`git push <remote-name> <my-changes>`
1. Open a pull request (in your web browser) against the repo.


#### Tests
Users can now test their code on their local machine against the CI checks implemented using `make run-tests`.

To test code changes on your local machine, run the following command:
```
make run-tests
```

#### Building Docker image
To build a Docker image of the project, please ensure you have `Docker` installed to be able to build the image. Now, run the following command to build the Docker image:
### Build and Run Leaderboard Locally
```sh
make docker
make run
```

### UI Lint Rules
31 changes: 11 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
check:
golangci-lint run
LEADERBOARD_DIR := leaderboard
PORT := 3000

check-clean-cache:
golangci-lint cache clean
# Commands
install:
@echo "Installing dependencies..."
cd $(LEADERBOARD_DIR) && npm install

protoc-setup:
wget -P meshes https://raw.githubusercontent.com/layer5io/meshery/master/meshes/meshops.proto
start:
@echo "Starting the site on port $(PORT)..."
cd $(LEADERBOARD_DIR) && npm start

proto:
protoc -I meshes/ meshes/meshops.proto --go_out=plugins=grpc:./meshes/
run: install start





site:
$(jekyll) serve --drafts --livereload

build:
$(jekyll) build --drafts

docker:
docker run --name site -d --rm -p 4000:4000 -v `pwd`:"/srv/jekyll" jekyll/jekyll:4.0.0 bash -c "bundle install; jekyll serve --drafts --livereload"
.PHONY: install start run
29,185 changes: 29,185 additions & 0 deletions leaderboard/package-lock.json

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion leaderboard/src/components/elements/Table/index.tsx
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ import React, { ReactNode, useState } from 'react';

import {
useReactTable,
SortingState,
getCoreRowModel,
getFilteredRowModel,
getPaginationRowModel,
@@ -53,12 +54,15 @@ function Table({
noData?: string;
}) {
const [globalFilter, setGlobalFilter] = useState<string>('');
const [sorting, setSorting] = useState<SortingState>([])
const table = useReactTable({
data,
columns,
state: {
globalFilter,
sorting,
},
onSortingChange: setSorting,
onGlobalFilterChange: setGlobalFilter,
getCoreRowModel: getCoreRowModel(),
getFilteredRowModel: getFilteredRowModel(),
@@ -115,11 +119,20 @@ function Table({
className="text-left text-xs text-white font-semibold uppercase whitespace-nowrap py-5 px-5 text-center"
>
{header.isPlaceholder ? null : (
<div>
<div {...{
className: header.column.getCanSort()
? 'cursor-pointer select-none'
: '',
onClick: header.column.getToggleSortingHandler(),
}}>
{flexRender(
header.column.columnDef.header,
header.getContext()
)}
{{
asc: ' 🔼',
desc: ' 🔽',
}[header.column.getIsSorted() as string] ?? null}
</div>
)}
</th>
16,088 changes: 8,040 additions & 8,048 deletions leaderboard/yarn.lock

Large diffs are not rendered by default.