Skip to content

Commit

Permalink
Warehouse changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TemuulenBM committed Nov 24, 2023
1 parent 1744274 commit 82da83e
Show file tree
Hide file tree
Showing 45 changed files with 524 additions and 2,029 deletions.
149 changes: 86 additions & 63 deletions addon/components/inventory-form-panel.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -29,69 +29,92 @@
</Overlay::Header>

<Overlay::Body @wrapperClass="new-service-rate-overlay-body px-4 space-y-4 pt-4" @increaseInnerBodyHeightBy={{1000}}>
<div class="grid grid-cols-1 text-xs dark:text-gray-100">
<InputGroup @name="Product">
<ModelSelect
@modelName="pallet-product"
@selectedModel={{this.inventory.product}}
@placeholder="Select Product"
@triggerClass="form-select form-input"
@infiniteScroll={{false}}
@renderInPlace={{true}}
@onChange={{fn (mut this.inventory.product)}}
@onChangeId={{fn (mut this.inventory.product_uuid)}}
as |model|
>
{{model.name}}
</ModelSelect>
</InputGroup>
<InputGroup @name="Supplier">
<ModelSelect
@modelName="vendor"
@selectedModel={{this.inventory.supplier}}
@placeholder="Select Supplier"
@triggerClass="form-select form-input"
@infiniteScroll={{false}}
@renderInPlace={{true}}
@onChange={{fn (mut this.inventory.supplier)}}
@onChangeId={{fn (mut this.inventory.supplier_uuid)}}
as |model|
>
{{model.name}}
</ModelSelect>
</InputGroup>
<InputGroup @name="Warehouse">
<ModelSelect
@modelName="warehouse"
@selectedModel={{this.inventory.warehouse}}
@placeholder="Select Warehouse"
@triggerClass="form-select form-input"
@infiniteScroll={{false}}
@renderInPlace={{true}}
@onChange={{fn (mut this.inventory.warehouse)}}
@onChangeId={{fn (mut this.inventory.warehouse_uuid)}}
as |model|
>
{{n-a model.name model.address}}
</ModelSelect>
</InputGroup>
<InputGroup @name="Batch">
<ModelSelect
@modelName="batch"
@selectedModel={{this.inventory.batch}}
@placeholder="Select Batch"
@triggerClass="form-select form-input"
@infiniteScroll={{false}}
@renderInPlace={{true}}
@onChange={{fn (mut this.inventory.batch)}}
@onChangeId={{fn (mut this.inventory.batch_uuid)}}
as |model|
>
{{model.display_name}}
</ModelSelect>
</InputGroup>
<InputGroup @name="Quantity" @type="number" @value={{this.inventory.quantity}} />
<InputGroup @name="Minimum Quantity" @type="number" @value={{this.inventory.min_quantity}} />
<div class="flex-1 space-y-4">
<ContentPanel @title="Details" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
<InputGroup @name="Product">
<ModelSelect
@modelName="pallet-product"
@selectedModel={{this.inventory.product}}
@placeholder="Select Product"
@triggerClass="form-select form-input"
@infiniteScroll={{false}}
@renderInPlace={{true}}
@onChange={{fn (mut this.inventory.product)}}
@onChangeId={{fn (mut this.inventory.product_uuid)}}
as |model|
>
{{model.name}}
</ModelSelect>
</InputGroup>
<InputGroup @name="Supplier">
<ModelSelect
@modelName="vendor"
@selectedModel={{this.inventory.supplier}}
@placeholder="Select Supplier"
@triggerClass="form-select form-input"
@infiniteScroll={{false}}
@renderInPlace={{true}}
@onChange={{fn (mut this.inventory.supplier)}}
@onChangeId={{fn (mut this.inventory.supplier_uuid)}}
as |model|
>
{{model.name}}
</ModelSelect>
</InputGroup>
<InputGroup @name="Warehouse">
<ModelSelect
@modelName="warehouse"
@selectedModel={{this.inventory.warehouse}}
@placeholder="Select Warehouse"
@triggerClass="form-select form-input"
@infiniteScroll={{false}}
@renderInPlace={{true}}
@onChange={{fn (mut this.inventory.warehouse)}}
@onChangeId={{fn (mut this.inventory.warehouse_uuid)}}
as |model|
>
{{n-a model.name model.address}}
</ModelSelect>
</InputGroup>
<InputGroup @name="Status">
<div class="fleetbase-model-select fleetbase-power-select ember-model-select">
<PowerSelect
@options={{this.statusOptions}}
@selected={{this.inventory.status}}
@onChange={{fn (mut this.inventory.status)}}
@placeholder="Select inventory status"
@triggerClass="form-select form-input"
as |status|
>
{{smart-humanize status}}
</PowerSelect>
</div>
</InputGroup>
<InputGroup @name="Quantity" @type="number" @value={{this.inventory.quantity}} />
<InputGroup @name="Minimum Quantity" @type="number" @value={{this.inventory.min_quantity}} />
</ContentPanel>
<ContentPanel @title="Batch" @open={{false}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
<InputGroup @name="Batch">
<ModelSelect
@modelName="batch"
@selectedModel={{this.inventory.batch}}
@placeholder="Select Batch"
@triggerClass="form-select form-input"
@infiniteScroll={{false}}
@renderInPlace={{true}}
@onChange={{fn (mut this.inventory.batch)}}
@onChangeId={{fn (mut this.inventory.batch_uuid)}}
as |model|
>
{{model.display_name}}
</ModelSelect>
</InputGroup>
<InputGroup @name="Batch Quantity" @type="number" @value={{this.inventory.batch.quantity}} />
<InputGroup @name="Batch Number" @type="number" @value={{this.inventory.batch.batch_number}} />
<InputGroup @name="Batch Reason">
<Textarea @value={{this.batch.reason}} aria-label="Reason" class="w-full form-input" placeholder="Reason" rows={{5}} />
</InputGroup>
</ContentPanel>
</div>
</Overlay::Body>
</Overlay>
1 change: 1 addition & 0 deletions addon/components/product-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export default class ProductPanelComponent extends Component {
constructor() {
super(...arguments);
this.product = this.args.product;
console.log('[this.product]', this.product);
this.tab = this.getTabUsingSlug(this.args.tab);
applyContextComponentArguments(this);
}
Expand Down
12 changes: 6 additions & 6 deletions addon/components/stock-adjustment-form-panel.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,12 @@
</PowerSelect>
</div>
</InputGroup>
<InputGroup @name="Stock Adjustment Reason">
<Textarea @value={{this.stockAdjustment.reason}} aria-label="Reason" class="w-full form-input" placeholder="Reason" rows={{5}} />
</InputGroup>
<InputGroup @name="Approval Status">
<InputGroup @name="Approval Required">
<div class="fleetbase-model-select fleetbase-power-select ember-model-select">
<PowerSelect
@options={{this.statusOptions}}
@selected={{this.stockAdjustment.approval_status}}
@onChange={{fn (mut this.stockAdjustment.approval_status)}}
@selected={{this.stockAdjustment.approval_required}}
@onChange={{fn (mut this.stockAdjustment.approval_required)}}
@placeholder="Select approval status"
@triggerClass="form-select form-input"
as |status|
Expand All @@ -61,6 +58,9 @@
</PowerSelect>
</div>
</InputGroup>
<InputGroup @name="Stock Adjustment Reason">
<Textarea @value={{this.stockAdjustment.reason}} aria-label="Reason" class="w-full form-input" placeholder="Reason" rows={{5}} />
</InputGroup>
<InputGroup @name="Quantity" @type="number" @value={{this.stockAdjustment.quantity}} />
</div>
</Overlay::Body>
Expand Down
103 changes: 70 additions & 33 deletions addon/components/warehouse-form-panel.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,81 @@
@titleWrapperClass="leading-5"
>
<div class="flex flex-1 justify-end">
<Button @icon={{if this.warehouse.id "save" "check"}} @type="primary" @text={{if this.warehouse.id "Save Warehouse" "Create Warehouse"}} @onClick={{this.save}} @wrapperClass="mr-2" />
<Button
@icon={{if this.warehouse.id "save" "check"}}
@type="primary"
@text={{if this.warehouse.id "Save Warehouse" "Create Warehouse"}}
@onClick={{this.save}}
@wrapperClass="mr-2"
/>
<Button @type="default" @icon="times" @helpText={{if this.warehouse.id "Cancel edit warehouse" "Cancel new warehouse"}} @onClick={{this.onPressCancel}} />
</div>
</Overlay::Header>

<Overlay::Body @wrapperClass="new-service-rate-overlay-body px-4 space-y-4 pt-4" @increaseInnerBodyHeightBy={{1000}}>
<div class="grid grid-cols-3 gap-1 text-xs dark:text-gray-100">
<InputGroup @name="Name" @wrapperClass="col-span-2">
<Input @value={{this.warehouse.name}} @type="text" class="w-full form-input" placeholder="Name" />
</InputGroup>
<InputGroup @name="Street 1" @value={{this.warehouse.street1}} @wrapperClass="col-span-3">
<AutocompleteInput @value={{this.warehouse.street1}} @fetchUrl="places/lookup" @onSelect={{this.onAutocomplete}} placeholder="Street 1" class="w-full" as |result|>
{{result.address}}
</AutocompleteInput>
</InputGroup>
<InputGroup @name="Street 2" @autocomplete="nope" @value={{this.warehouse.street2}} @wrapperClass="col-span-3" />
<InputGroup @name="Neighborhood" @autocomplete="nope" @value={{this.warehouse.neighborhood}} />
<InputGroup @name="Building" @autocomplete="nope" @value={{this.warehouse.building}} />
<InputGroup @name="Security Access Code" @autocomplete="nope" @value={{this.warehouse.security_access_code}} />
<InputGroup @name="Postal Code" @autocomplete="nope" @value={{this.warehouse.postal_code}} />
<InputGroup @name="City" @autocomplete="nope" @value={{this.warehouse.city}} />
<InputGroup @name="State" @autocomplete="nope" @value={{this.warehouse.province}} />
<InputGroup @name="Country" @wrapperClass="col-span-2">
<CountrySelect class="w-full form-input form-select form-datalist" @value={{this.warehouse.country}} @onChange={{fn (mut this.warehouse.country)}} warehouseholder="Country" />
</InputGroup>
<InputGroup @name="Coordinates" @wrapperClass="col-span-2">
<CoordinatesInput
@value={{this.warehouse.location}}
@onChange={{this.updateWarehouseCoordinates}}
@onGeocode={{this.onAutocomplete}}
@onUpdatedFromMap={{this.onReverseGeocode}}
@onInit={{this.setCoordinatesInput}}
/>
</InputGroup>
<div class="col-span-1"></div>
<InputGroup @name="Phone">
<PhoneInput @value={{this.warehouse.phone}} @autocomplete="nope" @onInput={{this.phone}} class="form-input w-full" />
</InputGroup>
<div class="flex-1 space-y-4">
<ContentPanel @title="Details" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
<InputGroup @name="Name" @wrapperClass="col-span-2">
<Input @value={{this.warehouse.name}} @type="text" class="w-full form-input" placeholder="Name" />
</InputGroup>
<InputGroup @name="Street 1" @value={{this.warehouse.street1}} @wrapperClass="col-span-3">
<AutocompleteInput @value={{this.warehouse.street1}} @fetchUrl="places/lookup" @onSelect={{this.onAutocomplete}} placeholder="Street 1" class="w-full" as |result|>
{{result.address}}
</AutocompleteInput>
</InputGroup>
<InputGroup @name="Street 2" @autocomplete="nope" @value={{this.warehouse.street2}} @wrapperClass="col-span-3" />
<InputGroup @name="Neighborhood" @autocomplete="nope" @value={{this.warehouse.neighborhood}} />
<InputGroup @name="Building" @autocomplete="nope" @value={{this.warehouse.building}} />
<InputGroup @name="Security Access Code" @autocomplete="nope" @value={{this.warehouse.security_access_code}} />
<InputGroup @name="Postal Code" @autocomplete="nope" @value={{this.warehouse.postal_code}} />
<InputGroup @name="City" @autocomplete="nope" @value={{this.warehouse.city}} />
<InputGroup @name="State" @autocomplete="nope" @value={{this.warehouse.province}} />
<InputGroup @name="Country" @wrapperClass="col-span-2">
<CountrySelect
class="w-full form-input form-select form-datalist"
@value={{this.warehouse.country}}
@onChange={{fn (mut this.warehouse.country)}}
warehouseholder="Country"
/>
</InputGroup>
<InputGroup @name="Coordinates" @wrapperClass="col-span-2">
<CoordinatesInput
@value={{this.warehouse.location}}
@onChange={{this.updateWarehouseCoordinates}}
@onGeocode={{this.onAutocomplete}}
@onUpdatedFromMap={{this.onReverseGeocode}}
@onInit={{this.setCoordinatesInput}}
/>
</InputGroup>
<div class="col-span-1"></div>
<InputGroup @name="Phone">
<PhoneInput @value={{this.warehouse.phone}} @autocomplete="nope" @onInput={{this.phone}} class="form-input w-full" />
</InputGroup>
{{!-- <InputGroup @name="Structural" @wrapperClass="col-span-1">
<Checkbox @checked={{this.warehouse.meta.structural}} @onChange={{this.toggleStructural}} />
</InputGroup>
<InputGroup @name="External" @wrapperClass="col-span-1">
<Checkbox @checked={{this.warehouse.meta.external}} @onChange={{this.toggleExternal}} />
</InputGroup> --}}
<div><Layout::Section::Header @title="Create" />
<Layout::Section::Body class="overflow-y-scroll h-full">
<div class="container mx-auto h-screen" {{increase-height-by 800}}>
<div class="mx-auto">
<InputGroup @name="Add Sections" @autocomplete="nope" @value={{this.warehouse.warehouse_sections}} @placeholder="Amount of sections" />
{{#if this.warehouse.warehouse_sections}}
<InputGroup @name="Add Aisles" @autocomplete="nope" @value={{this.warehouse.warehouse_aisles}} @placeholder="Amount of aisles" />
{{#if this.warehouse.warehouse_aisles}}
<InputGroup @name="Add Racks" @autocomplete="nope" @value={{this.warehouse.warehouse_racks}} @placeholder="Amount of racks" />
{{#if this.warehouse.warehouse_racks}}
<InputGroup @name="Add Bins" @autocomplete="nope" @value={{this.warehouse.warehouse_bins}} @placeholder="Amount of bins" />
{{/if}}
{{/if}}
{{/if}}
</div>
</div>
</Layout::Section::Body>
</div>
</ContentPanel>
</div>
</Overlay::Body>
</Overlay>
Loading

0 comments on commit 82da83e

Please sign in to comment.