Skip to content

Commit

Permalink
Merge pull request #690 from lunarphp/main
Browse files Browse the repository at this point in the history
0.1.2
  • Loading branch information
alecritson authored Nov 7, 2022
2 parents c8b18aa + fcae7ad commit 86ef10e
Show file tree
Hide file tree
Showing 43 changed files with 570 additions and 234 deletions.
6 changes: 3 additions & 3 deletions docs/src/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ module.exports = {
smoothScroll: true,
lastUpdated: false,
algolia: {
apiKey: '5b837c3914609051127d86be919e1724',
indexName: 'lunar',
appId: 'LRDQ9JSQEG'
apiKey: '42f3d86ed75f289e5cb75e9d7c6f43f9',
indexName: 'lunarphp',
appId: 'ZHX0K72823'
},
nav: [
{
Expand Down
88 changes: 56 additions & 32 deletions docs/src/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,66 +12,90 @@ You can contribute to the project in many different ways. Reporting bugs, fixing

Lunar uses a monorepo [lunarphp/lunar](https://github.com/lunarphp/lunar) to house the core, admin hub and documentation. [Monorepos](https://en.wikipedia.org/wiki/Monorepo) are quite common, but may not be familiar to some. The monorepo helps us to organise the code for ease of development.


## Repository Branching

There are two branches you need to be aware of when contributing to Lunar - `main` and `develop`.
**Bug Fixes** should target the latest compatible branch version i.e `0.1`. The `main` branch should never have bug fix PR's unless they fix features that are in an upcoming release.

The `main` branch hosts the latest stable version of the software and documentation. Whereas the `develop` branch hosts new features and updates in active development between releases.
**Features** should target the `main` branch.

## Documentation
## Contributing Code

If you would like to contribute to the documentation you can do easily by following these instructions...
The basic process for contributing to Lunar is as follows...

1. Fork the monorepo `lunarphp/lunar`
1. Fork the monorepo
2. Clone your fork locally
3. In your terminal change to the `/docs` directory
4. Run `npm install`
5. Run `npm run dev` to preview the documentation locally
6. Make your changes
7. Submit a pull request
3. Make your changes
4. Ensure the tests run and complete successfully
5. Submit a pull request

Lunar uses [VuePress](https://vuepress.vuejs.org/) for our documentation site which uses [Markdown](https://www.markdownguide.org/basic-syntax/) files to store the content. You'll find these Markdown files in the `/docs/src` directory.
However, if you're not used to working with monorepo's and setting them up inside a test Laravel application, no problem!

::: tip Development Guide
Here's a guide on how to set-up your development environment ready for contributing to Lunar.

[Setting Up Lunar For Local Development](/local-development.html)
:::

## Found a Bug?

If you find a bug in the software please raise a GitHub Issue on the [lunarphp/lunar](https://github.com/lunarphp/lunar/issues) repository.
If you find a bug in the software please raise a GitHub Issue on the [lunarphp/lunar](https://github.com/lunarphp/lunar/issues) repository. Please ensure that your issue includes the following:

**Minimum**

- Clear title and description of the issue
- Steps on how to reproduce the issue

**Ideal**

- An accompanying Pull Request with a test to demonstrate the issue.

Even better would be a pull request with a test that fails demonstrating the bug.
Lunar is an open source project and as such we want contribution to be as accessible as possible and to enable contributors to actively collaborate on features and issues. By making sure you provide as much information as possible you are giving your issue the best chance to get the attention it needs.

Be aware that creating an issue does not mean it will get activity straight away, please be patient and understand we will do our best to look into it as soon as possible.

Open source code belongs to all of us, and it's all of our responsibility to push it forward.

## Proposing a Feature

Before you start coding away on the next awesome feature, we highly recommend starting a [discussion](https://github.com/lunarphp/lunar/issues/new/choose) to check that your contribution will be welcomed. We would hate for you to spend valuable time on something that won't be merged into Lunar.

However, you're more than welcome to code away on your idea if you think it will help the discussion.

## Issue Not Getting Attention?
## Making a Pull Request

If you need a bug fixed and nobody is fixing it, your best bet is to provide a fix for it and make a [pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request). Open source code belongs to all of us, and it's all of our responsibility to push it forward.
When making a [pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request), there should be a suitable template for you to follow to ensure the bug or feature can be reviewed in a timely manner.
If the pull request is missing information or unclear as to what it offers or solves, it could any delay movement or be closed.

## Contributing Code
A PR should be able to include the following:

The basic process for contributing to Lunar is as follows...
- Clearly show in the title the version the PR is targeting i.e. `[0.1]` or `[0.2]`.
- A clear description of the feature or fix
- Any relevant documentation updates
- Unit tests with adequate code coverage
- Changelog entry

1. Fork the monorepo
2. Clone your fork locally
3. Make your changes
4. Ensure the tests run and complete successfully
5. Submit a pull request
## Code Styles

However, if you're not used to working with monorepo's and setting them up inside a test Laravel application, no problem!
Lunar currently uses [Laravel Pint](https://laravel.com/docs/9.x/pint) for code styling. This is not automatically triggered, so you will need to run `vendor/bin/pint` on your branch.

::: tip Development Guide
Here's a guide on how to set-up your development environment ready for contributing to Lunar.
## Asset compiling

[Setting Up Lunar For Local Development](/local-development.html)
:::
The Lunar hub and some other add-ons/utils will provide their own assets. Please do not commit these files as they will be overwritten by the core team when the release is being finalised.

## Making a Pull Request
## Documentation Updates

When making a [pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request), you will want to target the correct branch.
When providing updates to the documentation, your pull request should target the relevant branch for the version you are updating. For documentation of new features in an upcoming release, target the `main` branch.

If you are contributing documentation, the PR should be targeted straight to the `main` branch. However, code contributions should target the `develop` branch.
If you would like to contribute to the documentation you can do easily by following these instructions...

Please include a good description of what your pull request offers.
1. Fork the monorepo `lunarphp/lunar`
2. Clone your fork locally
3. In your terminal change to the `/docs` directory
4. Run `npm install`
5. Run `npm run dev` to preview the documentation locally
6. Make your changes
7. Submit a pull request

Lunar uses [VuePress](https://vuepress.vuejs.org/) for our documentation site which uses [Markdown](https://www.markdownguide.org/basic-syntax/) files to store the content. You'll find these Markdown files in the `/docs/src` directory.

When contributing code, please ensure you include suitable tests, documentation and changelog entries, as applicable.
2 changes: 1 addition & 1 deletion docs/src/extending/admin-hub.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class SeoSlot extends Component implements AbstractSlot

public static function getName()
{
return 'hub.product.slots.seo-slot';
return 'hub.components.products.slots.seo-slot';
}

public function getSlotHandle()
Expand Down
7 changes: 7 additions & 0 deletions docs/src/extending/tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ class CustomColumnComponent extends Component
}
```

### Positioning

You can specify a position for the new column by defining which column it should appear after.

```php
TextColumn::make('status')->after('name');
```

### TextColumn

Expand Down
12 changes: 8 additions & 4 deletions docs/src/lunar/carts.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ $cart = $cart->getManager()->getCart();

This will return a "hydrated" version of your cart with the following:

::: tip All values will return a `Lunar\Datatypes\Price` object. So you have
access to the following: `value`, `formatted`, `decimal` :::
::: tip
All values will return a `Lunar\Datatypes\Price` object. So you have
access to the following: `value`, `formatted`, `decimal`
:::

```php
$cart->total; // The total price value for the cart
Expand Down Expand Up @@ -164,8 +166,10 @@ $cart->getManager()->setBillingAddress(

## Cart Session Manager

::: tip The cart session manager is useful if you're building a traditional
Laravel storefront which makes use of sessions. :::
::: tip
The cart session manager is useful if you're building a traditional
Laravel storefront which makes use of sessions.
:::

When building a store, you're going to want an easy way to fetch the cart for
the current user (or guest user) by retrieving it from their current session.
Expand Down
2 changes: 2 additions & 0 deletions docs/src/lunar/customers.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Lunar\Models\Customer
|`last_name`||
|`company_name`|nullable|
|`vat_no`|nullable|
|`account_ref`|nullable|
|`attribute_data`|JSON|
|`meta`|JSON|
|`created_at`||
|`updated_at`||
Expand Down
23 changes: 23 additions & 0 deletions packages/admin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## 0.1.2

### Fixed

- Call `validate` when creating a tax class before the DB transaction.
- Fix product thumbnail on dashboard.
- Fix issue with customer saving [#654](https://github.com/lunarphp/lunar/issues/654)
- Use @js directive instead of @JSON
- Fixed an issue where Spatie Media couldn't regenerate media transforms from within the hub in production.
- Fixed issues with product editing when disabling variants.
- Fixed issue where trying to add a saved search on product types has no effect.
- Fixed an issue where the bulk action Livewire component wasn't registering correctly.
- The orders table will now show the correct minutes in the timestamp.

### Changed

- When the hub password reset form is submitted, it will return a success message regardless.

### Added

- Added `top`, `bottom` slots to brands
- Added unique validation to attribute handles.

## 0.1.1

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/public/app.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/admin/resources/lang/en/partials.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
'products.variants.strapline' => 'This product has multiple options, like different sizes or colors.',
'products.variants.table_row_action_text' => 'Edit',
'products.variants.table_row_delete_text' => 'Delete',
'products.variants.removal_message' => 'This will remove all variants from this product',
/**
* Product type.
*/
Expand Down
1 change: 1 addition & 0 deletions packages/admin/resources/lang/en/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
'taxes.tax-zones.delete_btn' => 'Delete tax zone',
'taxes.tax-zones.index.table_row_action_text' => 'Manage',
'taxes.tax-classes.index.title' => 'Tax Classes',
'taxes.tax-classes.index.create.title' => 'Create tax class',
'taxes.tax-classes.index.update.title' => 'Update tax class',
'taxes.tax-classes.create_btn' => 'Create tax class',
'taxes.tax-zones.price_display.label' => 'Price Display',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div x-data="{
messages: @json($messages),
messages: @js($messages),
level: '{{ $level }}',
timeout: null,
remove(message) {
Expand Down Expand Up @@ -54,4 +54,4 @@ class="w-4 h-4" />
</div>
</div>
</template>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ class="w-8 h-8" />

<div class="mt-8 lg:gap-8 lg:flex lg:items-start">
<div class="space-y-6 lg:flex-1">

@foreach ($this->getSlotsByPosition('top') as $slot)
<div id="{{ $slot->handle }}">
<div>
@livewire($slot->component, ['slotModel' => $customer], key('top-slot-' . $slot->handle))
</div>
</div>
@endforeach

<div>
@include('adminhub::partials.forms.brand')
</div>
Expand All @@ -45,6 +54,14 @@ class="w-8 h-8" />
<div id="urls">
@include('adminhub::partials.urls')
</div>

@foreach ($this->getSlotsByPosition('bottom') as $slot)
<div id="{{ $slot->handle }}">
<div>
@livewire($slot->component, ['slotModel' => $customer], key('top-slot-' . $slot->handle))
</div>
</div>
@endforeach
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@

<div>
<x-hub::input.group for="first_name"
:label="__('adminhub::inputs.firstname')">
<x-hub::input.text wire:model.defer="customer.first_name" />
:label="__('adminhub::inputs.firstname')" :error="$errors->first('customer.first_name')" required>
<x-hub::input.text wire:model.defer="customer.first_name" :error="$errors->first('customer.first_name')" />
</x-hub::input.group>
</div>

<div>
<x-hub::input.group for="last_name"
:label="__('adminhub::inputs.lastname')">
<x-hub::input.text wire:model.defer="customer.last_name" />
:label="__('adminhub::inputs.lastname')" :error="$errors->first('customer.last_name')" required>
<x-hub::input.text wire:model.defer="customer.last_name" :error="$errors->first('customer.last_name')" />
</x-hub::input.group>
</div>
</div>
Expand Down
Loading

0 comments on commit 86ef10e

Please sign in to comment.