Skip to content

Commit 2df85ac

Browse files
add admin:sales-table & yearly-graph
2 parents 8b275a3 + 373e105 commit 2df85ac

File tree

216 files changed

+3748
-3351
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+3748
-3351
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ module.exports = {
88
"airbnb",
99
"airbnb/hooks",
1010
"eslint:recommended",
11-
// "plugin:prettier/recommended",
11+
"prettier",
1212
"plugin:react/recommended",
1313
],
14-
plugins: ["react", "prettier"],
1514
overrides: [
1615
{
1716
env: {
@@ -49,11 +48,5 @@ module.exports = {
4948
alphabetize: { order: "asc", caseInsensitive: true },
5049
},
5150
],
52-
"prettier/prettier": [
53-
"error",
54-
{
55-
endOfLine: "auto",
56-
},
57-
],
5851
},
5952
};

.github/PULL_REQUEST_TEMPLATE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[Have you read the contributing guidelines ?](https://github.com/SpaceyaTech/SYT-Web-Redesign/blob/Dev/docs/CONTRIBUTING.md)
2+
3+
# What is the purpose of your *pull request*?
4+
5+
- [ ] Bug fix
6+
- [ ] New feature
7+
8+
# Proposed changes
9+
10+
11+
# Warning
12+
13+
Please read these points carefully and answer honestly with an `X`
14+
into all the boxes. Example : [X]
15+
16+
Before submitting a *pull request* make sure you have:
17+
18+
- [ ] Read the guidelines for contributing.
19+
- [ ] Wrote some tests.
20+
- [ ] Respected the linting guidelines.

.github/workflows/labels.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ name: Import open source standard labels
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66

77
jobs:
88
labels:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/setup-node@v2
13-
with:
14-
node-version: '14'
15-
- uses: SpaceyaTech/gh-action-open-source-labels@main
16-
with:
17-
github-token: ${{ secrets.GITHUB_TOKEN }}
18-
owner-name: ${{ github.repository_owner }}
19-
repository-name: ${{ github.event.repository.name }}
20-
force: false
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: "20"
15+
- uses: SpaceyaTech/gh-action-open-source-labels@main
16+
with:
17+
github-token: ${{ secrets.GITHUB_TOKEN }}
18+
owner-name: ${{ github.repository_owner }}
19+
repository-name: ${{ github.event.repository.name }}
20+
force: false

.github/workflows/tests.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Unit and E2E tests
2+
on:
3+
push:
4+
branches: [main, Dev]
5+
pull_request:
6+
branches: [main, Dev]
7+
jobs:
8+
tests:
9+
timeout-minutes: 60
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Prepare .env file
14+
run: |
15+
rm -f .env && touch .env
16+
echo "REACT_APP_API_BASE_URL=https://example.com" >> .env
17+
echo "VITE_SERVICE_ID=123fAkE" >> .env
18+
echo "VITE_TEMPLATE_ID=123fAkE" >> .env
19+
echo "VITE_PUBLIC_ID=123fAkE" >> .env
20+
- uses: actions/setup-node@v3
21+
with:
22+
node-version: "20.x"
23+
- name: Install dependencies
24+
run: npm install
25+
- name: Install Playwright Browsers
26+
run: npx playwright install --with-deps
27+
- name: Build the app
28+
run: npm run build
29+
- name: Run Unit tests
30+
run: npm run test
31+
- name: Run Playwright tests
32+
run: npm run test:e2e
33+
- uses: actions/upload-artifact@v3
34+
if: always()
35+
with:
36+
name: playwright-report
37+
path: playwright-report/
38+
retention-days: 5

.github/workflows/validate.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Lint, Format and Build
2+
on:
3+
push:
4+
branches: [main, Dev]
5+
pull_request:
6+
branches: [main, Dev]
7+
jobs:
8+
validate:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
13+
with:
14+
node-version: "20.x"
15+
- name: Install dependencies
16+
run: npm install
17+
- name: Run code validation (includes linting, prettier and building)
18+
run: npm run validate

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,8 @@ coverage
3434

3535
# Ignore all HTML files:
3636
*.html
37-
.env
37+
.env
38+
/test-results/
39+
/playwright-report/
40+
/blob-report/
41+
/playwright/.cache/

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.yarn
2+
.next
3+
dist
4+
node_modules

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"trailingComma": "es5",
3+
"tabWidth": 2,
4+
"singleQuote": false
5+
}

components.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "default",
4+
"rsc": false,
5+
"tsx": false,
6+
"tailwind": {
7+
"config": "tailwind.config.js",
8+
"css": "src/index.css",
9+
"baseColor": "gray",
10+
"cssVariables": false,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/utilities/utils"
16+
}
17+
}

jsconfig.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"baseUrl": ".",
4+
"paths": {
5+
"@/*": [
6+
"./src/*"
7+
]
8+
}
9+
}
10+
}

package.json

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,65 +6,74 @@
66
"scripts": {
77
"dev": "vite --host",
88
"build": "vite build",
9-
"lint": "eslint --fix eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0",
9+
"lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0",
1010
"preview": "vite preview",
1111
"prepare": "husky install",
12-
"start": "react-scripts start",
13-
"test": "react-scripts test",
14-
"eject": "react-scripts eject",
15-
"pretty": "prettier --write .",
12+
"test": "vitest run",
13+
"test:e2e": "playwright test",
14+
"prettier:format": "prettier --write --ignore-path .gitignore .",
15+
"prettier:check": "prettier --check --ignore-path .gitignore .",
16+
"validate": "concurrently --kill-others-on-fail -g -p \"[{name}]\" -n \"prettier,lint,build\" \"npm:prettier:check\" \"npm:lint\" \"npm:build\"",
17+
"validate:bun": "concurrently --kill-others-on-fail -g -p \"[{name}]\" -n \"prettier,lint,build\" \"bun:prettier:check\" \"bun:lint\" \"bun:build\"",
1618
"knip": "knip"
1719
},
1820
"dependencies": {
1921
"@emailjs/browser": "^3.11.0",
20-
"@fortawesome/fontawesome-svg-core": "^6.4.0",
21-
"@fortawesome/free-solid-svg-icons": "^6.4.0",
22-
"@fortawesome/react-fontawesome": "^0.2.0",
2322
"@headlessui/react": "^1.7.15",
24-
"@hookform/resolvers": "^3.3.2",
2523
"@hookstate/core": "^4.0.1",
26-
"@material-tailwind/react": "^2.1.9",
2724
"@tanstack/react-query": "^5.22.2",
2825
"@tanstack/react-query-devtools": "^5.24.0",
26+
"@tanstack/react-table": "^8.17.3",
2927
"axios": "^1.6.1",
28+
"class-variance-authority": "^0.7.0",
29+
"clsx": "^2.1.1",
3030
"date-fns": "^2.30.0",
3131
"html-react-parser": "^5.0.6",
32+
"lucide-react": "^0.395.0",
3233
"million": "^3.0.2",
3334
"prop-types": "^15.8.1",
3435
"react": "^18.2.0",
3536
"react-dom": "^18.2.0",
3637
"react-fast-marquee": "^1.6.2",
38+
"react-helmet-async": "^2.0.5",
3739
"react-hook-form": "^7.48.2",
3840
"react-hot-toast": "^2.4.1",
41+
"react-icons": "^5.2.1",
3942
"react-lazy-load-image-component": "^1.6.0",
4043
"react-photo-album": "^2.3.0",
4144
"react-router-dom": "^6.11.2",
4245
"react-share": "^5.1.0",
4346
"react-simple-wysiwyg": "^2.2.5",
47+
"recharts": "^2.12.7",
48+
"tailwind-merge": "^2.3.0",
4449
"tailwind-scrollbar-hide": "^1.1.7",
45-
"yet-another-react-lightbox": "^3.15.6",
46-
"yup": "^1.3.2"
50+
"tailwindcss-animate": "^1.0.7",
51+
"yet-another-react-lightbox": "^3.15.6"
4752
},
4853
"devDependencies": {
54+
"@playwright/test": "^1.44.1",
4955
"@types/node": "^20.14.1",
5056
"@types/react": "^18.0.28",
5157
"@types/react-dom": "^18.0.11",
5258
"@vitejs/plugin-react": "^4.0.0",
53-
"autoprefixer": "^10.4.14",
59+
"autoprefixer": "^10.4.19",
60+
"concurrently": "^8.2.2",
5461
"eslint": "^8.43.0",
5562
"eslint-config-airbnb": "^19.0.4",
63+
"eslint-config-prettier": "^9.1.0",
5664
"eslint-plugin-import": "^2.27.5",
5765
"eslint-plugin-jsx-a11y": "^6.7.1",
58-
"eslint-plugin-prettier": "^4.2.1",
66+
"eslint-plugin-prettier": "^5.1.3",
5967
"eslint-plugin-react": "^7.32.2",
6068
"eslint-plugin-react-hooks": "^4.6.0",
6169
"husky": "^8.0.0",
6270
"knip": "^4.6.0",
63-
"postcss": "^8.4.23",
64-
"prettier": "^2.8.8",
65-
"tailwindcss": "^3.3.2",
71+
"postcss": "^8.4.38",
72+
"prettier": "^3.3.2",
73+
"tailwindcss": "^3.4.3",
6674
"typescript": "^5.4.5",
67-
"vite": "^5.0.0"
75+
"vite": "^5.0.0",
76+
"vitest": "^1.6.0"
6877
},
6978
"lint-staged": {
7079
"**/*.{js,jsx}": [

playwright.config.cjs

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import { defineConfig, devices } from "@playwright/test";
2+
3+
/**
4+
* Read environment variables from file.
5+
* https://github.com/motdotla/dotenv
6+
*/
7+
// require('dotenv').config();
8+
9+
/**
10+
* @see https://playwright.dev/docs/test-configuration
11+
*/
12+
module.exports = defineConfig({
13+
testDir: "./tests",
14+
/* Run tests in files in parallel */
15+
fullyParallel: true,
16+
/* Fail the build on CI if you accidentally left test.only in the source code. */
17+
forbidOnly: !!process.env.CI,
18+
/* Retry on CI only */
19+
retries: process.env.CI ? 2 : 0,
20+
/* Opt out of parallel tests on CI. */
21+
workers: process.env.CI ? 1 : undefined,
22+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
23+
reporter: process.env.CI ? [["github"], ["list"], ["html"]] : "list",
24+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
25+
use: {
26+
/* Base URL to use in actions like `await page.goto('/')`. */
27+
// baseURL: 'http://127.0.0.1:3000',
28+
29+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
30+
trace: "on-first-retry",
31+
},
32+
33+
/* Configure projects for major browsers */
34+
projects: [
35+
{
36+
name: "chromium",
37+
use: { ...devices["Desktop Chrome"] },
38+
},
39+
40+
{
41+
name: "webkit",
42+
use: { ...devices["Desktop Safari"] },
43+
},
44+
45+
// {
46+
// name: 'firefox',
47+
// use: { ...devices['Desktop Firefox'] },
48+
// },
49+
50+
/* Test against mobile viewports. */
51+
// {
52+
// name: 'Mobile Chrome',
53+
// use: { ...devices['Pixel 5'] },
54+
// },
55+
// {
56+
// name: 'Mobile Safari',
57+
// use: { ...devices['iPhone 12'] },
58+
// },
59+
60+
/* Test against branded browsers. */
61+
// {
62+
// name: 'Microsoft Edge',
63+
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
64+
// },
65+
// {
66+
// name: 'Google Chrome',
67+
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
68+
// },
69+
],
70+
71+
/* Run your local dev server before starting the tests */
72+
webServer: {
73+
command: "npm run dev",
74+
url: "http://localhost:5173",
75+
reuseExistingServer: !process.env.CI,
76+
},
77+
});

0 commit comments

Comments
 (0)