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: add xml validation tool #525

Merged
merged 15 commits into from
Jun 19, 2022
Merged

Conversation

gm0stache
Copy link
Contributor

@gm0stache gm0stache commented May 15, 2022

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • UI change (please include screenshot!)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Internationalization and localization
  • Other (please describe):

What is the current behavior?

Currently there is no tool available in DevToys to enable a developer to validate XML data against a XSD schema.

Issue Number: #171

What is the new behavior?

  • a new XmlValidator tool page was created
  • logic was added to support validating XML data with a XSD schema
  • unit tests were added to assert the functionality of the XML validation logic

Other information

Quality check

Before creating this PR, have you:

  • Followed the code style guideline as described in CONTRIBUTING.md
  • Verified that the change work in Release build configuration
  • Checked all unit tests pass

@veler veler linked an issue May 15, 2022 that may be closed by this pull request
@veler
Copy link
Collaborator

veler commented May 17, 2022

Hi,
Thank you for this pull request. :)
Can you please address the merge conflict? Also, on my side, the solution doesn't build for some reason. 🤔

@gm0stache
Copy link
Contributor Author

Hi Etienne!
Thanks for the fast feedback!
I will look into it 😅

@gm0stache
Copy link
Contributor Author

gm0stache commented May 19, 2022

Alright, so the app should start now - sorry for the inconvenience!
As far as I can tell the changes in the src/dev/impl/DevToys/DevToys.csproj file (causing the conflict) are ok...

@veler
Copy link
Collaborator

veler commented May 21, 2022

Alright, so the app should start now - sorry for the inconvenience! As far as I can tell the changes in the src/dev/impl/DevToys/DevToys.csproj file (causing the conflict) are ok...

Thank you :) Unfortunately I still see a merge conflict indicated by GitHub. It looks like your branch doesn't have the last changes from the main branch.

@gm0stache
Copy link
Contributor Author

...one noob mistake after another .XD
So sorry - just rebased from main.

@veler
Copy link
Collaborator

veler commented Jun 5, 2022

Hello,

So sorry for the late answer. Wow, it's been 15 days already >.<

I gave a try to your pull request and overall, I love it! :D It's such a great tool and great execution!

One thing that bother me is the UI, but I can provide some guidance for it 😉

  1. In most of tools, there's no need of a "convert", "compare" or "validate" button. The simple fact that the text fields change make the app doing the work on the user input. This is even more true in Cheksum Generator tool, where Output Comparer will show an info bar indication if the has are equal.
    image
    image
    image
    Therefore, I would suggest the following approach:
    • When XSD input changes, if XML input isn't empty, do the validation.
    • When XML input changes, if XSD input isn't empty, do the validation.
    • When one of the two input is empty, don't do the validation (unless there are some cases where an empty XSD / XML can be a valid input? 🤔)
    • And therefore, remove the Validate button.
  2. To be consistent with other tools like Checksum Generator, replace this UI by an InfoBar.
    image
    A pre-made UI component exists for it. See an example here:
    https://github.com/veler/DevToys/blob/d1be28ed5837f02c5ed2a4b08185f872f54a2a8c/src/dev/impl/DevToys/Views/Tools/Generators/CheckSumGenerator/CheckSumGeneratorToolPage.xaml#L87-L92
  3. Make the text editor showing the XML colorization syntax. Here is how you can do this: https://github.com/veler/DevToys/blob/d1be28ed5837f02c5ed2a4b08185f872f54a2a8c/src/dev/impl/DevToys/Views/Tools/Formatters/XmlFormatter/XmlFormatterToolPage.xaml#L93-L101

What do you think? 😊

Thank you, and sorry again for the late answer. Please let me know if you have any question.

@gm0stache
Copy link
Contributor Author

Hi Etienne!
First of all: no worries - I am very thankful for your detailed response!
I love all your suggestions and will implement them!
I am on vacation for the rest of the week, but I will start working on it right afterwards 🙂
Thanks again and have a nice week!

@veler
Copy link
Collaborator

veler commented Jun 7, 2022

Hi Etienne! First of all: no worries - I am very thankful for your detailed response! I love all your suggestions and will implement them! I am on vacation for the rest of the week, but I will start working on it right afterwards 🙂 Thanks again and have a nice week!

That sounds great to me! :D Enjoy your vacation, and thank you again for your contribution!

@gm0stache
Copy link
Contributor Author

Hi Etienne!
Was able to address the issues already!
Hope you find everything as expected 😄

Copy link
Collaborator

@veler veler left a comment

Choose a reason for hiding this comment

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

Hello 😊
Thank you for the update. Very great progress overall! It feels almost ready for production!
I left some additional comments. Please let me know if you have any question or need any help.

Thank you again for this contribution, I'm excited to see this in DevToys 😁🥳

@gm0stache
Copy link
Contributor Author

Hi Etienne!
Wow! Thanks for your extensive feedback!
I am currently addressing all the things you mentioned - will be finished this weekend😃
Have a nice weekend!

@gm0stache
Copy link
Contributor Author

gm0stache commented Jun 19, 2022

Hi Etienne,
I addressed all threads.
Let me know if there is anything else coming to your mind!
All the best from Germany!

P.S.: Rebased the latest changes from main already. (I am learning 😅😋)

@gm0stache
Copy link
Contributor Author

Ah, and don't be confused - I just updated my username and picture.
Think it makes interactions more personal 😊

Copy link
Collaborator

@veler veler left a comment

Choose a reason for hiding this comment

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

It looks all great now! Thank you so much for offering this new tool. It will be shipped in the next update 🎉😁

@veler veler merged commit a830fdd into DevToys-app:main Jun 19, 2022
@gm0stache
Copy link
Contributor Author

Awesome!
Thank you for all of your help!
Have a great time!

veler pushed a commit that referenced this pull request Mar 31, 2023
* feat: add xml validation tool

The introduced tool allows to validate XML data against a XSD schema.

Refs: #171

* fix: revert manifest changes

* fix: remove 'validate' button

* feat: use standard info dialog

* chore: delete unused assets

* refactor: delete unused code

* feat: add new tool icon

* feat: add 'enable nullable' directive

* feat: adjust accessibility levels

* refactor: apply code convention

* feat: display info bar at startup

* fix: adjust overlay view layout

* feat: support SmartDetection

* fix: validation execution

* fix: remove unnecessary localization

Co-authored-by: davidTigris <[email protected]>
Co-authored-by: davidTigris <davidTigris [email protected]>
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.

Validate XML Using XML Schema
2 participants