So I been trying to chip in and create some custom components, to hopefully inspire other UD addicts to do the same. So I found this project here:- https://sweetalert2.github.io/#examples
and I thought this looked super cool, and had way more bling than your standard toast notification. As I love bling that I cannot afford I thought I would create this little beauty for UD. So next I found someone implementing this into ReactJs here:- https://github.com/kessejones/react-sweetalert2 then as I’m no react pro, I did some testing and building and here is a sneak peek:-
I will be uploading this to powershell gallery and github tomorrow but I hope you like what you see? I will make sure to make a readme for this as well.
Thanks @mylabonline much appreciated. Yeah the new-udbutton is expecting a json script block I believe, and I couldnt get it to work with that. It does work on it’s own and has a timer, or does work nicely on new-uninputaction as I have hopefully put in the readme.
I mean I don’t know if you looked at https://sweetalert2.github.io/#input-types
But yeah there is a lot more this can do. I would definatly like to develop this a bit more, just need to beef up my react skills.
Please feel free to post any issues on this or things you would like to see on the gihub repository associated with this https://github.com/psDevUK/UDsweetAlert
Many Thanks
adding this now
Ok telling you this on a side note…life with 4 kids (all girls) is real tough…anyways, I saw this being an easy upgrade I have now published the version 1.0.1 to powershell gallery
Yeah…as mentioned in previous post I believe this is looking for a json formatted script, and you’d have to pass the parameters as pscutom objects…or thats what I figured from watching youtube vid and inspecting the react element using the firefox react tool I installed.
So I couldn’t get it to work on a normal button, hence the example I have given is on the new-UDinputAction command where it just runs as expected. Think I need to upload the root folder onto the github repo I got then shout for some help in the development area…I mean it works if I render my own HTML button in the JSX but then you have a standard grey crappy looking HTML button, so I’d then have to include the materialize library for the button…I mean I know I done a few components now but still learning as I’m going.
Spent like an hour or more late last night trying to get the input to work with no luck so I might have to ask a man who can on this one for some development tips…
This happens with input fields for me when there was an unhandled error or unhandled output. Say a command was ran with -passthru and it’s output was not set to a variable.
Why does this not happen in your example, but when I run the github example it occurs.
Hi @gerane thanks for trying out this component. So I thought everything worked but sadly the input doesn’t. I tried to fix something else the spinner animation and broke the underlying JSX file. Doh! However I am now looking at sweetalert as better documentation for people who are not react jsx pros. I do have a github repo for this so this is on my TO DO list. Peace
P.S I used the poshud demo of input to take the input as a parameter then display the parameter name in the sweeralert2 window
after the alet display it unmount the input , if you upload your source code to github the jsx files and not only the js bundle file maybe i could help you.
Yo @gerane I forgot to welcome you to the community HELLO and WELCOME to the UD forums! Now that is over and done with and I have had a lovely chinese take-away to fuel my brain, here is the code behind my GIF:-
Hope this helps you out, let me know if I can help more, but this is still a WIP but I was so excited I released it a tad too early…as mentioned this will wipe out the underlying input box…but I am sure @AlonGvili has plenty of tricks to show me on making this better. Peace
P.S depending how new you are to UD you don’t need the end point initialization in 2.6.1 and above I believe, but as I been using UD for a little while now I have used it in this demo.