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

[Widget Params] Split title and mapping editing (2 of 3) #3334

Conversation

ranbena
Copy link
Contributor

@ranbena ranbena commented Jan 24, 2019

This is the second of a batch of 3 commits that change UX of widget params.

Why?

Currently, there is one edit button per parameter, opening a popover that allows editing both source type and title. A better user experience is to have edit buttons per editable content - one for title, one for source type.

How it looks

Title edit
screen shot 2019-01-24 at 13 50 03

Source type edit
screen shot 2019-01-24 at 13 51 33

Implementation notes

Since now popovers open to the right of the content, affecting data as you type makes the popover jump horizontally as the position of the edit button shifts.
So, I implemented a "cancel/save" to each popover, hence the underlying table stays put during editing.

@ranbena ranbena self-assigned this Jan 24, 2019
@ghost ghost added the in progress label Jan 24, 2019
@@ -149,7 +150,7 @@ export class ParameterMappingInput extends React.Component {
<div className="m-t-10">
<Select
className="w-100"
defaultValue={mapping.mapTo}
value={mapping.mapTo}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so that if edit is cancelled (making state.mapping reset to original props.mapping), it would affect these input components, or else they would have stayed as left.

</div>
);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bye bye!

return 'Static value';
default:
return ''; // won't happen (typescript-ftw)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to getSourceTypeLabel

@ranbena ranbena force-pushed the feature/widget-params-ux/list branch from 3eefd57 to 6e6b56e Compare January 25, 2019 19:20
@arikfr
Copy link
Member

arikfr commented Jan 28, 2019

@ranbena I can review this one directly instead of the previous one, right?

@ranbena
Copy link
Contributor Author

ranbena commented Jan 28, 2019

Yeah, although it's still incomplete until the dependency is fixed.
And I need to rebase it.

@ranbena ranbena force-pushed the feature/widget-params-ux/list branch from 6e6b56e to b8779dd Compare January 28, 2019 11:04
@ranbena ranbena force-pushed the feature/widget-params-ux/split-edit branch from ab9f2dd to b773c71 Compare January 28, 2019 11:04
@ranbena ranbena force-pushed the feature/widget-params-ux/list branch from b8779dd to 958ded0 Compare January 30, 2019 18:29
@ranbena ranbena force-pushed the feature/widget-params-ux/split-edit branch from b773c71 to 2f97354 Compare January 30, 2019 18:35
@ranbena
Copy link
Contributor Author

ranbena commented Jan 30, 2019

@arikfr ready!

@ranbena ranbena requested a review from arikfr January 30, 2019 18:38
@arikfr
Copy link
Member

arikfr commented Jan 31, 2019

1.

I think it makes sense to use a wider Modal:

image

Update: I actually noticed we already use a wider one when you edit parameters.

2.

image

Instead of "Change parameter value" maybe "Set Parameter value"?

3.

When adding the widget to a dashboard with a static value it complaints that no value is set for param, while if you refresh it (with the refresh button) it works:

image

4.

(NTH)

image

When the Popover is open, clicking on Esc closes the Modal instead of the Popover.

5.

Completely unrelated but I think we should pin to top (along with the header) the parameters input. I added a new widget that takes a dashboard parameter, but the input was not even seen on screen. Feels a bit disorienting. I will open an issue for this.

6.

(should be fixed but not a blocker:)

  1. Edit parameters of an existing widget.
  2. Map it to a different parameter that has a different value.
  3. The widget shows the old value. Expected: refresh and show value with the new parameter.

7.

We use the p_ prefix for all parameter in the URL, but for widgets we use only w{widget-id}_. Shouldn't it be p_w{widget-id}_?

@ranbena
Copy link
Contributor Author

ranbena commented Jan 31, 2019

I think it makes sense to use a wider Modal:

My only reservation is that the above inputs (query and visualization) would be incredibly long.
Lemme think on this.

Instead of "Change parameter value" maybe "Set Parameter value"?

This is trampled in the next commit #3377.

When adding the widget to a dashboard with a static value it complaints that no value is set for param, while if you refresh it (with the refresh button) it works:

That's a bug on master. I'll open a separate issue. EDIT: #3379

When the Popover is open, clicking on Esc closes the Modal instead of the Popover.

Right. I'll have a separate PR to solve this with an Ant Modal. #3387
EDIT: seems it's unsolvable react-component/trigger#113 (comment)

(should be fixed but not a blocker:)

  1. Edit parameters of an existing widget.
  2. Map it to a different parameter that has a different value.
  3. The widget shows the old value. Expected: refresh and show value with the new parameter.

Definitely a bug. I'll look into it. EDIT: fixed

We use the p_ prefix for all parameter in the URL, but for widgets we use only w{widget-id}_. Shouldn't it be p_w{widget-id}_?

Definitely. Will open a separate issue. EDIT: #3380

@ranbena
Copy link
Contributor Author

ranbena commented Feb 3, 2019

Moved to #3332

@ranbena ranbena closed this Feb 3, 2019
@ghost ghost removed the in progress label Feb 3, 2019
@guidopetri guidopetri deleted the feature/widget-params-ux/split-edit branch July 22, 2023 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants