Skip to content

Commit

Permalink
Fix more doc typos (#26)
Browse files Browse the repository at this point in the history
* Fix docs typos
  • Loading branch information
cvetty authored Jul 1, 2024
1 parent ee6f3af commit 21f8dd4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 21 deletions.
18 changes: 6 additions & 12 deletions docs/contribution.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
# Contribution

## Bugs Reporting
For any issues that you find, don't hesitate to raise a GH issue and then create
a PR with some suggested fixes.
For any issues that you find, don't hesitate to raise a GH issue and then create a PR with some suggested fixes.

## Features Proposing
For any feature ideas, again - please raise a GH issue with a descriptive title and a nice description
of the feature. If you create a PR for it, the issue will get more attention, and it will be pushed forward
faster.
For any feature ideas, please create a GitHub issue with a descriptive title and clear description.
Creating a pull request for it will attract more attention to the issue and speed up the process.

## Contribution Flow
As Krait library is actually a combination of PHP and NPM packages, we can't fix the bug in an already published
version (NPM has restrictions about the Packages Republishing). So we suggest you to always start from the `main` branch
as this is the latest branch that will be deployed (as next version of the package).
As the Krait library is a combination of PHP and NPM packages, we can't fix the bug in an already published version (NPM has restrictions about the Packages Republishing). So we suggest you always start from the main branch as this is the latest branch that will be deployed as the next version of the package.
For any PRs, please attach the correct GH labels and provide a clear title and description (it would be even better if there is a GH issue attached as well).

For any PRs, please attach the correct GH labels and provide a clear title and description (it would be even better if
there is a GH issue attached as well).

Please keep your PRs in `draft` state until they are ready for review.
Please keep your PRs in a `draft` state until they are ready for review.

## Coding Style
Please run the following commands and ensure that there aren't any failures before pushing your PR for review.
Expand Down
18 changes: 9 additions & 9 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ class UsersTable extends BaseTable
- The `additionalData` method is the place for defining data that should be passed along with the column values to the front-end.
- The `name` method returns the table name that's used for creating the routes.

As you can see, all columns are defined in the `initColumns` method using the `column()` class helper.
As you can see, all columns are defined in the `initColumns` method using the `column()` class helper.
You can find more information on all column attributes and properties in the [Core Components Columns Section](/core-components/#table-columns).
The Table Definition Class is a flexible way to define columns, they can even be fetched from a third party library/dataset.
The Table Definition Class is a flexible way to define columns, they can even be fetched from a third-party library/dataset.

Logically, we can associate these "Table Definition" classes with the `model` part of the `model-view-controller` pattern.

Expand Down Expand Up @@ -96,12 +96,12 @@ class UsersTableController extends Controller
}
```

The `UsersTable::from` static method returns an API resource collection class that contains the
The `UsersTable::from` static method returns an API resource collection class that contains the
correct table response structure, which the front-end will consume.

You can pass `arrays`, `collections` (both Eloquent and Regular ones).
You can pass `arrays`, and `collections` (both Eloquent and Regular ones).

This is the place where you can fetch the data and then pass it to the already defined table.
This is the place where you can fetch the data and then pass it to the already-defined table.
For example, if we want to fetch all `users`, we will write something like:

```php
Expand Down Expand Up @@ -154,11 +154,11 @@ defineProps({
<style scoped lang="scss"></style>
```

In most cases you will not update the `apiEndpoint` and the `tableName` props of the `DynamicTable`
In most cases, you will not update the `apiEndpoint` and the `tableName` props of the `DynamicTable`
component. The `DynamicTable` component uses [slots](https://vuejs.org/guide/components/slots.html)
to provide you with a way to manipulate the front-end representation of the data.
to provide an easy way to manipulate the front-end representation of the data.

- the `record` object contains the values for all columns (defined in the Table Definition Class)
- the `record` object contains the values for all columns (defined in the Table Definition Class)
- the `column` object contains all column properties (from the DTO class [`TableColumnDTO`](https://github.com/mtrdesign/krait/blob/main/krait/src/DTO/TableColumnDTO.php))

#### Implementing the Table in Blade Template
Expand All @@ -184,7 +184,7 @@ The Krait configurations are placed in the `config/krait.php` file.
| `krait_path` | **string** | The internal Krait API path prefix (for Krait actions). |
| `tables_path` | **string** | The Tables API path prefix (used to generate the routes for all registered tables). |
| `middleware` | **array** | List of middlewares that should be applied to all Krait routes. |
| `use_csrf` | **bool** | Flags if all Krait front-end request should contain the CSRF token. |
| `use_csrf` | **bool** | Flags if all Krait front-end requests should contain the CSRF token. |

???+ warning "Current Package Version Requires Authentication"
For now, Krait works for registered users only. We will expand it for unauthenticated usage in the upcoming versions.

0 comments on commit 21f8dd4

Please sign in to comment.