-
Notifications
You must be signed in to change notification settings - Fork 408
Docopsv2/views managing columns #1314
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
19 commits
Select commit
Hold shift + click to select a range
a13a343
new add property flow
Davy-c b51f0c6
warning message
Davy-c 401beb7
fix column icon paths
Davy-c 7751548
add icons for columns
Davy-c cdf8e35
fix onClose when adding column
Davy-c 4b77bbc
fix table component unique keys
Davy-c 62ef921
correct prop display and item title link
Davy-c ec7c650
fix popup alignment
Davy-c 6ced167
error state for cells
Davy-c ca21460
remove add col from properties context
Davy-c c198d78
fix update flow
Davy-c 86152a3
add orders to columns
Davy-c fcde12d
fix property menu
Davy-c 2077769
fix style of cells
Davy-c 2ad44ac
fix management of columns via calls only - no more instant state update
Davy-c 04092d3
add cursor pointer to table cols
Davy-c c7f1e35
add static props in table view
Davy-c d3dc22d
add input selection
Davy-c 116b2d2
fix date picker height
Davy-c 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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,91 @@ | ||
| import { mdiArrowLeft, mdiArrowRight, mdiTrashCanOutline } from '@mdi/js' | ||
| import React, { useCallback, useState } from 'react' | ||
| import MetadataContainer from '../../../../design/components/organisms/MetadataContainer' | ||
| import MetadataContainerRow from '../../../../design/components/organisms/MetadataContainer/molecules/MetadataContainerRow' | ||
| import { Column, ColumnMoveType } from '../../../lib/views/table' | ||
|
|
||
| interface ColumnSettingsContextProps { | ||
| column: Column | ||
| moveColumn: (move: ColumnMoveType) => void | ||
| removeColumn: (col: Column) => void | ||
| close: () => void | ||
| } | ||
|
|
||
| const ColumnSettingsContext = ({ | ||
| column, | ||
| removeColumn, | ||
| moveColumn, | ||
| close, | ||
| }: ColumnSettingsContextProps) => { | ||
| const [sending, setSending] = useState<string>() | ||
|
|
||
| const action = useCallback( | ||
| async (type: 'move-left' | 'move-right' | 'delete') => { | ||
| if (sending != null) { | ||
| return | ||
| } | ||
|
|
||
| setSending(type) | ||
|
|
||
| switch (type) { | ||
| case 'move-left': | ||
| await moveColumn('before') | ||
| break | ||
| case 'move-right': | ||
| await moveColumn('after') | ||
| break | ||
| case 'delete': | ||
| default: | ||
| await removeColumn(column) | ||
| break | ||
| } | ||
|
|
||
| setSending(undefined) | ||
| close() | ||
| }, | ||
| [sending, close, removeColumn, moveColumn, column] | ||
| ) | ||
|
|
||
| return ( | ||
| <MetadataContainer> | ||
| <MetadataContainerRow | ||
| row={{ | ||
| type: 'button', | ||
| props: { | ||
| iconPath: mdiArrowLeft, | ||
| label: 'Move Left', | ||
| spinning: sending === 'move-left', | ||
| onClick: () => action('move-left'), | ||
| disabled: sending != null, | ||
| }, | ||
| }} | ||
| /> | ||
| <MetadataContainerRow | ||
| row={{ | ||
| type: 'button', | ||
| props: { | ||
| iconPath: mdiArrowRight, | ||
| label: 'Move Right', | ||
| spinning: sending === 'move-right', | ||
| onClick: () => action('move-right'), | ||
| disabled: sending != null, | ||
| }, | ||
| }} | ||
| /> | ||
| <MetadataContainerRow | ||
| row={{ | ||
| type: 'button', | ||
| props: { | ||
| iconPath: mdiTrashCanOutline, | ||
| label: 'Delete', | ||
| spinning: sending === 'delete', | ||
| onClick: () => action('delete'), | ||
| disabled: sending != null, | ||
| }, | ||
| }} | ||
| /> | ||
| </MetadataContainer> | ||
| ) | ||
| } | ||
|
|
||
| export default ColumnSettingsContext |
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.
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.
Is there context for adding this state to all of the
Pickersinstead of just styling the cell? Is there difficult style clashes etc?Uh oh!
There was an error while loading. Please reload this page.
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.
we are essentially displaying the picker style rather than the cell style in the actual cell.
Also, I feel like error states will most likely end up having specific behaviour on pickers based on what we want ( like for example having only a delete option etc.. ) so that could simplify that if we go with it