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: move slack channel to top of table description #1446

Merged
merged 14 commits into from
May 8, 2024

Conversation

zhangvi7
Copy link
Contributor

@zhangvi7 zhangvi7 commented May 2, 2024

Minor Querybook Improvements for Tier 1 tables

  • Pull up slack channel to the top of the table description / highlight it.

Test Plan

Bring slack channel to top of table details and add channel link

const channelsKey = 'channels';
const channelsValue = customProperties[channelsKey]?.toString() ?? '';
const channelsName = channelsValue.slice(1);
const channelLink = `https://pinterest.slack.com/app_redirect?channel=${channelsName}`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is too Pinterest specific for the opensource repo and need a better solution for it. let's not add a link for now. maybe can add link in the properties when syncing from pincat

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed link for now

jczhong84
jczhong84 previously approved these changes May 3, 2024
Comment on lines 85 to 98
function createChannelLinkDOM(customProperties) {
const channelsKey = 'channels';
const channelsValue = customProperties[channelsKey]?.toString() ?? '';

return channelsValue === '' ? null : (
<KeyContentDisplay
key={channelsKey}
keyString={titleize(channelsKey, '_', ' ')}
>
{channelsValue}
</KeyContentDisplay>
);
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

this is duplicating a lot of code specially for channels, could you have something like:

/**
* any custom properties in this array will be shown on top following the order of the array
*/
const pinnedCustomProperties = ['channels'];

then when you go over customPropertiesDOM, make orderedProperties show at the beginning

Copy link
Contributor Author

@zhangvi7 zhangvi7 May 4, 2024

Choose a reason for hiding this comment

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

  • Refactored KeyContentDisplay to helper
  • Added pinnedCustomProperties[] to display pinned custom properties at top and unpinned custom properties at bottom
  • Updated test plan with screenshots

@zhangvi7
Copy link
Contributor Author

zhangvi7 commented May 7, 2024

  • moved to react component
  • address comment

@zhangvi7 zhangvi7 requested a review from czgu May 7, 2024 18:29
Copy link
Collaborator

@czgu czgu left a comment

Choose a reason for hiding this comment

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

LGTM 👏 , let's fix the errors before r+

@zhangvi7 zhangvi7 merged commit af818be into pinterest:master May 8, 2024
3 checks passed
@zhangvi7 zhangvi7 deleted the channel branch May 8, 2024 23:09
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.

3 participants