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

Add support toggling json view of schemas in CreateSchemaForm #939

Merged
merged 9 commits into from
Dec 12, 2023

Conversation

Gavinok
Copy link
Contributor

@Gavinok Gavinok commented Dec 1, 2023

This pr resolves #921 by introducing a standard way to toggle between the json representation of a schema as seen below.

  • Like on the issuance, there's a toggle for JSON entry on the schema popup
  • When you toggle back and forth from JSON to fielded entry, it keeps the 2 in sync
  • Invalid JSON gives a warning message, same as on issuance*.

*: For consistency invalid JSON is not allowed in this new component. How this error is indicated will be handled by the parent components.

Regular representation:
2023-12-01_12-22-44

JSON representation:
2023-12-01_12-23-07

The two are always kept in sync when switching. This way users can enter
some fields via the JSON view and other fields using the regular list view.

Here is an example of the attribute list being updated and reflected in the regular list view.

Change made in the JSON view:
2023-12-01_12-23-33

Resulting change seen in the list view:
2023-12-01_12-23-44

To reduce duplication of code I have adapted the code used in EnterCredentialValues.vue and extracted the functionality of toggling to a JSON view into it's own common component ToggleJson.

@Gavinok Gavinok requested a review from loneil December 1, 2023 20:43
@loneil
Copy link
Contributor

loneil commented Dec 1, 2023

Just adding to note to hold any merging until after Emiliano cuts the next release for Traction to go to Test and Prod.

@Gavinok Gavinok marked this pull request as draft December 1, 2023 21:41
@Gavinok Gavinok marked this pull request as ready for review December 4, 2023 19:56
@loneil
Copy link
Contributor

loneil commented Dec 6, 2023

@Gavinok could request a review from @jamshale if needed while I'm away.

@jamshale
Copy link
Contributor

jamshale commented Dec 6, 2023

This is a really good feature. We should have others tickets to do this for other objects, when we see them. It aligns for with the swagger api, which I think will be good in training scenarios and following existing documentation.

jamshale
jamshale previously approved these changes Dec 6, 2023
Copy link
Contributor

@jamshale jamshale left a comment

Choose a reason for hiding this comment

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

Really nice work!

Unit tests are annoying, but some could be considered. Especially in the ToggleJson component which will likely be reused or changed in the future.

@Gavinok
Copy link
Contributor Author

Gavinok commented Dec 6, 2023

Really nice work!

Unit tests are annoying, but some could be considered. Especially in the ToggleJson component which will likely be reused or changed in the future.

Sure thing I'll try adding them now

@Gavinok Gavinok marked this pull request as draft December 7, 2023 23:32
@Gavinok Gavinok marked this pull request as ready for review December 11, 2023 22:39
Signed-off-by: Gavin Jaeger-Freeborn <[email protected]>
@Gavinok Gavinok merged commit cba33cc into main Dec 12, 2023
11 checks passed
@loneil loneil deleted the toggle-json-for-schema branch June 11, 2024 21:03
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.

In the tenant UI allow schema creation with a JSON blob
3 participants