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

[FIX] Allow different text cases on component create #1454

Merged

Conversation

dansysanalyst
Copy link
Member

⚡ PowerGrid - Pull Request

Welcome and thank you for your interest in contributing to our project!. You must use this template to submit a Pull Request or it will not be accepted.


Motivation

  • Bug fix
  • Enhancement
  • New feature
  • Breaking change

Description

This Pull Request changes the powergrid:create command, keeping the text case informed by the user unaltered, while still trying to normalize and prevent mistakes. Before, we tried to fix/standardize the component paths, thus preventing user errors.

With this PR, we also disable the possibility to create components with dashes or underscores in the name. While PSR-4 cna can resolve underscores in namespaces, this is not very "Laravel like" and users are welcome to rename their folders and namespaces as they want, after the component is created.

   Enter a name for your new PowerGrid Component:

    Dispatch\ServiceCalls\ServiceCallIndexTable

    Dispatch.ServiceCalls.ServiceCallIndexTable
 ⚡ ServiceCallIndexTable was successfully created at [app/Livewire/Dispatch/ServiceCalls/ServiceCallIndexTable.php].

 💡 include the ServiceCallIndexTable component using the tag: <livewire:dispatch.servicecalls.service-call-index-table/>

 👍 Please consider ⭐ starring ⭐ our repository. Visit: https://github.com/Power-Components/livewire-powergrid

When using special characters:

   Enter a name for your new PowerGrid Component:

     tables/my-tables/UserTable

     tables/my_tables/UserTable

     tables/my-tables/@!$#UserTable

Will result in:

 ⚡ UserTable was successfully created at [app/Livewire/tables/mytables/UserTable.php].

 💡 include the UserTable component using the tag: <livewire:tables.mytables.user-table/>

 👍 Please consider ⭐ starring ⭐ our repository. Visit: https://github.com/Power-Components/livewire-powergrid

Related Issue(s): #1450.

Documentation

This PR requires Documentation update?

  • Yes
  • No
  • I have already submitted a Documentation pull request.

@dansysanalyst
Copy link
Member Author

PostgreSQL test failing for an unrelated reason (see PR #1455).

@luanfreitasdev
Copy link
Collaborator

Thank you @dansysanalyst !

@luanfreitasdev luanfreitasdev merged commit e908265 into Power-Components:5.x Mar 10, 2024
14 of 15 checks passed
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.

2 participants