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

[50307] Timestamp overflows the BorderBox on Storages index page #13923

Merged

Conversation

bsatarnejad
Copy link
Contributor

@bsatarnejad bsatarnejad commented Oct 16, 2023

@bsatarnejad bsatarnejad requested a review from a team October 23, 2023 09:49
@bsatarnejad bsatarnejad marked this pull request as ready for review October 24, 2023 13:20
Copy link
Contributor

@HDinger HDinger left a comment

Choose a reason for hiding this comment

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

Hi @bsatarnejad
As discussed, please get rid of the doubled avatars by applying a class.

@@ -1,9 +1,9 @@
<%=
if storages.present?
render(Primer::Beta::BorderBox.new) do |component|
render(Primer::Beta::BorderBox.new(classes: 'op-storage-list--box')) do |component|
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this new class needed for?

@media screen and (max-width: $breakpoint-md)
.op-storage-list--header--name
min-width: 140px
.op-storage-list--row--name, op-storage-list--row--host
Copy link
Contributor

Choose a reason for hiding this comment

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

The second selector is missing a dot, otherwise it won't get applied. That being said, it might be that it is necessary ?

.op-storage-list--header--name
min-width: 80px

.op-storage-list--row--name, op-storage-list--row--host
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.


@media screen and (max-width: $breakpoint-md)
.op-storage-list--header--name
min-width: 140px
Copy link
Contributor

Choose a reason for hiding this comment

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

The min-width can be replaced by using minmax(140px, 1fr) in the grid definition

@bsatarnejad
Copy link
Contributor Author

Hi @bsatarnejad As discussed, please get rid of the doubled avatars by applying a class.

Hi @HDinger
I'm not sure about selecting a right word for hiding in tablet and small laptop,
hidden-for-mini-laptop is ok?
The input name defined to be used for styling name of avatar 'classesForName' is good?

@bsatarnejad bsatarnejad requested a review from HDinger October 30, 2023 13:28
Copy link
Contributor

@HDinger HDinger left a comment

Choose a reason for hiding this comment

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

Hi @bsatarnejad

I have left some remarks. I think we can reduce the amount of touched files by adding a default to the new parameter. Thus you can undo all the changes to other places where the renderer is called. This will make the PR a bit more clear.

@@ -21,6 +21,7 @@ export interface AvatarOptions {
export interface NameOptions {
hide:boolean;
link:boolean;
classes:string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please make that optional, so that you don't have to pass an empty string everywhere.

@@ -164,6 +166,7 @@ export class PrincipalRendererService {
span.textContent = principal.name;
span.classList.add('op-principal--name');
span.title = title;
classes!== '' && span.classList.add(classes);
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a space missing, and I think the check is unnecessary, isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually it is needed. Without it, it raises an error of accessing null value.

frontend/src/global_styles/layout/_base_mobile.sass Outdated Show resolved Hide resolved
@@ -32,7 +32,7 @@ class AvatarComponent < ApplicationComponent
include AvatarHelper
include OpPrimer::ComponentHelpers

def initialize(user:, show_name: true, link: true, size: 'default', classes: '', title: nil)
def initialize(user:, show_name: true, link: true, size: 'default', classes: '', title: nil, classes_for_name: '')
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not super happy with that name. My suggestion would be name_classes, which is not really better tbh 🙈 but at least it is consistent to how we name this object in other classes 🤷‍♀️

@bsatarnejad bsatarnejad requested a review from HDinger November 2, 2023 13:44
Copy link
Contributor

@HDinger HDinger left a comment

Choose a reason for hiding this comment

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

As we discussed, it now looks weird to have two classes named ..-only. So please change it to hidden-for-tablet-and-small-laptops and change the breakpoints accordingly. I am really sorry for the extra round 🙈 🙈
Other than that, it looks fine 👍 So you can simpley merge the PR once the class name is changed and the CI is green. Please use the "squash" option for the merge, so that we have a cleaner history.

@bsatarnejad bsatarnejad merged commit 17480df into dev Nov 2, 2023
11 checks passed
@bsatarnejad bsatarnejad deleted the 50307-timestamp-overflows-the-borderbox-on-storages-index-page branch November 2, 2023 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants