Skip to content

Commit 4109a54

Browse files
committed
Release - 2.0-beta15 (#471)
1 parent f8f7a8f commit 4109a54

16 files changed

Lines changed: 321 additions & 96 deletions

File tree

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@ All notable changes to this project will be documented in this file.
33

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

6+
### 2.0-beta15 - 2022-08-10
7+
8+
## Changed
9+
10+
- `savePricing` on the `GetCandy\Hub\Http\Livewire\Traits\HasPrices` trait now supports `basePrices` and `tierPrices` parameters.
11+
12+
## Fixed
13+
14+
- When variants are disabled, editing a product type will not longer display tabs for variant attributes.
15+
- Fixed an issue where adding a comment to the activity log would error.
16+
- Comments should now show correctly on product editing pages.
17+
- Sortable is now attached to the browser window so it's globally available.
18+
- Fixed an issue where incorrect attributes were showing when changing product types
19+
- `doctrine/dbal` locked to `3.3.7` due to issue with Sqlite
20+
621
### 2.0-beta14 - 2022-08-03
722

823
## Changed

public/app.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/assets/hub.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ window.FilePond = require('filepond');
88
window.FilePondPluginImagePreview = require('filepond-plugin-image-preview');
99
window.FilePondPluginFileValidateSize = require('filepond-plugin-file-validate-size');
1010
window.FilePondPluginFileValidateType = require('filepond-plugin-file-validate-size');
11+
window.Sortable = Sortable;
1112

1213
if (typeof window.livewire === 'undefined') {
1314
throw 'Livewire Sortable Plugin: window.livewire is undefined. Make sure @livewireScripts is placed above this script include';

resources/views/layouts/base.blade.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
<title>{{ $title ?? 'Hub' }} | {{ config('app.name') }}</title>
77
<link data-n-head="ssr" rel="icon" type="image/png" href="https://cdn.getcandy.io/hub/favicon.svg">
88

9-
<link rel="preconnect" href="https://fonts.googleapis.com">
10-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
11-
<link href="https://fonts.googleapis.com/css2?family=Nunito&display=swap" rel="stylesheet">
9+
<link href="https://fonts.bunny.net/css2?family=Nunito&display=swap" rel="stylesheet">
1210
<link href="{{ asset('vendor/getcandy/admin-hub/app.css') }}" rel="stylesheet">
1311

1412
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.8.2/dist/alpine.min.js" defer></script>

resources/views/partials/attributes.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</header>
1010
<div class="space-y-4">
1111
@foreach($group['fields'] as $attIndex => $field)
12-
<div wire:key="{{ $field['handle'] }}">
12+
<div wire:key="attributes_{{ $field['handle'] }}">
1313
<x-hub::input.group
1414
:label="$field['name']"
1515
:for="$field['handle']"

resources/views/partials/forms/product-type.blade.php

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,22 @@
66
</div>
77

88
<div x-data="{ view: 'products' }">
9-
<nav class="flex space-x-4" aria-label="Tabs">
10-
<!-- Current: "bg-gray-100 text-gray-700", Default: "text-gray-500 hover:text-gray-700" -->
11-
<button type="button" wire:click="$set('view', 'products')" class="px-3 py-3 text-sm font-medium @if($view == 'products') text-gray-800 bg-white @else test-gray-500 hover:text-gray-700 @endif rounded-t">
12-
{{ __('adminhub::partials.product-type.product_attributes_btn') }}
13-
</button>
9+
@if(!$this->variantsDisabled)
10+
<nav class="flex space-x-4" aria-label="Tabs">
11+
<!-- Current: "bg-gray-100 text-gray-700", Default: "text-gray-500 hover:text-gray-700" -->
12+
<button type="button" wire:click="$set('view', 'products')" class="px-3 py-3 text-sm font-medium @if($view == 'products') text-gray-800 bg-white @else test-gray-500 hover:text-gray-700 @endif rounded-t">
13+
{{ __('adminhub::partials.product-type.product_attributes_btn') }}
14+
</button>
1415

15-
<button
16-
type="button"
17-
wire:click="$set('view', 'variants')"
18-
class="px-3 py-3 text-sm font-medium @if($view == 'variants') text-gray-800 bg-white @else test-gray-500 hover:text-gray-700 @endif rounded-t"
19-
>
20-
{{ __('adminhub::partials.product-type.variant_attributes_btn') }}
21-
</button>
22-
</nav>
16+
<button
17+
type="button"
18+
wire:click="$set('view', 'variants')"
19+
class="px-3 py-3 text-sm font-medium @if($view == 'variants') text-gray-800 bg-white @else test-gray-500 hover:text-gray-700 @endif rounded-t"
20+
>
21+
{{ __('adminhub::partials.product-type.variant_attributes_btn') }}
22+
</button>
23+
</nav>
24+
@endif
2325

2426
<div class="p-6 bg-white rounded-b shadow">
2527
@if($view == 'products')

src/Base/ActivityLog/Manifest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use GetCandy\Hub\Base\ActivityLog\Orders\Intent;
88
use GetCandy\Hub\Base\ActivityLog\Orders\StatusUpdate;
99
use GetCandy\Models\Order;
10+
use GetCandy\Models\Product;
1011
use Illuminate\Support\Collection;
1112

1213
class Manifest
@@ -24,6 +25,9 @@ class Manifest
2425
Intent::class,
2526
EmailNotification::class,
2627
],
28+
Product::class => [
29+
Comment::class,
30+
],
2731
];
2832

2933
/**

src/Http/Livewire/Components/ActivityLogFeed.php

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
namespace GetCandy\Hub\Http\Livewire\Components;
44

55
use GetCandy\Hub\Facades\ActivityLog;
6+
use GetCandy\Hub\Http\Livewire\Traits\Notifies;
67
use Illuminate\Database\Eloquent\Model;
78
use Livewire\Component;
89
use Livewire\WithPagination;
9-
use Spatie\Activitylog\Models\Activity;
1010

1111
class ActivityLogFeed extends Component
1212
{
13-
use WithPagination;
13+
use WithPagination, Notifies;
1414

1515
/**
1616
* The log subject to get activity for.
@@ -19,6 +19,46 @@ class ActivityLogFeed extends Component
1919
*/
2020
public Model $subject;
2121

22+
/**
23+
* The new comment for the subject.
24+
*
25+
* @var string|null
26+
*/
27+
public ?string $comment = null;
28+
29+
/**
30+
* {@inheritDoc}
31+
*/
32+
public function rules()
33+
{
34+
return [
35+
'comment' => 'string|required',
36+
];
37+
}
38+
39+
/**
40+
* Add a comment to the order.
41+
*
42+
* @return void
43+
*/
44+
public function addComment()
45+
{
46+
activity()
47+
->performedOn($this->subject)
48+
->causedBy(
49+
auth()->user()
50+
)
51+
->event('comment')
52+
->withProperties(['content' => $this->comment])
53+
->log('comment');
54+
55+
$this->notify(
56+
__('adminhub::notifications.order.comment_added')
57+
);
58+
59+
$this->comment = null;
60+
}
61+
2262
/**
2363
* Returns the activity log for the order.
2464
*

src/Http/Livewire/Components/Orders/OrderShow.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -534,29 +534,6 @@ public function getMetaFieldsProperty()
534534
return (array) $this->order->meta;
535535
}
536536

537-
/**
538-
* Add a comment to the order.
539-
*
540-
* @return void
541-
*/
542-
public function addComment()
543-
{
544-
activity()
545-
->performedOn($this->order)
546-
->causedBy(
547-
auth()->user()
548-
)
549-
->event('comment')
550-
->withProperties(['content' => $this->comment])
551-
->log('comment');
552-
553-
$this->notify(
554-
__('adminhub::notifications.order.comment_added')
555-
);
556-
557-
$this->comment = '';
558-
}
559-
560537
/**
561538
* Render the livewire component.
562539
*

0 commit comments

Comments
 (0)