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 workflow link to source query tab #1445

Merged
merged 8 commits into from
May 6, 2024

Conversation

zhangvi7
Copy link
Contributor

@zhangvi7 zhangvi7 commented May 2, 2024

[ER-7007] Minor Querybook Improvements for Tier 1 tables

  • Currently all Tier 1 tables have a link to the workflow creating the table. However this information is not included under the Source Query tab

Test Plan

Added workflow link to bottom of source query tab

Screenshot 2024-05-01 at 11 25 32 PM

@zhangvi7 zhangvi7 self-assigned this May 2, 2024
@@ -80,6 +81,21 @@ export const DataTableViewSourceQuery: React.FunctionComponent<IProps> = ({
);
});

const customProperties = table.custom_properties ?? {};
const workflowValue = customProperties['workflow']?.toString() ?? null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: the workflow is already a string I think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

custom_property values are string | number, so change to string type for Link component

Copy link
Collaborator

Choose a reason for hiding this comment

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

@zhangvi7 it doesn't make sense to convert if it is a number

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated to use typeof to assert string type

const workflowValue = customProperties['workflow']?.toString() ?? null;
const workflowDOM = workflowValue ? (
<div className="DataTableViewSourceQuery-workflow">
<div className="data-job-source-query-top">
Copy link
Collaborator

Choose a reason for hiding this comment

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

this class data-job-source-query-top is from component DataJobMetadataInfo, looks weird to be here. better to define its own.

@@ -80,6 +81,21 @@ export const DataTableViewSourceQuery: React.FunctionComponent<IProps> = ({
);
});

const customProperties = table.custom_properties ?? {};
const workflowValue = customProperties['workflow']?.toString() ?? null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

@zhangvi7 it doesn't make sense to convert if it is a number

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.

nice!

Workflow
</Title>
</div>
{/https?:\/\/[^\s]+/.test(workflowValue.trim()) ? (
Copy link
Collaborator

Choose a reason for hiding this comment

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

use isValidUrl in lib/utils/

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! added

@zhangvi7 zhangvi7 merged commit 74790d6 into pinterest:master May 6, 2024
3 checks passed
@zhangvi7 zhangvi7 deleted the workflow branch May 6, 2024 16:56
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