-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Conversation
scottyaslan
commented
May 9, 2024
There was a problem hiding this 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:
Hopefully we can unify to a common component.
@rfellows thanks for the updates and the PR. These are great! |
private getIconClassName(type: ComponentType | string | null) { | ||
if (type !== null && typeof type !== 'string') { | ||
return 'icon-drop'; | ||
} |
There was a problem hiding this comment.
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';
}
}
if (typeof type === 'string') { | ||
return type; | ||
} |
There was a problem hiding this comment.
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...
There was a problem hiding this 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
* [NIFI-13177] ensure consistent rendering of component type, name, and icon * ensure font-size consistency with .refresh-container and .mat-mdc-paginator * attempt at unifying how component context is displayed (apache#6) * use drop icon by default * final touches --------- Co-authored-by: Rob Fellows <rob.fellows@gmail.com> This closes apache#8786
* [NIFI-13177] ensure consistent rendering of component type, name, and icon * ensure font-size consistency with .refresh-container and .mat-mdc-paginator * attempt at unifying how component context is displayed (apache#6) * use drop icon by default * final touches --------- Co-authored-by: Rob Fellows <rob.fellows@gmail.com> This closes apache#8786