kontent-ai / java-packages

Delivery Java SDK for Kontent.ai including examples for Spring, Gradle, Kotlin and Java Android app
https://kontent.ai/learn/tutorials/develop-apps/overview/?tech=java
MIT License
14 stars 28 forks source link

Adding missing workflow_step #139

Closed JerRMartin closed 2 years ago

JerRMartin commented 2 years ago

Motivation

Which issue does this fix? N/A

If no issue exists, what is the fix or new feature? Were there any reasons to fix/implement things that are not obvious?

How to test

If manual testing is required, what are the steps?

Step 1:

Tip: lines 11 and (28-42) can be commented out.

In the Main.java file, edit the DeliveryOptions on line 13 to target a test Kontent Project and to look like this:

DeliveryOptions options = DeliveryOptions.builder()
                .projectId("<YOUR-PROJECT-ID>")
                .retryAttempts(2)
                .waitForLoadingNewContent(true)
                .previewApiKey("<YOUR-PREVIEW-API-KEY>")
                .usePreviewApi(true)
                .build();

Step 2:

Rename client to client2 on line 23, then remove the .getName() from line 25, and reference an item in the test Kontent Project like so:

        client2.getItem("<KONTENT-ITEM-CODENAME>")
                .thenAccept(item ->
                        System.out.println(item.getItem().getSystem()));

Expected Results:

When targeting a test project with an unpublished element you should see a System object printed out displaying the workflow_step as one of the fields like so:

System(id=<SOME-ID>, name=<SOME-NAME>, codename=<SOME-CODENAME>, language=default, type=<SOME-TYPE>, collection=default, sitemapLocations=[], lastModified=<SOME-TIMESTAMP>, workflowStep=draft)
JerRMartin commented 2 years ago

Thank you for your edits!

Could you reformat README.md to keep its shape and just leave the Workflow step part addition?

I'm sorry, I don't know that I understood what you meant by this. Would you mind rewording it?

Simply007 commented 2 years ago

Thank you for your edits! Could you reformat README.md to keep its shape and just leave the Workflow step part addition?

I'm sorry, I don't know that I understood what you meant by this. Would you mind rewording it?

Sure, In commit https://github.com/Kentico/kontent-java-packages/pull/139/commits/0567fb2ebddb5ef12b10ee38b2d80079c53042f2 you adjusted the readme with these changes which are completely correct.

image

But there are other changes that are changing the format of the README, like this one: image So I would like to have these other changes reverted.

JerRMartin commented 2 years ago

Thank you for your edits! Could you reformat README.md to keep its shape and just leave the Workflow step part addition?

I'm sorry, I don't know that I understood what you meant by this. Would you mind rewording it?

Sure, In commit 0567fb2 you adjusted the readme with these changes which are completely correct.

image

But there are other changes that are changing the format of the README, like this one: image So I would like to have these other changes reverted.

Sorry about that, it seems like the Markdown editor I used auto formatted the file without me noticing. Good Catch!

Simply007 commented 2 years ago

Hello @JerRMartin,

I have merged the PR and released 4.6.0-SNAPSHOT.

Could you test out, if everything works as expected on your particular project (the guide is here)?

Once confirmed, I can promote the snapshot to the production version.

JerRMartin commented 2 years ago

Hello @JerRMartin,

I have merged the PR and released 4.6.0-SNAPSHOT.

Could you test out, if everything works as expected on your particular project (the guide is here)?

Once confirmed, I can promote the snapshot to the production version.

@Simply007 Looks Great! I'd say its ready to be promoted!

Screen Shot 2022-06-20 at 12 47 47 PM
Simply007 commented 2 years ago

Version 4.6.0 is out!

https://repo1.maven.org/maven2/com/github/kentico/kontent-delivery/