Skip to content

Commit

Permalink
Merge pull request #385 from pauluwaifo/feat/HNG-77-Implement-Member-…
Browse files Browse the repository at this point in the history
…Management-Functionalities-on-Admin-Dashboard

Feat/hng 77 implement member management functionalities on admin dashboard
  • Loading branch information
pauluwaifo authored Jul 23, 2024
2 parents 7a9f492 + c6e7acb commit 94c2c8c
Show file tree
Hide file tree
Showing 378 changed files with 31,713 additions and 7,455 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
coverage
html
dist
!.prettierrc.cjs
119 changes: 52 additions & 67 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,83 +1,68 @@
// @ts-check

/**
* This is intended to be a basic starting point for linting in your app.
* It relies on recommended configs out of the box for simplicity, but you can
* and should modify this configuration to best suit your team's needs.
* To use this configuration, you need to install the following dependencies:
*
* eslint@^8.57.0 @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-react-refresh eslint-plugin-unicorn eslint-plugin-unused-imports@^3.2.0 prettier eslint-config-prettier eslint-plugin-prettier @ianvs/prettier-plugin-sort-imports prettier-plugin-tailwindcss
*
*
* To Replicate the vitest configuration, you need to install the following dependencies:
*
* eslint-plugin-vitest@^0.4.1 eslint-testing-library
*
* Also replicate the .prettierrc.cjs file in the root of your project.
*/

/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
},
reportUnusedDisableDirectives: true,
env: {
browser: true,
commonjs: true,
es6: true,
es2020: true,
},
ignorePatterns: ["!**/.server", "!**/.client"],

// Base config
extends: ["eslint:recommended"],

overrides: [
// React
{
files: ["**/*.{js,jsx,ts,tsx}"],
plugins: ["react", "jsx-a11y"],
extends: [
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"plugin:jsx-a11y/recommended",
],
settings: {
react: {
version: "detect",
},
formComponents: ["Form"],
linkComponents: [
{ name: "Link", linkAttribute: "to" },
{ name: "NavLink", linkAttribute: "to" },
],
"import/resolver": {
typescript: {},
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"plugin:unicorn/recommended",
"plugin:prettier/recommended",
],
ignorePatterns: ["dist", "node_modules"],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "react", "unicorn", "unused-imports"],
rules: {
"react/prop-types": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_",
},
},

// Typescript
],
"unicorn/filename-case": [
"error",
{ cases: { kebabCase: true, pascalCase: true, camelCase: true } },
],
},
settings: {
react: { version: "detect" },
vitest: { typecheck: true },
},
overrides: [
{
files: ["**/*.{ts,tsx}"],
plugins: ["@typescript-eslint", "import"],
parser: "@typescript-eslint/parser",
settings: {
"import/internal-regex": "^~/",
"import/resolver": {
node: {
extensions: [".ts", ".tsx"],
},
typescript: {
alwaysTryTypes: true,
},
},
},
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:import/recommended",
"plugin:import/typescript",
],
files: [".eslintrc.*js", ".vite(|st).(js|ts)"],
env: { node: true },
},

// Node
{
files: [".eslintrc.cjs"],
env: {
node: true,
files: ["*.d.ts"],
rules: {
"unicorn/prevent-abbreviations": "off",
},
},
],
Expand Down
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Feature
description: An enhancement or feature
title: "[Feature]: "
labels: ["triage", "feature"]
body:
- type: textarea
id: description
attributes:
label: Description
description: A step-by-step description of the suggested feature/enhancement.
placeholder: On the user page, you should be able to...
validations:
required: true
- type: textarea
id: acceptanceCriteria
attributes:
label: Acceptance Criteria
description: What are the things that must be achieved for your ticket to be considered complete.
validations:
required: true
- type: markdown
attributes:
value: >
| Please include any screenshots which would help demonstrate the steps
and point out which parts the feature is related to
- type: textarea
id: links
attributes:
label: Links
description: Place links to supporting docs here. e.g. Figma
value: >
| [`FIGMA LINK`](LINK_HERE)
- type: textarea
id: images
attributes:
label: Images
description: Paste images or image urls
value: "![image](URL_HERE)"
47 changes: 47 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!-- Do not delete this PR template. Just edit it to include the required information -->

# Description

<!-- If your PR fixes an open issue, use `Closes #999` to link your PR with the issue. #999 stands for the issue number you are fixing -->

<!-- Github Issue Example: Closes #31 -->

**Closes #issue_number_here**

# Changes proposed

## What were you told to do?

<!-- Write the title of the issue/feature you are working on -->

## What did you do?

<!-- Talk about the things you did eg. files changes, dependencies installed e.t.c -->

# Check List (Check all the applicable boxes)

🚨Please review the [contribution guideline](CONTRIBUTING.md) for this repository.

<!-- Mark all the applicable boxes. To mark the box as done follow the following conventions -->

<!--
[x] - Correct; marked as done
[X] - Correct; marked as done
[ ] - Not correct; marked as **not** done
-->

- [ ] My code follows the code style of this project.
- [ ] This PR does not contain plagiarized content.
- [ ] The title and description of the PR is clear and explains the approach.
- [ ] I am making a pull request against the **dev branch** (left side).
- [ ] My commit messages styles matches our requested structure.
- [ ] My code additions will fail neither code linting checks nor unit test.
- [ ] I am only making changes to files I was requested to.

# Screenshots/Videos

<!-- If the changes are static page changes or UI changes add screenshots -->
<!-- If the changes involve implementing a functionality or working with apis, include a video
detailing how to implement the functionality and the request to the api and responses from the api endpoint-->
<!-- Add all the screenshots/videos which support your changes i.e before your change and after your change -->
23 changes: 14 additions & 9 deletions .github/workflows/dev-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,30 @@ jobs:
with:
node-version: '20'

- name: Cache npm modules
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-npm-
${{ runner.os }}-pnpm-
- name: Install npm
run: npm install -g npm@9
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: npm install
run: pnpm install

- name: Lint code
run: npm run lint
run: pnpm lint

- name: Build email
run: pnpm email:build

- name: Build project
run: npm run build
run: pnpm build

deploy:
runs-on: ubuntu-latest
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/initial-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Label new issues
on:
issues:
types:
- reopened
- opened
jobs:
label_issues:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- run: gh issue edit "$NUMBER" --add-label "$LABELS"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: triage
18 changes: 18 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Lint

on:
pull_request:

jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: pnpm/action-setup@v4
with:
version: 9
- run: pnpm install
- run: pnpm lint
24 changes: 14 additions & 10 deletions .github/workflows/prod-cicd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Production CI/CD Pipeline

on:
Expand All @@ -25,25 +24,30 @@ jobs:
with:
node-version: '20'

- name: Cache npm modules
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-npm-
${{ runner.os }}-pnpm-
- name: Install npm
run: npm install -g npm@9
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: npm install
run: pnpm install

- name: Lint code
run: npm run lint
run: pnpm run lint

- name: Build email
run: pnpm email:build

- name: Build project
run: npm run build
run: pnpm run build

deploy:
runs-on: ubuntu-latest
Expand Down
Loading

0 comments on commit 94c2c8c

Please sign in to comment.