generated from RealDevSquad/website-template
-
Notifications
You must be signed in to change notification settings - Fork 166
standup feature page that takes standup of people and stores it #518
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
Merged
ankushdharkar
merged 65 commits into
RealDevSquad:develop
from
Pratiyushkumar:feature/standup-feature
Jun 18, 2023
Merged
Changes from all commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
82d743a
standup feature page that takes standup op people and stores it
Pratiyushkumar 9bad1a7
Merge branch 'develop' of https://github.com/Real-Dev-Squad/website-s…
Pratiyushkumar 56dda6c
modified UI design only
Pratiyushkumar ff23a23
test cases added for the standup feature
Pratiyushkumar 7d61a87
Delete url.ts
Pratiyushkumar 63a654f
Merge branch 'develop' of https://github.com/Real-Dev-Squad/website-s…
Pratiyushkumar de469f0
modified UI design only
Pratiyushkumar 75a5eb5
test cases added for the standup feature
Pratiyushkumar 20b7c0f
Made the working standup feature, only API integration remains
Pratiyushkumar f1a39e9
Merge branch 'Real-Dev-Squad:develop' into develop
Pratiyushkumar e27a5f2
Resolved merge conflicts
Pratiyushkumar 924a200
Merge branch 'develop' of https://github.com/Real-Dev-Squad/website-s…
Pratiyushkumar 7ded770
Merge branch 'develop' of https://github.com/Real-Dev-Squad/website-s…
Pratiyushkumar bc44ae0
Merge branch 'develop' of https://github.com/Real-Dev-Squad/website-s…
Pratiyushkumar 5869772
modified UI design only
Pratiyushkumar 3277362
test cases added for the standup feature
Pratiyushkumar c15d9c2
Made the working standup feature, only API integration remains
Pratiyushkumar 63f7f56
modified UI design only
Pratiyushkumar b94c266
Delete url.ts
Pratiyushkumar c80e189
updating the code as per the review comments
Pratiyushkumar 734d730
Merge branch 'feature/standup-feature' of https://github.com/Pratiyus…
Pratiyushkumar 77f1466
fixed error
Pratiyushkumar 4d430fd
fixing the errors in the PR
Pratiyushkumar ef1f499
deleting formatDate.js
Pratiyushkumar 6e207f3
fixed the api.ts file and standup.ts file
Pratiyushkumar 33c86ec
addded comments and also removed unwanted file
Pratiyushkumar 47cda6a
fixed the suggested changes in PR
Pratiyushkumar d03eb67
Merge branch 'develop' of https://github.com/Real-Dev-Squad/website-s…
Pratiyushkumar 8305d20
PR review comments fixed
Pratiyushkumar dd8a827
comments removed from standup.type file
Pratiyushkumar 5f32fa8
adding memo and useEffect dependency
Pratiyushkumar e532b6b
changes fixed as per PR review comments
Pratiyushkumar beaec0a
pipe symbol fixed and background color change fixed
Pratiyushkumar fb96dcb
PR review comments fixed
Pratiyushkumar 6acc12b
API integration running and feature is ready to be merge
Pratiyushkumar 0004581
changes done as per comments
Pratiyushkumar bab5d57
Merge branch 'develop' of https://github.com/Real-Dev-Squad/website-s…
Pratiyushkumar 80852ce
Merge branch 'develop' of https://github.com/Pratiyushkumar/website-s…
Pratiyushkumar 9a8b623
fixed class name as per review
Pratiyushkumar ed256f6
fixed the total missed update count
Pratiyushkumar 93b5631
put my feature behind the feature flag
Pratiyushkumar 7712e93
fixed className in css
Pratiyushkumar a9f3541
fixed edge case of total missed update
Pratiyushkumar 2eec52a
code bug fixed
Pratiyushkumar 514616b
Failing test case fixed
Pratiyushkumar 5b4abac
fixed total missed update and conditional rendering function
Pratiyushkumar 9d25d96
Merge branch 'develop' of https://github.com/Pratiyushkumar/website-s…
Pratiyushkumar b028f3d
Merge branch 'develop' of https://github.com/Pratiyushkumar/website-s…
Pratiyushkumar 0e07744
Delete standup.test.tsx
Pratiyushkumar 7faf398
Removed Test file and fixed Changes
Pratiyushkumar d829ec9
fixed minor changes
Pratiyushkumar 9ac2ee9
removed tag type, improved variable name
Pratiyushkumar 5e316b4
used moment library in getTotalMissedUpdates function
Pratiyushkumar ed333fa
Merge branch 'Real-Dev-Squad:develop' into develop
Pratiyushkumar 3bb87f7
fixed task progress banner
Pratiyushkumar c17d42e
fixed the if else condition in standup file
Pratiyushkumar 8fae607
Merge branch 'develop' into feature/standup-feature
Pratiyushkumar 3281d41
Merge branch 'Real-Dev-Squad:develop' into develop
Pratiyushkumar ee69597
Merge branch 'develop' into feature/standup-feature
Pratiyushkumar 69774e9
Merge branch 'Real-Dev-Squad:develop' into develop
Pratiyushkumar ca67d89
Merge branch 'develop' of https://github.com/Pratiyushkumar/website-s…
Pratiyushkumar 591b9e8
Merge branch 'feature/standup-feature' of https://github.com/Pratiyus…
Pratiyushkumar 3c64d79
removed fragments and useEffect hook
Pratiyushkumar b3bdcec
removed comments
Pratiyushkumar d8187a0
fixed css and css classname
Pratiyushkumar 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
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
Pratiyushkumar marked this conversation as resolved.
Show resolved
Hide resolved
|
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 |
|---|---|---|
| @@ -1,15 +1,25 @@ | ||
| import styles from '@/components/ProgressForm/ProgressForm.module.scss'; | ||
| import { FC } from 'react'; | ||
| import styles from '@/components/standup/standupContainer.module.scss'; | ||
| import { progressHeaderProps } from '@/types/ProgressUpdates'; | ||
|
|
||
| function ProgressHeader() { | ||
| const ProgressHeader: FC<progressHeaderProps> = ({ | ||
| totalMissedUpdates, | ||
| updateType, | ||
| }) => { | ||
| return ( | ||
| <header className={styles.banner}> | ||
| <p> | ||
| You have <span className={styles.mark}> 2 missed</span> Progress | ||
| Updates | ||
| <div className={styles.progressBanner}> | ||
| <p className={styles.bannerPara}> | ||
| You have | ||
| <span className={styles.totalMissedUpdates}> | ||
| {totalMissedUpdates} missed | ||
| </span> | ||
| {updateType} updates | ||
| </p> | ||
| <p>Lets try to avoid missing updates</p> | ||
| </header> | ||
| <p className={styles.bannerPara}> | ||
| Let's try to avoid having zero days | ||
shubhamsinghbundela marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </p> | ||
| </div> | ||
| ); | ||
| } | ||
| }; | ||
shubhamsinghbundela marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| export default ProgressHeader; | ||
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,38 @@ | ||
| import { FC } from 'react'; | ||
|
|
||
| import styles from '@/components/standup/standupContainer.module.scss'; | ||
| import { InputProps } from '@/types/standup.type'; | ||
|
|
||
| const FormInputComponent: FC<InputProps> = ({ | ||
| placeholder, | ||
| name, | ||
| value, | ||
| dataTestId, | ||
| labelValue, | ||
| htmlFor, | ||
| inputId, | ||
| handleChange, | ||
| }) => { | ||
| return ( | ||
| <> | ||
| <label className={styles.updateHeading} htmlFor={htmlFor}> | ||
| {labelValue} | ||
| </label> | ||
| <input | ||
| id={inputId} | ||
| data-testid={dataTestId} | ||
| type="text" | ||
| className={styles.inputField} | ||
| placeholder={placeholder} | ||
| required | ||
| name={name} | ||
| value={value} | ||
| onChange={(e: React.ChangeEvent<HTMLInputElement>) => | ||
| handleChange(e) | ||
| } | ||
| /> | ||
| </> | ||
| ); | ||
| }; | ||
|
|
||
| export default FormInputComponent; |
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,135 @@ | ||
| import { FC, useState, useEffect } from 'react'; | ||
| import moment from 'moment'; | ||
| import styles from '@/components/standup/standupContainer.module.scss'; | ||
|
|
||
| import { | ||
| useSaveProgressMutation, | ||
| useUserProgressDetailsQuery, | ||
| } from '@/app/services/progressesApi'; | ||
| import { useGetUserQuery } from '@/app/services/userApi'; | ||
|
|
||
| import FormInputComponent from './FormInputComponent'; | ||
| import { standupUpdateType } from '@/types/standup.type'; | ||
| import { getTotalMissedUpdates } from '@/utils/getTotalMissedUpdate'; | ||
| import { toast, ToastTypes } from '@/helperFunctions/toast'; | ||
| import { | ||
| ERROR_MESSAGE, | ||
| STANDUP_SUBMISSION_SUCCESS, | ||
| } from '@/constants/constants'; | ||
| import ProgressHeader from '../ProgressForm/ProgressHeader'; | ||
|
|
||
| const defaultState = { | ||
| type: 'user', | ||
| completed: '', | ||
| planned: '', | ||
| blockers: '', | ||
| }; | ||
|
|
||
| const StandUpContainer: FC = () => { | ||
| const [standupUpdate, setStandupUpdate] = | ||
| useState<standupUpdateType>(defaultState); | ||
|
|
||
| const [addStandup] = useSaveProgressMutation(); | ||
Pratiyushkumar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const { data: user } = useGetUserQuery(); | ||
| const { data: userStandupdata } = useUserProgressDetailsQuery(user?.id); | ||
|
|
||
| const { SUCCESS, ERROR } = ToastTypes; | ||
| const standupDates = userStandupdata?.data?.map((element) => element.date); | ||
| const totalMissedUpdates = getTotalMissedUpdates(standupDates || []); | ||
| const yesterdayDate = moment().subtract(1, 'days').format('MMMM DD, YYYY'); | ||
|
|
||
| const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => { | ||
| setStandupUpdate((prevStandupUpdate) => ({ | ||
| ...prevStandupUpdate, | ||
| [event.target.name]: event.target.value, | ||
| })); | ||
| }; | ||
| const isValidate = () => { | ||
| return ( | ||
| standupUpdate.completed !== '' && | ||
| standupUpdate.planned !== '' && | ||
| standupUpdate.blockers !== '' | ||
| ); | ||
| }; | ||
|
|
||
| const buttonStyleClass = !isValidate() | ||
| ? `${styles.nonActiveButton}` | ||
| : `${styles.activeButton}`; | ||
|
|
||
| const handleFormSubmission = async ( | ||
| event: React.FormEvent<HTMLFormElement> | ||
| ) => { | ||
| event.preventDefault(); | ||
| try { | ||
| await addStandup(standupUpdate); | ||
| toast(SUCCESS, STANDUP_SUBMISSION_SUCCESS); | ||
| setStandupUpdate(defaultState); | ||
| } catch (error) { | ||
| console.error(error); | ||
RitikJaiswal75 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| toast(ERROR, ERROR_MESSAGE); | ||
| } | ||
| }; | ||
|
|
||
| return ( | ||
| <> | ||
| <section className="container"> | ||
| <div className={styles.standupContainer}> | ||
| <ProgressHeader | ||
| totalMissedUpdates={totalMissedUpdates} | ||
| updateType="Standup" | ||
| /> | ||
|
|
||
| <div className={styles.standupUpdateContainer}> | ||
| <h1 className={styles.standupTitle}>Standup Update</h1> | ||
| <form | ||
| className={styles.standupForm} | ||
| onSubmit={handleFormSubmission} | ||
| > | ||
| <fieldset className={styles.formFields}> | ||
| <FormInputComponent | ||
| htmlFor="completed" | ||
| labelValue={yesterdayDate} | ||
| dataTestId="completedInputField" | ||
| placeholder="e.g Raised PR for adding new config" | ||
| name="completed" | ||
| value={standupUpdate.completed} | ||
| inputId="completed" | ||
| handleChange={handleChange} | ||
| /> | ||
| <FormInputComponent | ||
| htmlFor="planned" | ||
| labelValue="Today" | ||
| dataTestId="todayInputField" | ||
| placeholder="e.g Refactor signup to support Google login" | ||
| name="planned" | ||
| value={standupUpdate.planned} | ||
| inputId="planned" | ||
| handleChange={handleChange} | ||
| /> | ||
| <FormInputComponent | ||
| htmlFor="blockers" | ||
| labelValue="Blockers" | ||
| dataTestId="blockerInputField" | ||
| placeholder="e.g Waiting on identity team to deploy FF" | ||
| name="blockers" | ||
| value={standupUpdate.blockers} | ||
| inputId="blockers" | ||
| handleChange={handleChange} | ||
| /> | ||
| </fieldset> | ||
| <button | ||
RitikJaiswal75 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| className={`${styles.submitButton} ${buttonStyleClass}`} | ||
| disabled={!isValidate()} | ||
| type="submit" | ||
| > | ||
| Submit | ||
| </button> | ||
| </form> | ||
| </div> | ||
| </div> | ||
| </section> | ||
| </> | ||
| ); | ||
| }; | ||
|
|
||
| export default StandUpContainer; | ||
Oops, something went wrong.
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.