Skip to content

Commit

Permalink
docs: update docs content and github actions (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
mckenziearts authored Sep 7, 2024
1 parent 491ce85 commit f52a5fd
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 31 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/update-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ jobs:
git clone --depth=1 https://github.com/shopperlabs/laravelshopper.dev.git
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
echo "Cloned laravelshopper.dev repository!"
- name: Create and Copy folders assets
run: |
mkdir -p "./$DOC_REPOSITORY_NAME/$SCREENSHOT_PATH"
cp -Rf packages/admin/docs/content "./$DOC_REPOSITORY_NAME/resources/docs"
cp -Rf packages/admin/docs/screenshots "./$DOC_REPOSITORY_NAME/$SCREENSHOT_PATH"
cp -rf packages/admin/docs/content "./$DOC_REPOSITORY_NAME/resources/docs"
cp -rf packages/admin/docs/screenshots "./$DOC_REPOSITORY_NAME/$SCREENSHOT_PATH"
echo "Copied docs to the laravelshopper.dev repository!"
- name: Commit and Push Changes
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
Expand All @@ -37,7 +39,7 @@ jobs:
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "docs: update /resources/docs folder with latest changes"
git push origin main
git push https://x-access-token:${{ secrets.ACCESS_TOKEN }}@github.com/shopperlabs/laravelshopper.dev.git
else
echo "No changes to commit."
fi
2 changes: 1 addition & 1 deletion packages/admin/docs/content/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ To run the project you may use the built-in server: `php artisan serve`

After that, run `composer dump-autoload` to finish your installation!

If your are using Laravel Valet you can easily access with your project name with `.test` at the end when you navigate on you project.
If using Laravel Valet or Laravel Herd you can easily access with your project name with `.test` at the end when you navigate on you project.

```bash
http://laravelshopper.test/cpanel/login
Expand Down
11 changes: 5 additions & 6 deletions packages/admin/docs/content/legal.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,20 @@ The model used is `Shopper\Core\Models\Legal`.

## Components

The components used to manage Legal page are found in the component configuration file `config/shopper/components.php`. Each component corresponds to the page that is defined
The components used to manage Legal page are found in the component configuration file `config/shopper/components/setting.php`. Each component corresponds to the page that is defined

```php
use Shopper\Http\Livewire\Components;
use Shopper\Livewire;

return [
'livewire' => [

'pages' => [
// ...
'settings.legal.privacy' => Components\Settings\Legal\Privacy::class,
'settings.legal.refund' => Components\Settings\Legal\Refund::class,
'settings.legal.shipping' => Components\Settings\Legal\Shipping::class,
'settings.legal.terms' => Components\Settings\Legal\Terms::class,

// ...
];

];
```

Expand Down
50 changes: 29 additions & 21 deletions packages/admin/docs/content/locations.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,34 @@ The model used is `Shopper\Core\Models\Inventory`.
| `priority` | integer | default (`0`) | no |
| `latitude` | decimal | no | Nullable, GPS latitude coordinates |
| `longitude` | decimal | no | Nullable, GPS longitude coordinates |
| `is_default` | boolean | no | Default `false`, define location as defaut for stock |
| `is_default` | boolean | no | Default `false`, define location as default for stock |
| `country_id` | string | yes | foreign key for country, each location must be linked to a country |

### Components

The components used to manage locations are found in the component configuration file `config/shopper/components.php`.
The components used to manage locations are found in the component configuration file `config/shopper/components/setting.php`.
This configuration file is not available by default. But if you want to update or change the settings components, you can publish them with the command

```bash
php artisan shopper:component:publish setting
```

```php
use Shopper\Core\Http\Livewire;
use Shopper\Core\Http\Livewire\Components;
use Shopper\Livewire\Pages;

return [

'livewire' => [

'modals.delete-inventory' => Livewire\Modals\DeleteInventory::class, // [tl! focus]

'settings.inventories.browse' => Components\Settings\Inventories\Browse::class, // [tl! focus]
'settings.inventories.create' => Components\Settings\Inventories\Create::class,// [tl! focus]
'settings.inventories.edit' => Components\Settings\Inventories\Edit::class,// [tl! focus]

];
'pages' => [
// ...
'inventory-index' => Pages\Settings\Inventories\Browse::class,
'inventory-create' => Pages\Settings\Inventories\Create::class,
'inventory-edit' => Pages\Settings\Inventories\Edit::class,
// ...
];

'components' => [

],

];
```
Expand All @@ -73,46 +79,48 @@ In your administration area you must click on the "cog" icon to display the sett

<div class="screenshot">
<img src="/img/screenshots/{{version}}/settings-location.png" alt="Setting location">
<div class="caption">Settings > locations</div>
<div class="caption">Settings > Locations</div>
</div>

### Add location

In your administration area you must click on the "cog" icon to display the settings page of your store.

1. Click Add location.
2. Enter a unique name and an address for the location.

<div class="screenshot">
<img src="/img/screenshots/{{version}}/add-location.png" alt="Add location">
<div class="caption">Add location</div>
<img src="/img/screenshots/{{version}}/location-create.png" alt="Add location">
<div class="caption">Create location</div>
</div>

### Edit location

To update a location you click on an available location among those you have saved and you will have the update page.

<div class="screenshot">
<img src="/img/screenshots/{{version}}/update-location.png" alt="update location">
<img src="/img/screenshots/{{version}}/location-update.png" alt="update location">
<div class="caption">Update location</div>
</div>

### Define a default location
The default location is the one in which all products will be collected with each order. If this location is empty the products will be searched in another and if it is the only one the product will be out of stock on your store.

The default location is the one in which all products will be collected with each order. If this location is empty the products will be searched in another and if it is the only one the product will be out of stock on your store.
You select a location and during the modification you click on the checkbox **Set as default inventory**

<div class="screenshot">
<img src="/img/screenshots/{{version}}/default-location.png" alt="Set default location">
<img src="/img/screenshots/{{version}}/location-default.png" alt="Set default location">
<div class="caption">Set default location</div>
</div>

### Delete location
To delete a location you must click on a location to display it and at the bottom of the page you click on the delete button.

<div class="screenshot">
<img src="/img/screenshots/{{version}}/delete-location.png" alt="Delete location">
<img src="/img/screenshots/{{version}}/location-delete.png" alt="Delete location">
<div class="caption">Delete location confirmation</div>
</div>

:::danger
Once the location removed, all inventories will changed and this could complicate your inventory management. This is why you have a confirmation modal to be sure that this is indeed what you want to proceed.
Once the location removed, all inventories will be changed and this could complicate your inventory management. This is why you have a confirmation modal to be sure that this is indeed what you want to proceed.
:::

0 comments on commit f52a5fd

Please sign in to comment.