Skip to content

Commit

Permalink
few patches and minor fixes for oss compatability
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Dec 20, 2023
1 parent bb68cdb commit 846f613
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = {
'n/no-unpublished-require': [
'error',
{
allowModules: ['resolve', 'broccoli-funnel'],
allowModules: ['resolve', 'broccoli-funnel', 'broccoli-merge-trees'],
},
],
},
Expand Down
4 changes: 2 additions & 2 deletions addon/components/schedule-manager.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
{{#each-in this.schedule as |day hours|}}
<div class="content-panel {{@contentPanelClass}} shadow-sm">
<div class="content-panel-header items-center {{@contentPanelHeaderClass}}">
<h4 class="font-semibold dark:text-gray-100">{{day}}</h4>
<h4 class="font-semibold text-sm dark:text-gray-100">{{day}}</h4>
<div>
<Button @icon="calendar-week" @text="Add Hours" @onClick={{fn this.addHours @subject day}} class="{{@addHoursButtonClass}}" />
<Button @icon="calendar-week" @text="Add Hours" @textClass="truncate text-xs" @size="sm" @onClick={{fn this.addHours @subject day}} class="{{@addHoursButtonClass}}" />
</div>
</div>
<div class="content-panel-body {{@contentPanelBodyClass}}">
Expand Down
6 changes: 6 additions & 0 deletions addon/controllers/products/index/category/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ export default class ProductsIndexCategoryNewController extends BaseController {
}

@action queueFile(file) {
// since we have dropzone and upload button within dropzone validate the file state first
// as this method can be called twice from both functions
if (['queued', 'failed', 'timed_out', 'aborted'].indexOf(file.state) === -1) {
return;
}

this.uploadQueue.pushObject(file);
this.fetch.uploadFile.perform(
file,
Expand Down
2 changes: 1 addition & 1 deletion addon/templates/networks/index/network.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Overlay @position="right" @isResizable={{true}} @noBackdrop={{true}} @width="800px" @minResizeWidth={{700}} @fullHeight={{true}}>
<Overlay @position="right" @isResizable={{true}} @noBackdrop={{true}} @width="570px" @minResizeWidth={{570}} @fullHeight={{true}}>
<Overlay::Header @title="Manage Network" @onPressCancel={{this.transitionBack}} />
<Overlay::Body class="p-0i" @increaseInnerBodyHeightBy="0" @wrapperClass="space-y-4 pt-4">
<div class="flex flex-col">
Expand Down
4 changes: 2 additions & 2 deletions addon/templates/networks/index/network/stores.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Layout::Section::Header @title="Stores" @searchQuery={{this.storeQuery}} @onSearch={{perform this.search}}>
<Button @type="primary" @icon="plus" @text="Add Stores" @onClick={{this.addStores}} @wrapperClass="mr-2" />
<Button @type="primary" @icon="envelope-open-text" @text="Invite Stores" @onClick={{this.invite}} />
<Button @type="primary" @icon="plus" @text="Add Stores" @textClass="truncate" @size="sm" @onClick={{this.addStores}} @wrapperClass="mr-2" />
<Button @type="primary" @icon="envelope-open-text" @textClass="truncate" @size="sm" @text="Invite Stores" @onClick={{this.invite}} />
</Layout::Section::Header>

<Layout::Section::Body>
Expand Down
23 changes: 20 additions & 3 deletions addon/templates/products/index/category.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
<Layout::Section::Header @title={{concat this.category.name " Products"}} @searchQuery={{this.query}} @onSearch={{perform this.search}}>
<Button @type="default" @text="Edit this category" @icon="edit" @onClick={{fn this.editCategory this.category}} @disabled={{not this.category}} @wrapperClass="mr-2" />
<Button @type="danger" @text="Delete this category" @icon="trash" @onClick={{this.deleteCategory}} @disabled={{not this.category}} />
<Layout::Section::Header @title={{concat this.category.name " Products"}} @titleClass="truncate" @searchQuery={{this.query}} @onSearch={{perform this.search}}>
{{!-- <Button @type="default" @text="Edit this category" @textClass="truncate" @icon="edit" @onClick={{fn this.editCategory this.category}} @disabled={{not this.category}} @wrapperClass="mr-2" />
<Button @type="danger" @text="Delete this category" @textClass="truncate" @icon="trash" @onClick={{this.deleteCategory}} @disabled={{not this.category}} /> --}}

{{#if this.category}}
<DropdownButton @icon="gear" @text="Category" @type="default" @size="sm" @contentClass="dropdown-menu" as |dd|>
<div class="next-dd-menu">
<div class="px-1">
<a href="#" class="next-dd-item" {{on "click" (dropdown-fn dd this.editCategory this.category)}}>
Edit this category...
</a>
</div>
<div class="px-1">
<a href="#" class="text-red-500 next-dd-item" {{on "click" (dropdown-fn dd this.deleteCategory)}}>
Delete this category...
</a>
</div>
</div>
</DropdownButton>
{{/if}}
</Layout::Section::Header>

<div class="h-screen overflow-y-scroll p-6">
Expand Down
2 changes: 1 addition & 1 deletion addon/templates/products/index/category/new.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Overlay @position="right" @noBackdrop={{true}} @width="700px" @fullHeight={{true}} @containerClass="border-l border-transparent dark:border-gray-700">
<Overlay @position="right" @noBackdrop={{true}} @isResizable={{true}} @width="570px" @fullHeight={{true}} @containerClass="border-l border-transparent dark:border-gray-700">
<Overlay::Header @title={{this.overlayTitle}} @titleClass="truncate" @titleWrapperClass="w-3/4" @headerLeftClass="w-70pc" @headerLeftInnerClass="w-full flex-1" @onPressCancel={{this.transitionBack}}>
<Button @icon={{this.overlayActionButtonIcon}} @type="primary" @text={{this.overlayActionButtonTitle}} @onClick={{this.saveProduct}} @isLoading={{this.isSaving}} @isSubscriptionRequired={{true}} />
</Overlay::Header>
Expand Down
Binary file added assets/sounds/storefront_order_alert.mp3
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"@glimmer/tracking": "^1.1.2",
"broccoli-asset-rev": "^3.0.0",
"broccoli-funnel": "^3.0.8",
"broccoli-merge-trees": "^4.2.0",
"concurrently": "^8.2.2",
"ember-auto-import": "^2.6.3",
"ember-classic-decorator": "^3.0.0",
Expand Down
10 changes: 9 additions & 1 deletion server/src/Http/Resources/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Fleetbase\Storefront\Http\Resources;

use Fleetbase\Http\Resources\FleetbaseResource;
use Fleetbase\Support\Http;

class Cart extends FleetbaseResource
{
Expand All @@ -15,7 +16,14 @@ class Cart extends FleetbaseResource
public function toArray($request)
{
return [
'id' => $this->public_id,
'id' => $this->when(Http::isInternalRequest(), $this->id,$this->public_id),
'uuid' => $this->when(Http::isInternalRequest(), $this->uuid),
'public_id' => $this->when(Http::isInternalRequest(), $this->public_id),
'company_uuid' => $this->when(Http::isInternalRequest(), $this->company_uuid),
'user_uuid' => $this->when(Http::isInternalRequest(), $this->user_uuid),
'checkout_uuid' => $this->when(Http::isInternalRequest(), $this->checkout_uuid),
'checkout_uuid' => $this->when(Http::isInternalRequest(), $this->checkout_uuid),
'customer_id' => $this->customer_id,
'currency' => $this->currency,
'subtotal' => $this->subtotal,
'total_items' => $this->total_items,
Expand Down
4 changes: 4 additions & 0 deletions server/src/Http/Resources/Network.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ public function toArray($request)
'uuid' => $this->when(Http::isInternalRequest(), $this->uuid),
'public_id' => $this->when(Http::isInternalRequest(), $this->public_id),
'key' => $this->when(Http::isInternalRequest(), $this->key),
'company_uuid' => $this->when(Http::isInternalRequest(), $this->company_uuid),
'created_by_uuid' => $this->when(Http::isInternalRequest(), $this->created_by_uuid),
'logo_uuid' => $this->when(Http::isInternalRequest(), $this->logo_uuid),
'backdrop_uuid' => $this->when(Http::isInternalRequest(), $this->backdrop_uuid),
'name' => $this->name,
'description' => $this->description,
'translations' => $this->translations ?? [],
Expand Down
5 changes: 5 additions & 0 deletions server/src/Http/Resources/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public function toArray($request)
'id' => $this->when(Http::isInternalRequest(), $this->id, $this->public_id),
'uuid' => $this->when(Http::isInternalRequest(), $this->uuid),
'public_id' => $this->when(Http::isInternalRequest(), $this->public_id),
'company_uuid' => $this->when(Http::isInternalRequest(), $this->company_uuid),
'store_uuid' => $this->when(Http::isInternalRequest(), $this->store_uuid),
'category_uuid' => $this->when(Http::isInternalRequest(), $this->category_uuid),
'created_by_uuid' => $this->when(Http::isInternalRequest(), $this->created_by_uuid),
'primary_image_uuid' => $this->when(Http::isInternalRequest(), $this->primary_image_uuid),
'name' => $this->name,
'description' => $this->description,
'sku' => $this->sku,
Expand Down
4 changes: 4 additions & 0 deletions server/src/Http/Resources/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ public function toArray($request)
'uuid' => $this->when(Http::isInternalRequest(), $this->uuid),
'public_id' => $this->when(Http::isInternalRequest(), $this->public_id),
'key' => $this->when(Http::isInternalRequest(), $this->key),
'company_uuid' => $this->when(Http::isInternalRequest(), $this->company_uuid),
'created_by_uuid' => $this->when(Http::isInternalRequest(), $this->created_by_uuid),
'logo_uuid' => $this->when(Http::isInternalRequest(), $this->logo_uuid),
'backdrop_uuid' => $this->when(Http::isInternalRequest(), $this->backdrop_uuid),
'name' => $this->name,
'description' => $this->description,
'translations' => $this->translations ?? [],
Expand Down

0 comments on commit 846f613

Please sign in to comment.