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

Improvements on console UI for install command #4559

Merged
merged 21 commits into from
Aug 2, 2022

Conversation

promatik
Copy link
Contributor

WHY

BEFORE - What was wrong? What was happening before this PR?

This PR aims part of the idea reported on Laravel-Backpack/community-forum#163.

AFTER - What is happening after this PR?

Backpack installation is now much more complete, and in sync with the latest console UI changes on Laravel 9.21 — laravel/framework#43065.

image

image

Click below to expand more previews;

More previews image image image image image
2022-07-30.22-12-11.mp4

HOW

How did you achieve that, in technical terms?

Implementing manually the features we need from termwind (since it supports PHP8 only), it was not that hard since we need only a couple of them.

Is it a breaking change?

No 👌

How can we test the before & after?

Following the video above, and changing the branch of crud after it was installed.

@promatik
Copy link
Contributor Author

Key points of this PR.

image

To add new addons to the the list, it's as easy as add the require command class to this list;

image

It must follow a pattern, but it's also a matter of copy past from the others.

@promatik
Copy link
Contributor Author

promatik commented Jul 30, 2022

Another important note, since this inclues installation of paid addons, every paid addon must make sure about the same stuff;

  • composer repositories
  • authentication

Since that was done in DevTools require command, I used the same code, which made everything MUCH simpler.

Each Require addon command class is now less than 100 lines, and is readable 😌👌


#3843 may be closed by merging this one.

Copy link
Member

@tabacitu tabacitu left a comment

Choose a reason for hiding this comment

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

I FREAKING LOVE THIS! ❤️❤️❤️ Well done @promatik !

Beautiful & functional 👏👏👏

I want to merge this ASAP, so let's clean it up please 🙏 I have one big problem with it (the error I'm getting), other than that, I just changes the texts here and there. I want to test again after that error is fixed, then merge ASAP - this is a HUUUGE DX improvement.

src/app/Console/Commands/Install.php Outdated Show resolved Hide resolved
src/app/Console/Commands/Install.php Outdated Show resolved Hide resolved
src/app/Console/Commands/Install.php Outdated Show resolved Hide resolved
src/app/Console/Commands/Addons/RequirePro.php Outdated Show resolved Hide resolved
src/app/Console/Commands/Install.php Outdated Show resolved Hide resolved
src/app/Console/Commands/Install.php Outdated Show resolved Hide resolved
src/BackpackServiceProvider.php Show resolved Hide resolved
Copy link
Member

@tabacitu tabacitu left a comment

Choose a reason for hiding this comment

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

I LOVE IT! I love it, I love it, I love it! ❤️❤️❤️ Thanks @promatik !

I'm noticing a few design/visual changes we should be making here, to give the whole install process a coherent look & feel, mainly in terms of visual hierarchy.

But other than that... this is working WONDERFUL for me 👏👏👏
Much MUCH better than before.

src/app/Console/Commands/Install.php Outdated Show resolved Hide resolved
src/app/Console/Commands/Install.php Outdated Show resolved Hide resolved
src/app/Console/Commands/Install.php Outdated Show resolved Hide resolved
src/app/Console/Commands/Install.php Outdated Show resolved Hide resolved
src/app/Console/Commands/Install.php Outdated Show resolved Hide resolved
src/app/Console/Commands/Install.php Outdated Show resolved Hide resolved
src/app/Console/Commands/Addons/RequirePro.php Outdated Show resolved Hide resolved
src/app/Console/Commands/Install.php Show resolved Hide resolved
src/app/Console/Commands/Install.php Outdated Show resolved Hide resolved
promatik and others added 3 commits August 1, 2022 15:20
@promatik promatik assigned tabacitu and unassigned promatik Aug 1, 2022
@tabacitu
Copy link
Member

tabacitu commented Aug 1, 2022

I FREAKING LOVE THIS! EXCELLENT WORK @promatik !!!

happy_dance_cap

@pxpm could you please double-check? I want to launch this ASAP.

@tabacitu tabacitu assigned pxpm and unassigned tabacitu Aug 1, 2022
promatik and others added 2 commits August 2, 2022 11:36
Removed questions after being answered
[ci skip] [skip ci]
@pxpm
Copy link
Contributor

pxpm commented Aug 2, 2022

Hey guys. First of all, nice work @promatik, I think this "beauty terminal" has some real value!
So my usability tests so far and my feedback, nothing major I guess:

1) I think it would be usefull to have default values for the user questions (name/email/password).
User: Admin user,
Email: [email protected]
Password: s3cretPa$$w@rD-

2) I think it would help in the "resume of created user" to include the password too so it could be copy-pasted:
image

3) Would it be cumbersome to add some validation ? Nothing fancy, just like:

  • Name - required|max:(limit of table)
  • email - (valid format)|max:(limit of table)
  • password - min 8|max:(limit of table)

Avoiding things like:
image
image

4) Wouldn't be better to add some more "focus" on the numbers for the addons ? Maybe indent them inside the question and add some [1] or (1) or « 1 » -
image

I will review the code in a separate thread.

Cheers

$this->note('(Find your access token details on https://backpackforlaravel.com/user/tokens)');
$username = $this->ask('Access token username');
$password = $this->ask('Access token password');

Copy link
Contributor

Choose a reason for hiding this comment

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

We know we have some "pitfalls" when user adds wrong authentication, and then it's cached and then you need to dabble a little bit in your brain how to fix it (the issues we found in the other PR this one replaced).

I think it would atleast help if we do minimal validation here like, not empty and atleast min:xx characters (the number configured in backpack application to generate tokens).

It will not solve all the problems but atleast will prevent "simple" mistakes:

  • pressing enter twice;
  • not copying correctly from backpack website;
  • not pasting correctly on the console;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice idea, will do it 👌
I'll add simple validations to all the inputs.

Copy link
Member

Choose a reason for hiding this comment

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

I agree. But let's make a separate issue please. This doesn't relate to the current PR, it's an unrelated improvement.

@tabacitu
Copy link
Member

tabacitu commented Aug 2, 2022

In regards to Pedro's comment above:

  1. I think it would be usefull to have default values for the user questions (name/email/password).

I'd rather not add defaults at all. I don't want people creating the stock admin, and knowing you can "probably" try that email or email/password combo in all Backpack admin panels. Let them choose their own admin & password, no defaults.

  1. I think it would help in the "resume of created user" to include the password too so it could be copy-pasted:

Maaaybe... I don't know... I'll let @promatik decide about this one. Feels odd to echo the password, when the field itself will not echo the password.

  1. Would it be cumbersome to add some validation ? Nothing fancy, just like:

Yeah we should probably add validation. Bonus points if we re-use the validation from Registration or something. Then again this would make the whole process a lot more difficult, maybe you actually WANT to add an admin on localhost that is "admin" and "password" just so it's easy. It's localhost after all. So maybe we just add required as validation? Not a prio, but let's do it in a separate issue please. Then again... I like of LIKE the SQL error it throws - so yeah... low prio, I think.

  1. Wouldn't be better to add some more "focus" on the numbers for the addons ? Maybe indent them inside the question and add some [1] or (1) or « 1 » -

Yeah I also wish the numbers would be a little more evident.

@tabacitu
Copy link
Member

tabacitu commented Aug 2, 2022

@promatik let's wrap this up, I want to merge and tag it ASAP please 🙏 Please add separate issues for any other suggestions here, and we'll do them one-by-one. Nothing I see here is worth postponing the merge, in my opinion - not even my suggestions.

To rephrase the importance: Every day we delay merging this, we offer a sub-par installation experience to hundreds of devs. When we have a much much better one ready!

Is this ready for me to click the merge button?

obsessive-compulsive-animation-gif-by-michael-frei

@pxpm
Copy link
Contributor

pxpm commented Aug 2, 2022

Apart from what I already wrote, this is working fine, you can hit that button ✅

@tabacitu tabacitu assigned promatik and unassigned pxpm Aug 2, 2022
@promatik
Copy link
Contributor Author

promatik commented Aug 2, 2022

@tabacitu @pxpm the use count message is reverted.
This is ready to merge, I think 🙌


I'll add a PR with WIP for everything discussed here;

  • Validate user fields
  • Validate auth.json token fields
  • Generate a password in case user left it blank (only in that case, show it to the user)

@tabacitu tabacitu merged commit 6339e9c into main Aug 2, 2022
@tabacitu tabacitu deleted the install-console-ui-improvements branch August 2, 2022 16:47
@tabacitu
Copy link
Member

tabacitu commented Aug 2, 2022

@promatik - awesome, yes, please do send a separate PR for that.
@pxpm - I answered your concerns in the inline comment. Future will tell. I'm not ashamed to admin when I'm wrong 😀

I've just MERGED this. I'm so so glad about having this, some might call this small but it is a pretty BIG improvement. And a BIG step in the right direction. Let's polish this onboarding process some more 👏👏👏

Thanks guys!

@tabacitu
Copy link
Member

Writing about this in our Progress Report. So so happy with it ❤️ Just look at this beauty:
CleanShot 2022-08-19 at 11 42 06

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants