Skip to content

Commit

Permalink
preparing for next release, dependencies upgrades, ux improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed May 30, 2024
1 parent 778154b commit 8530fdf
Show file tree
Hide file tree
Showing 12 changed files with 208 additions and 122 deletions.
24 changes: 21 additions & 3 deletions addon/components/modals/manage-addons.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ s<Modal::Default @modalIsOpened={{@modalIsOpened}} @options={{@options}} @confir
{{/unless}}
</div>
<div>
<Button @type="magic" @text={{t "storefront.component.modals.manage-addons.title"}} @icon="plus" @iconPrefix="fas" @onClick={{perform this.createAddonCategory}} @disabled={{not this.createAddonCategory.isIdle}} />
<Button
@type="magic"
@text={{t "storefront.component.modals.manage-addons.title"}}
@icon="plus"
@iconPrefix="fas"
@onClick={{perform this.createAddonCategory}}
@disabled={{not this.createAddonCategory.isIdle}}
/>
</div>
</div>

Expand All @@ -17,10 +24,21 @@ s<Modal::Default @modalIsOpened={{@modalIsOpened}} @options={{@options}} @confir
<div class="flex items-center rounded-md shadow-sm px-3 py-2 font-semibold bg-gray-200 dark:bg-gray-800 dark:text-gray-100 mb-2">
<div class="flex-1 flex items-center">
<FaIcon @icon="pencil" class="mr-1 dark:text-gray-100" />
<Input @type="text" @value={{category.name}} {{on "blur" (perform this.saveAddonCategory category)}} class="w-full px-2 m-0 border-none bg-transparent dark:text-gray-100" />
<Input
@type="text"
@value={{category.name}}
{{on "blur" (perform this.saveAddonCategory category)}}
class="w-full px-2 m-0 border-none bg-transparent dark:text-gray-100"
/>
</div>
<div class="flex items-center">
<Button @text={{t "storefront.component.modals.manage-addons.new-addon"}} @icon="plus" @iconPrefix="fas" @onClick={{fn this.createNewAddon category}} class="mr-3" />
<Button
@text={{t "storefront.component.modals.manage-addons.new-addon"}}
@icon="plus"
@iconPrefix="fas"
@onClick={{fn this.createNewAddon category}}
class="mr-3"
/>
<a href="javascript:;" {{on "click" (perform this.deleteAddonCategory index)}} class="destroy-action opacity-50 hover:opacity-100 text-sm">
{{t "storefront.component.modals.manage-addons.delete"}}
</a>
Expand Down
2 changes: 0 additions & 2 deletions addon/templates/customers/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
@paginationMeta={{@model.meta}}
@page={{this.page}}
@onPageChange={{fn (mut this.page)}}
@tfootVerticalOffset="53"
@tfootVerticalOffsetElements=".next-view-section-subheader"
/>
</Layout::Section::Body>

Expand Down
2 changes: 0 additions & 2 deletions addon/templates/networks/index/network/customers.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,5 @@
@paginationMeta={{@model.meta}}
@page={{this.page}}
@onPageChange={{fn (mut this.page)}}
@tfootVerticalOffset="53"
@tfootVerticalOffsetElements=".next-view-section-subheader"
/>
</Layout::Section::Body>
2 changes: 0 additions & 2 deletions addon/templates/networks/index/network/orders.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,5 @@
@paginationMeta={{@model.meta}}
@page={{this.page}}
@onPageChange={{fn (mut this.page)}}
@tfootVerticalOffset="53"
@tfootVerticalOffsetElements=".next-view-section-subheader"
/>
</Layout::Section::Body>
2 changes: 0 additions & 2 deletions addon/templates/orders/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
@paginationMeta={{@model.meta}}
@page={{this.page}}
@onPageChange={{fn (mut this.page)}}
@tfootVerticalOffset="53"
@tfootVerticalOffsetElements=".next-view-section-subheader"
/>
</Layout::Section::Body>

Expand Down
72 changes: 63 additions & 9 deletions addon/templates/products/index/category/new.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<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={{perform this.saveProduct}} @isLoading={{not this.saveProduct.isIdle}} />
<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={{perform this.saveProduct}}
@isLoading={{not this.saveProduct.isIdle}}
/>
</Overlay::Header>

<Overlay::Body @increaseInnerBodyHeightBy="0" @wrapperClass="new-order-overlay-body px-4 space-y-4 pt-4">
Expand All @@ -9,21 +22,48 @@
<Textarea @value={{this.product.description}} class="form-input w-full" placeholder="Enter a description of your product...." rows={{4}} />
</InputGroup>
<InputGroup @name="Product Tags">
<TagInput class="form-input" @placeholder="Add tags" @allowSpacesInTags={{true}} @tags={{this.product.tags}} @addTag={{this.addTag}} @removeTagAtIndex={{this.removeTag}} as |tag|>
<TagInput
class="form-input"
@placeholder="Add tags"
@allowSpacesInTags={{true}}
@tags={{this.product.tags}}
@addTag={{this.addTag}}
@removeTagAtIndex={{this.removeTag}}
as |tag|
>
{{tag}}
</TagInput>
</InputGroup>
<InputGroup @name="Product SKU" @value={{this.product.sku}} @helpText="Enter product SKU if applicable" />
<div class="grid grid-cols-2 gap-2">
<InputGroup @name="Price" @helpText="Enter a price users will pay to purchase this product">
<MoneyInput class="w-full" @currency={{if this.product.currency this.product.currency this.activeStore.currency}} @value={{this.product.price}} @canSelectCurrency={{false}} @onCurrencyChange={{fn (mut this.product.currency)}} />
<MoneyInput
class="w-full"
@currency={{if this.product.currency this.product.currency this.activeStore.currency}}
@value={{this.product.price}}
@canSelectCurrency={{false}}
@onCurrencyChange={{fn (mut this.product.currency)}}
/>
</InputGroup>
<InputGroup @name="Sale Price" @helpText="Optionally add a sale price for the product if the product is put on sale">
<MoneyInput class="w-full" @currency={{if this.product.currency this.product.currency this.activeStore.currency}} @value={{this.product.sale_price}} @canSelectCurrency={{false}} @onCurrencyChange={{fn (mut this.product.currency)}} />
<MoneyInput
class="w-full"
@currency={{if this.product.currency this.product.currency this.activeStore.currency}}
@value={{this.product.sale_price}}
@canSelectCurrency={{false}}
@onCurrencyChange={{fn (mut this.product.currency)}}
/>
</InputGroup>
</div>

<ContentPanel @title="Metadata" @open={{this.product.meta_array.length}} @actionButtons={{this.metadataButtons}} @pad={{true}} @panelBodyWrapperClass="px-0 py-4" @panelBodyClass="bg-white dark:bg-gray-800">
<ContentPanel
@title="Metadata"
@open={{this.product.meta_array.length}}
@actionButtons={{this.metadataButtons}}
@pad={{true}}
@panelBodyWrapperClass="px-0 py-4"
@panelBodyClass="bg-white dark:bg-gray-800"
>
{{#each this.product.meta_array as |metaField index|}}
<div class="px-4 py-3 border-b border-gray-200 dark:border-gray-700">
<div class="input-group">
Expand Down Expand Up @@ -103,7 +143,12 @@
<Input @type="text" @value={{variantOption.description}} class="form-input w-full" placeholder="Option Description" />
</div>
<div class="col-span-2">
<MoneyInput class="w-full" @currency={{if this.product.currency this.product.currency this.activeStore.currency}} @canSelectCurrency={{false}} @value={{variantOption.additional_cost}} />
<MoneyInput
class="w-full"
@currency={{if this.product.currency this.product.currency this.activeStore.currency}}
@canSelectCurrency={{false}}
@value={{variantOption.additional_cost}}
/>
</div>
<div class="flex items-center justify-center text-center text-sm">
<a href="javascript:;" {{on "click" (fn this.removeVariantOption variant index)}}>Remove</a>
Expand Down Expand Up @@ -169,7 +214,9 @@
<ContentPanel @title="Images & Videos" @open={{this.product.files.length}} @pad={{false}} @panelBodyWrapperClass="px-0 py-4" @panelBodyClass="bg-white dark:bg-gray-800">
<div class="px-6 space-y-4">
{{#if this.isUploading}}
<div class="min-h-56 dropzone w-full rounded-lg px-4 py-8 min-h bg-gray-50 dark:bg-gray-900 bg-opacity-25 text-gray-900 dark:text-white text-center flex flex-col items-center justify-center border-2 border-dashed border-gray-200 dark:border-indigo-500">
<div
class="min-h-56 dropzone w-full rounded-lg px-4 py-8 min-h bg-gray-50 dark:bg-gray-900 bg-opacity-25 text-gray-900 dark:text-white text-center flex flex-col items-center justify-center border-2 border-dashed border-gray-200 dark:border-indigo-500"
>
<div class="flex items-center justify-center py-5">
<Spinner class="text-sm dar:text-gray-100" @loadingMessage={{t "component.dropzone.uploading"}} />
</div>
Expand Down Expand Up @@ -228,7 +275,14 @@
{{#each this.product.files as |file|}}
<FileRecord @file={{file}} @fileIconClass={{if (eq this.product.primary_image_uuid file.id) "border-blue-400"}} @onDelete={{this.removeFile}}>
<div class="flex items-center justify-evenly">
<Button @icon="magic" @text="Make Primary" @size="xs" @textClass="text-xs truncate" @onClick={{fn this.makePrimaryFile file}} @disabled={{eq this.product.primary_image_uuid file.id}} />
<Button
@icon="magic"
@text="Make Primary"
@size="xs"
@textClass="text-xs truncate"
@onClick={{fn this.makePrimaryFile file}}
@disabled={{eq this.product.primary_image_uuid file.id}}
/>
</div>
</FileRecord>
{{/each}}
Expand Down
13 changes: 11 additions & 2 deletions addon/templates/settings/gateways.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,17 @@
{{#each this.model as |gateway|}}
<ContentPanel @title={{gateway.name}} @open={{true}} @pad={{true}}>
<InputGroup @name={{t "storefront.settings.gateways.gateway-name"}} @value={{gateway.name}} @helpText={{t "storefront.settings.gateways.helpText"}} />
<InputGroup @name={{t "storefront.settings.gateways.gateway-code"}} @value={{gateway.code}} @disabled={{true}} @helpText={{t "storefront.settings.gateways.gateway-code-help-text"}} />
<InputGroup @name={{t "storefront.settings.gateways.callback-url"}} @value={{gateway.callback_url}} @helpText={{t "storefront.settings.gateways.callback-url-help-text"}} />
<InputGroup
@name={{t "storefront.settings.gateways.gateway-code"}}
@value={{gateway.code}}
@disabled={{true}}
@helpText={{t "storefront.settings.gateways.gateway-code-help-text"}}
/>
<InputGroup
@name={{t "storefront.settings.gateways.callback-url"}}
@value={{gateway.callback_url}}
@helpText={{t "storefront.settings.gateways.callback-url-help-text"}}
/>
<InputGroup @name={{t "storefront.settings.gateways.return-url"}} @value={{gateway.return_url}} @helpText={{t "storefront.settings.gateways.return-url-help-text"}} />
<div class="input-group">
<Checkbox @value={{gateway.sandbox}} @label={{t "storefront.settings.gateways.this-is-a-sandbox-gateway"}} @onToggle={{fn (mut gateway.sandbox)}} />
Expand Down
1 change: 1 addition & 0 deletions addon/templates/settings/locations.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@
{{/each}}
</div>
</form>
<Spacer @height="300px" />
</SettingsContainer>
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fleetbase/storefront-api",
"version": "0.3.8",
"version": "0.3.9",
"description": "Headless Commerce & Marketplace Extension for Fleetbase",
"keywords": [
"fleetbase-extension",
Expand All @@ -22,8 +22,8 @@
],
"require": {
"php": "^8.0",
"fleetbase/core-api": "^1.4.23",
"fleetbase/fleetops-api": "^0.4.28",
"fleetbase/core-api": "^1.4.25",
"fleetbase/fleetops-api": "^0.4.29",
"geocoder-php/google-maps-places-provider": "^1.4",
"laravel-notification-channels/apn": "^5.0",
"laravel-notification-channels/fcm": "^4.1",
Expand Down
2 changes: 1 addition & 1 deletion extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Storefront",
"version": "0.3.8",
"version": "0.3.9",
"description": "Headless Commerce & Marketplace Extension for Fleetbase",
"repository": "https://github.com/fleetbase/storefront",
"license": "MIT",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fleetbase/storefront-engine",
"version": "0.3.8",
"version": "0.3.9",
"description": "Headless Commerce & Marketplace Extension for Fleetbase",
"fleetbase": {
"route": "storefront",
Expand Down Expand Up @@ -43,8 +43,8 @@
"publish:github": "npm config set '@fleetbase:registry' https://npm.pkg.github.com/ && npm publish"
},
"dependencies": {
"@fleetbase/ember-core": "^0.2.9",
"@fleetbase/ember-ui": "^0.2.14",
"@fleetbase/ember-core": "^0.2.11",
"@fleetbase/ember-ui": "^0.2.16",
"@fleetbase/fleetops-data": "^0.1.15",
"@babel/core": "^7.23.2",
"@fortawesome/ember-fontawesome": "^0.4.1",
Expand Down
Loading

0 comments on commit 8530fdf

Please sign in to comment.