From 0c9bcd1bd52d11d8029bae36fe0b17b0dc92047a Mon Sep 17 00:00:00 2001 From: Caio Cabral Date: Tue, 8 Oct 2024 11:57:08 -0400 Subject: [PATCH 1/8] chore: adding prettierrc file --- Server/package-lock.json | 2 ++ Server/package.json | 1 + Server/routes/authRoute.js | 39 ++++++++++++-------------------------- 3 files changed, 15 insertions(+), 27 deletions(-) diff --git a/Server/package-lock.json b/Server/package-lock.json index d4147c7d1..80bfd9c6e 100644 --- a/Server/package-lock.json +++ b/Server/package-lock.json @@ -26,6 +26,7 @@ "multer": "1.4.5-lts.1", "nodemailer": "^6.9.14", "ping": "0.4.4", + "prettier": "^3.3.3", "sharp": "0.33.4", "ssl-checker": "2.0.10", "swagger-ui-express": "5.0.1", @@ -4610,6 +4611,7 @@ "version": "3.3.3", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, diff --git a/Server/package.json b/Server/package.json index 75d3b1cc2..f6f90819f 100644 --- a/Server/package.json +++ b/Server/package.json @@ -28,6 +28,7 @@ "multer": "1.4.5-lts.1", "nodemailer": "^6.9.14", "ping": "0.4.4", + "prettier": "^3.3.3", "sharp": "0.33.4", "ssl-checker": "2.0.10", "swagger-ui-express": "5.0.1", diff --git a/Server/routes/authRoute.js b/Server/routes/authRoute.js index ce6ec440e..57067f564 100644 --- a/Server/routes/authRoute.js +++ b/Server/routes/authRoute.js @@ -7,39 +7,24 @@ const upload = multer(); const User = require("../db/models/User"); const { - registerUser, - loginUser, - editUser, - requestRecovery, - validateRecovery, - resetPassword, - checkSuperadminExists, - getAllUsers, - deleteUser, + registerUser, + loginUser, + editUser, + requestRecovery, + validateRecovery, + resetPassword, + checkSuperadminExists, + getAllUsers, + deleteUser, } = require("../controllers/authController"); //Auth routes router.post("/register", upload.single("profileImage"), registerUser); router.post("/login", loginUser); -router.put( - "/user/:userId", - upload.single("profileImage"), - verifyJWT, - editUser -); +router.put("/user/:userId", upload.single("profileImage"), verifyJWT, editUser); router.get("/users/superadmin", checkSuperadminExists); -router.get( - "/users", - verifyJWT, - isAllowed(["admin", "superadmin"]), - getAllUsers -); -router.delete( - "/user/:userId", - verifyJWT, - verifyOwnership(User, "userId"), - deleteUser -); +router.get("/users", verifyJWT, isAllowed(["admin", "superadmin"]), getAllUsers); +router.delete("/user/:userId", verifyJWT, verifyOwnership(User, "userId"), deleteUser); //Recovery routes router.post("/recovery/request", requestRecovery); From db941d246cf7bc61f174f8a3974618848fe6c587 Mon Sep 17 00:00:00 2001 From: Caio Cabral Date: Tue, 8 Oct 2024 12:01:19 -0400 Subject: [PATCH 2/8] fix: committing from root folder --- .prettierrc | 16 +++++++++ Client/package-lock.json | 16 +++++++++ Client/package.json | 1 + Client/src/App.css | 4 +-- Client/src/App.jsx | 73 ++++++++++++++++++++++++++++++---------- 5 files changed, 91 insertions(+), 19 deletions(-) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..399423a21 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,16 @@ +{ + "printWidth": 90, + "useTabs": true, + "tabWidth": 2, + "singleQuote": false, + "bracketSpacing": true, + "proseWrap": "preserve", + "bracketSameLine": false, + "singleAttributePerLine": true, + "semi": true, + "jsx-single-quote": false, + "quoteProps": "as-needed", + "arrowParens": "always", + "trailingComma": "es5", + "htmlWhitespaceSensitivity": "css" +} diff --git a/Client/package-lock.json b/Client/package-lock.json index 4077ce2bf..e6b50b53b 100644 --- a/Client/package-lock.json +++ b/Client/package-lock.json @@ -23,6 +23,7 @@ "dayjs": "1.11.11", "joi": "17.13.1", "jwt-decode": "^4.0.0", + "prettier": "^3.3.3", "react": "^18.2.0", "react-dom": "^18.2.0", "react-redux": "9.1.2", @@ -5314,6 +5315,21 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/prop-types": { "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", diff --git a/Client/package.json b/Client/package.json index 22f15f7f9..e0621a455 100644 --- a/Client/package.json +++ b/Client/package.json @@ -25,6 +25,7 @@ "dayjs": "1.11.11", "joi": "17.13.1", "jwt-decode": "^4.0.0", + "prettier": "^3.3.3", "react": "^18.2.0", "react-dom": "^18.2.0", "react-redux": "9.1.2", diff --git a/Client/src/App.css b/Client/src/App.css index bf3d4ea92..44e06cd5f 100644 --- a/Client/src/App.css +++ b/Client/src/App.css @@ -1,7 +1,7 @@ .card { - padding: 2em; + padding: 2em; } .read-the-docs { - color: #888; + color: #888; } diff --git a/Client/src/App.jsx b/Client/src/App.jsx index 56c279e78..647ee2d44 100644 --- a/Client/src/App.jsx +++ b/Client/src/App.jsx @@ -70,7 +70,11 @@ function App() { - }> + } + > - } + element={} /> } + element={ + + } /> } + element={ + + } /> } + element={ + + } /> - } + element={} /> - } /> + } + /> - } /> - } /> + } + /> + } + /> {/* } /> */} - } /> - } /> - } /> - } /> + } + /> + } + /> + } + /> + } + /> } From 38b837d3b0dbdf54b3f41208fddfcc239821acd4 Mon Sep 17 00:00:00 2001 From: Caio Cabral Date: Tue, 15 Oct 2024 07:45:59 -0400 Subject: [PATCH 3/8] fix: setting prettier as dev dependency --- Client/package-lock.json | 3 ++- Client/package.json | 2 +- Server/package-lock.json | 4 ++-- Server/package.json | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Client/package-lock.json b/Client/package-lock.json index e6b50b53b..c78e9e33a 100644 --- a/Client/package-lock.json +++ b/Client/package-lock.json @@ -23,7 +23,6 @@ "dayjs": "1.11.11", "joi": "17.13.1", "jwt-decode": "^4.0.0", - "prettier": "^3.3.3", "react": "^18.2.0", "react-dom": "^18.2.0", "react-redux": "9.1.2", @@ -42,6 +41,7 @@ "eslint-plugin-react": "^7.34.1", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.6", + "prettier": "^3.3.3", "vite": "^5.2.0" } }, @@ -5319,6 +5319,7 @@ "version": "3.3.3", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "dev": true, "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" diff --git a/Client/package.json b/Client/package.json index e0621a455..948114e35 100644 --- a/Client/package.json +++ b/Client/package.json @@ -25,7 +25,6 @@ "dayjs": "1.11.11", "joi": "17.13.1", "jwt-decode": "^4.0.0", - "prettier": "^3.3.3", "react": "^18.2.0", "react-dom": "^18.2.0", "react-redux": "9.1.2", @@ -44,6 +43,7 @@ "eslint-plugin-react": "^7.34.1", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.6", + "prettier": "^3.3.3", "vite": "^5.2.0" } } diff --git a/Server/package-lock.json b/Server/package-lock.json index 80bfd9c6e..3a6b104f0 100644 --- a/Server/package-lock.json +++ b/Server/package-lock.json @@ -26,14 +26,14 @@ "multer": "1.4.5-lts.1", "nodemailer": "^6.9.14", "ping": "0.4.4", - "prettier": "^3.3.3", "sharp": "0.33.4", "ssl-checker": "2.0.10", "swagger-ui-express": "5.0.1", "winston": "^3.13.0" }, "devDependencies": { - "nodemon": "3.1.0" + "nodemon": "3.1.0", + "prettier": "^3.3.3" } }, "node_modules/@babel/code-frame": { diff --git a/Server/package.json b/Server/package.json index f6f90819f..af196402e 100644 --- a/Server/package.json +++ b/Server/package.json @@ -28,13 +28,13 @@ "multer": "1.4.5-lts.1", "nodemailer": "^6.9.14", "ping": "0.4.4", - "prettier": "^3.3.3", "sharp": "0.33.4", "ssl-checker": "2.0.10", "swagger-ui-express": "5.0.1", "winston": "^3.13.0" }, "devDependencies": { - "nodemon": "3.1.0" + "nodemon": "3.1.0", + "prettier": "^3.3.3" } } From 19dc8c24638b3b29405e313be4bf14a98792cdc8 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 15 Oct 2024 21:47:55 +0800 Subject: [PATCH 4/8] Fix typo in package.json --- Server/package.json | 86 ++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/Server/package.json b/Server/package.json index df9ab3343..068f23587 100644 --- a/Server/package.json +++ b/Server/package.json @@ -1,45 +1,45 @@ { - "name": "server", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "nyc mocha", - "dev": "nodemon index.js" - }, - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "@sendgrid/mail": "^8.1.3", - "axios": "^1.7.2", - "bcrypt": "^5.1.1", - "bullmq": "5.7.15", - "chai": "5.1.1", - "cors": "^2.8.5", - "dotenv": "^16.4.5", - "express": "^4.19.2", - "handlebars": "^4.7.8", - "helmet": "^7.1.0", - "joi": "^17.13.1", - "jsonwebtoken": "9.0.2", - "mailersend": "^2.2.0", - "mjml": "^5.0.0-alpha.4", - "mocha": "10.7.3", - "mongoose": "^8.3.3", - "multer": "1.4.5-lts.1", - "nodemailer": "^6.9.14", - "ping": "0.4.4", - "sharp": "0.33.4", - "ssl-checker": "2.0.10", - "swagger-ui-express": "5.0.1", - "winston": "^3.13.0" - }, - "devDependencies": { - "nodemon": "3.1.0", - "prettier": "^3.3.3" - "nyc": "17.1.0", - "proxyquire": "2.1.3", - "sinon": "19.0.2" - } + "name": "server", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "nyc mocha", + "dev": "nodemon index.js" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "@sendgrid/mail": "^8.1.3", + "axios": "^1.7.2", + "bcrypt": "^5.1.1", + "bullmq": "5.7.15", + "chai": "5.1.1", + "cors": "^2.8.5", + "dotenv": "^16.4.5", + "express": "^4.19.2", + "handlebars": "^4.7.8", + "helmet": "^7.1.0", + "joi": "^17.13.1", + "jsonwebtoken": "9.0.2", + "mailersend": "^2.2.0", + "mjml": "^5.0.0-alpha.4", + "mocha": "10.7.3", + "mongoose": "^8.3.3", + "multer": "1.4.5-lts.1", + "nodemailer": "^6.9.14", + "ping": "0.4.4", + "sharp": "0.33.4", + "ssl-checker": "2.0.10", + "swagger-ui-express": "5.0.1", + "winston": "^3.13.0" + }, + "devDependencies": { + "nodemon": "3.1.0", + "prettier": "^3.3.3", + "nyc": "17.1.0", + "proxyquire": "2.1.3", + "sinon": "19.0.2" + } } From be7e59b31b62f7540703c62647dc8e65109c51c6 Mon Sep 17 00:00:00 2001 From: Dhruv Davda Date: Tue, 15 Oct 2024 19:35:46 +0530 Subject: [PATCH 5/8] Add files via upload --- CODE_OF_CONDUCT.md | 69 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..25b71858b --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,69 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in the **bluewave-uptime** project and community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community, especially during Hacktoberfest, where we encourage new contributors to join and feel supported. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our community include: + +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +- Focusing on what is best not just for us as individuals, but for the overall community + +Examples of unacceptable behavior include: + +- The use of sexualized language or imagery, and sexual attention or advances of any kind +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, without their explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned with this Code of Conduct, especially during Hacktoberfest to ensure a positive experience for all contributors. + +## Scope + +This Code of Conduct applies within all project spaces, and it also applies when an individual is officially representing the project or its community in public spaces. Examples of representing our project include using an official project email address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [YOUR EMAIL HERE]. All complaints will be reviewed and investigated promptly and fairly. + +All project team members are obligated to respect the privacy and security of the reporter of any incident. + +## Enforcement Guidelines + +Project maintainers will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. +**Consequence**: A private, written warning from project maintainers, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. + +### 2. Warning +**Community Impact**: A violation through a single incident or series of actions. +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. + +### 3. Temporary Ban +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. +**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban +**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. +**Consequence**: A permanent ban from any sort of public interaction within the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +--- + +By following this Code of Conduct, we can ensure a welcoming and inclusive environment during Hacktoberfest and beyond, encouraging new contributors to engage with the project and the community. Thank you for helping make **bluewave-uptime** a positive space for all! \ No newline at end of file From 6d1d2ebfee89edb216476bd2c5e43a739bc69dc8 Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Tue, 15 Oct 2024 10:43:56 -0400 Subject: [PATCH 6/8] Fix email in code of conduct and we are good here. --- CODE_OF_CONDUCT.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 25b71858b..a5293601a 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -36,7 +36,7 @@ This Code of Conduct applies within all project spaces, and it also applies when ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [YOUR EMAIL HERE]. All complaints will be reviewed and investigated promptly and fairly. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hello@bluewavelabs.ca. All complaints will be reviewed and investigated promptly and fairly. All project team members are obligated to respect the privacy and security of the reporter of any incident. @@ -66,4 +66,4 @@ This Code of Conduct is adapted from the [Contributor Covenant](https://www.cont --- -By following this Code of Conduct, we can ensure a welcoming and inclusive environment during Hacktoberfest and beyond, encouraging new contributors to engage with the project and the community. Thank you for helping make **bluewave-uptime** a positive space for all! \ No newline at end of file +By following this Code of Conduct, we can ensure a welcoming and inclusive environment during Hacktoberfest and beyond, encouraging new contributors to engage with the project and the community. Thank you for helping make **bluewave-uptime** a positive space for all! From 7b73b7615d96f760208f0e9dcab6102453aa545b Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Tue, 15 Oct 2024 10:44:41 -0400 Subject: [PATCH 7/8] Code of conduct is not only for Hacktoberfest. --- CODE_OF_CONDUCT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index a5293601a..5421ce769 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -66,4 +66,4 @@ This Code of Conduct is adapted from the [Contributor Covenant](https://www.cont --- -By following this Code of Conduct, we can ensure a welcoming and inclusive environment during Hacktoberfest and beyond, encouraging new contributors to engage with the project and the community. Thank you for helping make **bluewave-uptime** a positive space for all! +By following this Code of Conduct, we can ensure a welcoming and inclusive environment, encouraging new contributors to engage with the project and the community. Thank you for helping make **bluewave-uptime** a positive space for all! From 8f9fa11b9df433dd241502099516674701cc1f38 Mon Sep 17 00:00:00 2001 From: "Gorkem Cetin (BWL)" <167266851+gorkem-bwl@users.noreply.github.com> Date: Tue, 15 Oct 2024 12:03:19 -0400 Subject: [PATCH 8/8] Update CONTRIBUTING.md --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 60cd78fc0..fa2ccf3f9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -77,6 +77,7 @@ Once it's filed: This section guides you through submitting an enhancement suggestion for the application, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community understand your enhancements and find related suggestions. - Make sure that you are using the latest version. +- Make sure you run the code locally. The Uptime Manager [documentation](https://bluewavelabs.gitbook.io/uptime-manager) covers it. - Find out if the functionality is already covered, maybe by an individual configuration. - Perform a [search](/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. - Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library.