Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: resource card editable name pencil css fix #715

Merged
merged 3 commits into from
Jan 19, 2022

Conversation

ChitlangeSahas
Copy link
Contributor

@ChitlangeSahas ChitlangeSahas commented Jan 10, 2022

Part of #702

Changes

Changes the CSS so that the icon is always aligned with the first line of the name.

Screenshots

Screen Shot 2022-01-10 at 3 54 18 PM

Screen Shot 2022-01-10 at 3 54 08 PM

Checklist

Check all that apply

  • Updated documentation to reflect changes
  • Added entry to top of Changelog with link to PR (not issue)
  • Tests pass
  • Peer reviewed and approved
  • Signed CLA (if not already signed)

@ChitlangeSahas ChitlangeSahas requested a review from a team January 10, 2022 22:55
@@ -158,7 +158,7 @@ export const ResourceCardEditableName = forwardRef<
onClick={handleClick}
data-testid={testID}
>
<span>{name || noNameString}</span>
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 span was part of the issue.

@@ -19,8 +19,8 @@
position: relative;
display: flex;
flex-wrap: nowrap;
align-items: center;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dont need it in center, rather, at the start of the flex.

Copy link
Contributor

Choose a reason for hiding this comment

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

one thing to be aware of when modifying CSS is where this class is used. I did a quick poke around the UI (in the chrome console, using $('.cf-resource-editable-name) will show you if there are any elements that match that class selector) and found a few places like in paginated tasks and paginated tokens where this class is used. Will justifying the content to flex-start mess things up there?

I did notice that changing align-items: center changed the vertical placement of text. Do you know what happens when you keep align-items: center and add justify-content: flex-start?

Copy link
Contributor

@hoorayimhelping hoorayimhelping left a comment

Choose a reason for hiding this comment

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

Changing a CSS selector is one of the more difficult parts of maintaining CSS because it can sometimes be hard to understand how often it's used. That difficulty is compounded when it's used in a component library like Clockface. Depending on how thoroughly you tested, we may want to tweak this or test more parts of the app.

@@ -19,8 +19,8 @@
position: relative;
display: flex;
flex-wrap: nowrap;
align-items: center;
Copy link
Contributor

Choose a reason for hiding this comment

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

one thing to be aware of when modifying CSS is where this class is used. I did a quick poke around the UI (in the chrome console, using $('.cf-resource-editable-name) will show you if there are any elements that match that class selector) and found a few places like in paginated tasks and paginated tokens where this class is used. Will justifying the content to flex-start mess things up there?

I did notice that changing align-items: center changed the vertical placement of text. Do you know what happens when you keep align-items: center and add justify-content: flex-start?

font-size: $cf-card--name-font-size;
font-weight: $cf-card--name-font-weight;
font-family: $cf-text-font;
display: inline-block;
Copy link
Contributor

Choose a reason for hiding this comment

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

this selector is also used in more places than dashboards and is something you'll want to take great care changing. Changing from inline-block to flex might have very odd changes in layout. It might be better to try inline-flex, but even then, I'd be very careful changing that, as it might have some strange, unintended consequences beyond just the cards you tested them in.

@ChitlangeSahas
Copy link
Contributor Author

I understand the concerns above, to best navigate the issue of making sure that this doesn't break anything I went through and tested all the pages that have the resource card, I checked:

  • Dashboards,
  • Telegraf (under load data)
  • Notebooks
  • Tasks
  • Tokens

Rest of the app has a different flow of renaming, (no pencil, but through the cog icon there is the rename option).

There seem to be no issues.

cc: @hoorayimhelping

Copy link
Contributor

@hoorayimhelping hoorayimhelping left a comment

Choose a reason for hiding this comment

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

I understand the concerns above, to best navigate the issue of making sure that this doesn't break anything I went through and tested all the pages that have the resource card, I checked:
...
There seem to be no issues.

outstanding, thank you! Good luck!

@ChitlangeSahas ChitlangeSahas merged commit 073831b into master Jan 19, 2022
@ChitlangeSahas ChitlangeSahas deleted the resource_card_pencil branch January 19, 2022 18:03
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants