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

[NIFI-13177] ensure consistent typography rendering #8786

Merged
merged 5 commits into from May 10, 2024

Conversation

scottyaslan
Copy link
Contributor

Screenshot 2024-05-09 at 10 53 29 AM
Screenshot 2024-05-09 at 10 53 41 AM
Screenshot 2024-05-09 at 10 54 03 AM

@scottyaslan scottyaslan added the new ui Pull requests for work relating to the new user interface being developed. label May 9, 2024
@scottyaslan scottyaslan requested a review from rfellows May 9, 2024 14:54
@scottyaslan scottyaslan changed the title Nifi 13177 [NIFI-13177] ensure consistent typography rendering May 9, 2024
Copy link
Contributor

@rfellows rfellows left a comment

Choose a reason for hiding this comment

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

There are still some differences in how we display the component info. We have a component for this, but it isn't 100% compatible with the various ways we use it. I took a quick stab at making it work for all 3 places, let me know what you think. I submitted a PR to your fork/branch: scottyaslan#6

Here are the various flavors of how they are displayed:
Screenshot 2024-05-09 at 3 29 56 PM
Screenshot 2024-05-09 at 3 29 39 PM
Screenshot 2024-05-09 at 3 29 27 PM

Hopefully we can unify to a common component.

@scottyaslan
Copy link
Contributor Author

@rfellows thanks for the updates and the PR. These are great!

Comment on lines 45 to 48
private getIconClassName(type: ComponentType | string | null) {
if (type !== null && typeof type !== 'string') {
return 'icon-drop';
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This didn't work for the Parameter Context example. It should show the nifi drop logo for param contexts. I made a quick change to this method that solves the issue.

basically we can't determine the difference between a string and a Component type. need to return the drop icon if it is null or it isn't in the switch (so the default scenario)...

    private getIconClassName(type: ComponentType | string | null) {
        if (type === null) {
            return 'icon-drop';
        }
        switch (type) {
            case ComponentType.Connection:
                return 'icon-connect';
            case ComponentType.Processor:
                return 'icon-processor';
            case ComponentType.OutputPort:
                return 'icon-port-out';
            case ComponentType.InputPort:
                return 'icon-port-in';
            case ComponentType.ProcessGroup:
                return 'icon-group';
            case ComponentType.Funnel:
                return 'icon-funnel';
            case ComponentType.Label:
                return 'icon-label';
            case ComponentType.RemoteProcessGroup:
                return 'icon-group-remote';
            default:
                return 'icon-drop';
        }
    }

Comment on lines 27 to 29
if (typeof type === 'string') {
return type;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this is an issue too, sorry for the bad suggestions. we need to remove this check and just return type in the default case of the switch...

Copy link
Contributor

@rfellows rfellows left a comment

Choose a reason for hiding this comment

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

LGTM 👍
Thanks, @scottyaslan . Will merge once CI completes

@rfellows rfellows merged commit 6b48e61 into apache:main May 10, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new ui Pull requests for work relating to the new user interface being developed.
Projects
None yet
2 participants