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
UX Design - Template Step - validation and error display #3662
Comments
@phantomjinx - is this something we hope to get in for 7.2? I'm asking because it's not required from the user story #3047. Do you have screenshots of what these validation errors may look like? How are they different from just the validation happening in the text editor? |
@dongniwang To your broader question, we should be able to get this in before the end of the sprint. A simple error message that appears underneath the editor box, updates on each keypress and disappears if parsing is fine should not be a problem, I think. There is a slight wrinkle that may need looking at. A further parsing check is required; to explain:
Therefore, an extra parsing function needs to be included to enhance mustache's parsing. @gaughan @michael-coker |
Design decisions from follow-up meeting:
@dongniwang @michael-coker - review please. |
If that's possible, sounds great. But I would be fine with the browser default behaviors for dragging a file. That would also match our current DnD UI in the integration importer and API client connector upload.
Yep, I can handle that by manipulating a class on the main element on the |
@phantomjinx @michael-coker - looks good to me, thanks so much for capturing the decisions! I'll upload the design file to the UX design tracker as well. |
@phantomjinx fyi, came across this, not sure if you've seen it - https://codemirror.net/demo/lint.html that looks like a good way to show code errors. |
On 02/10/18 22:09, Michael Coker wrote:
@phantomjinx <https://github.com/phantomjinx> fyi, came across this, not sure if you've seen it -
https://codemirror.net/demo/lint.html
that looks like a good way to show code errors.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3662 (comment)>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABjvhAVLMyakecZaYxVde6ExJ_iv74KHks5ug9YNgaJpZM4W3UPx>.
Hi Michael,
Thanks, looked into it, run with it and will push a commit for your review, by hopefully, end of
(my) day.
Dongni: Are you ok with varying the design to include this?
Cheers
PGR
…--
Paul Richardson
* p.g.richardson@phantomjinx.co.uk
* Ty-Carreg Barn, Penyrheol, Pontypool, Torfaen. NP4 5XZ
* (home) 01495 762483
* (mob) 07980 869490
"There is no operating system on the planet that can withstand a determined assault from a clueless
user."
"I know exactly who reads the papers ...
* The Daily Mirror is read by people who think they run the country.
* The Guardian is read by people who think they ought to run the country.
* The Times is read by people who do actually run the country.
* The Daily Mail is read by the wives of the people who run the country.
* The Financial Times is read by the people who own the country.
* The Morning Star is read by the people who think the country ought to be run by another country.
* The Daily Telegraph is read by the people who think it is."
Jim Hacker, Yes Minister
|
@phantomjinx - yes! That's totally fine with me. Thank you! |
@michael-coker Ok.... here is the 2 commits for the new and improved editor ... my-branch It should be good to test but let me know any problems, including if you need a PR instead? |
@phantomjinx great, thanks! I'll work from your branch. |
@phantomjinx the validation stuff looks great!! @dongniwang now that we have that inline validation in place in the editor itself, do we need to show the validation errors below the template editor? When you hover over the validation errors in the template editor, you get the details about the validation error. |
@michael-coker thanks. So I left the validation-under-editor in just because its per the design (and took a couple of hours last night to get right!). However, it is now redundant given mostly everything it displays in now inline. I say mostly because the MustacheMode class does not delegate to the Mustache library's own parse function, whereas the onChange() function of templateComponent.ts does. The purpose of calling this is to get Mustache to break up the text into symbols and text which then form the specification of the OutputDataShape. However, it does also spit out an errors if the text doesn't parse. The downside of this error is that it does not do it by line/column but by character number so doesn't fit with the inline error messages.
Therefore, probably put a pin in this one and revisit maybe at later stage. |
Yeah, I think the inline validation looks pretty awesome! Thank you @phantomjinx and @michael-coker for working on this! I agreed that the error message below the editor is not providing additional useful and helpful information and we can remove that for the template step. However, I think it's still a good functionality to keep in our back pocket and it could be very useful if we have other types of error messages we want to display or to complement the editor in the future. Thank you so much @phantomjinx for spending hours on this and I really appreciate you took the effort to match UI implementation with the UX design! |
Hey @phantomjinx, I made some minor updates to the UI and got the placeholder/hover overlay text working except that the Do you have any ideas? Those events seem to work fine in this example - http://jsfiddle.net/3pvvLote/69/ Also a small thing, but I noticed you can drop non And I removed the validation output from the HTML/CSS templates but left the typescript in there for you to remove in case it's used in a way I don't understand. |
So, by default, codemirror will let any file be dropped. This can be limited by included allowDropFileTypes in the configuration. The problem is specifying what the file-types are that can be included since it requires the MIME type of the file rather than the extension. A standard .tmpl text file has no MIME type and therefore is rejected. It is possible to get the $event during the drop and interrogate the DataTransfer object but that could be browser/OS specific and a real can-o-worms. @michael-coker |
@michael-coker I'll go ahead and create a PR just to get the rest of it in as I don't think this the issues are detrimental to the whole. |
* Reworks the template-step page to have the editor permanently displayed. syndesisio#3662
* Reworks the template-step page to have the editor permanently displayed. syndesisio#3662
@dongniwang @phantomjinx Just wanted to touch base about this and see if we can re-visit the 2 remaining issues from this. Not sure if I should open another issue or want to keep track of these here?
My initial thought about being able to drop any kind of file in the codemirror editor is, from what I tested, codemirror allows files with text in them (txt, json, css, html, hbs, etc), but not files that aren't just text (PDF, jpg, etc). What if we changed the "allowed file types" text to match whatever codemirror's restrictions are? Also, if you try to drop a PDF in the codemirror editor, there is no error message. Can we display one? And I'm not sure about the hover overlay |
@michael-coker @phantomjinx - Assuming with the latest work from #3763, we can close this issue now? |
@dongniwang I think so, all of my original issues have been addressed. |
Awesome, closing now. Will open new issues if needed. Thank you! |
This is a...
The problem
Expected behavior
Screenshot
https://redhat.invisionapp.com/share/VQ8UZ7PCE#/318752828_Template_Step_V3-1_9-6_3
@michael-coker @phantomjinx
cc: @syndesisio/uxd
The text was updated successfully, but these errors were encountered: