Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
luanfreitasdev committed Nov 2, 2021
2 parents 5b8690a + 17fe286 commit 87a9ebb
Show file tree
Hide file tree
Showing 10 changed files with 220 additions and 7 deletions.
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Bug report
about: Create a report to help us improve
title: Create a report to help us improve
labels: bug
assignees: luanfreitasdev

---

**Describe the bug**

* ..

**To Reproduce**
* Got to ..

**Laravel version (exactly):**
* 8.x.x ?

**Alpine version:**
* 3.x.x ?

**Theme:**
- [ ] Tailwind
- Version:

- [ ] Bootstrap
- Version:

**Screenshots** (***This helps to understand better***)



**Do you have any idea how we can fix it?**
107 changes: 107 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<div align="center">
<p><img src="art/header.jpg" alt="PowerGrid Logo"></p>
</div>

------

# How to contribute with PowerGrid

This article's objective is to facilitate the process of collaborating with [PowerGrid](https://github.com/Power-Components/livewire-powergrid).

## 1) Fork the project
To fork PowerGrid, you simply have to access the repository's page [PowerGrid](https://github.com/Power-Components/livewire-powergrid) and click *Fork*:<br />
<img src="https://raw.githubusercontent.com/Power-Components/como-contribuir-com-o-powergrid/main/img/click-to-fork.png" /><br />
As a result, you should have something similar to https://github.com/cpereiraweb/livewire-powergrid.<br />
Note: If you are a member of different teams or organizations, you must select which account you will be forking to.

## 2) Clone your fork repository to your computer
Select or create a new folder at your computer where you want to store project files:<br />
<img src="https://github.com/Power-Components/como-contribuir-com-o-powergrid/blob/main/img/cloning-repo.png?raw=true">

## 3) Create a new branch and push it to your repository
Access the repository's folder:
```bash
cd livewire-powergrid
```
Create a new branch (For instance, my own name as the branch name):
```bash
git checkout -b cpereiraweb
```
You need to push this branch to the server. As a suggestion, create a TODO.md file at the project's root. Add it and commit.
```bash
touch TODO.md
git add .
git commit -m "Added TODO.md"
git push origin cpereiraweb # Use your branch name here, ok?
```
## 4) Add PowerGrid to your Laravel project
Open your Laravel's project and install the component as described in its documentation.
```bash
composer require power-components/livewire-powergrid
```
## 5) Configure ```composer``` to use your own PowerGrid clone
You will need to inform `composer` that you want to use a developing version of this package and where is this version located.
This is very simple to do:
Open composer.json file and locate the PowerGrid requirement line:
```json
"power-components/livewire-powergrid": "^1.0",
```
Following what I have done so far, I will configure the version which must be `dev-`+`your-branch-name`. Following our example: `dev-cpereiraweb`:
```json
"power-components/livewire-powergrid": "dev-cpereiraweb",
```
The second step is to inform where is the repository located. To do so, we add the section `repositories` to the `composer.json` file.
In this section you can inform either your Github repository URL or indicate its path on your local machine.

The example below uses the GitHub repository URL:
```json
...
"spatie/laravel-ray": "^1.17",
"wulfheart/pretty_routes": "^0.2.0"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/cpereiraweb/livewire-powergrid.git"
}
],
"autoload": {
...
```

And, the next example shows the version with your local path:
```json
...
"spatie/laravel-ray": "^1.17",
"wulfheart/pretty_routes": "^0.2.0"
},
"repositories": [
{
"type": "path",
"url": "Z:\\Code\\forks\\PowerComponents\\livewire-powergrid"
}
],
"autoload": {
...
```

Note: The example above shows a Windows OS path. If you are a `WSL`, `Docker`, `Linux` or `MacOS` user, you must adapt this path to your system's format.
For example: `/home/cpereiraweb/code/forks/PowerComponents/livewire-powergrid`.

## 6) Run `composer update` command
Now, just run `composer update` command inside your Laravel project so composer can update its references. See below the result using the repository link:<br />

<img src="https://github.com/Power-Components/como-contribuir-com-o-powergrid/blob/main/img/composer-update.png?raw=true"><br />
The image shows the commits at my repository. First, I had installed the commit `219cdd8`. Now, at the image above you can see that it has been updated to the commit `65ae610`.

If you had your `composer.json` configured to use a local path instead, you should have a result similar to this:<br/>
<img src="https://github.com/Power-Components/como-contribuir-com-o-powergrid/blob/main/img/composer-update-local-repo.png?raw=true"><br />&nbsp;<br />

You may notice that the GitHub's version was removed and it was replaced by the local version. The commit indications are no longer displayed. With this configuration, I am not required to `push` my fork nor run `composer update` in my Laravel Project. It is a more dynamic process.

## It's all set!
Now, just follow the regular flow of any Git project. Perform any changes to your own fork and push to Github.
Always run `composer update` inside your Laravel project to update the codes used in your project.
That's it. Clean procedure and no MOP*.

\*(*[MacGyver](https://www.lexico.com/definition/macgyver)-oriented Programming*)
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Power Components ⚡

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 2 additions & 2 deletions resources/lang/es/datatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
'filter' => 'Filtrar',
],
'labels' => [
'action' => 'Ações',
'action' => 'Acción',
'results_per_page' => 'Registros por página',
'clear_filter' => 'Borrar filtro',
'clear_filter' => 'Borrar el filtro',
'no_data' => 'No se encontraron registros.',
'all' => 'Todos',
'selected' => 'Seleccionado',
Expand Down
45 changes: 45 additions & 0 deletions resources/lang/tr/datatable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

return [
'buttons' => [
'filter' => 'Filtre',
],
'labels' => [
'action' => 'İşlemler',
'results_per_page' => 'Sayfa başına veri',
'clear_filter' => 'Filtreleri temizle',
'no_data' => 'Veri bulunamadı',
'all' => 'Tümü',
'selected' => 'Seçili',
],
'placeholders' => [
'search' => 'Arama yap...',
'select' => 'Dönem seç',
],
'pagination' => [
'showing' => 'Gösterilen:',
'to' => 'ile',
'of' => 'arası. Toplam:',
'results' => 'Sonuç',
'all' => 'Tümü',
],
'multi_select' => [
'select' => 'Seç',
'all' => 'Tümü',
],
'select' => [
'select' => 'Seç',
'all' => 'Tümü',
],
'boolean_filter' => [
'all' => 'Tümü',
],
'input_text_options' => [
'is' => 'Eşit',
'is_not' => 'Eşit olmayan',
'contains' => 'İçeren',
'contains_not' => 'İçermeyen',
'starts_with' => 'Başlayan',
'ends_with' => 'Biten',
],
];
2 changes: 1 addition & 1 deletion resources/stubs/PowerGridDemoTable.stub
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class PowerGridDemoTable extends PowerGridComponent
|--------------------------------------------------------------------------
| Include Columns
|--------------------------------------------------------------------------
| Include the columns aaded columns, making them visible on the Table.
| Include the columns added columns, making them visible on the Table.
| Each column can be configured with properties, filters, actions...
|
*/
Expand Down
4 changes: 3 additions & 1 deletion resources/stubs/table.fillable.stub
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ namespace App\Http\Livewire{{ subFolder }};

use {{ modelName }};
use Illuminate\Support\Carbon;
use Illuminate\Database\QueryException;
use Illuminate\Database\Eloquent\Builder;
use PowerComponents\LivewirePowerGrid\Button;
use PowerComponents\LivewirePowerGrid\Column;
use PowerComponents\LivewirePowerGrid\PowerGrid;
use PowerComponents\LivewirePowerGrid\PowerGridEloquent;
Expand Down Expand Up @@ -71,7 +73,7 @@ class {{ componentName }} extends PowerGridComponent
|--------------------------------------------------------------------------
| Include Columns
|--------------------------------------------------------------------------
| Include the columns aaded columns, making them visible on the Table.
| Include the columns added columns, making them visible on the Table.
| Each column can be configured with properties, filters, actions...
|
*/
Expand Down
4 changes: 3 additions & 1 deletion resources/stubs/table.model.stub
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ namespace App\Http\Livewire{{ subFolder }};

use {{ modelName }};
use Illuminate\Support\Carbon;
use Illuminate\Database\QueryException;
use Illuminate\Database\Eloquent\Builder;
use PowerComponents\LivewirePowerGrid\Button;
use PowerComponents\LivewirePowerGrid\Column;
use PowerComponents\LivewirePowerGrid\PowerGrid;
use PowerComponents\LivewirePowerGrid\PowerGridEloquent;
Expand Down Expand Up @@ -77,7 +79,7 @@ class {{ componentName }} extends PowerGridComponent
|--------------------------------------------------------------------------
| Include Columns
|--------------------------------------------------------------------------
| Include the columns aaded columns, making them visible on the Table.
| Include the columns added columns, making them visible on the Table.
| Each column can be configured with properties, filters, actions...
|
*/
Expand Down
4 changes: 3 additions & 1 deletion resources/stubs/table.stub
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace App\Http\Livewire{{ subFolder }};

use Illuminate\Support\Collection;
use Illuminate\Database\QueryException;
use PowerComponents\LivewirePowerGrid\Button;
use PowerComponents\LivewirePowerGrid\Column;
use PowerComponents\LivewirePowerGrid\PowerGrid;
use PowerComponents\LivewirePowerGrid\PowerGridCollection;
Expand Down Expand Up @@ -60,7 +62,7 @@ class {{ componentName }} extends PowerGridComponent
|--------------------------------------------------------------------------
| Include Columns
|--------------------------------------------------------------------------
| Include the columns aaded columns, making them visible on the Table.
| Include the columns added columns, making them visible on the Table.
| Each column can be configured with properties, filters, actions...
|
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/FilterNumberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

it('properly filters by "min & max" formatted')
->livewire(DishesTable::class)
->set('filters', filterNumber('price', '1,50', '20,51', '.', ','))
->set('filters', filterNumber('price', '1,50', '20,51','.', ','))
->assertSeeHtml('Pastel de Nata')
->assertSeeHtml('Peixada da chef Nábia')
->assertDontSeeHtml('Carne Louca');
Expand Down

0 comments on commit 87a9ebb

Please sign in to comment.