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(rust): integrate space's subscription data in command #8296

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

adrianbenavides
Copy link
Member

@adrianbenavides adrianbenavides commented Jul 11, 2024

Adds the subscription data to the space, status and enroll commands. This PR also improves the output construction of those commands, which led me to improve the Output trait.

Changes to the Output trait

In this PR you can see that the Subscription struct is used in three different kinds of outputs (see images below for examples):

  1. As a standalone item (it's individual representation)
  2. As part of other structs in their individual representation (e.g. in the space show command)
  3. As part of other structs in their list representation (e.g. in the space list command)

Now, we want to reuse the output of the individual representation, but there are some differences we need to keep in mind: in 2. the subscription is padded + indented; in 3. the subscription is padded.

The Output trait lets you define the output for 1. and 3. but not for 2. and, in this case, the only difference between them is the left spacing. And I think this is also true for a lot of other structs.

That being said, I've extended the Output trait a little to make these "left-spacing" transformations easier. You can check the Subscription struct as an example of how to reuse the Display representation and how it's also integrated in the Space's Display impl.

enroll

Free trial + and the space has been just created:

image

Free trial + the space already existed:

image

Not a free trial subscription:

image

space and status

image

image

@adrianbenavides adrianbenavides requested a review from a team as a code owner July 11, 2024 15:59
@adrianbenavides adrianbenavides force-pushed the adrian/space-subscription-message branch 2 times, most recently from 869b9f4 to e2e0835 Compare July 12, 2024 07:31
Copy link
Member

@etorreborre etorreborre left a comment

Choose a reason for hiding this comment

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

Some of my comments can definitely be addressed in other PRs. My biggest concern is with inlining the whole Subscription data into one row cell.

@adrianbenavides adrianbenavides force-pushed the adrian/space-subscription-message branch 2 times, most recently from cc09508 to 1e653e5 Compare July 16, 2024 07:20
@adrianbenavides adrianbenavides force-pushed the adrian/space-subscription-message branch from 1e653e5 to f500194 Compare July 16, 2024 07:21
Copy link
Member

@etorreborre etorreborre 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 all the changes 🏵️

@adrianbenavides adrianbenavides added this pull request to the merge queue Jul 16, 2024
Merged via the queue into develop with commit 5290da6 Jul 16, 2024
42 checks passed
@adrianbenavides adrianbenavides deleted the adrian/space-subscription-message branch July 16, 2024 07:55
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.

2 participants