Skip to content

Commit

Permalink
created low stock,expired stock pages
Browse files Browse the repository at this point in the history
  • Loading branch information
TemuulenBM committed Dec 4, 2023
1 parent 0f14ede commit 4650c3e
Show file tree
Hide file tree
Showing 45 changed files with 1,002 additions and 84 deletions.
1 change: 1 addition & 0 deletions addon/adapters/expired-stock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './pallet';
1 change: 1 addition & 0 deletions addon/adapters/low-stock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './pallet';
4 changes: 2 additions & 2 deletions addon/components/batch-panel.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
@width={{or this.width @width "600px"}}
>
<Overlay::Header @title="Batch Details" @status={{this.batch.public_id}} @hideStatusDot={{true}} @createdAt={{this.batch.createdAt}}>
<Button @type="default" @icon="pen" @helpText="Edit fuel report" @onClick={{this.onEdit}} @wrapperClass="mr-2" />
<Button @type="default" @icon="times" @helpText={{if this.batch.id "Cancel edit fuel report" "Cancel new fuel report"}} @onClick={{this.onPressCancel}} />
<Button @type="default" @icon="pen" @helpText="Edit batch" @onClick={{this.onEdit}} @wrapperClass="mr-2" />
<Button @type="default" @icon="times" @helpText={{if this.batch.id "Cancel edit batch" "Cancel new batch"}} @onClick={{this.onPressCancel}} />
</Overlay::Header>
<Overlay::Body class="no-padding" @increaseInnerBodyHeightBy={{1000}}>
<div class="section-header-actions w-full overflow-x-scroll lg:overflow-x-auto">
Expand Down
17 changes: 16 additions & 1 deletion addon/components/inventory-form-panel.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,22 @@
@triggerClass="form-select form-input"
@infiniteScroll={{false}}
@renderInPlace={{true}}
@onChange={{fn (mut this.inventory.product)}}
@onChange={{this.handleProductChange}}
@onChangeId={{fn (mut this.inventory.product_uuid)}}
as |model|
>
{{model.name}}
</ModelSelect>
</InputGroup>
<InputGroup @name="Supplier">
<ModelSelect
@modelName="supplier"
@selectedModel={{this.inventory.supplier}}
@placeholder="Select Supplier"
@triggerClass="form-select form-input"
@infiniteScroll={{false}}
@renderInPlace={{true}}
@onChange={{this.inventory.supplier.name}}
@onChangeId={{fn (mut this.inventory.product_uuid)}}
as |model|
>
Expand Down
14 changes: 14 additions & 0 deletions addon/components/inventory-form-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,18 @@ export default class InventoryFormPanelComponent extends Component {
@action onPressCancel() {
return contextComponentCallback(this, 'onPressCancel', this.inventory);
}

@action handleProductChange(selectedProduct) {
this.store
.findRecord('supplier', selectedProduct.supplier_uuid)
.then((supplier) => {
this.inventory.setProperties({
product: selectedProduct,
supplier: supplier,
});
})
.catch((error) => {
console.error('Error fetching supplier:', error);
});
}
}
4 changes: 2 additions & 2 deletions addon/components/inventory-panel.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
@width={{or this.width @width "600px"}}
>
<Overlay::Header @title="Inventory Details" @status={{this.inventory.public_id}} @hideStatusDot={{true}} @createdAt={{this.inventory.createdAt}}>
<Button @type="default" @icon="pen" @helpText="Edit fuel report" @onClick={{this.onEdit}} @wrapperClass="mr-2" />
<Button @type="default" @icon="times" @helpText={{if this.inventory.id "Cancel edit fuel report" "Cancel new fuel report"}} @onClick={{this.onPressCancel}} />
<Button @type="default" @icon="pen" @helpText="Edit inventory" @onClick={{this.onEdit}} @wrapperClass="mr-2" />
<Button @type="default" @icon="times" @helpText={{if this.inventory.id "Cancel edit inventory" "Cancel new inventory"}} @onClick={{this.onPressCancel}} />
</Overlay::Header>
<Overlay::Body class="no-padding" @increaseInnerBodyHeightBy={{1000}}>
<div class="section-header-actions w-full overflow-x-scroll lg:overflow-x-auto">
Expand Down
4 changes: 2 additions & 2 deletions addon/components/supplier-panel.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
@width={{or this.width @width "600px"}}
>
<Overlay::Header @title="Supplier Details" @status={{this.supplier.public_id}} @hideStatusDot={{true}} @createdAt={{this.supplier.createdAt}}>
<Button @type="default" @icon="pen" @helpText="Edit fuel report" @onClick={{this.onEdit}} @wrapperClass="mr-2" />
<Button @type="default" @icon="times" @helpText={{if this.supplier.id "Cancel edit fuel report" "Cancel new fuel report"}} @onClick={{this.onPressCancel}} />
<Button @type="default" @icon="pen" @helpText="Edit supplier" @onClick={{this.onEdit}} @wrapperClass="mr-2" />
<Button @type="default" @icon="times" @helpText={{if this.supplier.id "Cancel edit supplier" "Cancel new supplier"}} @onClick={{this.onPressCancel}} />
</Overlay::Header>
<Overlay::Body class="no-padding" @increaseInnerBodyHeightBy={{1000}}>
<div class="section-header-actions w-full overflow-x-scroll lg:overflow-x-auto">
Expand Down
2 changes: 1 addition & 1 deletion addon/components/warehouse-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class WarehouseEditorComponent extends Component {
}

@action openEditor() {
console.log('openEditor() #overlayContextApi', this.overlayContextApi)
console.log('openEditor() #overlayContextApi', this.overlayContextApi);
if (this.overlayContextApi) {
this.overlayContextApi.open();
}
Expand Down
Loading

0 comments on commit 4650c3e

Please sign in to comment.