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

[KED-2973] & [KED-2974] - fix metadata alignment and overlapping text #643

Merged
merged 3 commits into from
Nov 24, 2021

Conversation

studioswong
Copy link
Contributor

Description

resolves KED-2973 & KED-2974.

This PR is raised to fix the issues with the alignment of rows between runs, as well as the text formatting in the run details table.

Development notes

While looking into the issue of the row alignment of the table row for the metadata component, I realize that the empty fields within the metadata component are missing a '-' value as per the designs, hence I have added a small util function to check for the run metadata fields and apply the dash for empty values. This in turn will also fix the alignment issue.

I have modified the css to ensure that long text gets wrapped in the tracking dataset fields.

The comparison view now looks like this:

image

QA notes

This can be QAed by running this against your locally generated experiment data.

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added new entries to the RELEASE.md file
  • Added tests to cover my changes

Copy link
Collaborator

@limdauto limdauto left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -4,6 +4,10 @@ import { toHumanReadableTime } from '../../../utils/date-utils';

import './run-metadata.css';

// checks if value is an empty string, which is the default value returned
// by the graphql endpoint for empty values
const checkEmptyValue = (value) => (value !== '' ? value : '-');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: a check in my head returns a boolean. This has side effect, so I'd go for something like sanitiseEmptyValue. Feel free to ignore this comment though.

Copy link
Member

Choose a reason for hiding this comment

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

Agree. I'd change the function name. I'd also remove the comment, as the name of the function itself is pretty self explanatory, IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks both! I agree with the suggestion of the function naming.

I added the comment above particularly to provide clarity on the format that is returned from the graphql endpoint ( i.e I am checking for an empty string here given the current endpoint setup, and not checking for null or undefined values). I initially had the doubt to check for those other 2 situations but confirmed with the endpoint, and think this piece of information would be important in the assumption for the check executed in this function.

Copy link
Member

@tynandebold tynandebold left a comment

Choose a reason for hiding this comment

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

Looks great! Tiny comments from me that aren't blockers. Nice work.

@@ -4,6 +4,10 @@ import { toHumanReadableTime } from '../../../utils/date-utils';

import './run-metadata.css';

// checks if value is an empty string, which is the default value returned
// by the graphql endpoint for empty values
const checkEmptyValue = (value) => (value !== '' ? value : '-');
Copy link
Member

Choose a reason for hiding this comment

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

Agree. I'd change the function name. I'd also remove the comment, as the name of the function itself is pretty self explanatory, IMO.

@@ -31,53 +34,60 @@ const RunMetadata = ({ isSingleRun, runs = [] }) => {
className={classnames('details-metadata__run', {
'details-metadata__run--single': isSingleRun,
})}
key={run.gitSha}>
key={run.title}
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure the run.title will always be unique, not like the gitSha was either. You may want to add the index to this for safety.

Suggested change
key={run.title}
key={run.title + index}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea I had the exact same doubt as well, however I default this to the title given that the title now is the unique timestamp, moreover given that we have not implemented the mutation for the title which ensures this is unique.

The suggestion to add the index sounds good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

update: I've added a comment that this value should be reverted to gitSha once the endpoint returns the actual value as it is still a better unique identifier.

@@ -32,6 +32,7 @@
font-size: 1.4em;
padding-bottom: 16px;
vertical-align: top;
word-wrap: break-word; // For breaking potential long text,such as as git branch, title, etc
Copy link
Member

Choose a reason for hiding this comment

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

There should be a space after "text,".

Copy link
Contributor

@rashidakanchwala rashidakanchwala left a comment

Choose a reason for hiding this comment

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

LGTM! agree with the comments raised above

@studioswong studioswong merged commit 4aefdb5 into main Nov 24, 2021
@studioswong studioswong deleted the fix/KED-2974-fix-metadata-alignmnt branch November 24, 2021 14:54
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.

4 participants