generated from Real-Dev-Squad/website-template
-
Notifications
You must be signed in to change notification settings - Fork 278
Feature/one time user colors #735
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
Open
isVivek99
wants to merge
37
commits into
Real-Dev-Squad:develop
Choose a base branch
from
isVivek99:feature/one-time-user-colors
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
2fed9ad
✨feat(addDefaultColor):
isVivek99 0f505b7
Merge branch 'develop' into feature/one-time-user-colors
vivek-geekyants cd2c96d
feat(user-colors):added code to add user colors
vivek-geekyants 5bd0f9a
Merge branch 'develop' into feature/one-time-user-colors
vivek-geekyants 5e4f75a
🐞 fix():removed console logs
vivek-geekyants 04c43e7
fixes+chores():fixed PR review changes and changed the filenames plus…
isVivek99 964dd56
chore(): dele commented code
isVivek99 0f65a11
chore(one-time-user-color): chores
isVivek99 146304a
fix(fixtures): changed color property
isVivek99 01c8138
fix():changed file structure suggested in the PR
isVivek99 7a75444
fix: helpers.js
isVivek99 54c94ce
chore():fixed migration filenames
isVivek99 f4d60d3
fix(userMigrations):
isVivek99 64f56cc
chore():removed unwanted comment
isVivek99 b210076
fix(usercolorArray): added constant
isVivek99 804c64c
code fix
isVivek99 b2c9c3c
Merge branch 'develop' into feature/one-time-user-colors
isVivek99 b495022
added firestore batch changes and updated tests
isVivek99 807df54
Update controllers/userMigrations.js
isVivek99 2ecedb5
review changes
isVivek99 4b0df82
change route name to noun
isVivek99 cc10b82
(#712) change route name to noun
isVivek99 b8c7521
update response based on review
isVivek99 231cbef
update test based on review
isVivek99 48f6ef3
(#712) moved firestore interaction inside controller and updated name…
isVivek99 f322598
Merge branch 'develop' of https://github.com/Real-Dev-Squad/website-b…
isVivek99 018f829
(#712) added test for helpers
isVivek99 62fb581
updated tests for the model
isVivek99 542d504
updated tests for the model
isVivek99 7e0d00a
Update users.test.js
isVivek99 a522f0f
adress PR comments
isVivek99 c723578
remove unrequired check
isVivek99 d76b090
Merge branch 'feature/one-time-user-colors' of https://github.com/vic…
isVivek99 c87fe9c
added dataAccessLayer to fetch users
isVivek99 6aaafd7
address failing test
isVivek99 c2151cd
updated helper file
isVivek99 0852243
update helper
isVivek99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| module.exports = [ | ||
| { color_primary: "#DB1212", color_secondary: "#F88181" }, | ||
| { color_primary: "#E9C46A", color_secondary: "#FFE094" }, | ||
| { color_primary: "#F4A261", color_secondary: "#FFBF8C" }, | ||
| { color_primary: "#2A9D8F", color_secondary: "#42E0CD" }, | ||
| { color_primary: "#165692", color_secondary: "#3D8BD3" }, | ||
| { color_primary: "#264653", color_secondary: "#387892" }, | ||
| { color_primary: "#B93160", color_secondary: "#D75281" }, | ||
| { color_primary: "#A5C9CA", color_secondary: "#E7F6F2" }, | ||
| { color_primary: "#6E85B7", color_secondary: "#B2C8DF" }, | ||
| { color_primary: "#FBA1A1", color_secondary: "#FBC5C5" }, | ||
| ]; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| const userQuery = require("../models/users"); | ||
| const logger = require("../utils/logger"); | ||
|
|
||
| /** | ||
| * Returns the lists of usernames where default colors were added | ||
| * | ||
| * @param req {Object} - Express request object | ||
| * @param res {Object} - Express response object | ||
| */ | ||
|
|
||
| const addDefaultColors = async (req, res) => { | ||
| try { | ||
| const addedDefaultColorsData = await userQuery.addDefaultColors(); | ||
|
|
||
| return res.json({ | ||
| message: "User colors updated successfully!", | ||
| ...addedDefaultColorsData, | ||
| }); | ||
| } catch (error) { | ||
| logger.error(`Error adding default colors to users: ${error}`); | ||
| return res.boom.badImplementation("Something went wrong. Please contact admin"); | ||
| } | ||
| }; | ||
|
|
||
| module.exports = { | ||
| addDefaultColors, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| const express = require("express"); | ||
| const router = express.Router(); | ||
| const authenticate = require("../middlewares/authenticate"); | ||
| const authorizeRoles = require("../middlewares/authorizeRoles"); | ||
| const { SUPERUSER } = require("../constants/roles"); | ||
| const migrations = require("../controllers/migrations"); | ||
|
|
||
| router.patch("/addDefaultColorProperty", authenticate, authorizeRoles([SUPERUSER]), migrations.addDefaultColors); | ||
|
|
||
| module.exports = router; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.