Skip to content
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

Fix drag issue when contains same field #364

Merged
merged 2 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const SingleEncodeEditor: React.FC<MultiEncodeEditorProps> = (props) => {
<div className="relative select-none flex flex-col py-0.5 px-1 touch-none" {...provided.droppableProps} ref={refMapper(provided.innerRef)}>
{channelItems.map((channelItem, index) => {
return (
<Draggable key={getFieldIdentifier(channelItem)} draggableId={`encode_${dkey.id}_${getFieldIdentifier(channelItem)}`} index={index}>
<Draggable key={`encode_${dkey.id}_${index}_${getFieldIdentifier(channelItem)}`} draggableId={`encode_${dkey.id}_${index}_${getFieldIdentifier(channelItem)}`} index={index}>
{(provided, snapshot) => {
return (
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const SingleEncodeEditor: React.FC<SingleEncodeEditorProps> = (props) => {
{t('actions.drop_field')}
</div>
{channelItem && (
<Draggable key={getFieldIdentifier(channelItem)} draggableId={`encode_${dkey.id}_${getFieldIdentifier(channelItem)}`} index={0}>
<Draggable draggableId={`encode_${dkey.id}_${getFieldIdentifier(channelItem)}`} index={0}>
{(provided, snapshot) => {
return (
<div
Expand Down
2 changes: 1 addition & 1 deletion packages/graphic-walker/src/fields/filterField/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const FilterItemContainer: React.FC<FieldContainerProps> = observer(({ provided
ref={refMapper(provided.innerRef)}
>
{filters.map((f, index) => (
<Draggable key={getFieldIdentifier(f)} draggableId={`filters_${getFieldIdentifier(f)}`} index={index}>
<Draggable key={`filters_${index}_${getFieldIdentifier(f)}`} draggableId={`filters_${index}_${getFieldIdentifier(f)}`} index={index}>
{(provided, snapshot) => {
return (
<FilterPill
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const OBFieldContainer: React.FC<FieldContainerProps> = (props) => {
<FieldsContainer {...provided.droppableProps} ref={refMapper(provided.innerRef)}>
{/* {provided.placeholder} */}
{allEncodings[dkey.id].map((f, index) => (
<Draggable key={getFieldIdentifier(f)} draggableId={`encode_${dkey.id}_${getFieldIdentifier(f)}`} index={index}>
<Draggable key={`encode_${dkey.id}_${index}_${getFieldIdentifier(f)}`} draggableId={`encode_${dkey.id}_${index}_${getFieldIdentifier(f)}`} index={index}>
{(provided, snapshot) => {
return <OBPill dkey={dkey} fIndex={index} provided={provided} />;
}}
Expand Down
2 changes: 1 addition & 1 deletion packages/graphic-walker/src/lib/op/aggregate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function aggregate(data: IRow[], query: IAggQuery): IRow[] {
const values: number[] = subGroup
.map((r) => r[mea.field])
.map((x) => {
if (mea.format) {
if (mea.format !== undefined) {
return newDate(x).getTime();
}
return x;
Expand Down
Loading