-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[WEB-2106] fix: add date and state change functionalities to list and grid view #5533
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
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
da9d92e
added functionality to list and grid
sharma01ketan 3b4a699
fixed logic for archived module
sharma01ketan 4546018
fixed logic for list view
sharma01ketan 0ad9429
improved logic and fixed linting issues
sharma01ketan d1621d9
improved variable names
sharma01ketan 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| import React, { FC } from 'react' | ||
| import { observer } from 'mobx-react'; | ||
| import { IModule } from '@plane/types'; | ||
| import { CustomSelect, TModuleStatus, ModuleStatusIcon } from '@plane/ui' | ||
| import { MODULE_STATUS } from '@/constants/module' | ||
|
|
||
| type Props = { | ||
| isDisabled: boolean; | ||
| moduleDetails: IModule; | ||
| handleModuleDetailsChange: (payload: Partial<IModule>) => Promise<void>; | ||
| }; | ||
|
|
||
| export const ModuleStatusDropdown : FC<Props> = observer((props : Props) => { | ||
| const {isDisabled, moduleDetails, handleModuleDetailsChange} = props; | ||
| const moduleStatus = MODULE_STATUS.find((status) => status.value === moduleDetails.status); | ||
|
|
||
| if(!moduleStatus) return <></> | ||
|
|
||
| return ( | ||
| <CustomSelect | ||
| customButton={ | ||
| <span | ||
| className={`flex h-6 w-20 items-center justify-center rounded-sm text-center text-xs ${ | ||
| isDisabled ? "cursor-not-allowed" : "cursor-pointer" | ||
| }`} | ||
| style={{ | ||
| color: moduleStatus ? moduleStatus.color : "#a3a3a2", | ||
| backgroundColor: moduleStatus ? `${moduleStatus.color}20` : "#a3a3a220", | ||
| }} | ||
| > | ||
| {moduleStatus?.label ?? "Backlog"} | ||
| </span> | ||
| } | ||
| value={moduleStatus?.value} | ||
| onChange={(val: TModuleStatus)=>{ | ||
| handleModuleDetailsChange({status: val}) | ||
| }} | ||
| disabled={isDisabled} | ||
| > | ||
| {MODULE_STATUS.map((status) => ( | ||
| <CustomSelect.Option key={status.value} value={status.value}> | ||
| <div className="flex items-center gap-2"> | ||
| <ModuleStatusIcon status={status.value} /> | ||
| {status.label} | ||
| </div> | ||
| </CustomSelect.Option> | ||
| ))} | ||
| </CustomSelect> | ||
| ) | ||
| }) |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed issue resolution: Simplified boolean expression.
The boolean expression for
isDisabledhas been simplified, enhancing readability and maintainability. This change correctly implements previous suggestions.