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

feat: use schema's title when available in {one,any,all}Of applicators #744

Merged

Conversation

KtorZ
Copy link
Contributor

@KtorZ KtorZ commented Aug 6, 2023

Description

Applicators can be a little hard to navigate, especially on deeply nested schema. While the uid provides a nice middle-ground solution, it doesn't actually work when schemas are defined outside of the main specification and more importantly, it isn't necessarily meant to be human-readable. The title property however is meant just for that.

Changes proposed in this pull request:

  • This PR does just that, it adds the title next to branches enumeration in {one,any,all}Of applicators. When not available, it defaults to the current behavior.
image

Related issue(s)

N/A

@KtorZ KtorZ changed the title Use schema's title when available in {one,any,all}Of applicators Use schema's title when available in {one,any,all}Of applicators Aug 6, 2023
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@KtorZ KtorZ changed the title Use schema's title when available in {one,any,all}Of applicators feat: Use schema's title when available in {one,any,all}Of applicators Aug 6, 2023
@KtorZ KtorZ changed the title feat: Use schema's title when available in {one,any,all}Of applicators feat: use schema's title when available in {one,any,all}Of applicators Aug 6, 2023
fmvilas
fmvilas previously approved these changes Sep 6, 2023
Copy link
Member

@fmvilas fmvilas left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@fmvilas
Copy link
Member

fmvilas commented Sep 6, 2023

/au

@fmvilas
Copy link
Member

fmvilas commented Sep 6, 2023

@KtorZ would you mind merging the next branch into your branch? I'd do it myself but Github doesn't let me.

@KtorZ
Copy link
Contributor Author

KtorZ commented Sep 6, 2023

I'll try to get this done in the upcoming days!

@KtorZ KtorZ force-pushed the enforce-title-in-one_any_all-of branch from 695ded8 to c87fe54 Compare September 8, 2023 08:26
@KtorZ
Copy link
Contributor Author

KtorZ commented Sep 8, 2023

@fmvilas done 👌

@Amzani
Copy link

Amzani commented Sep 26, 2023

/au

@KtorZ KtorZ force-pushed the enforce-title-in-one_any_all-of branch from c87fe54 to 16a51de Compare September 26, 2023 15:27
@derberg
Copy link
Member

derberg commented Sep 28, 2023

next will soon be deleted. It is already merged into master and 1.0 is now available.

no more long living release branches!

sorry for any trouble with your PR 😞 but we really had to finally release this v1 and get rid of release branch

maybe changing target branch from next to master will not cause to much trouble and conflicts. Can you try 🙏🏼

@KtorZ KtorZ changed the base branch from next to master September 28, 2023 15:33
@KtorZ KtorZ dismissed fmvilas’s stale review September 28, 2023 15:33

The base branch was changed.

@KtorZ KtorZ force-pushed the enforce-title-in-one_any_all-of branch from 16a51de to 1b1a754 Compare September 28, 2023 15:35
@KtorZ
Copy link
Contributor Author

KtorZ commented Sep 28, 2023

No worries. Just switching the branch didn't do it (more than 100k lines changed for some reason). So I just pulled the latest master and cherry-picked the commit onto it. Seems like it's good.

Let me know 🙏

Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

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

Thanks for your patience. I left one small comment

Please also have a look at the linter issues

ERROR: (triple-equals) /home/runner/work/asyncapi-react/asyncapi-react/library/src/helpers/schema.ts[110, 27]: != should be !==

library/src/components/Schema.tsx Show resolved Hide resolved
derberg
derberg previously approved these changes Oct 3, 2023
@derberg
Copy link
Member

derberg commented Oct 3, 2023

@KtorZ please fix linter issues and also update with latest master

@derberg
Copy link
Member

derberg commented Oct 11, 2023

there is just one tiny fix

ERROR: (triple-equals) /home/runner/work/asyncapi-react/asyncapi-react/library/src/helpers/schema.ts[110, 27]: != should be !==

I cannot commit it directly for you as you open a PR not from personal but for organization fork

@asyncapi-bot
Copy link
Contributor

Hello, @derberg! 👋🏼

    I'm 🧞🧞🧞 Genie 🧞🧞🧞 from the magic lamp. Looks like somebody needs a hand!

    At the moment the following comments are supported in pull requests:

    - `/ready-to-merge` or `/rtm` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added
    - `/do-not-merge` or `/dnm` - This comment will block automerging even if all conditions are met and ready-to-merge label is added
    - `/autoupdate` or `/au` - This comment will add `autoupdate` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR.

@KtorZ
Copy link
Contributor Author

KtorZ commented Oct 11, 2023

I'll take care of it tomorrow 🫡

@derberg
Copy link
Member

derberg commented Oct 25, 2023

@KtorZ kind ping 😉

@KtorZ KtorZ force-pushed the enforce-title-in-one_any_all-of branch from 1b1a754 to 9cd9820 Compare October 26, 2023 08:54
@KtorZ
Copy link
Contributor Author

KtorZ commented Oct 26, 2023

My bad. Tomorrow ended up being way further in the future than I anticipated. Linted + rebased on top of master

@derberg
Copy link
Member

derberg commented Nov 6, 2023

SonarCloud blocked merge because of new rule related to accessibility. Issue mitigated by creating #827

@derberg
Copy link
Member

derberg commented Nov 6, 2023

@KtorZ all looks good but sorry, cannot merge as I cannot update your branch on my own as it is an org-fork, you have to do it on your own again, sorry

@derberg
Copy link
Member

derberg commented Nov 13, 2023

@KtorZ whenever you update your fork with latest master, just ping me directly here or in slack, so i will quickly merge

  Applicators can be a little hard to navigate, especially on deeply nested schema. While the uid provides a nice middleground solution, it doesn't actually work when schemas are defined outside of the main specification and more importantly, it isn't necessarily meant to be human-readable. The 'title' property however is meant just for that.
@KtorZ KtorZ force-pushed the enforce-title-in-one_any_all-of branch from 9cd9820 to b3b48df Compare November 13, 2023 15:58
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.3% 0.3% Duplication

@KtorZ
Copy link
Contributor Author

KtorZ commented Nov 13, 2023

@derberg 🙏

@derberg
Copy link
Member

derberg commented Nov 14, 2023

/rtm

@asyncapi-bot asyncapi-bot merged commit 8782f4a into asyncapi:master Nov 14, 2023
11 checks passed
@derberg
Copy link
Member

derberg commented Nov 14, 2023

@KtorZ finally we did it 😄

@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@KtorZ
Copy link
Contributor Author

KtorZ commented Nov 14, 2023

Easy enough ... 😶

Copy link
Member

derberg commented Nov 14, 2023

yeah, organization forks are pain, at least for upstream maintainers 😃

otherCases: string,
title?: string,
) {
const suffix = (title !== null && ` ${title}:`) || `:`;
Copy link
Contributor

Choose a reason for hiding this comment

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

The title can also be undefined it seems. This introduced Consists of undefined: for us. So this check needs to be improved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants